/* Generated by Cython 3.0.11 */

/* BEGIN: Cython Metadata
{
    "distutils": {
        "depends": [
            "amplpy/amplpython/cppinterface/include/ampl/ampl_c.h"
        ],
        "extra_compile_args": [
            "-Wno-stringop-truncation",
            "-Wno-catch-value",
            "-Wno-unused-variable"
        ],
        "extra_link_args": [
            "-Wl,-rpath,$ORIGIN/amplpy/amplpython/cppinterface/lib/amd64"
        ],
        "include_dirs": [
            "amplpy/amplpython/cppinterface/include"
        ],
        "libraries": [
            "ampl"
        ],
        "library_dirs": [
            "amplpy/amplpython/cppinterface/lib/amd64"
        ],
        "name": "_amplpy",
        "sources": [
            "amplpy/ampl.pyx"
        ]
    },
    "module_name": "_amplpy"
}
END: Cython Metadata */

#ifndef PY_SSIZE_T_CLEAN
#define PY_SSIZE_T_CLEAN
#endif /* PY_SSIZE_T_CLEAN */
#if defined(CYTHON_LIMITED_API) && 0
  #ifndef Py_LIMITED_API
    #if CYTHON_LIMITED_API+0 > 0x03030000
      #define Py_LIMITED_API CYTHON_LIMITED_API
    #else
      #define Py_LIMITED_API 0x03030000
    #endif
  #endif
#endif

#include "Python.h"

    #if PY_MAJOR_VERSION >= 3
      #define __Pyx_PyFloat_FromString(obj)  PyFloat_FromString(obj)
    #else
      #define __Pyx_PyFloat_FromString(obj)  PyFloat_FromString(obj, NULL)
    #endif
    

    #if PY_MAJOR_VERSION <= 2
    #define PyDict_GetItemWithError _PyDict_GetItemWithError
    #endif
    

    #if (PY_VERSION_HEX < 0x030700b1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030600)) && !defined(PyContextVar_Get)
    #define PyContextVar_Get(var, d, v)         ((d) ?             ((void)(var), Py_INCREF(d), (v)[0] = (d), 0) :             ((v)[0] = NULL, 0)         )
    #endif
    
#ifndef Py_PYTHON_H
    #error Python headers needed to compile C extensions, please install development version of Python.
#elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
    #error Cython requires Python 2.7+ or Python 3.3+.
#else
#if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API
#define __PYX_EXTRA_ABI_MODULE_NAME "limited"
#else
#define __PYX_EXTRA_ABI_MODULE_NAME ""
#endif
#define CYTHON_ABI "3_0_11" __PYX_EXTRA_ABI_MODULE_NAME
#define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI
#define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "."
#define CYTHON_HEX_VERSION 0x03000BF0
#define CYTHON_FUTURE_DIVISION 1
#include <stddef.h>
#ifndef offsetof
  #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
#endif
#if !defined(_WIN32) && !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
  #define HAVE_LONG_LONG
#endif
#ifndef PY_LONG_LONG
  #define PY_LONG_LONG LONG_LONG
#endif
#ifndef Py_HUGE_VAL
  #define Py_HUGE_VAL HUGE_VAL
#endif
#define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX
#if defined(GRAALVM_PYTHON)
  /* For very preliminary testing purposes. Most variables are set the same as PyPy.
     The existence of this section does not imply that anything works or is even tested */
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_CPYTHON 0
  #define CYTHON_COMPILING_IN_LIMITED_API 0
  #define CYTHON_COMPILING_IN_GRAAL 1
  #define CYTHON_COMPILING_IN_NOGIL 0
  #undef CYTHON_USE_TYPE_SLOTS
  #define CYTHON_USE_TYPE_SLOTS 0
  #undef CYTHON_USE_TYPE_SPECS
  #define CYTHON_USE_TYPE_SPECS 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_GIL
  #define CYTHON_FAST_GIL 0
  #undef CYTHON_METH_FASTCALL
  #define CYTHON_METH_FASTCALL 0
  #undef CYTHON_FAST_PYCALL
  #define CYTHON_FAST_PYCALL 0
  #ifndef CYTHON_PEP487_INIT_SUBCLASS
    #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3)
  #endif
  #undef CYTHON_PEP489_MULTI_PHASE_INIT
  #define CYTHON_PEP489_MULTI_PHASE_INIT 1
  #undef CYTHON_USE_MODULE_STATE
  #define CYTHON_USE_MODULE_STATE 0
  #undef CYTHON_USE_TP_FINALIZE
  #define CYTHON_USE_TP_FINALIZE 0
  #undef CYTHON_USE_DICT_VERSIONS
  #define CYTHON_USE_DICT_VERSIONS 0
  #undef CYTHON_USE_EXC_INFO_STACK
  #define CYTHON_USE_EXC_INFO_STACK 0
  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
    #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
  #endif
  #undef CYTHON_USE_FREELISTS
  #define CYTHON_USE_FREELISTS 0
#elif defined(PYPY_VERSION)
  #define CYTHON_COMPILING_IN_PYPY 1
  #define CYTHON_COMPILING_IN_CPYTHON 0
  #define CYTHON_COMPILING_IN_LIMITED_API 0
  #define CYTHON_COMPILING_IN_GRAAL 0
  #define CYTHON_COMPILING_IN_NOGIL 0
  #undef CYTHON_USE_TYPE_SLOTS
  #define CYTHON_USE_TYPE_SLOTS 0
  #ifndef CYTHON_USE_TYPE_SPECS
    #define CYTHON_USE_TYPE_SPECS 0
  #endif
  #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_GIL
  #define CYTHON_FAST_GIL 0
  #undef CYTHON_METH_FASTCALL
  #define CYTHON_METH_FASTCALL 0
  #undef CYTHON_FAST_PYCALL
  #define CYTHON_FAST_PYCALL 0
  #ifndef CYTHON_PEP487_INIT_SUBCLASS
    #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3)
  #endif
  #if PY_VERSION_HEX < 0x03090000
    #undef CYTHON_PEP489_MULTI_PHASE_INIT
    #define CYTHON_PEP489_MULTI_PHASE_INIT 0
  #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT)
    #define CYTHON_PEP489_MULTI_PHASE_INIT 1
  #endif
  #undef CYTHON_USE_MODULE_STATE
  #define CYTHON_USE_MODULE_STATE 0
  #undef CYTHON_USE_TP_FINALIZE
  #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00)
  #undef CYTHON_USE_DICT_VERSIONS
  #define CYTHON_USE_DICT_VERSIONS 0
  #undef CYTHON_USE_EXC_INFO_STACK
  #define CYTHON_USE_EXC_INFO_STACK 0
  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
    #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
  #endif
  #undef CYTHON_USE_FREELISTS
  #define CYTHON_USE_FREELISTS 0
#elif defined(CYTHON_LIMITED_API)
  #ifdef Py_LIMITED_API
    #undef __PYX_LIMITED_VERSION_HEX
    #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API
  #endif
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_CPYTHON 0
  #define CYTHON_COMPILING_IN_LIMITED_API 1
  #define CYTHON_COMPILING_IN_GRAAL 0
  #define CYTHON_COMPILING_IN_NOGIL 0
  #undef CYTHON_CLINE_IN_TRACEBACK
  #define CYTHON_CLINE_IN_TRACEBACK 0
  #undef CYTHON_USE_TYPE_SLOTS
  #define CYTHON_USE_TYPE_SLOTS 0
  #undef CYTHON_USE_TYPE_SPECS
  #define CYTHON_USE_TYPE_SPECS 1
  #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
  #undef CYTHON_USE_UNICODE_INTERNALS
  #define CYTHON_USE_UNICODE_INTERNALS 0
  #ifndef CYTHON_USE_UNICODE_WRITER
    #define CYTHON_USE_UNICODE_WRITER 0
  #endif
  #undef CYTHON_USE_PYLONG_INTERNALS
  #define CYTHON_USE_PYLONG_INTERNALS 0
  #ifndef CYTHON_AVOID_BORROWED_REFS
    #define CYTHON_AVOID_BORROWED_REFS 0
  #endif
  #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_GIL
  #define CYTHON_FAST_GIL 0
  #undef CYTHON_METH_FASTCALL
  #define CYTHON_METH_FASTCALL 0
  #undef CYTHON_FAST_PYCALL
  #define CYTHON_FAST_PYCALL 0
  #ifndef CYTHON_PEP487_INIT_SUBCLASS
    #define CYTHON_PEP487_INIT_SUBCLASS 1
  #endif
  #undef CYTHON_PEP489_MULTI_PHASE_INIT
  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
  #undef CYTHON_USE_MODULE_STATE
  #define CYTHON_USE_MODULE_STATE 1
  #ifndef CYTHON_USE_TP_FINALIZE
    #define CYTHON_USE_TP_FINALIZE 0
  #endif
  #undef CYTHON_USE_DICT_VERSIONS
  #define CYTHON_USE_DICT_VERSIONS 0
  #undef CYTHON_USE_EXC_INFO_STACK
  #define CYTHON_USE_EXC_INFO_STACK 0
  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
    #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
  #endif
  #undef CYTHON_USE_FREELISTS
  #define CYTHON_USE_FREELISTS 0
#elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL)
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_CPYTHON 0
  #define CYTHON_COMPILING_IN_LIMITED_API 0
  #define CYTHON_COMPILING_IN_GRAAL 0
  #define CYTHON_COMPILING_IN_NOGIL 1
  #ifndef CYTHON_USE_TYPE_SLOTS
    #define CYTHON_USE_TYPE_SLOTS 1
  #endif
  #ifndef CYTHON_USE_TYPE_SPECS
    #define CYTHON_USE_TYPE_SPECS 0
  #endif
  #undef CYTHON_USE_PYTYPE_LOOKUP
  #define CYTHON_USE_PYTYPE_LOOKUP 0
  #ifndef CYTHON_USE_ASYNC_SLOTS
    #define CYTHON_USE_ASYNC_SLOTS 1
  #endif
  #ifndef CYTHON_USE_PYLONG_INTERNALS
    #define CYTHON_USE_PYLONG_INTERNALS 0
  #endif
  #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
  #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_GIL
  #define CYTHON_FAST_GIL 0
  #ifndef CYTHON_METH_FASTCALL
    #define CYTHON_METH_FASTCALL 1
  #endif
  #undef CYTHON_FAST_PYCALL
  #define CYTHON_FAST_PYCALL 0
  #ifndef CYTHON_PEP487_INIT_SUBCLASS
    #define CYTHON_PEP487_INIT_SUBCLASS 1
  #endif
  #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
    #define CYTHON_PEP489_MULTI_PHASE_INIT 1
  #endif
  #ifndef CYTHON_USE_MODULE_STATE
    #define CYTHON_USE_MODULE_STATE 0
  #endif
  #ifndef CYTHON_USE_TP_FINALIZE
    #define CYTHON_USE_TP_FINALIZE 1
  #endif
  #undef CYTHON_USE_DICT_VERSIONS
  #define CYTHON_USE_DICT_VERSIONS 0
  #undef CYTHON_USE_EXC_INFO_STACK
  #define CYTHON_USE_EXC_INFO_STACK 0
  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
    #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
  #endif
  #ifndef CYTHON_USE_FREELISTS
    #define CYTHON_USE_FREELISTS 0
  #endif
#else
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_CPYTHON 1
  #define CYTHON_COMPILING_IN_LIMITED_API 0
  #define CYTHON_COMPILING_IN_GRAAL 0
  #define CYTHON_COMPILING_IN_NOGIL 0
  #ifndef CYTHON_USE_TYPE_SLOTS
    #define CYTHON_USE_TYPE_SLOTS 1
  #endif
  #ifndef CYTHON_USE_TYPE_SPECS
    #define CYTHON_USE_TYPE_SPECS 0
  #endif
  #ifndef 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
  #ifndef 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 || PY_VERSION_HEX >= 0x030B00A2
    #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_GIL
    #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6)
  #endif
  #ifndef CYTHON_METH_FASTCALL
    #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1)
  #endif
  #ifndef CYTHON_FAST_PYCALL
    #define CYTHON_FAST_PYCALL 1
  #endif
  #ifndef CYTHON_PEP487_INIT_SUBCLASS
    #define CYTHON_PEP487_INIT_SUBCLASS 1
  #endif
  #if PY_VERSION_HEX < 0x03050000
    #undef CYTHON_PEP489_MULTI_PHASE_INIT
    #define CYTHON_PEP489_MULTI_PHASE_INIT 0
  #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT)
    #define CYTHON_PEP489_MULTI_PHASE_INIT 1
  #endif
  #ifndef CYTHON_USE_MODULE_STATE
    #define CYTHON_USE_MODULE_STATE 0
  #endif
  #if PY_VERSION_HEX < 0x030400a1
    #undef CYTHON_USE_TP_FINALIZE
    #define CYTHON_USE_TP_FINALIZE 0
  #elif !defined(CYTHON_USE_TP_FINALIZE)
    #define CYTHON_USE_TP_FINALIZE 1
  #endif
  #if PY_VERSION_HEX < 0x030600B1
    #undef CYTHON_USE_DICT_VERSIONS
    #define CYTHON_USE_DICT_VERSIONS 0
  #elif !defined(CYTHON_USE_DICT_VERSIONS)
    #define CYTHON_USE_DICT_VERSIONS  (PY_VERSION_HEX < 0x030C00A5)
  #endif
  #if PY_VERSION_HEX < 0x030700A3
    #undef CYTHON_USE_EXC_INFO_STACK
    #define CYTHON_USE_EXC_INFO_STACK 0
  #elif !defined(CYTHON_USE_EXC_INFO_STACK)
    #define CYTHON_USE_EXC_INFO_STACK 1
  #endif
  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
    #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
  #endif
  #ifndef CYTHON_USE_FREELISTS
    #define CYTHON_USE_FREELISTS 1
  #endif
#endif
#if !defined(CYTHON_FAST_PYCCALL)
#define CYTHON_FAST_PYCCALL  (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
#endif
#if !defined(CYTHON_VECTORCALL)
#define CYTHON_VECTORCALL  (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1)
#endif
#define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1)
#if CYTHON_USE_PYLONG_INTERNALS
  #if PY_MAJOR_VERSION < 3
    #include "longintrepr.h"
  #endif
  #undef SHIFT
  #undef BASE
  #undef MASK
  #ifdef SIZEOF_VOID_P
    enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
  #endif
#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(__cplusplus)
    /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17
     * but leads to warnings with -pedantic, since it is a C++17 feature */
    #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
      #if __has_cpp_attribute(maybe_unused)
        #define CYTHON_UNUSED [[maybe_unused]]
      #endif
    #endif
  #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_UNUSED_VAR
#  if defined(__cplusplus)
     template<class T> void CYTHON_UNUSED_VAR( const T& ) { }
#  else
#    define CYTHON_UNUSED_VAR(x) (void)(x)
#  endif
#endif
#ifndef CYTHON_MAYBE_UNUSED_VAR
  #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x)
#endif
#ifndef CYTHON_NCP_UNUSED
# if CYTHON_COMPILING_IN_CPYTHON
#  define CYTHON_NCP_UNUSED
# else
#  define CYTHON_NCP_UNUSED CYTHON_UNUSED
# endif
#endif
#ifndef CYTHON_USE_CPP_STD_MOVE
  #if defined(__cplusplus) && (\
    __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600))
    #define CYTHON_USE_CPP_STD_MOVE 1
  #else
    #define CYTHON_USE_CPP_STD_MOVE 0
  #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 short    uint16_t;
            typedef unsigned int      uint32_t;
        #else
            typedef unsigned __int8   uint8_t;
            typedef unsigned __int16  uint16_t;
            typedef unsigned __int32  uint32_t;
        #endif
    #endif
    #if _MSC_VER < 1300
        #ifdef _WIN64
            typedef unsigned long long  __pyx_uintptr_t;
        #else
            typedef unsigned int        __pyx_uintptr_t;
        #endif
    #else
        #ifdef _WIN64
            typedef unsigned __int64    __pyx_uintptr_t;
        #else
            typedef unsigned __int32    __pyx_uintptr_t;
        #endif
    #endif
#else
    #include <stdint.h>
    typedef uintptr_t  __pyx_uintptr_t;
#endif
#ifndef CYTHON_FALLTHROUGH
  #if defined(__cplusplus)
    /* for clang __has_cpp_attribute(fallthrough) is true even before C++17
     * but leads to warnings with -pedantic, since it is a C++17 feature */
    #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
      #if __has_cpp_attribute(fallthrough)
        #define CYTHON_FALLTHROUGH [[fallthrough]]
      #endif
    #endif
    #ifndef CYTHON_FALLTHROUGH
      #if __has_cpp_attribute(clang::fallthrough)
        #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
      #elif __has_cpp_attribute(gnu::fallthrough)
        #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
      #endif
    #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
#ifdef __cplusplus
  template <typename T>
  struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);};
  #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL<type>::value)
#else
  #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0)
#endif
#if CYTHON_COMPILING_IN_PYPY == 1
  #define __PYX_NEED_TP_PRINT_SLOT  (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000)
#else
  #define __PYX_NEED_TP_PRINT_SLOT  (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000)
#endif
#define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer))

#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

#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_DefaultClassType PyClass_Type
  #define __Pyx_PyCode_New(a, p, 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)
#else
  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
  #define __Pyx_DefaultClassType PyType_Type
#if CYTHON_COMPILING_IN_LIMITED_API
    static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f,
                                                    PyObject *code, PyObject *c, PyObject* n, PyObject *v,
                                                    PyObject *fv, PyObject *cell, PyObject* fn,
                                                    PyObject *name, int fline, PyObject *lnos) {
        PyObject *exception_table = NULL;
        PyObject *types_module=NULL, *code_type=NULL, *result=NULL;
        #if __PYX_LIMITED_VERSION_HEX < 0x030B0000
        PyObject *version_info;
        PyObject *py_minor_version = NULL;
        #endif
        long minor_version = 0;
        PyObject *type, *value, *traceback;
        PyErr_Fetch(&type, &value, &traceback);
        #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000
        minor_version = 11;
        #else
        if (!(version_info = PySys_GetObject("version_info"))) goto end;
        if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end;
        minor_version = PyLong_AsLong(py_minor_version);
        Py_DECREF(py_minor_version);
        if (minor_version == -1 && PyErr_Occurred()) goto end;
        #endif
        if (!(types_module = PyImport_ImportModule("types"))) goto end;
        if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end;
        if (minor_version <= 7) {
            (void)p;
            result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code,
                          c, n, v, fn, name, fline, lnos, fv, cell);
        } else if (minor_version <= 10) {
            result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code,
                          c, n, v, fn, name, fline, lnos, fv, cell);
        } else {
            if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end;
            result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code,
                          c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell);
        }
    end:
        Py_XDECREF(code_type);
        Py_XDECREF(exception_table);
        Py_XDECREF(types_module);
        if (type) {
            PyErr_Restore(type, value, traceback);
        }
        return result;
    }
    #ifndef CO_OPTIMIZED
    #define CO_OPTIMIZED 0x0001
    #endif
    #ifndef CO_NEWLOCALS
    #define CO_NEWLOCALS 0x0002
    #endif
    #ifndef CO_VARARGS
    #define CO_VARARGS 0x0004
    #endif
    #ifndef CO_VARKEYWORDS
    #define CO_VARKEYWORDS 0x0008
    #endif
    #ifndef CO_ASYNC_GENERATOR
    #define CO_ASYNC_GENERATOR 0x0200
    #endif
    #ifndef CO_GENERATOR
    #define CO_GENERATOR 0x0020
    #endif
    #ifndef CO_COROUTINE
    #define CO_COROUTINE 0x0080
    #endif
#elif PY_VERSION_HEX >= 0x030B0000
  static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f,
                                                    PyObject *code, PyObject *c, PyObject* n, PyObject *v,
                                                    PyObject *fv, PyObject *cell, PyObject* fn,
                                                    PyObject *name, int fline, PyObject *lnos) {
    PyCodeObject *result;
    PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0);
    if (!empty_bytes) return NULL;
    result =
      #if PY_VERSION_HEX >= 0x030C0000
        PyUnstable_Code_NewWithPosOnlyArgs
      #else
        PyCode_NewWithPosOnlyArgs
      #endif
        (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes);
    Py_DECREF(empty_bytes);
    return result;
  }
#elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY
  #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
          PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
#else
  #define __Pyx_PyCode_New(a, p, 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)
#endif
#endif
#if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE)
  #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type)
#else
  #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type))
#endif
#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is)
  #define __Pyx_Py_Is(x, y)  Py_Is(x, y)
#else
  #define __Pyx_Py_Is(x, y) ((x) == (y))
#endif
#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone)
  #define __Pyx_Py_IsNone(ob) Py_IsNone(ob)
#else
  #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None)
#endif
#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue)
  #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob)
#else
  #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True)
#endif
#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse)
  #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob)
#else
  #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False)
#endif
#define __Pyx_NoneAsNull(obj)  (__Pyx_Py_IsNone(obj) ? NULL : (obj))
#if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY
  #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o)
#else
  #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o)
#endif
#ifndef CO_COROUTINE
  #define CO_COROUTINE 0x80
#endif
#ifndef CO_ASYNC_GENERATOR
  #define CO_ASYNC_GENERATOR 0x200
#endif
#ifndef Py_TPFLAGS_CHECKTYPES
  #define Py_TPFLAGS_CHECKTYPES 0
#endif
#ifndef Py_TPFLAGS_HAVE_INDEX
  #define Py_TPFLAGS_HAVE_INDEX 0
#endif
#ifndef Py_TPFLAGS_HAVE_NEWBUFFER
  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
#endif
#ifndef Py_TPFLAGS_HAVE_FINALIZE
  #define Py_TPFLAGS_HAVE_FINALIZE 0
#endif
#ifndef Py_TPFLAGS_SEQUENCE
  #define Py_TPFLAGS_SEQUENCE 0
#endif
#ifndef Py_TPFLAGS_MAPPING
  #define Py_TPFLAGS_MAPPING 0
#endif
#ifndef METH_STACKLESS
  #define METH_STACKLESS 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
  #if PY_VERSION_HEX >= 0x030d00A4
  #  define __Pyx_PyCFunctionFast PyCFunctionFast
  #  define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords
  #else
  #  define __Pyx_PyCFunctionFast _PyCFunctionFast
  #  define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
  #endif
#endif
#if CYTHON_METH_FASTCALL
  #define __Pyx_METH_FASTCALL METH_FASTCALL
  #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast
  #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords
#else
  #define __Pyx_METH_FASTCALL METH_VARARGS
  #define __Pyx_PyCFunction_FastCall PyCFunction
  #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords
#endif
#if CYTHON_VECTORCALL
  #define __pyx_vectorcallfunc vectorcallfunc
  #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET  PY_VECTORCALL_ARGUMENTS_OFFSET
  #define __Pyx_PyVectorcall_NARGS(n)  PyVectorcall_NARGS((size_t)(n))
#elif CYTHON_BACKPORT_VECTORCALL
  typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args,
                                            size_t nargsf, PyObject *kwnames);
  #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET  ((size_t)1 << (8 * sizeof(size_t) - 1))
  #define __Pyx_PyVectorcall_NARGS(n)  ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET))
#else
  #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET  0
  #define __Pyx_PyVectorcall_NARGS(n)  ((Py_ssize_t)(n))
#endif
#if PY_MAJOR_VERSION >= 0x030900B1
#define __Pyx_PyCFunction_CheckExact(func)  PyCFunction_CheckExact(func)
#else
#define __Pyx_PyCFunction_CheckExact(func)  PyCFunction_Check(func)
#endif
#define __Pyx_CyOrPyCFunction_Check(func)  PyCFunction_Check(func)
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func)  (((PyCFunctionObject*)(func))->m_ml->ml_meth)
#elif !CYTHON_COMPILING_IN_LIMITED_API
#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func)  PyCFunction_GET_FUNCTION(func)
#endif
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_CyOrPyCFunction_GET_FLAGS(func)  (((PyCFunctionObject*)(func))->m_ml->ml_flags)
static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) {
    return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self;
}
#endif
static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) {
#if CYTHON_COMPILING_IN_LIMITED_API
    return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc;
#else
    return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
#endif
}
#define __Pyx_IsSameCFunction(func, cfunc)   __Pyx__IsSameCFunction(func, cfunc)
#if __PYX_LIMITED_VERSION_HEX < 0x030900B1
  #define __Pyx_PyType_FromModuleAndSpec(m, s, b)  ((void)m, PyType_FromSpecWithBases(s, b))
  typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *);
#else
  #define __Pyx_PyType_FromModuleAndSpec(m, s, b)  PyType_FromModuleAndSpec(m, s, b)
  #define __Pyx_PyCMethod  PyCMethod
#endif
#ifndef METH_METHOD
  #define METH_METHOD 0x200
#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_LIMITED_API
  #define __Pyx_PyCode_HasFreeVars(co)  (PyCode_GetNumFree(co) > 0)
  #define __Pyx_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_COMPILING_IN_LIMITED_API
  #define __Pyx_PyThreadState_Current PyThreadState_Get()
#elif !CYTHON_FAST_THREAD_STATE
  #define __Pyx_PyThreadState_Current PyThreadState_GET()
#elif PY_VERSION_HEX >= 0x030d00A1
  #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked()
#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 CYTHON_COMPILING_IN_LIMITED_API
static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op)
{
    void *result;
    result = PyModule_GetState(op);
    if (!result)
        Py_FatalError("Couldn't find the module state");
    return result;
}
#endif
#define __Pyx_PyObject_GetSlot(obj, name, func_ctype)  __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype)
#if CYTHON_COMPILING_IN_LIMITED_API
  #define __Pyx_PyType_GetSlot(type, name, func_ctype)  ((func_ctype) PyType_GetSlot((type), Py_##name))
#else
  #define __Pyx_PyType_GetSlot(type, name, func_ctype)  ((type)->name)
#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;
}
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
#if PY_MAJOR_VERSION < 3
    #if CYTHON_COMPILING_IN_PYPY
        #if PYPY_VERSION_NUM < 0x07030600
            #if defined(__cplusplus) && __cplusplus >= 201402L
                [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]]
            #elif defined(__GNUC__) || defined(__clang__)
                __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")))
            #elif defined(_MSC_VER)
                __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))
            #endif
            static CYTHON_INLINE int PyGILState_Check(void) {
                return 0;
            }
        #else  // PYPY_VERSION_NUM < 0x07030600
        #endif  // PYPY_VERSION_NUM < 0x07030600
    #else
        static CYTHON_INLINE int PyGILState_Check(void) {
            PyThreadState * tstate = _PyThreadState_Current;
            return tstate && (tstate == PyGILState_GetThisThreadState());
        }
    #endif
#endif
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || 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 > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS
#define __Pyx_PyDict_GetItemStrWithError(dict, name)  _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) {
    PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name);
    if (res == NULL) PyErr_Clear();
    return res;
}
#elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000)
#define __Pyx_PyDict_GetItemStrWithError  PyDict_GetItemWithError
#define __Pyx_PyDict_GetItemStr           PyDict_GetItem
#else
static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) {
#if CYTHON_COMPILING_IN_PYPY
    return PyDict_GetItem(dict, name);
#else
    PyDictEntry *ep;
    PyDictObject *mp = (PyDictObject*) dict;
    long hash = ((PyStringObject *) name)->ob_shash;
    assert(hash != -1);
    ep = (mp->ma_lookup)(mp, name, hash);
    if (ep == NULL) {
        return NULL;
    }
    return ep->me_value;
#endif
}
#define __Pyx_PyDict_GetItemStr           PyDict_GetItem
#endif
#if CYTHON_USE_TYPE_SLOTS
  #define __Pyx_PyType_GetFlags(tp)   (((PyTypeObject *)tp)->tp_flags)
  #define __Pyx_PyType_HasFeature(type, feature)  ((__Pyx_PyType_GetFlags(type) & (feature)) != 0)
  #define __Pyx_PyObject_GetIterNextFunc(obj)  (Py_TYPE(obj)->tp_iternext)
#else
  #define __Pyx_PyType_GetFlags(tp)   (PyType_GetFlags((PyTypeObject *)tp))
  #define __Pyx_PyType_HasFeature(type, feature)  PyType_HasFeature(type, feature)
  #define __Pyx_PyObject_GetIterNextFunc(obj)  PyIter_Next
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
  #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v)
#else
  #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v)
#endif
#if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000
#define __Pyx_PyHeapTypeObject_GC_Del(obj)  {\
    PyTypeObject *type = Py_TYPE((PyObject*)obj);\
    assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\
    PyObject_GC_Del(obj);\
    Py_DECREF(type);\
}
#else
#define __Pyx_PyHeapTypeObject_GC_Del(obj)  PyObject_GC_Del(obj)
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
  #define CYTHON_PEP393_ENABLED 1
  #define __Pyx_PyUnicode_READY(op)       (0)
  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GetLength(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i)
  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   ((void)u, 1114111U)
  #define __Pyx_PyUnicode_KIND(u)         ((void)u, (0))
  #define __Pyx_PyUnicode_DATA(u)         ((void*)u)
  #define __Pyx_PyUnicode_READ(k, d, i)   ((void)k, PyUnicode_ReadChar((PyObject*)(d), i))
  #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GetLength(u))
#elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
  #define CYTHON_PEP393_ENABLED 1
  #if PY_VERSION_HEX >= 0x030C0000
    #define __Pyx_PyUnicode_READY(op)       (0)
  #else
    #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ?\
                                                0 : _PyUnicode_Ready((PyObject *)(op)))
  #endif
  #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)         ((int)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, (Py_UCS4) ch)
  #if PY_VERSION_HEX >= 0x030C0000
    #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GET_LENGTH(u))
  #else
    #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000
    #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
    #else
    #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
    #endif
  #endif
#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) ? 65535U : 1114111U)
  #define __Pyx_PyUnicode_KIND(u)         ((int)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] = (Py_UNICODE) 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
  #if !defined(PyUnicode_DecodeUnicodeEscape)
    #define PyUnicode_DecodeUnicodeEscape(s, size, errors)  PyUnicode_Decode(s, size, "unicode_escape", errors)
  #endif
  #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500)
    #undef PyUnicode_Contains
    #define PyUnicode_Contains(u, s)  PySequence_Contains(u, s)
  #endif
  #if !defined(PyByteArray_Check)
    #define PyByteArray_Check(obj)  PyObject_TypeCheck(obj, &PyByteArray_Type)
  #endif
  #if !defined(PyObject_Format)
    #define PyObject_Format(obj, fmt)  PyObject_CallMethod(obj, "__format__", "O", fmt)
  #endif
#endif
#define __Pyx_PyString_FormatSafe(a, b)   ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
#define __Pyx_PyUnicode_FormatSafe(a, b)  ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? 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
#ifndef PyObject_Unicode
  #define PyObject_Unicode             PyObject_Str
#endif
#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
#if CYTHON_COMPILING_IN_CPYTHON
  #define __Pyx_PySequence_ListKeepNew(obj)\
    (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj))
#else
  #define __Pyx_PySequence_ListKeepNew(obj)  PySequence_List(obj)
#endif
#ifndef PySet_CheckExact
  #define PySet_CheckExact(obj)        __Pyx_IS_TYPE(obj, &PySet_Type)
#endif
#if PY_VERSION_HEX >= 0x030900A4
  #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
  #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
#else
  #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
  #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
#endif
#if CYTHON_ASSUME_SAFE_MACROS
  #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i)
  #define __Pyx_PySequence_SIZE(seq)  Py_SIZE(seq)
  #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0))
  #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0))
  #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o)
  #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o)
  #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o)
  #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o)
  #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o)
#else
  #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i)
  #define __Pyx_PySequence_SIZE(seq)  PySequence_Size(seq)
  #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v)
  #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v)
  #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o)
  #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o)
  #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o)
  #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o)
  #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o)
#endif
#if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1
  #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name)
#else
  static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) {
      PyObject *module = PyImport_AddModule(name);
      Py_XINCREF(module);
      return module;
  }
#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 __Pyx_Py3Int_Check(op)       PyLong_Check(op)
  #define __Pyx_Py3Int_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
#else
  #define __Pyx_Py3Int_Check(op)       (PyLong_Check(op) || PyInt_Check(op))
  #define __Pyx_Py3Int_CheckExact(op)  (PyLong_CheckExact(op) || PyInt_CheckExact(op))
#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   __Pyx_PyIndex_AsHash_t
#else
  #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
  #define __Pyx_PyInt_AsHash_t   __Pyx_PyIndex_AsSsize_t
#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(WIN32) || defined(MS_WINDOWS)
  #if !defined(_USE_MATH_DEFINES)
    #define _USE_MATH_DEFINES
  #endif
#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_MARK_ERR_POS(f_index, lineno) \
    { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__;  (void)__pyx_clineno; }
#define __PYX_ERR(f_index, lineno, Ln_error) \
    { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }

#ifdef CYTHON_EXTERN_C
    #undef __PYX_EXTERN_C
    #define __PYX_EXTERN_C CYTHON_EXTERN_C
#elif defined(__PYX_EXTERN_C)
    #ifdef _MSC_VER
    #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.")
    #else
    #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.
    #endif
#else
  #ifdef __cplusplus
    #define __PYX_EXTERN_C extern "C"
  #else
    #define __PYX_EXTERN_C extern
  #endif
#endif

#define __PYX_HAVE___amplpy
#define __PYX_HAVE_API___amplpy
/* Early includes */
#include "ampl/ampl_c.h"
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <stddef.h>
#include "pythread.h"
#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_UTF8 0
#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
#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)))  )
static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
    return (size_t) i < (size_t) limit;
}
#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 Py_ssize_t __Pyx_ssize_strlen(const char *s);
static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*);
#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_uintptr_t) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsWritableSString(s)    ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsWritableUString(s)    ((unsigned char*)(__pyx_uintptr_t) __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)
#define __Pyx_PyUnicode_FromOrdinal(o)       PyUnicode_FromOrdinal((int)o)
#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 int __Pyx_PyObject_IsTrueAndDecref(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);
static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
#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
#if CYTHON_USE_PYLONG_INTERNALS
  #if PY_VERSION_HEX >= 0x030C00A7
  #ifndef _PyLong_SIGN_MASK
    #define _PyLong_SIGN_MASK 3
  #endif
  #ifndef _PyLong_NON_SIZE_BITS
    #define _PyLong_NON_SIZE_BITS 3
  #endif
  #define __Pyx_PyLong_Sign(x)  (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK)
  #define __Pyx_PyLong_IsNeg(x)  ((__Pyx_PyLong_Sign(x) & 2) != 0)
  #define __Pyx_PyLong_IsNonNeg(x)  (!__Pyx_PyLong_IsNeg(x))
  #define __Pyx_PyLong_IsZero(x)  (__Pyx_PyLong_Sign(x) & 1)
  #define __Pyx_PyLong_IsPos(x)  (__Pyx_PyLong_Sign(x) == 0)
  #define __Pyx_PyLong_CompactValueUnsigned(x)  (__Pyx_PyLong_Digits(x)[0])
  #define __Pyx_PyLong_DigitCount(x)  ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS))
  #define __Pyx_PyLong_SignedDigitCount(x)\
        ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x))
  #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue)
    #define __Pyx_PyLong_IsCompact(x)     PyUnstable_Long_IsCompact((PyLongObject*) x)
    #define __Pyx_PyLong_CompactValue(x)  PyUnstable_Long_CompactValue((PyLongObject*) x)
  #else
    #define __Pyx_PyLong_IsCompact(x)     (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS))
    #define __Pyx_PyLong_CompactValue(x)  ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0])
  #endif
  typedef Py_ssize_t  __Pyx_compact_pylong;
  typedef size_t  __Pyx_compact_upylong;
  #else
  #define __Pyx_PyLong_IsNeg(x)  (Py_SIZE(x) < 0)
  #define __Pyx_PyLong_IsNonNeg(x)  (Py_SIZE(x) >= 0)
  #define __Pyx_PyLong_IsZero(x)  (Py_SIZE(x) == 0)
  #define __Pyx_PyLong_IsPos(x)  (Py_SIZE(x) > 0)
  #define __Pyx_PyLong_CompactValueUnsigned(x)  ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0])
  #define __Pyx_PyLong_DigitCount(x)  __Pyx_sst_abs(Py_SIZE(x))
  #define __Pyx_PyLong_SignedDigitCount(x)  Py_SIZE(x)
  #define __Pyx_PyLong_IsCompact(x)  (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1)
  #define __Pyx_PyLong_CompactValue(x)\
        ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0]))
  typedef sdigit  __Pyx_compact_pylong;
  typedef digit  __Pyx_compact_upylong;
  #endif
  #if PY_VERSION_HEX >= 0x030C00A5
  #define __Pyx_PyLong_Digits(x)  (((PyLongObject*)x)->long_value.ob_digit)
  #else
  #define __Pyx_PyLong_Digits(x)  (((PyLongObject*)x)->ob_digit)
  #endif
#endif
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
#include <string.h>
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] = (char) 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
#include <string.h>
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) + 1);
    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; }

#if !CYTHON_USE_MODULE_STATE
static PyObject *__pyx_m = NULL;
#endif
static int __pyx_lineno;
static int __pyx_clineno = 0;
static const char * __pyx_cfilenm = __FILE__;
static const char *__pyx_filename;

/* #### Code section: filename_table ### */

static const char *__pyx_f[] = {
  "amplpy/dataframe.pxi",
  "amplpy/exceptions.pxi",
  "amplpy/outputhandler.pxi",
  "amplpy/ampl.pyx",
  "amplpy/util.pxi",
  "amplpy/constraint.pxi",
  "amplpy/iterators.pxi",
  "contextvars.pxd",
  "<stringsource>",
  "amplpy/entity.pxi",
  "amplpy/environment.pxi",
  "amplpy/errorhandler.pxi",
  "amplpy/objective.pxi",
  "amplpy/parameter.pxi",
  "amplpy/set.pxi",
  "amplpy/variable.pxi",
  "bool.pxd",
  "type.pxd",
  "complex.pxd",
};
/* #### Code section: utility_code_proto_before_types ### */
/* ForceInitThreads.proto */
#ifndef __PYX_FORCE_INIT_THREADS
  #define __PYX_FORCE_INIT_THREADS 0
#endif

/* NoFastGil.proto */
#define __Pyx_PyGILState_Ensure PyGILState_Ensure
#define __Pyx_PyGILState_Release PyGILState_Release
#define __Pyx_FastGIL_Remember()
#define __Pyx_FastGIL_Forget()
#define __Pyx_FastGilFuncInit()

/* #### Code section: numeric_typedefs ### */
/* #### Code section: complex_type_declarations ### */
/* #### Code section: type_declarations ### */

/*--- Type declarations ---*/
struct __pyx_obj_7_amplpy_Row;
struct __pyx_obj_7_amplpy_Column;
struct __pyx_obj_7_amplpy_DataFrame;
struct __pyx_obj_7_amplpy_Entity;
struct __pyx_obj_7_amplpy_Constraint;
struct __pyx_obj_7_amplpy_Environment;
struct __pyx_obj_7_amplpy_ErrorHandler;
struct __pyx_obj_7_amplpy_EnvIterator;
struct __pyx_obj_7_amplpy_EntityMap;
struct __pyx_obj_7_amplpy_InstanceIterator;
struct __pyx_obj_7_amplpy_MemberRangeIterator;
struct __pyx_obj_7_amplpy_ColIterator;
struct __pyx_obj_7_amplpy_RowIterator;
struct __pyx_obj_7_amplpy_Objective;
struct __pyx_obj_7_amplpy_OutputHandler;
struct __pyx_obj_7_amplpy_Parameter;
struct __pyx_obj_7_amplpy_Set;
struct __pyx_obj_7_amplpy_Variable;
struct __pyx_obj_7_amplpy_AMPL;
struct __pyx_obj_7_amplpy___pyx_scope_struct____iter__;
struct __pyx_obj_7_amplpy___pyx_scope_struct_1_genexpr;
struct __pyx_obj_7_amplpy___pyx_scope_struct_2_genexpr;
struct __pyx_obj_7_amplpy___pyx_scope_struct_3_genexpr;
struct __pyx_obj_7_amplpy___pyx_scope_struct_4__get_headers;
struct __pyx_obj_7_amplpy___pyx_scope_struct_5_genexpr;
struct __pyx_obj_7_amplpy___pyx_scope_struct_6_from_dict;
struct __pyx_obj_7_amplpy___pyx_scope_struct_7_genexpr;
struct __pyx_obj_7_amplpy___pyx_scope_struct_8_genexpr;
struct __pyx_obj_7_amplpy___pyx_scope_struct_9_genexpr;
struct __pyx_obj_7_amplpy___pyx_scope_struct_10_genexpr;
struct __pyx_obj_7_amplpy___pyx_scope_struct_11_set_values;
struct __pyx_obj_7_amplpy___pyx_scope_struct_12_genexpr;
struct __pyx_obj_7_amplpy___pyx_scope_struct_13_genexpr;
struct __pyx_obj_7_amplpy___pyx_scope_struct_14_genexpr;
struct __pyx_obj_7_amplpy___pyx_scope_struct_15_genexpr;
struct __pyx_opt_args_7cpython_11contextvars_get_value;
struct __pyx_opt_args_7cpython_11contextvars_get_value_no_default;

/* "cpython/contextvars.pxd":112
 * 
 * 
 * cdef inline object get_value(var, default_value=None):             # <<<<<<<<<<<<<<
 *     """Return a new reference to the value of the context variable,
 *     or the default value of the context variable,
 */
struct __pyx_opt_args_7cpython_11contextvars_get_value {
  int __pyx_n;
  PyObject *default_value;
};

/* "cpython/contextvars.pxd":129
 * 
 * 
 * cdef inline object get_value_no_default(var, default_value=None):             # <<<<<<<<<<<<<<
 *     """Return a new reference to the value of the context variable,
 *     or the provided default value if no such value was found.
 */
struct __pyx_opt_args_7cpython_11contextvars_get_value_no_default {
  int __pyx_n;
  PyObject *default_value;
};

/* "amplpy/dataframe.pxi":17
 * 
 * 
 * cdef class Row(object):             # <<<<<<<<<<<<<<
 *     """
 *     Represents a row in a :class:`~amplpy.DataFrame`.
 */
struct __pyx_obj_7_amplpy_Row {
  PyObject_HEAD
  struct __pyx_vtabstruct_7_amplpy_Row *__pyx_vtab;
  AMPL_DATAFRAME *_df;
  size_t _index;
};


/* "amplpy/dataframe.pxi":49
 * 
 * 
 * cdef class Column(object):             # <<<<<<<<<<<<<<
 *     """
 *     Represents a column in a :class:`~amplpy.DataFrame`.
 */
struct __pyx_obj_7_amplpy_Column {
  PyObject_HEAD
  struct __pyx_vtabstruct_7_amplpy_Column *__pyx_vtab;
  AMPL_DATAFRAME *_df;
  size_t _index;
};


/* "amplpy/dataframe.pxi":88
 * 
 * 
 * cdef class DataFrame(object):             # <<<<<<<<<<<<<<
 *     """
 *     A DataFrame object, used to communicate data to and from the AMPL entities.
 */
struct __pyx_obj_7_amplpy_DataFrame {
  PyObject_HEAD
  struct __pyx_vtabstruct_7_amplpy_DataFrame *__pyx_vtab;
  AMPL_DATAFRAME *_c_df;
};


/* "amplpy/entity.pxi":12
 * 
 * 
 * cdef class Entity(object):             # <<<<<<<<<<<<<<
 *     """
 *     An AMPL entity such as a parameter or a variable.
 */
struct __pyx_obj_7_amplpy_Entity {
  PyObject_HEAD
  struct __pyx_vtabstruct_7_amplpy_Entity *__pyx_vtab;
  AMPL *_c_ampl;
  char *_name;
  AMPL_TUPLE *_index;
  AMPL_ENTITYTYPE wrap_function;
  PyObject *_entity;
};


/* "amplpy/constraint.pxi":6
 * 
 * 
 * cdef class Constraint(Entity):             # <<<<<<<<<<<<<<
 *     """
 *     Bases: :class:`~amplpy.Entity`.
 */
struct __pyx_obj_7_amplpy_Constraint {
  struct __pyx_obj_7_amplpy_Entity __pyx_base;
};


/* "amplpy/environment.pxi":5
 * 
 * 
 * cdef class Environment(object):             # <<<<<<<<<<<<<<
 *     """
 *     This class provides access to the environment variables and provides
 */
struct __pyx_obj_7_amplpy_Environment {
  PyObject_HEAD
  struct __pyx_vtabstruct_7_amplpy_Environment *__pyx_vtab;
  AMPL_ENVIRONMENT *_c_env;
};


/* "amplpy/errorhandler.pxi":15
 * 
 * 
 * cdef class ErrorHandler:             # <<<<<<<<<<<<<<
 *     """
 *     A basic interface for AMPL error handlers. If an application needs to
 */
struct __pyx_obj_7_amplpy_ErrorHandler {
  PyObject_HEAD
};


/* "amplpy/iterators.pxi":1
 * cdef class EnvIterator(object):             # <<<<<<<<<<<<<<
 *     cdef campl.AMPL_ENVIRONMENT* env_c
 *     cdef campl.AMPL_ENVIRONMENTVAR* begin
 */
struct __pyx_obj_7_amplpy_EnvIterator {
  PyObject_HEAD
  struct __pyx_vtabstruct_7_amplpy_EnvIterator *__pyx_vtab;
  AMPL_ENVIRONMENT *env_c;
  AMPL_ENVIRONMENTVAR *begin;
  AMPL_ENVIRONMENTVAR *end;
  AMPL_ENVIRONMENTVAR *iterator;
};


/* "amplpy/iterators.pxi":38
 * 
 * 
 * cdef class EntityMap(object):             # <<<<<<<<<<<<<<
 *     cdef campl.AMPL* _c_ampl
 *     cdef campl.AMPL_ENTITYTYPE entity_class
 */
struct __pyx_obj_7_amplpy_EntityMap {
  PyObject_HEAD
  struct __pyx_vtabstruct_7_amplpy_EntityMap *__pyx_vtab;
  AMPL *_c_ampl;
  AMPL_ENTITYTYPE entity_class;
  char **begin;
  char **end;
  size_t iterator;
  size_t _size;
};


/* "amplpy/iterators.pxi":117
 *         return self.size()
 * 
 * cdef class InstanceIterator(object):             # <<<<<<<<<<<<<<
 *     cdef campl.AMPL* _c_ampl
 *     cdef char* _name
 */
struct __pyx_obj_7_amplpy_InstanceIterator {
  PyObject_HEAD
  struct __pyx_vtabstruct_7_amplpy_InstanceIterator *__pyx_vtab;
  AMPL *_c_ampl;
  char *_name;
  AMPL_ENTITYTYPE entity_class;
  AMPL_TUPLE **begin;
  AMPL_TUPLE **end;
  size_t iterator;
  size_t _size;
  PyObject *_entity;
};


/* "amplpy/iterators.pxi":192
 * 
 * 
 * cdef class MemberRangeIterator(object):             # <<<<<<<<<<<<<<
 *     """Iterator for set members."""
 *     cdef campl.AMPL* _c_ampl
 */
struct __pyx_obj_7_amplpy_MemberRangeIterator {
  PyObject_HEAD
  struct __pyx_vtabstruct_7_amplpy_MemberRangeIterator *__pyx_vtab;
  AMPL *_c_ampl;
  char *_name;
  AMPL_TUPLE *_index;
  AMPL_TUPLE **begin;
  AMPL_TUPLE **end;
  size_t iterator;
  size_t _size;
  PyObject *_entity;
};


/* "amplpy/iterators.pxi":263
 *             return py_tuple
 * 
 * cdef class ColIterator(object):             # <<<<<<<<<<<<<<
 *     cdef campl.AMPL_DATAFRAME* _df
 *     cdef size_t _index
 */
struct __pyx_obj_7_amplpy_ColIterator {
  PyObject_HEAD
  struct __pyx_vtabstruct_7_amplpy_ColIterator *__pyx_vtab;
  AMPL_DATAFRAME *_df;
  size_t _index;
  size_t _rowsize;
  size_t _rowit;
};


/* "amplpy/iterators.pxi":289
 *         return to_py_variant(v)
 * 
 * cdef class RowIterator(object):             # <<<<<<<<<<<<<<
 *     cdef campl.AMPL_DATAFRAME* _df
 *     cdef size_t _index
 */
struct __pyx_obj_7_amplpy_RowIterator {
  PyObject_HEAD
  struct __pyx_vtabstruct_7_amplpy_RowIterator *__pyx_vtab;
  AMPL_DATAFRAME *_df;
  size_t _index;
  size_t _columnsize;
  size_t _columnit;
};


/* "amplpy/objective.pxi":4
 * 
 * 
 * cdef class Objective(Entity):             # <<<<<<<<<<<<<<
 *     """
 *     Bases: :class:`~amplpy.Entity`.
 */
struct __pyx_obj_7_amplpy_Objective {
  struct __pyx_obj_7_amplpy_Entity __pyx_base;
};


/* "amplpy/outputhandler.pxi":6
 * 
 * 
 * cdef class OutputHandler(object):             # <<<<<<<<<<<<<<
 *     """
 *     Interface to handle the outputs from the calls to any
 */
struct __pyx_obj_7_amplpy_OutputHandler {
  PyObject_HEAD
};


/* "amplpy/parameter.pxi":19
 * 
 * 
 * cdef class Parameter(Entity):             # <<<<<<<<<<<<<<
 *     """
 *     Represents an AMPL parameter. The values can be float or string (in case of
 */
struct __pyx_obj_7_amplpy_Parameter {
  struct __pyx_obj_7_amplpy_Entity __pyx_base;
};


/* "amplpy/set.pxi":12
 * 
 * 
 * cdef class Set(Entity):             # <<<<<<<<<<<<<<
 *     """
 *     Represents an AMPL set. In case of not indexed sets, this class exposes
 */
struct __pyx_obj_7_amplpy_Set {
  struct __pyx_obj_7_amplpy_Entity __pyx_base;
};


/* "amplpy/variable.pxi":3
 * # -*- coding: utf-8 -*-
 * 
 * cdef class Variable(Entity):             # <<<<<<<<<<<<<<
 *     """
 *     Bases: :class:`~amplpy.Entity`.
 */
struct __pyx_obj_7_amplpy_Variable {
  struct __pyx_obj_7_amplpy_Entity __pyx_base;
};


/* "amplpy/ampl.pyx":61
 * """
 * 
 * cdef class AMPL:             # <<<<<<<<<<<<<<
 *     """An AMPL translator.
 * 
 */
struct __pyx_obj_7_amplpy_AMPL {
  PyObject_HEAD
  AMPL *_c_ampl;
  PyObject *_output_handler;
  PyObject *_error_handler;
};


/* "amplpy/dataframe.pxi":193
 *         return self.to_string()
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         # FIXME: C++ iterators for dataframes not working with SWIG.
 *         return (self._get_row_by_index(i) for i in range(self._get_num_rows()))
 */
struct __pyx_obj_7_amplpy___pyx_scope_struct____iter__ {
  PyObject_HEAD
  struct __pyx_obj_7_amplpy_DataFrame *__pyx_v_self;
};


/* "amplpy/dataframe.pxi":195
 *     def __iter__(self):
 *         # FIXME: C++ iterators for dataframes not working with SWIG.
 *         return (self._get_row_by_index(i) for i in range(self._get_num_rows()))             # <<<<<<<<<<<<<<
 * 
 *     def _get_num_cols(self):
 */
struct __pyx_obj_7_amplpy___pyx_scope_struct_1_genexpr {
  PyObject_HEAD
  struct __pyx_obj_7_amplpy___pyx_scope_struct____iter__ *__pyx_outer_scope;
  PyObject *__pyx_genexpr_arg_0;
  PyObject *__pyx_v_i;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "amplpy/dataframe.pxi":268
 *         else:
 *             assert len(values) == self._get_num_rows()
 *             if any(isinstance(value, str) for value in values):             # <<<<<<<<<<<<<<
 *                 c_string_array = <const char**> malloc(size * sizeof(const char*))
 *                 if not isinstance(values, (list, tuple)):
 */
struct __pyx_obj_7_amplpy___pyx_scope_struct_2_genexpr {
  PyObject_HEAD
  PyObject *__pyx_genexpr_arg_0;
  PyObject *__pyx_v_value;
};


/* "amplpy/dataframe.pxi":279
 *                         free(c_string_array[i])
 *                 free(c_string_array)
 *             elif all(isinstance(value, Real) for value in values):             # <<<<<<<<<<<<<<
 *                 values = list(map(float, values))
 *                 c_double_array = <double*> malloc(size * sizeof(double))
 */
struct __pyx_obj_7_amplpy___pyx_scope_struct_3_genexpr {
  PyObject_HEAD
  PyObject *__pyx_genexpr_arg_0;
  PyObject *__pyx_v_value;
};


/* "amplpy/dataframe.pxi":365
 *         return Row.create(self._c_df, index)
 * 
 *     def _get_headers(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the headers of this DataFrame.
 */
struct __pyx_obj_7_amplpy___pyx_scope_struct_4__get_headers {
  PyObject_HEAD
  char **__pyx_v_headers;
};


/* "amplpy/dataframe.pxi":375
 *         cdef char** headers
 *         campl.AMPL_DataFrameGetHeaders(self._c_df, &size, &headers)
 *         headers_py = tuple(str(headers[i].decode('utf-8')) for i in range(size))             # <<<<<<<<<<<<<<
 *         for i in range(size):
 *             campl.AMPL_StringFree(&headers[i])
 */
struct __pyx_obj_7_amplpy___pyx_scope_struct_5_genexpr {
  PyObject_HEAD
  struct __pyx_obj_7_amplpy___pyx_scope_struct_4__get_headers *__pyx_outer_scope;
  size_t __pyx_genexpr_arg_0;
  size_t __pyx_v_i;
  size_t __pyx_t_0;
  size_t __pyx_t_1;
  size_t __pyx_t_2;
};


/* "amplpy/dataframe.pxi":478
 *                 return pd.DataFrame(columns, index=index)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def from_dict(cls, dic, index_names=None, column_names=None):
 *         """
 */
struct __pyx_obj_7_amplpy___pyx_scope_struct_6_from_dict {
  PyObject_HEAD
  Py_ssize_t __pyx_v_ncolumns;
  Py_ssize_t __pyx_v_nindices;
};


/* "amplpy/dataframe.pxi":502
 *         assert index_names is None or nindices == len(index_names)
 *         assert column_names is None or ncolumns == len(column_names)
 *         assert all(len(k) == nindices for k in lst_index)             # <<<<<<<<<<<<<<
 *         assert all(len(v) == ncolumns for v in lst_columns)
 * 
 */
struct __pyx_obj_7_amplpy___pyx_scope_struct_7_genexpr {
  PyObject_HEAD
  struct __pyx_obj_7_amplpy___pyx_scope_struct_6_from_dict *__pyx_outer_scope;
  PyObject *__pyx_genexpr_arg_0;
  PyObject *__pyx_v_k;
};


/* "amplpy/dataframe.pxi":503
 *         assert column_names is None or ncolumns == len(column_names)
 *         assert all(len(k) == nindices for k in lst_index)
 *         assert all(len(v) == ncolumns for v in lst_columns)             # <<<<<<<<<<<<<<
 * 
 *         index = zip(*lst_index)
 */
struct __pyx_obj_7_amplpy___pyx_scope_struct_8_genexpr {
  PyObject_HEAD
  struct __pyx_obj_7_amplpy___pyx_scope_struct_6_from_dict *__pyx_outer_scope;
  PyObject *__pyx_genexpr_arg_0;
  PyObject *__pyx_v_v;
};


/* "amplpy/parameter.pxi":172
 *                 self.set_values(tuple(itertools.chain(*values.tolist())))
 *         elif isinstance(values, Iterable):
 *             if all(isinstance(value, str) for value in values):             # <<<<<<<<<<<<<<
 *                 if not isinstance(values, (list, tuple)):
 *                     values = list(values)
 */
struct __pyx_obj_7_amplpy___pyx_scope_struct_9_genexpr {
  PyObject_HEAD
  PyObject *__pyx_genexpr_arg_0;
  PyObject *__pyx_v_value;
};


/* "amplpy/parameter.pxi":176
 *                     values = list(values)
 *                 setValuesParamStr(self._c_ampl, self._name, values)
 *             elif all(isinstance(value, Real) for value in values):             # <<<<<<<<<<<<<<
 *                 values = list(map(float, values))
 *                 setValuesParamNum(self._c_ampl, self._name, values)
 */
struct __pyx_obj_7_amplpy___pyx_scope_struct_10_genexpr {
  PyObject_HEAD
  PyObject *__pyx_genexpr_arg_0;
  PyObject *__pyx_v_value;
};


/* "amplpy/set.pxi":103
 *         return contains_c
 * 
 *     def set_values(self, values):             # <<<<<<<<<<<<<<
 *         """
 *         Set the tuples in this set. Valid only for non-indexed sets.
 */
struct __pyx_obj_7_amplpy___pyx_scope_struct_11_set_values {
  PyObject_HEAD
  PyObject *__pyx_v_cast_value;
  PyObject *__pyx_v_dimen;
};


/* "amplpy/set.pxi":142
 *         elif isinstance(values, Iterable):
 *             dimen = self.arity()
 *             if dimen == 1 and all(isinstance(value, str) for value in values):             # <<<<<<<<<<<<<<
 *                 if not isinstance(values, (list, tuple)):
 *                     values = list(values)
 */
struct __pyx_obj_7_amplpy___pyx_scope_struct_12_genexpr {
  PyObject_HEAD
  PyObject *__pyx_genexpr_arg_0;
  PyObject *__pyx_v_value;
};


/* "amplpy/set.pxi":146
 *                     values = list(values)
 *                 setValues(self._c_ampl, self._name, self._index, values, len(values))
 *             elif dimen == 1 and all(isinstance(value, Real) for value in values):             # <<<<<<<<<<<<<<
 *                 values = list(map(float, values))
 *                 setValues(self._c_ampl, self._name, self._index, values, len(values))
 */
struct __pyx_obj_7_amplpy___pyx_scope_struct_13_genexpr {
  PyObject_HEAD
  PyObject *__pyx_genexpr_arg_0;
  PyObject *__pyx_v_value;
};


/* "amplpy/set.pxi":174
 *                 values = [cast_row(row) for row in values]
 *                 if dimen == 1:
 *                     if any(isinstance(row, tuple) for row in values):             # <<<<<<<<<<<<<<
 *                         raise ValueError(
 *                             f"Trying to assign tuples to set of arity {dimen}."
 */
struct __pyx_obj_7_amplpy___pyx_scope_struct_14_genexpr {
  PyObject_HEAD
  PyObject *__pyx_genexpr_arg_0;
  PyObject *__pyx_v_row;
};


/* "amplpy/set.pxi":180
 *                 else:
 *                     if any(
 *                         not isinstance(row, tuple) or len(row) != dimen             # <<<<<<<<<<<<<<
 *                         for row in values
 *                     ):
 */
struct __pyx_obj_7_amplpy___pyx_scope_struct_15_genexpr {
  PyObject_HEAD
  struct __pyx_obj_7_amplpy___pyx_scope_struct_11_set_values *__pyx_outer_scope;
  PyObject *__pyx_genexpr_arg_0;
  PyObject *__pyx_v_row;
};



/* "amplpy/dataframe.pxi":17
 * 
 * 
 * cdef class Row(object):             # <<<<<<<<<<<<<<
 *     """
 *     Represents a row in a :class:`~amplpy.DataFrame`.
 */

struct __pyx_vtabstruct_7_amplpy_Row {
  PyObject *(*create)(AMPL_DATAFRAME *, size_t);
};
static struct __pyx_vtabstruct_7_amplpy_Row *__pyx_vtabptr_7_amplpy_Row;


/* "amplpy/dataframe.pxi":49
 * 
 * 
 * cdef class Column(object):             # <<<<<<<<<<<<<<
 *     """
 *     Represents a column in a :class:`~amplpy.DataFrame`.
 */

struct __pyx_vtabstruct_7_amplpy_Column {
  PyObject *(*create)(AMPL_DATAFRAME *, size_t);
};
static struct __pyx_vtabstruct_7_amplpy_Column *__pyx_vtabptr_7_amplpy_Column;


/* "amplpy/dataframe.pxi":88
 * 
 * 
 * cdef class DataFrame(object):             # <<<<<<<<<<<<<<
 *     """
 *     A DataFrame object, used to communicate data to and from the AMPL entities.
 */

struct __pyx_vtabstruct_7_amplpy_DataFrame {
  AMPL_DATAFRAME *(*get_ptr)(struct __pyx_obj_7_amplpy_DataFrame *);
  PyObject *(*create)(AMPL_DATAFRAME *);
};
static struct __pyx_vtabstruct_7_amplpy_DataFrame *__pyx_vtabptr_7_amplpy_DataFrame;


/* "amplpy/entity.pxi":12
 * 
 * 
 * cdef class Entity(object):             # <<<<<<<<<<<<<<
 *     """
 *     An AMPL entity such as a parameter or a variable.
 */

struct __pyx_vtabstruct_7_amplpy_Entity {
  PyObject *(*create)(AMPL *, char *, AMPL_TUPLE *, PyObject *);
};
static struct __pyx_vtabstruct_7_amplpy_Entity *__pyx_vtabptr_7_amplpy_Entity;


/* "amplpy/constraint.pxi":6
 * 
 * 
 * cdef class Constraint(Entity):             # <<<<<<<<<<<<<<
 *     """
 *     Bases: :class:`~amplpy.Entity`.
 */

struct __pyx_vtabstruct_7_amplpy_Constraint {
  struct __pyx_vtabstruct_7_amplpy_Entity __pyx_base;
};
static struct __pyx_vtabstruct_7_amplpy_Constraint *__pyx_vtabptr_7_amplpy_Constraint;


/* "amplpy/environment.pxi":5
 * 
 * 
 * cdef class Environment(object):             # <<<<<<<<<<<<<<
 *     """
 *     This class provides access to the environment variables and provides
 */

struct __pyx_vtabstruct_7_amplpy_Environment {
  AMPL_ENVIRONMENT *(*get_c_pointer)(struct __pyx_obj_7_amplpy_Environment *);
};
static struct __pyx_vtabstruct_7_amplpy_Environment *__pyx_vtabptr_7_amplpy_Environment;


/* "amplpy/iterators.pxi":1
 * cdef class EnvIterator(object):             # <<<<<<<<<<<<<<
 *     cdef campl.AMPL_ENVIRONMENT* env_c
 *     cdef campl.AMPL_ENVIRONMENTVAR* begin
 */

struct __pyx_vtabstruct_7_amplpy_EnvIterator {
  PyObject *(*create)(AMPL_ENVIRONMENT *);
};
static struct __pyx_vtabstruct_7_amplpy_EnvIterator *__pyx_vtabptr_7_amplpy_EnvIterator;


/* "amplpy/iterators.pxi":38
 * 
 * 
 * cdef class EntityMap(object):             # <<<<<<<<<<<<<<
 *     cdef campl.AMPL* _c_ampl
 *     cdef campl.AMPL_ENTITYTYPE entity_class
 */

struct __pyx_vtabstruct_7_amplpy_EntityMap {
  PyObject *(*create)(AMPL *, AMPL_ENTITYTYPE);
};
static struct __pyx_vtabstruct_7_amplpy_EntityMap *__pyx_vtabptr_7_amplpy_EntityMap;


/* "amplpy/iterators.pxi":117
 *         return self.size()
 * 
 * cdef class InstanceIterator(object):             # <<<<<<<<<<<<<<
 *     cdef campl.AMPL* _c_ampl
 *     cdef char* _name
 */

struct __pyx_vtabstruct_7_amplpy_InstanceIterator {
  PyObject *(*create)(AMPL *, char *, AMPL_ENTITYTYPE, PyObject *);
};
static struct __pyx_vtabstruct_7_amplpy_InstanceIterator *__pyx_vtabptr_7_amplpy_InstanceIterator;


/* "amplpy/iterators.pxi":192
 * 
 * 
 * cdef class MemberRangeIterator(object):             # <<<<<<<<<<<<<<
 *     """Iterator for set members."""
 *     cdef campl.AMPL* _c_ampl
 */

struct __pyx_vtabstruct_7_amplpy_MemberRangeIterator {
  PyObject *(*create)(AMPL *, char *, AMPL_TUPLE *, PyObject *);
};
static struct __pyx_vtabstruct_7_amplpy_MemberRangeIterator *__pyx_vtabptr_7_amplpy_MemberRangeIterator;


/* "amplpy/iterators.pxi":263
 *             return py_tuple
 * 
 * cdef class ColIterator(object):             # <<<<<<<<<<<<<<
 *     cdef campl.AMPL_DATAFRAME* _df
 *     cdef size_t _index
 */

struct __pyx_vtabstruct_7_amplpy_ColIterator {
  PyObject *(*create)(AMPL_DATAFRAME *, size_t);
};
static struct __pyx_vtabstruct_7_amplpy_ColIterator *__pyx_vtabptr_7_amplpy_ColIterator;


/* "amplpy/iterators.pxi":289
 *         return to_py_variant(v)
 * 
 * cdef class RowIterator(object):             # <<<<<<<<<<<<<<
 *     cdef campl.AMPL_DATAFRAME* _df
 *     cdef size_t _index
 */

struct __pyx_vtabstruct_7_amplpy_RowIterator {
  PyObject *(*create)(AMPL_DATAFRAME *, size_t);
};
static struct __pyx_vtabstruct_7_amplpy_RowIterator *__pyx_vtabptr_7_amplpy_RowIterator;


/* "amplpy/objective.pxi":4
 * 
 * 
 * cdef class Objective(Entity):             # <<<<<<<<<<<<<<
 *     """
 *     Bases: :class:`~amplpy.Entity`.
 */

struct __pyx_vtabstruct_7_amplpy_Objective {
  struct __pyx_vtabstruct_7_amplpy_Entity __pyx_base;
};
static struct __pyx_vtabstruct_7_amplpy_Objective *__pyx_vtabptr_7_amplpy_Objective;


/* "amplpy/parameter.pxi":19
 * 
 * 
 * cdef class Parameter(Entity):             # <<<<<<<<<<<<<<
 *     """
 *     Represents an AMPL parameter. The values can be float or string (in case of
 */

struct __pyx_vtabstruct_7_amplpy_Parameter {
  struct __pyx_vtabstruct_7_amplpy_Entity __pyx_base;
};
static struct __pyx_vtabstruct_7_amplpy_Parameter *__pyx_vtabptr_7_amplpy_Parameter;


/* "amplpy/set.pxi":12
 * 
 * 
 * cdef class Set(Entity):             # <<<<<<<<<<<<<<
 *     """
 *     Represents an AMPL set. In case of not indexed sets, this class exposes
 */

struct __pyx_vtabstruct_7_amplpy_Set {
  struct __pyx_vtabstruct_7_amplpy_Entity __pyx_base;
};
static struct __pyx_vtabstruct_7_amplpy_Set *__pyx_vtabptr_7_amplpy_Set;


/* "amplpy/variable.pxi":3
 * # -*- coding: utf-8 -*-
 * 
 * cdef class Variable(Entity):             # <<<<<<<<<<<<<<
 *     """
 *     Bases: :class:`~amplpy.Entity`.
 */

struct __pyx_vtabstruct_7_amplpy_Variable {
  struct __pyx_vtabstruct_7_amplpy_Entity __pyx_base;
};
static struct __pyx_vtabstruct_7_amplpy_Variable *__pyx_vtabptr_7_amplpy_Variable;
/* #### Code section: utility_code_proto ### */

/* --- Runtime support code (head) --- */
/* Refnanny.proto */
#ifndef CYTHON_REFNANNY
  #define CYTHON_REFNANNY 0
#endif
#if CYTHON_REFNANNY
  typedef struct {
    void (*INCREF)(void*, PyObject*, Py_ssize_t);
    void (*DECREF)(void*, PyObject*, Py_ssize_t);
    void (*GOTREF)(void*, PyObject*, Py_ssize_t);
    void (*GIVEREF)(void*, PyObject*, Py_ssize_t);
    void* (*SetupContext)(const char*, Py_ssize_t, 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__));\
          }
  #define __Pyx_RefNannyFinishContextNogil() {\
              PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
              __Pyx_RefNannyFinishContext();\
              PyGILState_Release(__pyx_gilstate_save);\
          }
#else
  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
          __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__))
  #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext()
#endif
  #define __Pyx_RefNannyFinishContextNogil() {\
              PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
              __Pyx_RefNannyFinishContext();\
              PyGILState_Release(__pyx_gilstate_save);\
          }
  #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); else {__Pyx_INCREF(r); }} while(0)
  #define __Pyx_XDECREF(r)  do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0)
  #define __Pyx_XGOTREF(r)  do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0)
  #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0)
#else
  #define __Pyx_RefNannyDeclarations
  #define __Pyx_RefNannySetupContext(name, acquire_gil)
  #define __Pyx_RefNannyFinishContextNogil()
  #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_Py_XDECREF_SET(r, v) do {\
        PyObject *tmp = (PyObject *) r;\
        r = v; Py_XDECREF(tmp);\
    } while (0)
#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)

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

/* PyThreadStateGet.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyThreadState_declare  PyThreadState *__pyx_tstate;
#define __Pyx_PyThreadState_assign  __pyx_tstate = __Pyx_PyThreadState_Current;
#if PY_VERSION_HEX >= 0x030C00A6
#define __Pyx_PyErr_Occurred()  (__pyx_tstate->current_exception != NULL)
#define __Pyx_PyErr_CurrentExceptionType()  (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL)
#else
#define __Pyx_PyErr_Occurred()  (__pyx_tstate->curexc_type != NULL)
#define __Pyx_PyErr_CurrentExceptionType()  (__pyx_tstate->curexc_type)
#endif
#else
#define __Pyx_PyThreadState_declare
#define __Pyx_PyThreadState_assign
#define __Pyx_PyErr_Occurred()  (PyErr_Occurred() != NULL)
#define __Pyx_PyErr_CurrentExceptionType()  PyErr_Occurred()
#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 && PY_VERSION_HEX < 0x030C00A6
#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

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

/* PyObjectGetAttrStrNoError.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);

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

/* PyDictVersioning.proto */
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
#define __PYX_DICT_VERSION_INIT  ((PY_UINT64_T) -1)
#define __PYX_GET_DICT_VERSION(dict)  (((PyDictObject*)(dict))->ma_version_tag)
#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
    (version_var) = __PYX_GET_DICT_VERSION(dict);\
    (cache_var) = (value);
#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
    static PY_UINT64_T __pyx_dict_version = 0;\
    static PyObject *__pyx_dict_cached_value = NULL;\
    if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
        (VAR) = __pyx_dict_cached_value;\
    } else {\
        (VAR) = __pyx_dict_cached_value = (LOOKUP);\
        __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
    }\
}
static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
#else
#define __PYX_GET_DICT_VERSION(dict)  (0)
#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP)  (VAR) = (LOOKUP);
#endif

/* GetModuleGlobalName.proto */
#if CYTHON_USE_DICT_VERSIONS
#define __Pyx_GetModuleGlobalName(var, name)  do {\
    static PY_UINT64_T __pyx_dict_version = 0;\
    static PyObject *__pyx_dict_cached_value = NULL;\
    (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
        (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
        __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
} while(0)
#define __Pyx_GetModuleGlobalNameUncached(var, name)  do {\
    PY_UINT64_T __pyx_dict_version;\
    PyObject *__pyx_dict_cached_value;\
    (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
} while(0)
static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
#else
#define __Pyx_GetModuleGlobalName(var, name)  (var) = __Pyx__GetModuleGlobalName(name)
#define __Pyx_GetModuleGlobalNameUncached(var, name)  (var) = __Pyx__GetModuleGlobalName(name)
static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
#endif

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

/* decode_c_string_utf16.proto */
static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) {
    int byteorder = 0;
    return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
}
static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(const char *s, Py_ssize_t size, const char *errors) {
    int byteorder = -1;
    return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
}
static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_ssize_t size, const char *errors) {
    int byteorder = 1;
    return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
}

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

/* PyFunctionFastCall.proto */
#if CYTHON_FAST_PYCALL
#if !CYTHON_VECTORCALL
#define __Pyx_PyFunction_FastCall(func, args, nargs)\
    __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
#endif
#define __Pyx_BUILD_ASSERT_EXPR(cond)\
    (sizeof(char [1 - 2*!(cond)]) - 1)
#ifndef Py_MEMBER_SIZE
#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
#endif
#if !CYTHON_VECTORCALL
#if PY_VERSION_HEX >= 0x03080000
  #include "frameobject.h"
#if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API
  #ifndef Py_BUILD_CORE
    #define Py_BUILD_CORE 1
  #endif
  #include "internal/pycore_frame.h"
#endif
  #define __Pxy_PyFrame_Initialize_Offsets()
  #define __Pyx_PyFrame_GetLocalsplus(frame)  ((frame)->f_localsplus)
#else
  static size_t __pyx_pyframe_localsplus_offset = 0;
  #include "frameobject.h"
  #define __Pxy_PyFrame_Initialize_Offsets()\
    ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
     (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
  #define __Pyx_PyFrame_GetLocalsplus(frame)\
    (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
#endif
#endif
#endif

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

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

/* PyObjectFastCall.proto */
#define __Pyx_PyObject_FastCall(func, args, nargs)  __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL)
static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs);

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

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

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

/* ModFloat[double].proto */
static CYTHON_INLINE double __Pyx_mod_double(double, double);

/* PyIntFromDouble.proto */
#if PY_MAJOR_VERSION < 3
static CYTHON_INLINE PyObject* __Pyx_PyInt_FromDouble(double value);
#else
#define __Pyx_PyInt_FromDouble(value) PyLong_FromDouble(value)
#endif

/* 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);
        #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000
        L->ob_item[len] = x;
        #else
        PyList_SET_ITEM(list, len, x);
        #endif
        __Pyx_SET_SIZE(list, len + 1);
        return 0;
    }
    return PyList_Append(list, x);
}
#else
#define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
#endif

/* PyObjectFormatSimple.proto */
#if CYTHON_COMPILING_IN_PYPY
    #define __Pyx_PyObject_FormatSimple(s, f) (\
        likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
        PyObject_Format(s, f))
#elif PY_MAJOR_VERSION < 3
    #define __Pyx_PyObject_FormatSimple(s, f) (\
        likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
        likely(PyString_CheckExact(s)) ? PyUnicode_FromEncodedObject(s, NULL, "strict") :\
        PyObject_Format(s, f))
#elif CYTHON_USE_TYPE_SLOTS
    #define __Pyx_PyObject_FormatSimple(s, f) (\
        likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
        likely(PyLong_CheckExact(s)) ? PyLong_Type.tp_repr(s) :\
        likely(PyFloat_CheckExact(s)) ? PyFloat_Type.tp_repr(s) :\
        PyObject_Format(s, f))
#else
    #define __Pyx_PyObject_FormatSimple(s, f) (\
        likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
        PyObject_Format(s, f))
#endif

/* PyObjectCallNoArg.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);

/* TupleAndListFromArray.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n);
static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n);
#endif

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

/* fastcall.proto */
#if CYTHON_AVOID_BORROWED_REFS
    #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i)
#elif CYTHON_ASSUME_SAFE_MACROS
    #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i)
#else
    #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i)
#endif
#if CYTHON_AVOID_BORROWED_REFS
    #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg)
    #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg)
#else
    #define __Pyx_Arg_NewRef_VARARGS(arg) arg
    #define __Pyx_Arg_XDECREF_VARARGS(arg)
#endif
#define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds)
#define __Pyx_KwValues_VARARGS(args, nargs) NULL
#define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s)
#define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw)
#if CYTHON_METH_FASTCALL
    #define __Pyx_Arg_FASTCALL(args, i) args[i]
    #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds)
    #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs))
    static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s);
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000
    CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues);
  #else
    #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw)
  #endif
    #define __Pyx_Arg_NewRef_FASTCALL(arg) arg  /* no-op, __Pyx_Arg_FASTCALL is direct and this needs
                                                   to have the same reference counting */
    #define __Pyx_Arg_XDECREF_FASTCALL(arg)
#else
    #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS
    #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS
    #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS
    #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS
    #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS
    #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg)
    #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg)
#endif
#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
#define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start)
#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start)
#else
#define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop)
#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop)
#endif

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

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

/* GetTopmostException.proto */
#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE
static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
#endif

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

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

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

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

/* pybytes_as_double.proto */
static double __Pyx_SlowPyString_AsDouble(PyObject *obj);
static double __Pyx__PyBytes_AsDouble(PyObject *obj, const char* start, Py_ssize_t length);
static CYTHON_INLINE double __Pyx_PyBytes_AsDouble(PyObject *obj) {
    char* as_c_string;
    Py_ssize_t size;
#if CYTHON_ASSUME_SAFE_MACROS
    as_c_string = PyBytes_AS_STRING(obj);
    size = PyBytes_GET_SIZE(obj);
#else
    if (PyBytes_AsStringAndSize(obj, &as_c_string, &size) < 0) {
        return (double)-1;
    }
#endif
    return __Pyx__PyBytes_AsDouble(obj, as_c_string, size);
}
static CYTHON_INLINE double __Pyx_PyByteArray_AsDouble(PyObject *obj) {
    char* as_c_string;
    Py_ssize_t size;
#if CYTHON_ASSUME_SAFE_MACROS
    as_c_string = PyByteArray_AS_STRING(obj);
    size = PyByteArray_GET_SIZE(obj);
#else
    as_c_string = PyByteArray_AsString(obj);
    if (as_c_string == NULL) {
        return (double)-1;
    }
    size = PyByteArray_Size(obj);
#endif
    return __Pyx__PyBytes_AsDouble(obj, as_c_string, size);
}

/* pyunicode_as_double.proto */
#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY && CYTHON_ASSUME_SAFE_MACROS
static const char* __Pyx__PyUnicode_AsDouble_Copy(const void* data, const int kind, char* buffer, Py_ssize_t start, Py_ssize_t end) {
    int last_was_punctuation;
    Py_ssize_t i;
    last_was_punctuation = 1;
    for (i=start; i <= end; i++) {
        Py_UCS4 chr = PyUnicode_READ(kind, data, i);
        int is_punctuation = (chr == '_') | (chr == '.');
        *buffer = (char)chr;
        buffer += (chr != '_');
        if (unlikely(chr > 127)) goto parse_failure;
        if (unlikely(last_was_punctuation & is_punctuation)) goto parse_failure;
        last_was_punctuation = is_punctuation;
    }
    if (unlikely(last_was_punctuation)) goto parse_failure;
    *buffer = '\0';
    return buffer;
parse_failure:
    return NULL;
}
static double __Pyx__PyUnicode_AsDouble_inf_nan(const void* data, int kind, Py_ssize_t start, Py_ssize_t length) {
    int matches = 1;
    Py_UCS4 chr;
    Py_UCS4 sign = PyUnicode_READ(kind, data, start);
    int is_signed = (sign == '-') | (sign == '+');
    start += is_signed;
    length -= is_signed;
    switch (PyUnicode_READ(kind, data, start)) {
        #ifdef Py_NAN
        case 'n':
        case 'N':
            if (unlikely(length != 3)) goto parse_failure;
            chr = PyUnicode_READ(kind, data, start+1);
            matches &= (chr == 'a') | (chr == 'A');
            chr = PyUnicode_READ(kind, data, start+2);
            matches &= (chr == 'n') | (chr == 'N');
            if (unlikely(!matches)) goto parse_failure;
            return (sign == '-') ? -Py_NAN : Py_NAN;
        #endif
        case 'i':
        case 'I':
            if (unlikely(length < 3)) goto parse_failure;
            chr = PyUnicode_READ(kind, data, start+1);
            matches &= (chr == 'n') | (chr == 'N');
            chr = PyUnicode_READ(kind, data, start+2);
            matches &= (chr == 'f') | (chr == 'F');
            if (likely(length == 3 && matches))
                return (sign == '-') ? -Py_HUGE_VAL : Py_HUGE_VAL;
            if (unlikely(length != 8)) goto parse_failure;
            chr = PyUnicode_READ(kind, data, start+3);
            matches &= (chr == 'i') | (chr == 'I');
            chr = PyUnicode_READ(kind, data, start+4);
            matches &= (chr == 'n') | (chr == 'N');
            chr = PyUnicode_READ(kind, data, start+5);
            matches &= (chr == 'i') | (chr == 'I');
            chr = PyUnicode_READ(kind, data, start+6);
            matches &= (chr == 't') | (chr == 'T');
            chr = PyUnicode_READ(kind, data, start+7);
            matches &= (chr == 'y') | (chr == 'Y');
            if (unlikely(!matches)) goto parse_failure;
            return (sign == '-') ? -Py_HUGE_VAL : Py_HUGE_VAL;
        case '.': case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9':
            break;
        default:
            goto parse_failure;
    }
    return 0.0;
parse_failure:
    return -1.0;
}
static double __Pyx_PyUnicode_AsDouble_WithSpaces(PyObject *obj) {
    double value;
    const char *last;
    char *end;
    Py_ssize_t start, length = PyUnicode_GET_LENGTH(obj);
    const int kind = PyUnicode_KIND(obj);
    const void* data = PyUnicode_DATA(obj);
    start = 0;
    while (Py_UNICODE_ISSPACE(PyUnicode_READ(kind, data, start)))
        start++;
    while (start < length - 1 && Py_UNICODE_ISSPACE(PyUnicode_READ(kind, data, length - 1)))
        length--;
    length -= start;
    if (unlikely(length <= 0)) goto fallback;
    value = __Pyx__PyUnicode_AsDouble_inf_nan(data, kind, start, length);
    if (unlikely(value == -1.0)) goto fallback;
    if (value != 0.0) return value;
    if (length < 40) {
        char number[40];
        last = __Pyx__PyUnicode_AsDouble_Copy(data, kind, number, start, start + length);
        if (unlikely(!last)) goto fallback;
        value = PyOS_string_to_double(number, &end, NULL);
    } else {
        char *number = (char*) PyMem_Malloc((length + 1) * sizeof(char));
        if (unlikely(!number)) goto fallback;
        last = __Pyx__PyUnicode_AsDouble_Copy(data, kind, number, start, start + length);
        if (unlikely(!last)) {
            PyMem_Free(number);
            goto fallback;
        }
        value = PyOS_string_to_double(number, &end, NULL);
        PyMem_Free(number);
    }
    if (likely(end == last) || (value == (double)-1 && PyErr_Occurred())) {
        return value;
    }
fallback:
    return __Pyx_SlowPyString_AsDouble(obj);
}
#endif
static CYTHON_INLINE double __Pyx_PyUnicode_AsDouble(PyObject *obj) {
#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY && CYTHON_ASSUME_SAFE_MACROS
    if (unlikely(__Pyx_PyUnicode_READY(obj) == -1))
        return (double)-1;
    if (likely(PyUnicode_IS_ASCII(obj))) {
        const char *s;
        Py_ssize_t length;
        s = PyUnicode_AsUTF8AndSize(obj, &length);
        return __Pyx__PyBytes_AsDouble(obj, s, length);
    }
    return __Pyx_PyUnicode_AsDouble_WithSpaces(obj);
#else
    return __Pyx_SlowPyString_AsDouble(obj);
#endif
}

/* pyobject_as_double.proto */
static double __Pyx__PyObject_AsDouble(PyObject* obj);
#if CYTHON_COMPILING_IN_PYPY
#define __Pyx_PyObject_AsDouble(obj)\
(likely(PyFloat_CheckExact(obj)) ? PyFloat_AS_DOUBLE(obj) :\
 likely(PyInt_CheckExact(obj)) ?\
 PyFloat_AsDouble(obj) : __Pyx__PyObject_AsDouble(obj))
#else
#define __Pyx_PyObject_AsDouble(obj)\
((likely(PyFloat_CheckExact(obj))) ?  PyFloat_AS_DOUBLE(obj) :\
 likely(PyLong_CheckExact(obj)) ?\
 PyLong_AsDouble(obj) : __Pyx__PyObject_AsDouble(obj))
#endif

/* PyObject_Unicode.proto */
#if PY_MAJOR_VERSION >= 3
#define __Pyx_PyObject_Unicode(obj)\
    (likely(PyUnicode_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Str(obj))
#else
#define __Pyx_PyObject_Unicode(obj)\
    (likely(PyUnicode_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Unicode(obj))
#endif

/* ListCompAppend.proto */
#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
    PyListObject* L = (PyListObject*) list;
    Py_ssize_t len = Py_SIZE(list);
    if (likely(L->allocated > len)) {
        Py_INCREF(x);
        #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000
        L->ob_item[len] = x;
        #else
        PyList_SET_ITEM(list, len, x);
        #endif
        __Pyx_SET_SIZE(list, len + 1);
        return 0;
    }
    return PyList_Append(list, x);
}
#else
#define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
#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

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

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

/* pep479.proto */
static void __Pyx_Generator_Replace_StopIteration(int in_async_gen);

/* AssertionsEnabled.proto */
#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
  #define __Pyx_init_assertions_enabled()  (0)
  #define __pyx_assertions_enabled()  (1)
#elif CYTHON_COMPILING_IN_LIMITED_API  ||  (CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030C0000)
  static int __pyx_assertions_enabled_flag;
  #define __pyx_assertions_enabled() (__pyx_assertions_enabled_flag)
  static int __Pyx_init_assertions_enabled(void) {
    PyObject *builtins, *debug, *debug_str;
    int flag;
    builtins = PyEval_GetBuiltins();
    if (!builtins) goto bad;
    debug_str = PyUnicode_FromStringAndSize("__debug__", 9);
    if (!debug_str) goto bad;
    debug = PyObject_GetItem(builtins, debug_str);
    Py_DECREF(debug_str);
    if (!debug) goto bad;
    flag = PyObject_IsTrue(debug);
    Py_DECREF(debug);
    if (flag == -1) goto bad;
    __pyx_assertions_enabled_flag = flag;
    return 0;
  bad:
    __pyx_assertions_enabled_flag = 1;
    return -1;
  }
#else
  #define __Pyx_init_assertions_enabled()  (0)
  #define __pyx_assertions_enabled()  (!Py_OptimizeFlag)
#endif

/* IncludeStructmemberH.proto */
#include <structmember.h>

/* FixUpExtensionType.proto */
#if CYTHON_USE_TYPE_SPECS
static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type);
#endif

/* FetchSharedCythonModule.proto */
static PyObject *__Pyx_FetchSharedCythonABIModule(void);

/* FetchCommonType.proto */
#if !CYTHON_USE_TYPE_SPECS
static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
#else
static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases);
#endif

/* PyMethodNew.proto */
#if CYTHON_COMPILING_IN_LIMITED_API
static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) {
    PyObject *typesModule=NULL, *methodType=NULL, *result=NULL;
    CYTHON_UNUSED_VAR(typ);
    if (!self)
        return __Pyx_NewRef(func);
    typesModule = PyImport_ImportModule("types");
    if (!typesModule) return NULL;
    methodType = PyObject_GetAttrString(typesModule, "MethodType");
    Py_DECREF(typesModule);
    if (!methodType) return NULL;
    result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL);
    Py_DECREF(methodType);
    return result;
}
#elif PY_MAJOR_VERSION >= 3
static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) {
    CYTHON_UNUSED_VAR(typ);
    if (!self)
        return __Pyx_NewRef(func);
    return PyMethod_New(func, self);
}
#else
    #define __Pyx_PyMethod_New PyMethod_New
#endif

/* PyVectorcallFastCallDict.proto */
#if CYTHON_METH_FASTCALL
static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw);
#endif

/* CythonFunctionShared.proto */
#define __Pyx_CyFunction_USED
#define __Pyx_CYFUNCTION_STATICMETHOD  0x01
#define __Pyx_CYFUNCTION_CLASSMETHOD   0x02
#define __Pyx_CYFUNCTION_CCLASS        0x04
#define __Pyx_CYFUNCTION_COROUTINE     0x08
#define __Pyx_CyFunction_GetClosure(f)\
    (((__pyx_CyFunctionObject *) (f))->func_closure)
#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
  #define __Pyx_CyFunction_GetClassObj(f)\
      (((__pyx_CyFunctionObject *) (f))->func_classobj)
#else
  #define __Pyx_CyFunction_GetClassObj(f)\
      ((PyObject*) ((PyCMethodObject *) (f))->mm_class)
#endif
#define __Pyx_CyFunction_SetClassObj(f, classobj)\
    __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (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 {
#if CYTHON_COMPILING_IN_LIMITED_API
    PyObject_HEAD
    PyObject *func;
#elif PY_VERSION_HEX < 0x030900B1
    PyCFunctionObject func;
#else
    PyCMethodObject func;
#endif
#if CYTHON_BACKPORT_VECTORCALL
    __pyx_vectorcallfunc func_vectorcall;
#endif
#if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API
    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;
#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
    PyObject *func_classobj;
#endif
    void *defaults;
    int defaults_pyobjects;
    size_t defaults_size;
    int flags;
    PyObject *defaults_tuple;
    PyObject *defaults_kwdict;
    PyObject *(*defaults_getter)(PyObject *);
    PyObject *func_annotations;
    PyObject *func_is_coroutine;
} __pyx_CyFunctionObject;
#undef __Pyx_CyOrPyCFunction_Check
#define __Pyx_CyFunction_Check(obj)  __Pyx_TypeCheck(obj, __pyx_CyFunctionType)
#define __Pyx_CyOrPyCFunction_Check(obj)  __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type)
#define __Pyx_CyFunction_CheckExact(obj)  __Pyx_IS_TYPE(obj, __pyx_CyFunctionType)
static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc);
#undef __Pyx_IsSameCFunction
#define __Pyx_IsSameCFunction(func, cfunc)   __Pyx__IsSameCyOrCFunction(func, cfunc)
static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml,
                                      int flags, PyObject* qualname,
                                      PyObject *closure,
                                      PyObject *module, PyObject *globals,
                                      PyObject* code);
static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj);
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(PyObject *module);
#if CYTHON_METH_FASTCALL
static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
#if CYTHON_BACKPORT_VECTORCALL
#define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall)
#else
#define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall)
#endif
#endif

/* CythonFunction.proto */
static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
                                      int flags, PyObject* qualname,
                                      PyObject *closure,
                                      PyObject *module, PyObject *globals,
                                      PyObject* code);

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

/* PyObjectGetMethod.proto */
static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method);

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

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

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

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

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

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

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

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

/* PyIntCompare.proto */
static CYTHON_INLINE int __Pyx_PyInt_BoolEqObjC(PyObject *op1, PyObject *op2, long intval, long inplace);

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

/* GCCDiagnostics.proto */
#if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
#define __Pyx_HAS_GCC_DIAGNOSTIC
#endif

/* BuildPyUnicode.proto */
static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength, char* chars, int clength,
                                                int prepend_sign, char padding_char);

/* CIntToPyUnicode.proto */
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width, char padding_char, char format_char);

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

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

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

/* PyIntCompare.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, long intval, long inplace);

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

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

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

/* RaiseUnexpectedTypeError.proto */
static int __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj);

/* pynumber_float.proto */
static CYTHON_INLINE PyObject* __Pyx__PyNumber_Float(PyObject* obj);
#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : __Pyx__PyNumber_Float(x))

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

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

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

/* unicode_tailmatch.proto */
static int __Pyx_PyUnicode_Tailmatch(
    PyObject* s, PyObject* substr, Py_ssize_t start, Py_ssize_t end, int direction);

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

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

/* WriteUnraisableException.proto */
static void __Pyx_WriteUnraisable(const char *name, int clineno,
                                  int lineno, const char *filename,
                                  int full_traceback, int nogil);

/* Py3UpdateBases.proto */
static PyObject* __Pyx_PEP560_update_bases(PyObject *bases);

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

/* SetNameInClass.proto */
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000
#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

/* PyObjectCall2Args.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);

/* PyObjectLookupSpecial.proto */
#if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
#define __Pyx_PyObject_LookupSpecialNoError(obj, attr_name)  __Pyx__PyObject_LookupSpecial(obj, attr_name, 0)
#define __Pyx_PyObject_LookupSpecial(obj, attr_name)  __Pyx__PyObject_LookupSpecial(obj, attr_name, 1)
static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error);
#else
#define __Pyx_PyObject_LookupSpecialNoError(o,n) __Pyx_PyObject_GetAttrStrNoError(o,n)
#define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n)
#endif

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

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

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

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

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

/* ValidateBasesTuple.proto */
#if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS
static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases);
#endif

/* PyType_Ready.proto */
CYTHON_UNUSED static int __Pyx_PyType_Ready(PyTypeObject *t);

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

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

/* SetVTable.proto */
static int __Pyx_SetVtable(PyTypeObject* typeptr , void* vtable);

/* GetVTable.proto */
static void* __Pyx_GetVtable(PyTypeObject *type);

/* MergeVTables.proto */
#if !CYTHON_COMPILING_IN_LIMITED_API
static int __Pyx_MergeVtables(PyTypeObject *type);
#endif

/* SetupReduce.proto */
#if !CYTHON_COMPILING_IN_LIMITED_API
static int __Pyx_setup_reduce(PyObject* type_obj);
#endif

/* TypeImport.proto */
#ifndef __PYX_HAVE_RT_ImportType_proto_3_0_11
#define __PYX_HAVE_RT_ImportType_proto_3_0_11
#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
#include <stdalign.h>
#endif
#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L
#define __PYX_GET_STRUCT_ALIGNMENT_3_0_11(s) alignof(s)
#else
#define __PYX_GET_STRUCT_ALIGNMENT_3_0_11(s) sizeof(void*)
#endif
enum __Pyx_ImportType_CheckSize_3_0_11 {
   __Pyx_ImportType_CheckSize_Error_3_0_11 = 0,
   __Pyx_ImportType_CheckSize_Warn_3_0_11 = 1,
   __Pyx_ImportType_CheckSize_Ignore_3_0_11 = 2
};
static PyTypeObject *__Pyx_ImportType_3_0_11(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_11 check_size);
#endif

/* ImportDottedModule.proto */
static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple);
#if PY_MAJOR_VERSION >= 3
static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple);
#endif

/* GetNameInClass.proto */
#define __Pyx_GetNameInClass(var, nmspace, name)  (var) = __Pyx__GetNameInClass(nmspace, name)
static PyObject *__Pyx__GetNameInClass(PyObject *nmspace, PyObject *name);

/* ClassMethod.proto */
#include "descrobject.h"
CYTHON_UNUSED static PyObject* __Pyx_Method_ClassMethod(PyObject *method);

/* 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 */
#if !CYTHON_COMPILING_IN_LIMITED_API
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);
#endif

/* 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_AMPL_OUTPUTKIND(AMPL_OUTPUTKIND value);

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

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

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

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

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_AMPL_ENTITYTYPE(AMPL_ENTITYTYPE value);

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

/* FormatTypeName.proto */
#if CYTHON_COMPILING_IN_LIMITED_API
typedef PyObject *__Pyx_TypeName;
#define __Pyx_FMT_TYPENAME "%U"
static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp);
#define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj)
#else
typedef const char *__Pyx_TypeName;
#define __Pyx_FMT_TYPENAME "%.200s"
#define __Pyx_PyType_GetName(tp) ((tp)->tp_name)
#define __Pyx_DECREF_TypeName(obj)
#endif

/* FastTypeChecks.proto */
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
#define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2)
static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, 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_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2))
#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_PyErr_ExceptionMatches2(err1, err2)  __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2)
#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)

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

/* CoroutineBase.proto */
struct __pyx_CoroutineObject;
typedef PyObject *(*__pyx_coroutine_body_t)(struct __pyx_CoroutineObject *, PyThreadState *, PyObject *);
#if CYTHON_USE_EXC_INFO_STACK
#define __Pyx_ExcInfoStruct  _PyErr_StackItem
#else
typedef struct {
    PyObject *exc_type;
    PyObject *exc_value;
    PyObject *exc_traceback;
} __Pyx_ExcInfoStruct;
#endif
typedef struct __pyx_CoroutineObject {
    PyObject_HEAD
    __pyx_coroutine_body_t body;
    PyObject *closure;
    __Pyx_ExcInfoStruct gi_exc_state;
    PyObject *gi_weakreflist;
    PyObject *classobj;
    PyObject *yieldfrom;
    PyObject *gi_name;
    PyObject *gi_qualname;
    PyObject *gi_modulename;
    PyObject *gi_code;
    PyObject *gi_frame;
    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 CYTHON_INLINE void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *self);
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);
#if CYTHON_USE_EXC_INFO_STACK
#define __Pyx_Coroutine_SwapException(self)
#define __Pyx_Coroutine_ResetAndClearException(self)  __Pyx_Coroutine_ExceptionClear(&(self)->gi_exc_state)
#else
#define __Pyx_Coroutine_SwapException(self) {\
    __Pyx_ExceptionSwap(&(self)->gi_exc_state.exc_type, &(self)->gi_exc_state.exc_value, &(self)->gi_exc_state.exc_traceback);\
    __Pyx_Coroutine_ResetFrameBackpointer(&(self)->gi_exc_state);\
    }
#define __Pyx_Coroutine_ResetAndClearException(self) {\
    __Pyx_ExceptionReset((self)->gi_exc_state.exc_type, (self)->gi_exc_state.exc_value, (self)->gi_exc_state.exc_traceback);\
    (self)->gi_exc_state.exc_type = (self)->gi_exc_state.exc_value = (self)->gi_exc_state.exc_traceback = NULL;\
    }
#endif
#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_ExcInfoStruct *exc_state);

/* 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
#define __Pyx_Generator_CheckExact(obj) __Pyx_IS_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(PyObject *module);

/* CheckBinaryVersion.proto */
static unsigned long __Pyx_get_runtime_version(void);
static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer);

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

/* #### Code section: module_declarations ### */
static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4real_real(PyComplexObject *__pyx_v_self); /* proto*/
static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4imag_imag(PyComplexObject *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_7_amplpy_10Constraint_create(AMPL *__pyx_v_ampl_c, char *__pyx_v_name, AMPL_TUPLE *__pyx_v_index, PyObject *__pyx_v_parent); /* proto*/
static PyObject *__pyx_f_7_amplpy_3Row_create(AMPL_DATAFRAME *__pyx_v_df, size_t __pyx_v_index); /* proto*/
static PyObject *__pyx_f_7_amplpy_6Column_create(AMPL_DATAFRAME *__pyx_v_df, size_t __pyx_v_index); /* proto*/
static AMPL_DATAFRAME *__pyx_f_7_amplpy_9DataFrame_get_ptr(struct __pyx_obj_7_amplpy_DataFrame *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_7_amplpy_9DataFrame_create(AMPL_DATAFRAME *__pyx_v_df_c); /* proto*/
static PyObject *__pyx_f_7_amplpy_6Entity_create(AMPL *__pyx_v_ampl_c, char *__pyx_v_name, AMPL_TUPLE *__pyx_v_index, PyObject *__pyx_v_parent); /* proto*/
static AMPL_ENVIRONMENT *__pyx_f_7_amplpy_11Environment_get_c_pointer(struct __pyx_obj_7_amplpy_Environment *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_7_amplpy_11EnvIterator_create(AMPL_ENVIRONMENT *__pyx_v_env_c); /* proto*/
static PyObject *__pyx_f_7_amplpy_9EntityMap_create(AMPL *__pyx_v_ampl, AMPL_ENTITYTYPE __pyx_v_entity_class); /* proto*/
static PyObject *__pyx_f_7_amplpy_16InstanceIterator_create(AMPL *__pyx_v_ampl, char *__pyx_v_name, AMPL_ENTITYTYPE __pyx_v_entity_class, PyObject *__pyx_v_parent); /* proto*/
static PyObject *__pyx_f_7_amplpy_19MemberRangeIterator_create(AMPL *__pyx_v_ampl, char *__pyx_v_name, AMPL_TUPLE *__pyx_v_index, PyObject *__pyx_v_parent); /* proto*/
static PyObject *__pyx_f_7_amplpy_11ColIterator_create(AMPL_DATAFRAME *__pyx_v_df, size_t __pyx_v_index); /* proto*/
static PyObject *__pyx_f_7_amplpy_11RowIterator_create(AMPL_DATAFRAME *__pyx_v_df, size_t __pyx_v_index); /* proto*/
static PyObject *__pyx_f_7_amplpy_9Objective_create(AMPL *__pyx_v_ampl_c, char *__pyx_v_name, AMPL_TUPLE *__pyx_v_index, PyObject *__pyx_v_parent); /* proto*/
static PyObject *__pyx_f_7_amplpy_9Parameter_create(AMPL *__pyx_v_ampl_c, char *__pyx_v_name, AMPL_TUPLE *__pyx_v_index, PyObject *__pyx_v_parent); /* proto*/
static PyObject *__pyx_f_7_amplpy_3Set_create(AMPL *__pyx_v_ampl_c, char *__pyx_v_name, AMPL_TUPLE *__pyx_v_index, PyObject *__pyx_v_parent); /* proto*/
static PyObject *__pyx_f_7_amplpy_8Variable_create(AMPL *__pyx_v_ampl_c, char *__pyx_v_name, AMPL_TUPLE *__pyx_v_index, PyObject *__pyx_v_parent); /* proto*/

/* Module declarations from "libcpp" */

/* Module declarations from "amplpy.ampl" */

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

/* Module declarations from "libc.stdlib" */

/* Module declarations from "__builtin__" */

/* Module declarations from "cpython.bool" */

/* Module declarations from "cpython.version" */

/* Module declarations from "__builtin__" */

/* Module declarations from "cpython.type" */

/* Module declarations from "libc.stdio" */

/* Module declarations from "cpython.object" */

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

/* Module declarations from "cpython.exc" */

/* Module declarations from "cpython.module" */

/* Module declarations from "cpython.mem" */

/* Module declarations from "cpython.tuple" */

/* Module declarations from "cpython.list" */

/* Module declarations from "cpython.sequence" */

/* Module declarations from "cpython.mapping" */

/* Module declarations from "cpython.iterator" */

/* Module declarations from "cpython.number" */

/* Module declarations from "cpython.int" */

/* Module declarations from "cpython.long" */

/* Module declarations from "cpython.float" */

/* Module declarations from "__builtin__" */

/* Module declarations from "cpython.complex" */

/* Module declarations from "cpython.string" */

/* Module declarations from "libc.stddef" */

/* Module declarations from "cpython.unicode" */

/* Module declarations from "cpython.pyport" */

/* Module declarations from "cpython.dict" */

/* Module declarations from "cpython.instance" */

/* Module declarations from "cpython.function" */

/* Module declarations from "cpython.method" */

/* Module declarations from "cpython.weakref" */

/* Module declarations from "cpython.getargs" */

/* Module declarations from "cpython.pythread" */

/* Module declarations from "cpython.pystate" */

/* Module declarations from "cpython.cobject" */

/* Module declarations from "cpython.oldbuffer" */

/* Module declarations from "cpython.set" */

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

/* Module declarations from "cpython.bytes" */

/* Module declarations from "cpython.pycapsule" */

/* Module declarations from "cpython.contextvars" */

/* Module declarations from "cpython" */

/* Module declarations from "_amplpy" */
static PyObject *__pyx_f_7_amplpy_PY_AMPL_CALL(AMPL_ERRORINFO *); /*proto*/
static void __pyx_f_7_amplpy_setValues(AMPL *, char *, AMPL_TUPLE *, PyObject *, size_t); /*proto*/
static PyObject *__pyx_f_7_amplpy_to_py_variant(AMPL_VARIANT *); /*proto*/
static PyObject *__pyx_f_7_amplpy_to_py_tuple(AMPL_TUPLE *); /*proto*/
static AMPL_TUPLE *__pyx_f_7_amplpy_to_c_tuple(PyObject *); /*proto*/
static AMPL_VARIANT *__pyx_f_7_amplpy_to_c_variant(PyObject *); /*proto*/
static PyObject *__pyx_f_7_amplpy_create_entity(AMPL_ENTITYTYPE, AMPL *, char *, AMPL_TUPLE *, PyObject *); /*proto*/
static void __pyx_f_7_amplpy_setValuesParamNum(AMPL *, char *, PyObject *); /*proto*/
static void __pyx_f_7_amplpy_setValuesParamStr(AMPL *, char *, PyObject *); /*proto*/
static void __pyx_f_7_amplpy_setValuesPyDict(AMPL *, char *, PyObject *); /*proto*/
static PyObject *__pyx_f_7_amplpy_raiseKeyError(AMPL_ENTITYTYPE, char *); /*proto*/
static void __pyx_f_7_amplpy_PyError(bool, char const *, int, int, char const *, void *); /*proto*/
static void __pyx_f_7_amplpy_PyOutput(AMPL_OUTPUTKIND, char const *, void *); /*proto*/
static PyObject *__pyx_f_7_amplpy___pyx_unpickle_ErrorHandler__set_state(struct __pyx_obj_7_amplpy_ErrorHandler *, PyObject *); /*proto*/
static PyObject *__pyx_f_7_amplpy___pyx_unpickle_OutputHandler__set_state(struct __pyx_obj_7_amplpy_OutputHandler *, PyObject *); /*proto*/
/* #### Code section: typeinfo ### */
/* #### Code section: before_global_var ### */
#define __Pyx_MODULE_NAME "_amplpy"
extern int __pyx_module_is_main__amplpy;
int __pyx_module_is_main__amplpy = 0;

/* Implementation of "_amplpy" */
/* #### Code section: global_var ### */
static PyObject *__pyx_builtin_ImportError;
static PyObject *__pyx_builtin_RuntimeError;
static PyObject *__pyx_builtin_object;
static PyObject *__pyx_builtin_property;
static PyObject *__pyx_builtin_SystemError;
static PyObject *__pyx_builtin_IOError;
static PyObject *__pyx_builtin_TypeError;
static PyObject *__pyx_builtin_print;
static PyObject *__pyx_builtin_KeyError;
static PyObject *__pyx_builtin_ValueError;
static PyObject *__pyx_builtin_range;
static PyObject *__pyx_builtin_AttributeError;
static PyObject *__pyx_builtin_AssertionError;
static PyObject *__pyx_builtin_map;
static PyObject *__pyx_builtin_NotImplementedError;
static PyObject *__pyx_builtin_zip;
static PyObject *__pyx_builtin_enumerate;
static PyObject *__pyx_builtin_super;
static PyObject *__pyx_builtin_StopIteration;
static PyObject *__pyx_builtin_MemoryError;
static PyObject *__pyx_builtin_open;
/* #### Code section: string_decls ### */
static const char __pyx_k_c[] = "c";
static const char __pyx_k_d[] = "d";
static const char __pyx_k_e[] = "e";
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_p[] = "p";
static const char __pyx_k_t[] = "t";
static const char __pyx_k_v[] = "v";
static const char __pyx_k_75[] = "75";
static const char __pyx_k_CD[] = "CD";
static const char __pyx_k_IF[] = "_IF";
static const char __pyx_k_cd[] = "cd";
static const char __pyx_k_df[] = "df";
static const char __pyx_k_gc[] = "gc";
static const char __pyx_k_lb[] = "lb";
static const char __pyx_k_np[] = "np";
static const char __pyx_k_nt[] = "nt";
static const char __pyx_k_os[] = "os";
static const char __pyx_k_pd[] = "pd";
static const char __pyx_k_rc[] = "rc";
static const char __pyx_k_ub[] = "ub";
static const char __pyx_k_FIX[] = "FIX";
static const char __pyx_k_FOR[] = "FOR";
static const char __pyx_k_LET[] = "LET";
static const char __pyx_k_Row[] = "Row";
static const char __pyx_k_Set[] = "Set";
static const char __pyx_k__21[] = ".";
static const char __pyx_k__22[] = "";
static const char __pyx_k__24[] = "\t";
static const char __pyx_k__25[] = "\n";
static const char __pyx_k__26[] = "\n\t";
static const char __pyx_k__33[] = "[";
static const char __pyx_k__34[] = "(";
static const char __pyx_k__35[] = ",)";
static const char __pyx_k__36[] = "*******************************************************************************";
static const char __pyx_k__38[] = "* ";
static const char __pyx_k__39[] = " *";
static const char __pyx_k__40[] = " ";
static const char __pyx_k__41[] = ";";
static const char __pyx_k__84[] = "*";
static const char __pyx_k_ast[] = "ast";
static const char __pyx_k_cls[] = "cls";
static const char __pyx_k_col[] = "col";
static const char __pyx_k_con[] = "_con";
static const char __pyx_k_dic[] = "dic";
static const char __pyx_k_doc[] = "__doc__";
static const char __pyx_k_end[] = "end";
static const char __pyx_k_exp[] = "exp";
static const char __pyx_k_fix[] = "fix";
static const char __pyx_k_get[] = "get";
static const char __pyx_k_key[] = "key";
static const char __pyx_k_lb0[] = "lb0";
static const char __pyx_k_lb1[] = "lb1";
static const char __pyx_k_lb2[] = "lb2";
static const char __pyx_k_lbs[] = "lbs";
static const char __pyx_k_lrc[] = "lrc";
static const char __pyx_k_lst[] = "lst";
static const char __pyx_k_map[] = "map";
static const char __pyx_k_msg[] = "msg";
static const char __pyx_k_new[] = "__new__";
static const char __pyx_k_num[] = "num";
static const char __pyx_k_obj[] = "_obj";
static const char __pyx_k_row[] = "row";
static const char __pyx_k_set[] = "set";
static const char __pyx_k_str[] = "__str__";
static const char __pyx_k_sys[] = "sys";
static const char __pyx_k_t_c[] = "t_c";
static const char __pyx_k_ub0[] = "ub0";
static const char __pyx_k_ub1[] = "ub1";
static const char __pyx_k_ub2[] = "ub2";
static const char __pyx_k_ubs[] = "ubs";
static const char __pyx_k_urc[] = "urc";
static const char __pyx_k_val[] = "val";
static const char __pyx_k_var[] = "_var";
static const char __pyx_k_zip[] = "zip";
static const char __pyx_k_AMPL[] = "AMPL";
static const char __pyx_k_CALL[] = "CALL";
static const char __pyx_k_DATA[] = "DATA";
static const char __pyx_k_DROP[] = "DROP";
static const char __pyx_k_ELSE[] = "_ELSE";
static const char __pyx_k_EXIT[] = "EXIT";
static const char __pyx_k_Enum[] = "Enum";
static const char __pyx_k_Kind[] = "Kind";
static const char __pyx_k_LOAD[] = "LOAD";
static const char __pyx_k_MISC[] = "MISC";
static const char __pyx_k_READ[] = "READ";
static const char __pyx_k_Real[] = "Real";
static const char __pyx_k_SHOW[] = "SHOW";
static const char __pyx_k_Sets[] = "Sets";
static const char __pyx_k_THEN[] = "THEN";
static const char __pyx_k_XREF[] = "XREF";
static const char __pyx_k__390[] = "?";
static const char __pyx_k_ampl[] = "ampl";
static const char __pyx_k_args[] = "args";
static const char __pyx_k_body[] = "body";
static const char __pyx_k_data[] = "data";
static const char __pyx_k_df_c[] = "df_c";
static const char __pyx_k_dict[] = "__dict__";
static const char __pyx_k_drop[] = "drop";
static const char __pyx_k_dual[] = "dual";
static const char __pyx_k_enum[] = "enum";
static const char __pyx_k_eval[] = "eval";
static const char __pyx_k_file[] = "file: ";
static const char __pyx_k_find[] = "find";
static const char __pyx_k_flat[] = "flat";
static const char __pyx_k_impl[] = "_impl";
static const char __pyx_k_init[] = "__init__";
static const char __pyx_k_iter[] = "__iter__";
static const char __pyx_k_keys[] = "keys";
static const char __pyx_k_kind[] = "kind";
static const char __pyx_k_main[] = "__main__";
static const char __pyx_k_name[] = "name";
static const char __pyx_k_open[] = "open";
static const char __pyx_k_path[] = "path";
static const char __pyx_k_read[] = "read";
static const char __pyx_k_self[] = "self";
static const char __pyx_k_send[] = "send";
static const char __pyx_k_sets[] = "sets";
static const char __pyx_k_size[] = "size";
static const char __pyx_k_spec[] = "__spec__";
static const char __pyx_k_stmt[] = "stmt";
static const char __pyx_k_test[] = "__test__";
static const char __pyx_k_xref[] = "xref";
static const char __pyx_k_BREAK[] = "BREAK";
static const char __pyx_k_CHECK[] = "CHECK";
static const char __pyx_k_CLOSE[] = "CLOSE";
static const char __pyx_k_ENDIF[] = "ENDIF";
static const char __pyx_k_Error[] = "Error:\n";
static const char __pyx_k_PRINT[] = "PRINT";
static const char __pyx_k_PURGE[] = "PURGE";
static const char __pyx_k_RESET[] = "RESET";
static const char __pyx_k_SOLVE[] = "SOLVE";
static const char __pyx_k_SSTEP[] = "SSTEP";
static const char __pyx_k_UNFIX[] = "UNFIX";
static const char __pyx_k_WRITE[] = "WRITE";
static const char __pyx_k_arity[] = "arity";
static const char __pyx_k_array[] = "array";
static const char __pyx_k_chain[] = "chain";
static const char __pyx_k_close[] = "close";
static const char __pyx_k_cname[] = "cname";
static const char __pyx_k_con_2[] = "con";
static const char __pyx_k_dimen[] = "dimen";
static const char __pyx_k_dinit[] = "dinit";
static const char __pyx_k_error[] = "error";
static const char __pyx_k_exprs[] = "exprs";
static const char __pyx_k_flush[] = "flush";
static const char __pyx_k_index[] = "index";
static const char __pyx_k_init0[] = "init0";
static const char __pyx_k_items[] = "items";
static const char __pyx_k_ldual[] = "ldual";
static const char __pyx_k_model[] = "model";
static const char __pyx_k_names[] = "names";
static const char __pyx_k_ncols[] = "ncols";
static const char __pyx_k_numpy[] = "numpy";
static const char __pyx_k_obj_2[] = "obj";
static const char __pyx_k_param[] = "_param";
static const char __pyx_k_print[] = "print";
static const char __pyx_k_range[] = "range";
static const char __pyx_k_reset[] = "reset";
static const char __pyx_k_set_2[] = "_set";
static const char __pyx_k_shape[] = "shape";
static const char __pyx_k_slack[] = "slack";
static const char __pyx_k_solve[] = "solve ";
static const char __pyx_k_split[] = "split";
static const char __pyx_k_stack[] = "stack";
static const char __pyx_k_state[] = "state";
static const char __pyx_k_super[] = "super";
static const char __pyx_k_throw[] = "throw";
static const char __pyx_k_tools[] = "tools";
static const char __pyx_k_tuple[] = "tuple";
static const char __pyx_k_udual[] = "udual";
static const char __pyx_k_unfix[] = "unfix";
static const char __pyx_k_utf_8[] = "utf-8";
static const char __pyx_k_value[] = "value";
static const char __pyx_k_var_2[] = "var";
static const char __pyx_k_write[] = "write";
static const char __pyx_k_zeros[] = "zeros";
static const char __pyx_k_Column[] = "Column";
static const char __pyx_k_EXPAND[] = "EXPAND";
static const char __pyx_k_Entity[] = "Entity";
static const char __pyx_k_OPTION[] = "OPTION";
static const char __pyx_k_PRINTF[] = "PRINTF";
static const char __pyx_k_PROMPT[] = "PROMPT";
static const char __pyx_k_RBRACE[] = "RBRACE";
static const char __pyx_k_RELOAD[] = "RELOAD";
static const char __pyx_k_REMOVE[] = "REMOVE";
static const char __pyx_k_REPEAT[] = "REPEAT";
static const char __pyx_k_Series[] = "Series";
static const char __pyx_k_UNLOAD[] = "UNLOAD";
static const char __pyx_k_UPDATE[] = "UPDATE";
static const char __pyx_k_addRow[] = "_addRow";
static const char __pyx_k_amplpy[] = "_amplpy";
static const char __pyx_k_cindex[] = "cindex";
static const char __pyx_k_column[] = "column";
static const char __pyx_k_data_c[] = "data_c";
static const char __pyx_k_defeqn[] = "defeqn";
static const char __pyx_k_defvar[] = "defvar";
static const char __pyx_k_df_ref[] = "df_ref";
static const char __pyx_k_dict_2[] = "_dict";
static const char __pyx_k_dinit0[] = "dinit0";
static const char __pyx_k_enable[] = "enable";
static const char __pyx_k_encode[] = "encode";
static const char __pyx_k_entity[] = "entity";
static const char __pyx_k_exists[] = "exists";
static const char __pyx_k_file_2[] = "file";
static const char __pyx_k_getRow[] = "_getRow";
static const char __pyx_k_getSet[] = "getSet";
static const char __pyx_k_header[] = "header";
static const char __pyx_k_import[] = "__import__";
static const char __pyx_k_init_2[] = "init";
static const char __pyx_k_kwargs[] = "kwargs";
static const char __pyx_k_lslack[] = "lslack";
static const char __pyx_k_module[] = "__module__";
static const char __pyx_k_name_2[] = "__name__";
static const char __pyx_k_name_c[] = "name_c";
static const char __pyx_k_nested[] = "nested";
static const char __pyx_k_object[] = "object";
static const char __pyx_k_offset[] = "offset";
static const char __pyx_k_option[] = "option";
static const char __pyx_k_output[] = "output";
static const char __pyx_k_pandas[] = "pandas";
static const char __pyx_k_pickle[] = "pickle";
static const char __pyx_k_pylist[] = "pylist";
static const char __pyx_k_reduce[] = "__reduce__";
static const char __pyx_k_result[] = "result";
static const char __pyx_k_solver[] = "solver";
static const char __pyx_k_status[] = "status";
static const char __pyx_k_stderr[] = "stderr";
static const char __pyx_k_toDict[] = "toDict";
static const char __pyx_k_toList[] = "toList";
static const char __pyx_k_tolist[] = "tolist";
static const char __pyx_k_update[] = "update";
static const char __pyx_k_uslack[] = "uslack";
static const char __pyx_k_values[] = "values";
static const char __pyx_k_AMPL_cd[] = "AMPL.cd";
static const char __pyx_k_DISPLAY[] = "DISPLAY";
static const char __pyx_k_ENVIRON[] = "ENVIRON";
static const char __pyx_k_IOError[] = "IOError";
static const char __pyx_k_LOOPEND[] = "LOOPEND";
static const char __pyx_k_Options[] = "Options";
static const char __pyx_k_PROBLEM[] = "PROBLEM";
static const char __pyx_k_RESTORE[] = "RESTORE";
static const char __pyx_k_WAITING[] = "WAITING";
static const char __pyx_k_Warning[] = "Warning:\n";
static const char __pyx_k_add_row[] = "_add_row";
static const char __pyx_k_astatus[] = "astatus";
static const char __pyx_k_bin_dir[] = "bin_dir";
static const char __pyx_k_columns[] = "columns";
static const char __pyx_k_disable[] = "disable";
static const char __pyx_k_display[] = "display";
static const char __pyx_k_environ[] = "environ";
static const char __pyx_k_genexpr[] = "genexpr";
static const char __pyx_k_getData[] = "getData";
static const char __pyx_k_getSets[] = "getSets";
static const char __pyx_k_get_iis[] = "get_iis";
static const char __pyx_k_get_row[] = "_get_row";
static const char __pyx_k_get_set[] = "get_set";
static const char __pyx_k_getitem[] = "__getitem__";
static const char __pyx_k_headers[] = "headers";
static const char __pyx_k_iis_con[] = "iis_con";
static const char __pyx_k_iis_var[] = "iis_var";
static const char __pyx_k_index_c[] = "index_c";
static const char __pyx_k_members[] = "members";
static const char __pyx_k_message[] = "message";
static const char __pyx_k_model_c[] = "model_c";
static const char __pyx_k_ndarray[] = "ndarray";
static const char __pyx_k_nlevels[] = "nlevels";
static const char __pyx_k_numbers[] = "numbers";
static const char __pyx_k_objname[] = "objname";
static const char __pyx_k_options[] = "_options";
static const char __pyx_k_param_2[] = "param";
static const char __pyx_k_prepare[] = "__prepare__";
static const char __pyx_k_problem[] = "problem";
static const char __pyx_k_py_list[] = "py_list";
static const char __pyx_k_restore[] = "restore";
static const char __pyx_k_setData[] = "setData";
static const char __pyx_k_setDual[] = "setDual";
static const char __pyx_k_setitem[] = "__setitem__";
static const char __pyx_k_solve_2[] = "solve";
static const char __pyx_k_sstatus[] = "sstatus";
static const char __pyx_k_to_dict[] = "to_dict";
static const char __pyx_k_to_list[] = "to_list";
static const char __pyx_k_tuple_c[] = "tuple_c";
static const char __pyx_k_value_c[] = "value_c";
static const char __pyx_k_verbose[] = "verbose";
static const char __pyx_k_warning[] = "warning";
static const char __pyx_k_workdir[] = "workdir";
static const char __pyx_k_COMMANDS[] = "COMMANDS";
static const char __pyx_k_CONTINUE[] = "CONTINUE";
static const char __pyx_k_Iterable[] = "Iterable";
static const char __pyx_k_KeyError[] = "KeyError";
static const char __pyx_k_RUN_ARGS[] = "RUN_ARGS";
static const char __pyx_k_SOLUTION[] = "SOLUTION";
static const char __pyx_k_Set_size[] = "Set.size";
static const char __pyx_k_Variable[] = "Variable";
static const char __pyx_k_auxfiles[] = "auxfiles";
static const char __pyx_k_bin_name[] = "bin_name";
static const char __pyx_k_cast_row[] = "cast_row";
static const char __pyx_k_contains[] = "contains";
static const char __pyx_k_endswith[] = "endswith";
static const char __pyx_k_exitcode[] = "exitcode";
static const char __pyx_k_filename[] = "filename";
static const char __pyx_k_fromDict[] = "fromDict";
static const char __pyx_k_getValue[] = "getValue";
static const char __pyx_k_get_data[] = "get_data";
static const char __pyx_k_get_sets[] = "get_sets";
static const char __pyx_k_getstate[] = "__getstate__";
static const char __pyx_k_isScalar[] = "isScalar";
static const char __pyx_k_minimize[] = "minimize";
static const char __pyx_k_name_c_2[] = "_name_c";
static const char __pyx_k_ncolumns[] = "ncolumns";
static const char __pyx_k_nindices[] = "nindices";
static const char __pyx_k_option_2[] = "_option";
static const char __pyx_k_output_c[] = "output_c";
static const char __pyx_k_property[] = "property";
static const char __pyx_k_pyx_type[] = "__pyx_type";
static const char __pyx_k_qualname[] = "__qualname__";
static const char __pyx_k_readData[] = "readData";
static const char __pyx_k_rowindex[] = "rowindex";
static const char __pyx_k_setValue[] = "setValue";
static const char __pyx_k_set_data[] = "set_data";
static const char __pyx_k_set_dual[] = "set_dual";
static const char __pyx_k_set_name[] = "set_name";
static const char __pyx_k_setstate[] = "__setstate__";
static const char __pyx_k_snapshot[] = "snapshot";
static const char __pyx_k_suffixes[] = "suffixes";
static const char __pyx_k_toPandas[] = "toPandas";
static const char __pyx_k_toString[] = "toString";
static const char __pyx_k_to_tuple[] = "to_tuple";
static const char __pyx_k_AMPL__con[] = "AMPL._con";
static const char __pyx_k_AMPL__obj[] = "AMPL._obj";
static const char __pyx_k_AMPL__set[] = "AMPL._set";
static const char __pyx_k_AMPL__var[] = "AMPL._var";
static const char __pyx_k_AMPL_eval[] = "AMPL.eval";
static const char __pyx_k_AMPL_read[] = "AMPL.read";
static const char __pyx_k_DELETECMD[] = "DELETECMD";
static const char __pyx_k_DataFrame[] = "DataFrame";
static const char __pyx_k_EntityMap[] = "EntityMap";
static const char __pyx_k_OBJECTIVE[] = "OBJECTIVE";
static const char __pyx_k_Objective[] = "Objective";
static const char __pyx_k_Parameter[] = "Parameter";
static const char __pyx_k_READTABLE[] = "_READTABLE";
static const char __pyx_k_SEMICOLON[] = "SEMICOLON";
static const char __pyx_k_Set_arity[] = "Set.arity";
static const char __pyx_k_TypeError[] = "TypeError";
static const char __pyx_k_Variables[] = "Variables";
static const char __pyx_k_addColumn[] = "_addColumn";
static const char __pyx_k_bin_dir_c[] = "bin_dir_c";
static const char __pyx_k_enumerate[] = "enumerate";
static const char __pyx_k_errorinfo[] = "errorinfo";
static const char __pyx_k_exception[] = "exception";
static const char __pyx_k_fromNumpy[] = "fromNumpy";
static const char __pyx_k_from_dict[] = "from_dict";
static const char __pyx_k_getBinDir[] = "getBinDir";
static const char __pyx_k_getColumn[] = "_getColumn";
static const char __pyx_k_getEntity[] = "getEntity";
static const char __pyx_k_getOffset[] = "getOffset";
static const char __pyx_k_getOption[] = "getOption";
static const char __pyx_k_getOutput[] = "getOutput";
static const char __pyx_k_getValues[] = "getValues";
static const char __pyx_k_get_value[] = "get_value";
static const char __pyx_k_indices_c[] = "indices_c";
static const char __pyx_k_instances[] = "instances";
static const char __pyx_k_isLogical[] = "isLogical";
static const char __pyx_k_isRunning[] = "isRunning";
static const char __pyx_k_is_scalar[] = "is_scalar";
static const char __pyx_k_isenabled[] = "isenabled";
static const char __pyx_k_isrunning[] = "isrunning";
static const char __pyx_k_itertools[] = "itertools";
static const char __pyx_k_lst_index[] = "lst_index";
static const char __pyx_k_metaclass[] = "__metaclass__";
static const char __pyx_k_objname_c[] = "objname_c";
static const char __pyx_k_options_2[] = "options";
static const char __pyx_k_options_c[] = "options_c";
static const char __pyx_k_pyx_state[] = "__pyx_state";
static const char __pyx_k_readTable[] = "readTable";
static const char __pyx_k_read_data[] = "read_data";
static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
static const char __pyx_k_setBinDir[] = "setBinDir";
static const char __pyx_k_setColumn[] = "_setColumn";
static const char __pyx_k_setOption[] = "setOption";
static const char __pyx_k_setValues[] = "_setValues";
static const char __pyx_k_set_value[] = "set_value";
static const char __pyx_k_to_pandas[] = "to_pandas";
static const char __pyx_k_to_string[] = "to_string";
static const char __pyx_k_workdir_c[] = "workdir_c";
static const char __pyx_k_AMPL_close[] = "AMPL.close";
static const char __pyx_k_AMPL_reset[] = "AMPL.reset";
static const char __pyx_k_AMPL_solve[] = "AMPL.solve";
static const char __pyx_k_AMPL_write[] = "AMPL.write";
static const char __pyx_k_BREAKPOINT[] = "BREAKPOINT";
static const char __pyx_k_Constraint[] = "Constraint";
static const char __pyx_k_ELSE_CHECK[] = "ELSE_CHECK";
static const char __pyx_k_Entity_get[] = "Entity.get";
static const char __pyx_k_MultiIndex[] = "MultiIndex";
static const char __pyx_k_Objectives[] = "Objectives";
static const char __pyx_k_Parameters[] = "Parameters";
static const char __pyx_k_READ_TABLE[] = "READ_TABLE";
static const char __pyx_k_REPEAT_END[] = "REPEAT_END";
static const char __pyx_k_ValueError[] = "ValueError";
static const char __pyx_k_WRITETABLE[] = "_WRITETABLE";
static const char __pyx_k_add_column[] = "_add_column";
static const char __pyx_k_bin_name_c[] = "bin_name_c";
static const char __pyx_k_cast_value[] = "cast_value";
static const char __pyx_k_contains_c[] = "contains_c";
static const char __pyx_k_data_frame[] = "data_frame";
static const char __pyx_k_entitytype[] = "entitytype";
static const char __pyx_k_exportData[] = "exportData";
static const char __pyx_k_fromPandas[] = "fromPandas";
static const char __pyx_k_from_numpy[] = "from_numpy";
static const char __pyx_k_getBinName[] = "getBinName";
static const char __pyx_k_getHeaders[] = "_getHeaders";
static const char __pyx_k_getMessage[] = "getMessage";
static const char __pyx_k_getNumCols[] = "_getNumCols";
static const char __pyx_k_getNumRows[] = "_getNumRows";
static const char __pyx_k_get_column[] = "_get_column";
static const char __pyx_k_get_entity[] = "get_entity";
static const char __pyx_k_get_offset[] = "get_offset";
static const char __pyx_k_get_option[] = "get_option";
static const char __pyx_k_get_output[] = "get_output";
static const char __pyx_k_get_values[] = "get_values";
static const char __pyx_k_hasDefault[] = "hasDefault";
static const char __pyx_k_headers_py[] = "headers_py";
static const char __pyx_k_indexarity[] = "indexarity";
static const char __pyx_k_isSymbolic[] = "isSymbolic";
static const char __pyx_k_is_logical[] = "is_logical";
static const char __pyx_k_is_running[] = "is_running";
static const char __pyx_k_py_variant[] = "py_variant";
static const char __pyx_k_pyx_result[] = "__pyx_result";
static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
static const char __pyx_k_read_table[] = "read_table";
static const char __pyx_k_setBinName[] = "setBinName";
static const char __pyx_k_set_column[] = "_set_column";
static const char __pyx_k_set_name_2[] = "__set_name__";
static const char __pyx_k_set_option[] = "set_option";
static const char __pyx_k_set_values[] = "set_values";
static const char __pyx_k_skip_index[] = "skip_index";
static const char __pyx_k_statements[] = "statements";
static const char __pyx_k_suffixes_c[] = "suffixes_c";
static const char __pyx_k_table_name[] = "table_name";
static const char __pyx_k_writeTable[] = "writeTable";
static const char __pyx_k_AMPL__param[] = "AMPL._param";
static const char __pyx_k_ColIterator[] = "ColIterator";
static const char __pyx_k_Constraints[] = "Constraints";
static const char __pyx_k_Entity_find[] = "Entity.find";
static const char __pyx_k_Entity_name[] = "Entity.name";
static const char __pyx_k_Entity_xref[] = "Entity.xref";
static const char __pyx_k_EnvIterator[] = "EnvIterator";
static const char __pyx_k_Environment[] = "Environment";
static const char __pyx_k_ImportError[] = "ImportError";
static const char __pyx_k_MemoryError[] = "MemoryError";
static const char __pyx_k_PickleError[] = "PickleError";
static const char __pyx_k_RowIterator[] = "RowIterator";
static const char __pyx_k_Set_members[] = "Set.members";
static const char __pyx_k_SystemError[] = "SystemError";
static const char __pyx_k_Variable_lb[] = "Variable.lb";
static const char __pyx_k_Variable_rc[] = "Variable.rc";
static const char __pyx_k_Variable_ub[] = "Variable.ub";
static const char __pyx_k_WRITE_TABLE[] = "WRITE_TABLE";
static const char __pyx_k_binary_name[] = "binary_name";
static const char __pyx_k_environment[] = "environment";
static const char __pyx_k_exportModel[] = "exportModel";
static const char __pyx_k_export_data[] = "export_data";
static const char __pyx_k_from_arrays[] = "from_arrays";
static const char __pyx_k_from_pandas[] = "from_pandas";
static const char __pyx_k_from_tuples[] = "from_tuples";
static const char __pyx_k_getVariable[] = "getVariable";
static const char __pyx_k_get_bin_dir[] = "get_bin_dir";
static const char __pyx_k_get_headers[] = "_get_headers";
static const char __pyx_k_get_message[] = "get_message";
static const char __pyx_k_has_default[] = "has_default";
static const char __pyx_k_index_names[] = "index_names";
static const char __pyx_k_is_symbolic[] = "is_symbolic";
static const char __pyx_k_line_number[] = "line_number";
static const char __pyx_k_loadSession[] = "_loadSession";
static const char __pyx_k_lst_columns[] = "lst_columns";
static const char __pyx_k_mro_entries[] = "__mro_entries__";
static const char __pyx_k_multi_index[] = "multi_index";
static const char __pyx_k_setValues_2[] = "setValues";
static const char __pyx_k_set_bin_dir[] = "set_bin_dir";
static const char __pyx_k_source_name[] = "source_name";
static const char __pyx_k_to_string_c[] = "to_string_c";
static const char __pyx_k_write_table[] = "write_table";
static const char __pyx_k_AMPL__option[] = "AMPL._option";
static const char __pyx_k_AMPL_display[] = "AMPL.display";
static const char __pyx_k_AMPL_get_iis[] = "AMPL.get_iis";
static const char __pyx_k_AMPL_get_set[] = "AMPL.get_set";
static const char __pyx_k_ErrorHandler[] = "ErrorHandler";
static const char __pyx_k_OPTION_RESET[] = "OPTION_RESET";
static const char __pyx_k_RuntimeError[] = "RuntimeError";
static const char __pyx_k_SHELL_OUTPUT[] = "SHELL_OUTPUT";
static const char __pyx_k_Set_contains[] = "Set.contains";
static const char __pyx_k_Variable_fix[] = "Variable.fix";
static const char __pyx_k_Variable_lb0[] = "Variable.lb0";
static const char __pyx_k_Variable_lb1[] = "Variable.lb1";
static const char __pyx_k_Variable_lb2[] = "Variable.lb2";
static const char __pyx_k_Variable_lrc[] = "Variable.lrc";
static const char __pyx_k_Variable_ub0[] = "Variable.ub0";
static const char __pyx_k_Variable_ub1[] = "Variable.ub1";
static const char __pyx_k_Variable_ub2[] = "Variable.ub2";
static const char __pyx_k_Variable_urc[] = "Variable.urc";
static const char __pyx_k_ampl_libpath[] = "ampl_libpath";
static const char __pyx_k_column_names[] = "column_names";
static const char __pyx_k_conv_to_list[] = "conv_to_list";
static const char __pyx_k_export_model[] = "export_model";
static const char __pyx_k_getObjective[] = "getObjective";
static const char __pyx_k_getParameter[] = "getParameter";
static const char __pyx_k_getVariables[] = "getVariables";
static const char __pyx_k_get_bin_name[] = "get_bin_name";
static const char __pyx_k_get_num_cols[] = "_get_num_cols";
static const char __pyx_k_get_num_rows[] = "_get_num_rows";
static const char __pyx_k_get_solution[] = "get_solution";
static const char __pyx_k_get_variable[] = "get_variable";
static const char __pyx_k_initializing[] = "_initializing";
static const char __pyx_k_is_coroutine[] = "_is_coroutine";
static const char __pyx_k_literal_eval[] = "literal_eval";
static const char __pyx_k_load_session[] = "_load_session";
static const char __pyx_k_lst_solution[] = "lst_solution";
static const char __pyx_k_minimization[] = "minimization";
static const char __pyx_k_numInstances[] = "numInstances";
static const char __pyx_k_pyx_checksum[] = "__pyx_checksum";
static const char __pyx_k_set_bin_name[] = "set_bin_name";
static const char __pyx_k_set_values_2[] = "_set_values";
static const char __pyx_k_solve_result[] = "solve_result";
static const char __pyx_k_statements_c[] = "statements_c";
static const char __pyx_k_stringsource[] = "<stringsource>";
static const char __pyx_k_use_setstate[] = "use_setstate";
static const char __pyx_k_AMPLException[] = "AMPLException";
static const char __pyx_k_AMPL_get_data[] = "AMPL.get_data";
static const char __pyx_k_AMPL_get_sets[] = "AMPL.get_sets";
static const char __pyx_k_AMPL_set_data[] = "AMPL.set_data";
static const char __pyx_k_AMPL_snapshot[] = "AMPL.snapshot";
static const char __pyx_k_Constraint_lb[] = "Constraint.lb";
static const char __pyx_k_Constraint_ub[] = "Constraint.ub";
static const char __pyx_k_OutputHandler[] = "OutputHandler";
static const char __pyx_k_Parameter_set[] = "Parameter.set";
static const char __pyx_k_Row_to_string[] = "Row.to_string";
static const char __pyx_k_SHELL_MESSAGE[] = "SHELL_MESSAGE";
static const char __pyx_k_Set_instances[] = "Set.instances";
static const char __pyx_k_StopIteration[] = "StopIteration";
static const char __pyx_k_Variable_dual[] = "Variable.dual";
static const char __pyx_k_Variable_init[] = "Variable.init";
static const char __pyx_k_class_getitem[] = "__class_getitem__";
static const char __pyx_k_error_handler[] = "error_handler";
static const char __pyx_k_getConstraint[] = "getConstraint";
static const char __pyx_k_getLineNumber[] = "getLineNumber";
static const char __pyx_k_getNumIndices[] = "_getNumIndices";
static const char __pyx_k_getObjectives[] = "getObjectives";
static const char __pyx_k_getParameters[] = "getParameters";
static const char __pyx_k_getRowByIndex[] = "_getRowByIndex";
static const char __pyx_k_getSourceName[] = "getSourceName";
static const char __pyx_k_get_objective[] = "get_objective";
static const char __pyx_k_get_parameter[] = "get_parameter";
static const char __pyx_k_get_variables[] = "get_variables";
static const char __pyx_k_init_subclass[] = "__init_subclass__";
static const char __pyx_k_num_instances[] = "num_instances";
static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
static const char __pyx_k_return_output[] = "return_output";
static const char __pyx_k_stopRecording[] = "_stopRecording";
static const char __pyx_k_AMPL_get_value[] = "AMPL.get_value";
static const char __pyx_k_AMPL_read_data[] = "AMPL.read_data";
static const char __pyx_k_AssertionError[] = "AssertionError";
static const char __pyx_k_AttributeError[] = "AttributeError";
static const char __pyx_k_Column_to_list[] = "Column.to_list";
static const char __pyx_k_Constraint_lbs[] = "Constraint.lbs";
static const char __pyx_k_Constraint_ubs[] = "Constraint.ubs";
static const char __pyx_k_Constraint_val[] = "Constraint.val";
static const char __pyx_k_EntityMap_size[] = "EntityMap.size";
static const char __pyx_k_Entity_to_dict[] = "Entity.to_dict";
static const char __pyx_k_Entity_to_list[] = "Entity.to_list";
static const char __pyx_k_Objective_drop[] = "Objective.drop";
static const char __pyx_k_Set_get_values[] = "Set.get_values";
static const char __pyx_k_Set_set_values[] = "Set.set_values";
static const char __pyx_k_Variable_init0[] = "Variable.init0";
static const char __pyx_k_Variable_slack[] = "Variable.slack";
static const char __pyx_k_Variable_unfix[] = "Variable.unfix";
static const char __pyx_k_Variable_value[] = "Variable.value";
static const char __pyx_k_amplpy_set_pxi[] = "amplpy/set.pxi";
static const char __pyx_k_c_double_array[] = "c_double_array";
static const char __pyx_k_c_string_array[] = "c_string_array";
static const char __pyx_k_getConstraints[] = "getConstraints";
static const char __pyx_k_get_constraint[] = "get_constraint";
static const char __pyx_k_get_objectives[] = "get_objectives";
static const char __pyx_k_get_parameters[] = "get_parameters";
static const char __pyx_k_output_handler[] = "output_handler";
static const char __pyx_k_startRecording[] = "_startRecording";
static const char __pyx_k_stop_recording[] = "_stop_recording";
static const char __pyx_k_AMPL_get_entity[] = "AMPL.get_entity";
static const char __pyx_k_AMPL_get_option[] = "AMPL.get_option";
static const char __pyx_k_AMPL_get_output[] = "AMPL.get_output";
static const char __pyx_k_AMPL_is_running[] = "AMPL.is_running";
static const char __pyx_k_AMPL_read_table[] = "AMPL.read_table";
static const char __pyx_k_AMPL_set_option[] = "AMPL.set_option";
static const char __pyx_k_Constraint_body[] = "Constraint.body";
static const char __pyx_k_Constraint_drop[] = "Constraint.drop";
static const char __pyx_k_Constraint_dual[] = "Constraint.dual";
static const char __pyx_k_Objective_value[] = "Objective.value";
static const char __pyx_k_Parameter_value[] = "Parameter.value";
static const char __pyx_k_SUPPORT_MESSAGE[] = "_SUPPORT_MESSAGE";
static const char __pyx_k_Variable_defeqn[] = "Variable.defeqn";
static const char __pyx_k_Variable_lslack[] = "Variable.lslack";
static const char __pyx_k_Variable_status[] = "Variable.status";
static const char __pyx_k_Variable_uslack[] = "Variable.uslack";
static const char __pyx_k_amplpy_ampl_pyx[] = "amplpy/ampl.pyx";
static const char __pyx_k_collections_abc[] = "collections.abc";
static const char __pyx_k_getErrorHandler[] = "getErrorHandler";
static const char __pyx_k_getIndexingSets[] = "getIndexingSets";
static const char __pyx_k_get_constraints[] = "get_constraints";
static const char __pyx_k_get_line_number[] = "get_line_number";
static const char __pyx_k_get_num_indices[] = "_get_num_indices";
static const char __pyx_k_get_source_name[] = "get_source_name";
static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError";
static const char __pyx_k_setErrorHandler[] = "setErrorHandler";
static const char __pyx_k_set_locals_Sets[] = "_set.<locals>.Sets";
static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
static const char __pyx_k_start_recording[] = "_start_recording";
static const char __pyx_k_AMPL_export_data[] = "AMPL.export_data";
static const char __pyx_k_AMPL_write_table[] = "AMPL.write_table";
static const char __pyx_k_Column_to_string[] = "Column.to_string";
static const char __pyx_k_Constraint_dinit[] = "Constraint.dinit";
static const char __pyx_k_Constraint_ldual[] = "Constraint.ldual";
static const char __pyx_k_Constraint_slack[] = "Constraint.slack";
static const char __pyx_k_Constraint_udual[] = "Constraint.udual";
static const char __pyx_k_Entity_instances[] = "Entity.instances";
static const char __pyx_k_Entity_is_scalar[] = "Entity.is_scalar";
static const char __pyx_k_Entity_to_pandas[] = "Entity.to_pandas";
static const char __pyx_k_Entity_to_string[] = "Entity.to_string";
static const char __pyx_k_InstanceIterator[] = "InstanceIterator";
static const char __pyx_k_Objective_result[] = "Objective.result";
static const char __pyx_k_Variable_astatus[] = "Variable.astatus";
static const char __pyx_k_Variable_sstatus[] = "Variable.sstatus";
static const char __pyx_k_ampl_expressions[] = "ampl_expressions";
static const char __pyx_k_binary_directory[] = "binary_directory";
static const char __pyx_k_getOutputHandler[] = "getOutputHandler";
static const char __pyx_k_get_row_by_index[] = "_get_row_by_index";
static const char __pyx_k_setOutputHandler[] = "setOutputHandler";
static const char __pyx_k_solve_result_num[] = "solve_result_num";
static const char __pyx_k_unsupported_type[] = "unsupported type ";
static const char __pyx_k_AMPL_export_model[] = "AMPL.export_model";
static const char __pyx_k_AMPL_get_solution[] = "AMPL.get_solution";
static const char __pyx_k_AMPL_get_variable[] = "AMPL.get_variable";
static const char __pyx_k_Constraint_defvar[] = "Constraint.defvar";
static const char __pyx_k_Constraint_dinit0[] = "Constraint.dinit0";
static const char __pyx_k_Constraint_lslack[] = "Constraint.lslack";
static const char __pyx_k_Constraint_status[] = "Constraint.status";
static const char __pyx_k_Constraint_uslack[] = "Constraint.uslack";
static const char __pyx_k_DataFrame_to_dict[] = "DataFrame.to_dict";
static const char __pyx_k_DataFrame_to_list[] = "DataFrame.to_list";
static const char __pyx_k_Entity_get_values[] = "Entity.get_values";
static const char __pyx_k_Entity_indexarity[] = "Entity.indexarity";
static const char __pyx_k_Entity_set_values[] = "Entity.set_values";
static const char __pyx_k_Objective_astatus[] = "Objective.astatus";
static const char __pyx_k_Objective_message[] = "Objective.message";
static const char __pyx_k_Objective_restore[] = "Objective.restore";
static const char __pyx_k_Objective_sstatus[] = "Objective.sstatus";
static const char __pyx_k_PresolveException[] = "PresolveException";
static const char __pyx_k_amplpy_entity_pxi[] = "amplpy/entity.pxi";
static const char __pyx_k_get_error_handler[] = "get_error_handler";
static const char __pyx_k_get_indexing_sets[] = "get_indexing_sets";
static const char __pyx_k_scalar_expression[] = "scalar_expression";
static const char __pyx_k_set_error_handler[] = "set_error_handler";
static const char __pyx_k_AMPL__load_session[] = "AMPL._load_session";
static const char __pyx_k_AMPL_get_objective[] = "AMPL.get_objective";
static const char __pyx_k_AMPL_get_parameter[] = "AMPL.get_parameter";
static const char __pyx_k_AMPL_get_variables[] = "AMPL.get_variables";
static const char __pyx_k_Constraint_astatus[] = "Constraint.astatus";
static const char __pyx_k_Constraint_restore[] = "Constraint.restore";
static const char __pyx_k_Constraint_sstatus[] = "Constraint.sstatus";
static const char __pyx_k_DataFrame__add_row[] = "DataFrame._add_row";
static const char __pyx_k_DataFrame__get_row[] = "DataFrame._get_row";
static const char __pyx_k_ErrorHandler_error[] = "ErrorHandler.error";
static const char __pyx_k_Objective_exitcode[] = "Objective.exitcode";
static const char __pyx_k_Variable_set_value[] = "Variable.set_value";
static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines";
static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
static const char __pyx_k_get_output_handler[] = "get_output_handler";
static const char __pyx_k_set_output_handler[] = "set_output_handler";
static const char __pyx_k_AMPLException___str[] = "AMPLException.__str__";
static const char __pyx_k_AMPL_get_constraint[] = "AMPL.get_constraint";
static const char __pyx_k_AMPL_get_objectives[] = "AMPL.get_objectives";
static const char __pyx_k_AMPL_get_parameters[] = "AMPL.get_parameters";
static const char __pyx_k_Constraint_set_dual[] = "Constraint.set_dual";
static const char __pyx_k_DROP_OR_RESTORE_ALL[] = "DROP_OR_RESTORE_ALL";
static const char __pyx_k_DataFrame_from_dict[] = "DataFrame.from_dict";
static const char __pyx_k_DataFrame_to_pandas[] = "DataFrame.to_pandas";
static const char __pyx_k_DataFrame_to_string[] = "DataFrame.to_string";
static const char __pyx_k_MemberRangeIterator[] = "MemberRangeIterator";
static const char __pyx_k_NotImplementedError[] = "NotImplementedError";
static const char __pyx_k_PresolveException_2[] = "PresolveException: ";
static const char __pyx_k_Row___reduce_cython[] = "Row.__reduce_cython__";
static const char __pyx_k_Set___reduce_cython[] = "Set.__reduce_cython__";
static const char __pyx_k_amplpy_variable_pxi[] = "amplpy/variable.pxi";
static const char __pyx_k_from_data_frame_ref[] = "_from_data_frame_ref";
static const char __pyx_k_getCurrentObjective[] = "getCurrentObjective";
static const char __pyx_k_AMPLException___init[] = "AMPLException.__init__";
static const char __pyx_k_AMPL___reduce_cython[] = "AMPL.__reduce_cython__";
static const char __pyx_k_AMPL__stop_recording[] = "AMPL._stop_recording";
static const char __pyx_k_AMPL_get_constraints[] = "AMPL.get_constraints";
static const char __pyx_k_DataFrame_from_numpy[] = "DataFrame.from_numpy";
static const char __pyx_k_Entity_num_instances[] = "Entity.num_instances";
static const char __pyx_k_ErrorHandler_warning[] = "ErrorHandler.warning";
static const char __pyx_k_OutputHandler_output[] = "OutputHandler.output";
static const char __pyx_k_Parameter_set_values[] = "Parameter.set_values";
static const char __pyx_k_Unexpected_data_type[] = "Unexpected data type: ";
static const char __pyx_k_Unknown_entity_class[] = "Unknown entity class.";
static const char __pyx_k_amplpy_dataframe_pxi[] = "amplpy/dataframe.pxi";
static const char __pyx_k_amplpy_iterators_pxi[] = "amplpy/iterators.pxi";
static const char __pyx_k_amplpy_objective_pxi[] = "amplpy/objective.pxi";
static const char __pyx_k_amplpy_parameter_pxi[] = "amplpy/parameter.pxi";
static const char __pyx_k_var_locals_Variables[] = "_var.<locals>.Variables";
static const char __pyx_k_AMPL__start_recording[] = "AMPL._start_recording";
static const char __pyx_k_Constraint_is_logical[] = "Constraint.is_logical";
static const char __pyx_k_DataFrame__add_column[] = "DataFrame._add_column";
static const char __pyx_k_DataFrame__get_column[] = "DataFrame._get_column";
static const char __pyx_k_DataFrame__set_column[] = "DataFrame._set_column";
static const char __pyx_k_DataFrame__set_values[] = "DataFrame._set_values";
static const char __pyx_k_DataFrame_from_pandas[] = "DataFrame.from_pandas";
static const char __pyx_k_Environment_to_string[] = "Environment.to_string";
static const char __pyx_k_Expected_a_dictionary[] = "Expected a dictionary";
static const char __pyx_k_InstanceIterator_size[] = "InstanceIterator.size";
static const char __pyx_k_Parameter_has_default[] = "Parameter.has_default";
static const char __pyx_k_Parameter_is_symbolic[] = "Parameter.is_symbolic";
static const char __pyx_k_Row___setstate_cython[] = "Row.__setstate_cython__";
static const char __pyx_k_Set___setstate_cython[] = "Set.__setstate_cython__";
static const char __pyx_k_amplpy_constraint_pxi[] = "amplpy/constraint.pxi";
static const char __pyx_k_amplpy_exceptions_pxi[] = "amplpy/exceptions.pxi";
static const char __pyx_k_display_error_message[] = "display_error_message";
static const char __pyx_k_get_current_objective[] = "get_current_objective";
static const char __pyx_k_iter___locals_genexpr[] = "__iter__.<locals>.genexpr";
static const char __pyx_k_obj_locals_Objectives[] = "_obj.<locals>.Objectives";
static const char __pyx_k_option_locals_Options[] = "_option.<locals>.Options";
static const char __pyx_k_AMPL_NOT_FOUND_MESSAGE[] = "AMPL_NOT_FOUND_MESSAGE";
static const char __pyx_k_AMPL___setstate_cython[] = "AMPL.__setstate_cython__";
static const char __pyx_k_AMPL_get_error_handler[] = "AMPL.get_error_handler";
static const char __pyx_k_AMPL_set_error_handler[] = "AMPL.set_error_handler";
static const char __pyx_k_Column___reduce_cython[] = "Column.__reduce_cython__";
static const char __pyx_k_DataFrame__get_headers[] = "DataFrame._get_headers";
static const char __pyx_k_Entity___reduce_cython[] = "Entity.__reduce_cython__";
static const char __pyx_k_Failed_to_access_value[] = "Failed to access value";
static const char __pyx_k_InfeasibilityException[] = "InfeasibilityException";
static const char __pyx_k_Objective_minimization[] = "Objective.minimization";
static const char __pyx_k_amplpy_environment_pxi[] = "amplpy/environment.pxi";
static const char __pyx_k_con_locals_Constraints[] = "_con.<locals>.Constraints";
static const char __pyx_k_set_locals_Sets___init[] = "_set.<locals>.Sets.__init__";
static const char __pyx_k_set_locals_Sets___iter[] = "_set.<locals>.Sets.__iter__";
static const char __pyx_k_AMPL_get_output_handler[] = "AMPL.get_output_handler";
static const char __pyx_k_AMPL_set_output_handler[] = "AMPL.set_output_handler";
static const char __pyx_k_DataFrame__get_num_cols[] = "DataFrame._get_num_cols";
static const char __pyx_k_DataFrame__get_num_rows[] = "DataFrame._get_num_rows";
static const char __pyx_k_Environment_get_bin_dir[] = "Environment.get_bin_dir";
static const char __pyx_k_Environment_set_bin_dir[] = "Environment.set_bin_dir";
static const char __pyx_k_Excepted_string_or_real[] = "Excepted string or real.";
static const char __pyx_k_Excepted_tuple_of_arity[] = "Excepted tuple of arity ";
static const char __pyx_k_amplpy_errorhandler_pxi[] = "amplpy/errorhandler.pxi";
static const char __pyx_k_nested_dict_of_suffixes[] = "nested_dict_of_suffixes";
static const char __pyx_k_param_locals_Parameters[] = "_param.<locals>.Parameters";
static const char __pyx_k_AMPLException_get_offset[] = "AMPLException.get_offset";
static const char __pyx_k_AMPL_unknown_return_code[] = "AMPL: unknown return code!";
static const char __pyx_k_Column___setstate_cython[] = "Column.__setstate_cython__";
static const char __pyx_k_Entity___setstate_cython[] = "Entity.__setstate_cython__";
static const char __pyx_k_Entity_get_indexing_sets[] = "Entity.get_indexing_sets";
static const char __pyx_k_Environment_get_bin_name[] = "Environment.get_bin_name";
static const char __pyx_k_Environment_set_bin_name[] = "Environment.set_bin_name";
static const char __pyx_k_Expected_tuples_of_arity[] = "Expected tuples of arity ";
static const char __pyx_k_InfeasibilityException_2[] = "InfeasibilityException: ";
static const char __pyx_k_MemberRangeIterator_size[] = "MemberRangeIterator.size";
static const char __pyx_k_Variable___reduce_cython[] = "Variable.__reduce_cython__";
static const char __pyx_k_amplpy_outputhandler_pxi[] = "amplpy/outputhandler.pxi";
static const char __pyx_k_from_dict_locals_genexpr[] = "from_dict.<locals>.genexpr";
static const char __pyx_k_AMPLException_get_message[] = "AMPLException.get_message";
static const char __pyx_k_AMPL_could_not_be_started[] = "AMPL could not be started";
static const char __pyx_k_DataFrame___reduce_cython[] = "DataFrame.__reduce_cython__";
static const char __pyx_k_EntityMap___reduce_cython[] = "EntityMap.__reduce_cython__";
static const char __pyx_k_Objective___reduce_cython[] = "Objective.__reduce_cython__";
static const char __pyx_k_Parameter___reduce_cython[] = "Parameter.__reduce_cython__";
static const char __pyx_k_add_column_locals_genexpr[] = "_add_column.<locals>.genexpr";
static const char __pyx_k_from_dict_locals_to_tuple[] = "from_dict.<locals>.to_tuple";
static const char __pyx_k_pyx_unpickle_ErrorHandler[] = "__pyx_unpickle_ErrorHandler";
static const char __pyx_k_set_locals_Sets___getitem[] = "_set.<locals>.Sets.__getitem__";
static const char __pyx_k_set_locals_Sets___setitem[] = "_set.<locals>.Sets.__setitem__";
static const char __pyx_k_set_values_locals_genexpr[] = "set_values.<locals>.genexpr";
static const char __pyx_k_AMPL_get_current_objective[] = "AMPL.get_current_objective";
static const char __pyx_k_Constraint___reduce_cython[] = "Constraint.__reduce_cython__";
static const char __pyx_k_DataFrame__get_num_indices[] = "DataFrame._get_num_indices";
static const char __pyx_k_Variable___setstate_cython[] = "Variable.__setstate_cython__";
static const char __pyx_k_get_headers_locals_genexpr[] = "_get_headers.<locals>.genexpr";
static const char __pyx_k_pyx_unpickle_OutputHandler[] = "__pyx_unpickle_OutputHandler";
static const char __pyx_k_set_values_locals_cast_row[] = "set_values.<locals>.cast_row";
static const char __pyx_k_AMPL_AMPL_NO_DATA_EXCEPTION[] = "AMPL: AMPL_NO_DATA_EXCEPTION";
static const char __pyx_k_ColIterator___reduce_cython[] = "ColIterator.__reduce_cython__";
static const char __pyx_k_DataFrame___setstate_cython[] = "DataFrame.__setstate_cython__";
static const char __pyx_k_DataFrame__get_row_by_index[] = "DataFrame._get_row_by_index";
static const char __pyx_k_EntityMap___setstate_cython[] = "EntityMap.__setstate_cython__";
static const char __pyx_k_EnvIterator___reduce_cython[] = "EnvIterator.__reduce_cython__";
static const char __pyx_k_Environment___reduce_cython[] = "Environment.__reduce_cython__";
static const char __pyx_k_Objective___setstate_cython[] = "Objective.__setstate_cython__";
static const char __pyx_k_Parameter___setstate_cython[] = "Parameter.__setstate_cython__";
static const char __pyx_k_RowIterator___reduce_cython[] = "RowIterator.__reduce_cython__";
static const char __pyx_k_var_locals_Variables___init[] = "_var.<locals>.Variables.__init__";
static const char __pyx_k_var_locals_Variables___iter[] = "_var.<locals>.Variables.__iter__";
static const char __pyx_k_Constraint___setstate_cython[] = "Constraint.__setstate_cython__";
static const char __pyx_k_ErrorHandler___reduce_cython[] = "ErrorHandler.__reduce_cython__";
static const char __pyx_k_obj_locals_Objectives___init[] = "_obj.<locals>.Objectives.__init__";
static const char __pyx_k_obj_locals_Objectives___iter[] = "_obj.<locals>.Objectives.__iter__";
static const char __pyx_k_option_locals_Options___init[] = "_option.<locals>.Options.__init__";
static const char __pyx_k_set_values_locals_cast_value[] = "set_values.<locals>.cast_value";
static const char __pyx_k_AMPLException_get_line_number[] = "AMPLException.get_line_number";
static const char __pyx_k_AMPLException_get_source_name[] = "AMPLException.get_source_name";
static const char __pyx_k_ColIterator___setstate_cython[] = "ColIterator.__setstate_cython__";
static const char __pyx_k_EnvIterator___setstate_cython[] = "EnvIterator.__setstate_cython__";
static const char __pyx_k_Environment___setstate_cython[] = "Environment.__setstate_cython__";
static const char __pyx_k_OutputHandler___reduce_cython[] = "OutputHandler.__reduce_cython__";
static const char __pyx_k_RowIterator___setstate_cython[] = "RowIterator.__setstate_cython__";
static const char __pyx_k_con_locals_Constraints___init[] = "_con.<locals>.Constraints.__init__";
static const char __pyx_k_con_locals_Constraints___iter[] = "_con.<locals>.Constraints.__iter__";
static const char __pyx_k_DataFrame__from_data_frame_ref[] = "DataFrame._from_data_frame_ref";
static const char __pyx_k_ErrorHandler___setstate_cython[] = "ErrorHandler.__setstate_cython__";
static const char __pyx_k_Please_make_sure_that_the_AMPL[] = "\nPlease make sure that the AMPL directory is in the system search path, or\nadd it before instantiating the AMPL object with:\n\n    from amplpy import AMPL, add_to_path\n    add_to_path(r\"full path to the AMPL installation directory\")\n    ampl = AMPL()\n\nOr, if you are using amplpy.modules, please make sure that they are installed:\n\n    # Install solver modules (e.g., HiGHS, CBC, Gurobi)\n    $ python -m amplpy.modules install highs cbc gurobi\n";
static const char __pyx_k_param_locals_Parameters___init[] = "_param.<locals>.Parameters.__init__";
static const char __pyx_k_param_locals_Parameters___iter[] = "_param.<locals>.Parameters.__iter__";
static const char __pyx_k_set_values_locals_conv_to_list[] = "_set_values.<locals>.conv_to_list";
static const char __pyx_k_var_locals_Variables___getitem[] = "_var.<locals>.Variables.__getitem__";
static const char __pyx_k_var_locals_Variables___setitem[] = "_var.<locals>.Variables.__setitem__";
static const char __pyx_k_A_constraint_called_name_cannot[] = "A constraint called {name} cannot be found.";
static const char __pyx_k_An_objective_called_name_cannot[] = "An objective called {name} cannot be found.";
static const char __pyx_k_OutputHandler___setstate_cython[] = "OutputHandler.__setstate_cython__";
static const char __pyx_k_Represent_an_exception_generate[] = "\n    Represent an exception generated by AMPL.\n    ";
static const char __pyx_k_Represents_the_type_of_the_outp[] = "\n    Represents the type of the output coming from the interpreter.\n    ";
static const char __pyx_k_con_locals_Constraints___getite[] = "_con.<locals>.Constraints.__getitem__";
static const char __pyx_k_con_locals_Constraints___setite[] = "_con.<locals>.Constraints.__setitem__";
static const char __pyx_k_i_in_1__ncons__con_i_iis_non__c[] = "{i in 1.._ncons: _con[i].iis != 'non'} (_conname[i], _con[i].iis)";
static const char __pyx_k_i_in_1__nvars__var_i_iis_non__v[] = "{i in 1.._nvars: _var[i].iis != 'non'} (_varname[i], _var[i].iis)";
static const char __pyx_k_i_in_1__nvars__var_i_val_0__var[] = "{i in 1.._nvars: _var[i].val != 0} (_varname[i], _var[i].val)";
static const char __pyx_k_i_in_1__nvars__varname_i__var_i[] = "{i in 1.._nvars} (_varname[i], _var[i].val)";
static const char __pyx_k_obj_locals_Objectives___getitem[] = "_obj.<locals>.Objectives.__getitem__";
static const char __pyx_k_option_locals_Options___getitem[] = "_option.<locals>.Options.__getitem__";
static const char __pyx_k_option_locals_Options___setitem[] = "_option.<locals>.Options.__setitem__";
static const char __pyx_k_param_locals_Parameters___getit[] = "_param.<locals>.Parameters.__getitem__";
static const char __pyx_k_param_locals_Parameters___setit[] = "_param.<locals>.Parameters.__setitem__";
static const char __pyx_k_self__c_ampl_self__index_cannot[] = "self._c_ampl,self._index cannot be converted to a Python object for pickling";
static const char __pyx_k_self__df_cannot_be_converted_to[] = "self._df cannot be converted to a Python object for pickling";
static const char __pyx_k_AMPL_AMPL_INVALID_SUBSCRIPT_EXCE[] = "AMPL: AMPL_INVALID_SUBSCRIPT_EXCEPTION";
static const char __pyx_k_AMPL_AMPL_SYNTAX_ERROR_EXCEPTION[] = "AMPL: AMPL_SYNTAX_ERROR_EXCEPTION";
static const char __pyx_k_A_parameter_called_name_cannot_b[] = "A parameter called {name} cannot be found.";
static const char __pyx_k_A_set_called_name_cannot_be_foun[] = "A set called {name} cannot be found.";
static const char __pyx_k_A_variable_called_name_cannot_be[] = "A variable called {name} cannot be found.";
static const char __pyx_k_All_values_must_be_either_number[] = "All values must be either numbers or strings";
static const char __pyx_k_Dictionary_must_contain_either_a[] = "Dictionary must contain either all strings or all numbers";
static const char __pyx_k_Excepted_dictionary_of_set_membe[] = "Excepted dictionary of set members for each index.";
static const char __pyx_k_Incompatible_checksums_0x_x_vs_0[] = "Incompatible checksums (0x%x vs (0xe3b0c44, 0xda39a3e, 0xd41d8cd) = ())";
static const char __pyx_k_InstanceIterator___reduce_cython[] = "InstanceIterator.__reduce_cython__";
static const char __pyx_k_InstanceIterator___setstate_cyth[] = "InstanceIterator.__setstate_cython__";
static const char __pyx_k_MemberRangeIterator___reduce_cyt[] = "MemberRangeIterator.__reduce_cython__";
static const char __pyx_k_MemberRangeIterator___setstate_c[] = "MemberRangeIterator.__setstate_cython__";
static const char __pyx_k_Trying_to_assign_tuples_to_set_o[] = "Trying to assign tuples to set of arity ";
static const char __pyx_k_Unable_to_allocate_memory_for_ar[] = "Unable to allocate memory for array of strings";
static const char __pyx_k_cannot_convert_to_dictionary_wit[] = "cannot convert to dictionary without an index";
static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__";
static const char __pyx_k_self__c_ampl_cannot_be_converted[] = "self._c_ampl cannot be converted to a Python object for pickling";
static const char __pyx_k_self__c_ampl_self__index_self_be[] = "self._c_ampl,self._index,self.begin,self.end cannot be converted to a Python object for pickling";
static const char __pyx_k_self__c_ampl_self_begin_self_end[] = "self._c_ampl,self.begin,self.end cannot be converted to a Python object for pickling";
static const char __pyx_k_self_begin_self_end_self_env_c_s[] = "self.begin,self.end,self.env_c,self.iterator cannot be converted to a Python object for pickling";
/* #### Code section: decls ### */
static int __pyx_pf_7_amplpy_10Constraint___setitem__(struct __pyx_obj_7_amplpy_Constraint *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_7_amplpy_10Constraint_2is_logical(struct __pyx_obj_7_amplpy_Constraint *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_10Constraint_4drop(struct __pyx_obj_7_amplpy_Constraint *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_10Constraint_6restore(struct __pyx_obj_7_amplpy_Constraint *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_10Constraint_8body(struct __pyx_obj_7_amplpy_Constraint *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_10Constraint_10astatus(struct __pyx_obj_7_amplpy_Constraint *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_10Constraint_12defvar(struct __pyx_obj_7_amplpy_Constraint *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_10Constraint_14dinit(struct __pyx_obj_7_amplpy_Constraint *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_10Constraint_16dinit0(struct __pyx_obj_7_amplpy_Constraint *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_10Constraint_18dual(struct __pyx_obj_7_amplpy_Constraint *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_10Constraint_20lb(struct __pyx_obj_7_amplpy_Constraint *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_10Constraint_22ub(struct __pyx_obj_7_amplpy_Constraint *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_10Constraint_24lbs(struct __pyx_obj_7_amplpy_Constraint *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_10Constraint_26ubs(struct __pyx_obj_7_amplpy_Constraint *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_10Constraint_28ldual(struct __pyx_obj_7_amplpy_Constraint *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_10Constraint_30udual(struct __pyx_obj_7_amplpy_Constraint *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_10Constraint_32lslack(struct __pyx_obj_7_amplpy_Constraint *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_10Constraint_34uslack(struct __pyx_obj_7_amplpy_Constraint *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_10Constraint_36slack(struct __pyx_obj_7_amplpy_Constraint *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_10Constraint_38sstatus(struct __pyx_obj_7_amplpy_Constraint *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_10Constraint_40status(struct __pyx_obj_7_amplpy_Constraint *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_10Constraint_42set_dual(struct __pyx_obj_7_amplpy_Constraint *__pyx_v_self, PyObject *__pyx_v_dual); /* proto */
static PyObject *__pyx_pf_7_amplpy_10Constraint_44val(struct __pyx_obj_7_amplpy_Constraint *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_10Constraint_46__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7_amplpy_Constraint *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_10Constraint_48__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7_amplpy_Constraint *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7_amplpy_3Row___str__(struct __pyx_obj_7_amplpy_Row *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_3Row_2__iter__(struct __pyx_obj_7_amplpy_Row *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_3Row_4__getitem__(struct __pyx_obj_7_amplpy_Row *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_7_amplpy_3Row_6to_string(struct __pyx_obj_7_amplpy_Row *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_3Row_8__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7_amplpy_Row *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_3Row_10__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7_amplpy_Row *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7_amplpy_6Column___str__(struct __pyx_obj_7_amplpy_Column *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_6Column_2__iter__(struct __pyx_obj_7_amplpy_Column *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_6Column_4to_string(struct __pyx_obj_7_amplpy_Column *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_6Column_6to_list(struct __pyx_obj_7_amplpy_Column *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_6Column_8__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7_amplpy_Column *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_6Column_10__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7_amplpy_Column *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7_amplpy_9DataFrame___cinit__(struct __pyx_obj_7_amplpy_DataFrame *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_columns, CYTHON_UNUSED PyObject *__pyx_v_kwargs); /* proto */
static void __pyx_pf_7_amplpy_9DataFrame_2__dealloc__(struct __pyx_obj_7_amplpy_DataFrame *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_9DataFrame_4to_string(struct __pyx_obj_7_amplpy_DataFrame *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_9DataFrame_6__str__(struct __pyx_obj_7_amplpy_DataFrame *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_9DataFrame_8__iter___genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */
static PyObject *__pyx_pf_7_amplpy_9DataFrame_8__iter__(struct __pyx_obj_7_amplpy_DataFrame *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_9DataFrame_10_get_num_cols(struct __pyx_obj_7_amplpy_DataFrame *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_9DataFrame_12_get_num_rows(struct __pyx_obj_7_amplpy_DataFrame *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_9DataFrame_14_get_num_indices(struct __pyx_obj_7_amplpy_DataFrame *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_9DataFrame_16_add_row(struct __pyx_obj_7_amplpy_DataFrame *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_7_amplpy_9DataFrame_11_add_column_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */
static PyObject *__pyx_pf_7_amplpy_9DataFrame_11_add_column_3genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */
static PyObject *__pyx_pf_7_amplpy_9DataFrame_18_add_column(struct __pyx_obj_7_amplpy_DataFrame *__pyx_v_self, PyObject *__pyx_v_header, PyObject *__pyx_v_values); /* proto */
static PyObject *__pyx_pf_7_amplpy_9DataFrame_20_get_column(struct __pyx_obj_7_amplpy_DataFrame *__pyx_v_self, PyObject *__pyx_v_header); /* proto */
static PyObject *__pyx_pf_7_amplpy_9DataFrame_22_set_column(struct __pyx_obj_7_amplpy_DataFrame *__pyx_v_self, PyObject *__pyx_v_header, PyObject *__pyx_v_values); /* proto */
static PyObject *__pyx_pf_7_amplpy_9DataFrame_24_get_row(struct __pyx_obj_7_amplpy_DataFrame *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_7_amplpy_9DataFrame_26_get_row_by_index(struct __pyx_obj_7_amplpy_DataFrame *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
static PyObject *__pyx_pf_7_amplpy_9DataFrame_12_get_headers_genexpr(PyObject *__pyx_self, size_t __pyx_genexpr_arg_0); /* proto */
static PyObject *__pyx_pf_7_amplpy_9DataFrame_28_get_headers(struct __pyx_obj_7_amplpy_DataFrame *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_9DataFrame_11_set_values_conv_to_list(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_7_amplpy_9DataFrame_30_set_values(struct __pyx_obj_7_amplpy_DataFrame *__pyx_v_self, PyObject *__pyx_v_values); /* proto */
static PyObject *__pyx_pf_7_amplpy_9DataFrame_32to_dict(struct __pyx_obj_7_amplpy_DataFrame *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_9DataFrame_34to_list(struct __pyx_obj_7_amplpy_DataFrame *__pyx_v_self, PyObject *__pyx_v_skip_index); /* proto */
static PyObject *__pyx_pf_7_amplpy_9DataFrame_36to_pandas(struct __pyx_obj_7_amplpy_DataFrame *__pyx_v_self, PyObject *__pyx_v_multi_index); /* proto */
static PyObject *__pyx_pf_7_amplpy_9DataFrame_9from_dict_to_tuple(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_e); /* proto */
static PyObject *__pyx_pf_7_amplpy_9DataFrame_9from_dict_2genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */
static PyObject *__pyx_pf_7_amplpy_9DataFrame_9from_dict_5genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */
static PyObject *__pyx_pf_7_amplpy_9DataFrame_38from_dict(PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_dic, PyObject *__pyx_v_index_names, PyObject *__pyx_v_column_names); /* proto */
static PyObject *__pyx_pf_7_amplpy_9DataFrame_40from_pandas(PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_df, PyObject *__pyx_v_index_names, PyObject *__pyx_v_indexarity); /* proto */
static PyObject *__pyx_pf_7_amplpy_9DataFrame_42from_numpy(PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_data); /* proto */
static PyObject *__pyx_pf_7_amplpy_9DataFrame_44_from_data_frame_ref(PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_df_ref); /* proto */
static PyObject *__pyx_pf_7_amplpy_9DataFrame_46__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7_amplpy_DataFrame *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_9DataFrame_48__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7_amplpy_DataFrame *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static void __pyx_pf_7_amplpy_6Entity___dealloc__(struct __pyx_obj_7_amplpy_Entity *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_6Entity_2to_string(struct __pyx_obj_7_amplpy_Entity *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_6Entity_4__str__(struct __pyx_obj_7_amplpy_Entity *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_6Entity_6__iter__(struct __pyx_obj_7_amplpy_Entity *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_6Entity_8__getitem__(struct __pyx_obj_7_amplpy_Entity *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
static PyObject *__pyx_pf_7_amplpy_6Entity_10get(struct __pyx_obj_7_amplpy_Entity *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
static PyObject *__pyx_pf_7_amplpy_6Entity_12find(struct __pyx_obj_7_amplpy_Entity *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
static PyObject *__pyx_pf_7_amplpy_6Entity_14instances(struct __pyx_obj_7_amplpy_Entity *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_6Entity_16name(struct __pyx_obj_7_amplpy_Entity *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_6Entity_18indexarity(struct __pyx_obj_7_amplpy_Entity *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_6Entity_20is_scalar(struct __pyx_obj_7_amplpy_Entity *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_6Entity_22num_instances(struct __pyx_obj_7_amplpy_Entity *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_6Entity_24get_indexing_sets(struct __pyx_obj_7_amplpy_Entity *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_6Entity_26xref(struct __pyx_obj_7_amplpy_Entity *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_6Entity_28get_values(struct __pyx_obj_7_amplpy_Entity *__pyx_v_self, PyObject *__pyx_v_suffixes); /* proto */
static PyObject *__pyx_pf_7_amplpy_6Entity_30to_pandas(struct __pyx_obj_7_amplpy_Entity *__pyx_v_self, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_7_amplpy_6Entity_32to_dict(struct __pyx_obj_7_amplpy_Entity *__pyx_v_self, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_7_amplpy_6Entity_34to_list(struct __pyx_obj_7_amplpy_Entity *__pyx_v_self, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_7_amplpy_6Entity_36set_values(struct __pyx_obj_7_amplpy_Entity *__pyx_v_self, PyObject *__pyx_v_data); /* proto */
static PyObject *__pyx_pf_7_amplpy_6Entity_38__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7_amplpy_Entity *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_6Entity_40__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7_amplpy_Entity *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7_amplpy_11Environment___cinit__(struct __pyx_obj_7_amplpy_Environment *__pyx_v_self, PyObject *__pyx_v_binary_directory, PyObject *__pyx_v_binary_name); /* proto */
static void __pyx_pf_7_amplpy_11Environment_2__dealloc__(struct __pyx_obj_7_amplpy_Environment *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_11Environment_4__str__(struct __pyx_obj_7_amplpy_Environment *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_11Environment_6__iter__(struct __pyx_obj_7_amplpy_Environment *__pyx_v_self); /* proto */
static int __pyx_pf_7_amplpy_11Environment_8__setitem__(struct __pyx_obj_7_amplpy_Environment *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_7_amplpy_11Environment_10__getitem__(struct __pyx_obj_7_amplpy_Environment *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_7_amplpy_11Environment_12to_string(struct __pyx_obj_7_amplpy_Environment *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_11Environment_14set_bin_dir(struct __pyx_obj_7_amplpy_Environment *__pyx_v_self, PyObject *__pyx_v_binary_directory); /* proto */
static PyObject *__pyx_pf_7_amplpy_11Environment_16get_bin_dir(struct __pyx_obj_7_amplpy_Environment *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_11Environment_18set_bin_name(struct __pyx_obj_7_amplpy_Environment *__pyx_v_self, PyObject *__pyx_v_binary_name); /* proto */
static PyObject *__pyx_pf_7_amplpy_11Environment_20get_bin_name(struct __pyx_obj_7_amplpy_Environment *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_11Environment_22__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7_amplpy_Environment *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_11Environment_24__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7_amplpy_Environment *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7_amplpy_display_error_message(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_exception, PyObject *__pyx_v_error); /* proto */
static PyObject *__pyx_pf_7_amplpy_12ErrorHandler_error(CYTHON_UNUSED struct __pyx_obj_7_amplpy_ErrorHandler *__pyx_v_self, PyObject *__pyx_v_exception); /* proto */
static PyObject *__pyx_pf_7_amplpy_12ErrorHandler_2warning(CYTHON_UNUSED struct __pyx_obj_7_amplpy_ErrorHandler *__pyx_v_self, PyObject *__pyx_v_exception); /* proto */
static PyObject *__pyx_pf_7_amplpy_12ErrorHandler_4__reduce_cython__(struct __pyx_obj_7_amplpy_ErrorHandler *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_12ErrorHandler_6__setstate_cython__(struct __pyx_obj_7_amplpy_ErrorHandler *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7_amplpy_13AMPLException___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_source_name, PyObject *__pyx_v_line_number, PyObject *__pyx_v_offset, PyObject *__pyx_v_message); /* proto */
static PyObject *__pyx_pf_7_amplpy_13AMPLException_2get_source_name(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_13AMPLException_4get_line_number(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_13AMPLException_6get_offset(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_13AMPLException_8get_message(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_13AMPLException_10__str__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_11EnvIterator___iter__(struct __pyx_obj_7_amplpy_EnvIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_11EnvIterator_2__next__(struct __pyx_obj_7_amplpy_EnvIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_11EnvIterator_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7_amplpy_EnvIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_11EnvIterator_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7_amplpy_EnvIterator *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static void __pyx_pf_7_amplpy_9EntityMap___dealloc__(struct __pyx_obj_7_amplpy_EntityMap *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_9EntityMap_2__iter__(struct __pyx_obj_7_amplpy_EntityMap *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_9EntityMap_4__next__(struct __pyx_obj_7_amplpy_EntityMap *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_9EntityMap_6__getitem__(struct __pyx_obj_7_amplpy_EntityMap *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_7_amplpy_9EntityMap_8size(struct __pyx_obj_7_amplpy_EntityMap *__pyx_v_self); /* proto */
static Py_ssize_t __pyx_pf_7_amplpy_9EntityMap_10__len__(struct __pyx_obj_7_amplpy_EntityMap *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_9EntityMap_12__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7_amplpy_EntityMap *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_9EntityMap_14__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7_amplpy_EntityMap *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static void __pyx_pf_7_amplpy_16InstanceIterator___dealloc__(struct __pyx_obj_7_amplpy_InstanceIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_16InstanceIterator_2__iter__(struct __pyx_obj_7_amplpy_InstanceIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_16InstanceIterator_4__next__(struct __pyx_obj_7_amplpy_InstanceIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_16InstanceIterator_6__getitem__(struct __pyx_obj_7_amplpy_InstanceIterator *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_7_amplpy_16InstanceIterator_8size(struct __pyx_obj_7_amplpy_InstanceIterator *__pyx_v_self); /* proto */
static Py_ssize_t __pyx_pf_7_amplpy_16InstanceIterator_10__len__(struct __pyx_obj_7_amplpy_InstanceIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_16InstanceIterator_12__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7_amplpy_InstanceIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_16InstanceIterator_14__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7_amplpy_InstanceIterator *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static void __pyx_pf_7_amplpy_19MemberRangeIterator___dealloc__(struct __pyx_obj_7_amplpy_MemberRangeIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_19MemberRangeIterator_2size(struct __pyx_obj_7_amplpy_MemberRangeIterator *__pyx_v_self); /* proto */
static Py_ssize_t __pyx_pf_7_amplpy_19MemberRangeIterator_4__len__(struct __pyx_obj_7_amplpy_MemberRangeIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_19MemberRangeIterator_6__iter__(struct __pyx_obj_7_amplpy_MemberRangeIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_19MemberRangeIterator_8__next__(struct __pyx_obj_7_amplpy_MemberRangeIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_19MemberRangeIterator_10__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7_amplpy_MemberRangeIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_19MemberRangeIterator_12__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7_amplpy_MemberRangeIterator *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7_amplpy_11ColIterator___iter__(struct __pyx_obj_7_amplpy_ColIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_11ColIterator_2__next__(struct __pyx_obj_7_amplpy_ColIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_11ColIterator_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7_amplpy_ColIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_11ColIterator_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7_amplpy_ColIterator *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7_amplpy_11RowIterator___iter__(struct __pyx_obj_7_amplpy_RowIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_11RowIterator_2__next__(struct __pyx_obj_7_amplpy_RowIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_11RowIterator_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7_amplpy_RowIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_11RowIterator_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7_amplpy_RowIterator *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7_amplpy_9Objective_value(struct __pyx_obj_7_amplpy_Objective *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_9Objective_2astatus(struct __pyx_obj_7_amplpy_Objective *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_9Objective_4sstatus(struct __pyx_obj_7_amplpy_Objective *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_9Objective_6exitcode(struct __pyx_obj_7_amplpy_Objective *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_9Objective_8message(struct __pyx_obj_7_amplpy_Objective *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_9Objective_10result(struct __pyx_obj_7_amplpy_Objective *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_9Objective_12drop(struct __pyx_obj_7_amplpy_Objective *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_9Objective_14restore(struct __pyx_obj_7_amplpy_Objective *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_9Objective_16minimization(struct __pyx_obj_7_amplpy_Objective *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_9Objective_18__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7_amplpy_Objective *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_9Objective_20__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7_amplpy_Objective *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7_amplpy_13OutputHandler_output(CYTHON_UNUSED struct __pyx_obj_7_amplpy_OutputHandler *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_kind, PyObject *__pyx_v_msg); /* proto */
static PyObject *__pyx_pf_7_amplpy_13OutputHandler_2__reduce_cython__(struct __pyx_obj_7_amplpy_OutputHandler *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_13OutputHandler_4__setstate_cython__(struct __pyx_obj_7_amplpy_OutputHandler *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7_amplpy_9Parameter___setitem__(struct __pyx_obj_7_amplpy_Parameter *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_7_amplpy_9Parameter_2is_symbolic(struct __pyx_obj_7_amplpy_Parameter *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_9Parameter_4has_default(struct __pyx_obj_7_amplpy_Parameter *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_9Parameter_6__getitem__(struct __pyx_obj_7_amplpy_Parameter *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
static PyObject *__pyx_pf_7_amplpy_9Parameter_8value(struct __pyx_obj_7_amplpy_Parameter *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_9Parameter_10set(struct __pyx_obj_7_amplpy_Parameter *__pyx_v_self, PyObject *__pyx_v_args); /* proto */
static PyObject *__pyx_pf_7_amplpy_9Parameter_10set_values_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */
static PyObject *__pyx_pf_7_amplpy_9Parameter_10set_values_3genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */
static PyObject *__pyx_pf_7_amplpy_9Parameter_12set_values(struct __pyx_obj_7_amplpy_Parameter *__pyx_v_self, PyObject *__pyx_v_values); /* proto */
static PyObject *__pyx_pf_7_amplpy_9Parameter_14__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7_amplpy_Parameter *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_9Parameter_16__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7_amplpy_Parameter *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7_amplpy_3Set___setitem__(struct __pyx_obj_7_amplpy_Set *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_7_amplpy_3Set_2__iter__(struct __pyx_obj_7_amplpy_Set *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_3Set_4instances(struct __pyx_obj_7_amplpy_Set *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_3Set_6arity(struct __pyx_obj_7_amplpy_Set *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_3Set_8get_values(struct __pyx_obj_7_amplpy_Set *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_3Set_10members(struct __pyx_obj_7_amplpy_Set *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_3Set_12size(struct __pyx_obj_7_amplpy_Set *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_3Set_14contains(struct __pyx_obj_7_amplpy_Set *__pyx_v_self, PyObject *__pyx_v_t); /* proto */
static PyObject *__pyx_pf_7_amplpy_3Set_10set_values_cast_value(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_7_amplpy_3Set_10set_values_2cast_row(PyObject *__pyx_self, PyObject *__pyx_v_row); /* proto */
static PyObject *__pyx_pf_7_amplpy_3Set_10set_values_4genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */
static PyObject *__pyx_pf_7_amplpy_3Set_10set_values_7genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */
static PyObject *__pyx_pf_7_amplpy_3Set_10set_values_10genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */
static PyObject *__pyx_pf_7_amplpy_3Set_10set_values_13genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */
static PyObject *__pyx_pf_7_amplpy_3Set_16set_values(struct __pyx_obj_7_amplpy_Set *__pyx_v_self, PyObject *__pyx_v_values); /* proto */
static PyObject *__pyx_pf_7_amplpy_3Set_18__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7_amplpy_Set *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_3Set_20__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7_amplpy_Set *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7_amplpy_8Variable___setitem__(struct __pyx_obj_7_amplpy_Variable *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_7_amplpy_8Variable_2value(struct __pyx_obj_7_amplpy_Variable *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_8Variable_4fix(struct __pyx_obj_7_amplpy_Variable *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_7_amplpy_8Variable_6unfix(struct __pyx_obj_7_amplpy_Variable *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_8Variable_8set_value(struct __pyx_obj_7_amplpy_Variable *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_7_amplpy_8Variable_10astatus(struct __pyx_obj_7_amplpy_Variable *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_8Variable_12defeqn(struct __pyx_obj_7_amplpy_Variable *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_8Variable_14dual(struct __pyx_obj_7_amplpy_Variable *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_8Variable_16init(struct __pyx_obj_7_amplpy_Variable *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_8Variable_18init0(struct __pyx_obj_7_amplpy_Variable *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_8Variable_20lb(struct __pyx_obj_7_amplpy_Variable *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_8Variable_22ub(struct __pyx_obj_7_amplpy_Variable *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_8Variable_24lb0(struct __pyx_obj_7_amplpy_Variable *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_8Variable_26ub0(struct __pyx_obj_7_amplpy_Variable *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_8Variable_28lb1(struct __pyx_obj_7_amplpy_Variable *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_8Variable_30ub1(struct __pyx_obj_7_amplpy_Variable *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_8Variable_32lb2(struct __pyx_obj_7_amplpy_Variable *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_8Variable_34ub2(struct __pyx_obj_7_amplpy_Variable *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_8Variable_36lrc(struct __pyx_obj_7_amplpy_Variable *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_8Variable_38urc(struct __pyx_obj_7_amplpy_Variable *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_8Variable_40lslack(struct __pyx_obj_7_amplpy_Variable *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_8Variable_42uslack(struct __pyx_obj_7_amplpy_Variable *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_8Variable_44rc(struct __pyx_obj_7_amplpy_Variable *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_8Variable_46slack(struct __pyx_obj_7_amplpy_Variable *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_8Variable_48sstatus(struct __pyx_obj_7_amplpy_Variable *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_8Variable_50status(struct __pyx_obj_7_amplpy_Variable *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_8Variable_52__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7_amplpy_Variable *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_8Variable_54__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7_amplpy_Variable *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7_amplpy_2nested_dict_of_suffixes(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_lst); /* proto */
static int __pyx_pf_7_amplpy_4AMPL___init__(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self, PyObject *__pyx_v_environment); /* proto */
static void __pyx_pf_7_amplpy_4AMPL_2__dealloc__(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_4AMPL_4get_data(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self, PyObject *__pyx_v_statements); /* proto */
static PyObject *__pyx_pf_7_amplpy_4AMPL_6get_entity(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_7_amplpy_4AMPL_8get_variable(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_7_amplpy_4AMPL_10get_constraint(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_7_amplpy_4AMPL_12get_objective(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_7_amplpy_4AMPL_14get_set(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_7_amplpy_4AMPL_16get_parameter(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_7_amplpy_4AMPL_18eval(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self, PyObject *__pyx_v_statements); /* proto */
static PyObject *__pyx_pf_7_amplpy_4AMPL_20get_output(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self, PyObject *__pyx_v_statements); /* proto */
static PyObject *__pyx_pf_7_amplpy_4AMPL_22reset(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_4AMPL_24close(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_4AMPL_26is_running(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_4AMPL_28solve(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self, PyObject *__pyx_v_problem, PyObject *__pyx_v_solver, PyObject *__pyx_v_verbose, PyObject *__pyx_v_return_output, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_7_amplpy_4AMPL_30cd(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self, PyObject *__pyx_v_path); /* proto */
static PyObject *__pyx_pf_7_amplpy_4AMPL_32set_option(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_7_amplpy_4AMPL_34get_option(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_7_amplpy_4AMPL_36read(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self, PyObject *__pyx_v_filename); /* proto */
static PyObject *__pyx_pf_7_amplpy_4AMPL_38read_data(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self, PyObject *__pyx_v_filename); /* proto */
static PyObject *__pyx_pf_7_amplpy_4AMPL_40get_value(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self, PyObject *__pyx_v_scalar_expression); /* proto */
static PyObject *__pyx_pf_7_amplpy_4AMPL_42set_data(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self, PyObject *__pyx_v_data, PyObject *__pyx_v_set_name); /* proto */
static PyObject *__pyx_pf_7_amplpy_4AMPL_44read_table(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self, PyObject *__pyx_v_table_name); /* proto */
static PyObject *__pyx_pf_7_amplpy_4AMPL_46write_table(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self, PyObject *__pyx_v_table_name); /* proto */
static PyObject *__pyx_pf_7_amplpy_4AMPL_48display(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self, PyObject *__pyx_v_ampl_expressions); /* proto */
static PyObject *__pyx_pf_7_amplpy_4AMPL_50set_output_handler(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self, PyObject *__pyx_v_output_handler); /* proto */
static PyObject *__pyx_pf_7_amplpy_4AMPL_52set_error_handler(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self, PyObject *__pyx_v_error_handler); /* proto */
static PyObject *__pyx_pf_7_amplpy_4AMPL_54get_output_handler(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_4AMPL_56get_error_handler(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_4AMPL_58get_variables(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_4AMPL_60get_constraints(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_4AMPL_62get_objectives(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_4AMPL_64get_sets(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_4AMPL_66get_parameters(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_4AMPL_68get_current_objective(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_4AMPL_4_var_9Variables___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_ampl); /* proto */
static PyObject *__pyx_pf_7_amplpy_4AMPL_4_var_9Variables_2__getitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_7_amplpy_4AMPL_4_var_9Variables_4__setitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_7_amplpy_4AMPL_4_var_9Variables_6__iter__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_4AMPL_70_var(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_4AMPL_4_con_11Constraints___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_ampl); /* proto */
static PyObject *__pyx_pf_7_amplpy_4AMPL_4_con_11Constraints_2__getitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_7_amplpy_4AMPL_4_con_11Constraints_4__setitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_7_amplpy_4AMPL_4_con_11Constraints_6__iter__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_4AMPL_72_con(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_4AMPL_4_obj_10Objectives___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_ampl); /* proto */
static PyObject *__pyx_pf_7_amplpy_4AMPL_4_obj_10Objectives_2__getitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_7_amplpy_4AMPL_4_obj_10Objectives_4__iter__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_4AMPL_74_obj(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_4AMPL_4_set_4Sets___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_ampl); /* proto */
static PyObject *__pyx_pf_7_amplpy_4AMPL_4_set_4Sets_2__getitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_7_amplpy_4AMPL_4_set_4Sets_4__setitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_values); /* proto */
static PyObject *__pyx_pf_7_amplpy_4AMPL_4_set_4Sets_6__iter__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_4AMPL_76_set(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_4AMPL_6_param_10Parameters___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_ampl); /* proto */
static PyObject *__pyx_pf_7_amplpy_4AMPL_6_param_10Parameters_2__getitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_7_amplpy_4AMPL_6_param_10Parameters_4__setitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_7_amplpy_4AMPL_6_param_10Parameters_6__iter__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_4AMPL_78_param(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_4AMPL_7_option_7Options___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_ampl); /* proto */
static PyObject *__pyx_pf_7_amplpy_4AMPL_7_option_7Options_2__getitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_7_amplpy_4AMPL_7_option_7Options_4__setitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_7_amplpy_4AMPL_80_option(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_4AMPL_82export_model(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self, PyObject *__pyx_v_filename); /* proto */
static PyObject *__pyx_pf_7_amplpy_4AMPL_84export_data(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self, PyObject *__pyx_v_filename); /* proto */
static PyObject *__pyx_pf_7_amplpy_4AMPL_86snapshot(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self, PyObject *__pyx_v_filename, PyObject *__pyx_v_model, PyObject *__pyx_v_data, PyObject *__pyx_v_options); /* proto */
static PyObject *__pyx_pf_7_amplpy_4AMPL_88write(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self, PyObject *__pyx_v_filename, PyObject *__pyx_v_auxfiles); /* proto */
static PyObject *__pyx_pf_7_amplpy_4AMPL_12solve_result___get__(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_4AMPL_16solve_result_num___get__(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_4AMPL_90get_iis(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self, PyObject *__pyx_v_flat); /* proto */
static PyObject *__pyx_pf_7_amplpy_4AMPL_92get_solution(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self, PyObject *__pyx_v_flat, PyObject *__pyx_v_zeros); /* proto */
static PyObject *__pyx_pf_7_amplpy_4AMPL_94_start_recording(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self, PyObject *__pyx_v_filename); /* proto */
static PyObject *__pyx_pf_7_amplpy_4AMPL_96_stop_recording(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_4AMPL_98_load_session(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self, PyObject *__pyx_v_filename); /* proto */
static PyObject *__pyx_pf_7_amplpy_4AMPL_100__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7_amplpy_4AMPL_102__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7_amplpy_4__pyx_unpickle_ErrorHandler(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7_amplpy_6__pyx_unpickle_OutputHandler(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_tp_new_7_amplpy_Row(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7_amplpy_Column(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7_amplpy_DataFrame(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7_amplpy_Entity(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7_amplpy_Constraint(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7_amplpy_Environment(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7_amplpy_ErrorHandler(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7_amplpy_EnvIterator(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7_amplpy_EntityMap(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7_amplpy_InstanceIterator(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7_amplpy_MemberRangeIterator(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7_amplpy_ColIterator(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7_amplpy_RowIterator(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7_amplpy_Objective(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7_amplpy_OutputHandler(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7_amplpy_Parameter(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7_amplpy_Set(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7_amplpy_Variable(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7_amplpy_AMPL(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7_amplpy___pyx_scope_struct____iter__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7_amplpy___pyx_scope_struct_1_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7_amplpy___pyx_scope_struct_2_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7_amplpy___pyx_scope_struct_3_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7_amplpy___pyx_scope_struct_4__get_headers(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7_amplpy___pyx_scope_struct_5_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7_amplpy___pyx_scope_struct_6_from_dict(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7_amplpy___pyx_scope_struct_7_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7_amplpy___pyx_scope_struct_8_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7_amplpy___pyx_scope_struct_9_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7_amplpy___pyx_scope_struct_10_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7_amplpy___pyx_scope_struct_11_set_values(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7_amplpy___pyx_scope_struct_12_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7_amplpy___pyx_scope_struct_13_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7_amplpy___pyx_scope_struct_14_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7_amplpy___pyx_scope_struct_15_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
/* #### Code section: late_includes ### */
/* #### Code section: module_state ### */
typedef struct {
  PyObject *__pyx_d;
  PyObject *__pyx_b;
  PyObject *__pyx_cython_runtime;
  PyObject *__pyx_empty_tuple;
  PyObject *__pyx_empty_bytes;
  PyObject *__pyx_empty_unicode;
  #ifdef __Pyx_CyFunction_USED
  PyTypeObject *__pyx_CyFunctionType;
  #endif
  #ifdef __Pyx_FusedFunction_USED
  PyTypeObject *__pyx_FusedFunctionType;
  #endif
  #ifdef __Pyx_Generator_USED
  PyTypeObject *__pyx_GeneratorType;
  #endif
  #ifdef __Pyx_IterableCoroutine_USED
  PyTypeObject *__pyx_IterableCoroutineType;
  #endif
  #ifdef __Pyx_Coroutine_USED
  PyTypeObject *__pyx_CoroutineAwaitType;
  #endif
  #ifdef __Pyx_Coroutine_USED
  PyTypeObject *__pyx_CoroutineType;
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  PyTypeObject *__pyx_ptype_7cpython_4bool_bool;
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  PyTypeObject *__pyx_ptype_7cpython_4type_type;
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  PyTypeObject *__pyx_ptype_7cpython_7complex_complex;
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  PyObject *__pyx_type_7_amplpy_Row;
  PyObject *__pyx_type_7_amplpy_Column;
  PyObject *__pyx_type_7_amplpy_DataFrame;
  PyObject *__pyx_type_7_amplpy_Entity;
  PyObject *__pyx_type_7_amplpy_Constraint;
  PyObject *__pyx_type_7_amplpy_Environment;
  PyObject *__pyx_type_7_amplpy_ErrorHandler;
  PyObject *__pyx_type_7_amplpy_EnvIterator;
  PyObject *__pyx_type_7_amplpy_EntityMap;
  PyObject *__pyx_type_7_amplpy_InstanceIterator;
  PyObject *__pyx_type_7_amplpy_MemberRangeIterator;
  PyObject *__pyx_type_7_amplpy_ColIterator;
  PyObject *__pyx_type_7_amplpy_RowIterator;
  PyObject *__pyx_type_7_amplpy_Objective;
  PyObject *__pyx_type_7_amplpy_OutputHandler;
  PyObject *__pyx_type_7_amplpy_Parameter;
  PyObject *__pyx_type_7_amplpy_Set;
  PyObject *__pyx_type_7_amplpy_Variable;
  PyObject *__pyx_type_7_amplpy_AMPL;
  PyObject *__pyx_type_7_amplpy___pyx_scope_struct____iter__;
  PyObject *__pyx_type_7_amplpy___pyx_scope_struct_1_genexpr;
  PyObject *__pyx_type_7_amplpy___pyx_scope_struct_2_genexpr;
  PyObject *__pyx_type_7_amplpy___pyx_scope_struct_3_genexpr;
  PyObject *__pyx_type_7_amplpy___pyx_scope_struct_4__get_headers;
  PyObject *__pyx_type_7_amplpy___pyx_scope_struct_5_genexpr;
  PyObject *__pyx_type_7_amplpy___pyx_scope_struct_6_from_dict;
  PyObject *__pyx_type_7_amplpy___pyx_scope_struct_7_genexpr;
  PyObject *__pyx_type_7_amplpy___pyx_scope_struct_8_genexpr;
  PyObject *__pyx_type_7_amplpy___pyx_scope_struct_9_genexpr;
  PyObject *__pyx_type_7_amplpy___pyx_scope_struct_10_genexpr;
  PyObject *__pyx_type_7_amplpy___pyx_scope_struct_11_set_values;
  PyObject *__pyx_type_7_amplpy___pyx_scope_struct_12_genexpr;
  PyObject *__pyx_type_7_amplpy___pyx_scope_struct_13_genexpr;
  PyObject *__pyx_type_7_amplpy___pyx_scope_struct_14_genexpr;
  PyObject *__pyx_type_7_amplpy___pyx_scope_struct_15_genexpr;
  #endif
  PyTypeObject *__pyx_ptype_7_amplpy_Row;
  PyTypeObject *__pyx_ptype_7_amplpy_Column;
  PyTypeObject *__pyx_ptype_7_amplpy_DataFrame;
  PyTypeObject *__pyx_ptype_7_amplpy_Entity;
  PyTypeObject *__pyx_ptype_7_amplpy_Constraint;
  PyTypeObject *__pyx_ptype_7_amplpy_Environment;
  PyTypeObject *__pyx_ptype_7_amplpy_ErrorHandler;
  PyTypeObject *__pyx_ptype_7_amplpy_EnvIterator;
  PyTypeObject *__pyx_ptype_7_amplpy_EntityMap;
  PyTypeObject *__pyx_ptype_7_amplpy_InstanceIterator;
  PyTypeObject *__pyx_ptype_7_amplpy_MemberRangeIterator;
  PyTypeObject *__pyx_ptype_7_amplpy_ColIterator;
  PyTypeObject *__pyx_ptype_7_amplpy_RowIterator;
  PyTypeObject *__pyx_ptype_7_amplpy_Objective;
  PyTypeObject *__pyx_ptype_7_amplpy_OutputHandler;
  PyTypeObject *__pyx_ptype_7_amplpy_Parameter;
  PyTypeObject *__pyx_ptype_7_amplpy_Set;
  PyTypeObject *__pyx_ptype_7_amplpy_Variable;
  PyTypeObject *__pyx_ptype_7_amplpy_AMPL;
  PyTypeObject *__pyx_ptype_7_amplpy___pyx_scope_struct____iter__;
  PyTypeObject *__pyx_ptype_7_amplpy___pyx_scope_struct_1_genexpr;
  PyTypeObject *__pyx_ptype_7_amplpy___pyx_scope_struct_2_genexpr;
  PyTypeObject *__pyx_ptype_7_amplpy___pyx_scope_struct_3_genexpr;
  PyTypeObject *__pyx_ptype_7_amplpy___pyx_scope_struct_4__get_headers;
  PyTypeObject *__pyx_ptype_7_amplpy___pyx_scope_struct_5_genexpr;
  PyTypeObject *__pyx_ptype_7_amplpy___pyx_scope_struct_6_from_dict;
  PyTypeObject *__pyx_ptype_7_amplpy___pyx_scope_struct_7_genexpr;
  PyTypeObject *__pyx_ptype_7_amplpy___pyx_scope_struct_8_genexpr;
  PyTypeObject *__pyx_ptype_7_amplpy___pyx_scope_struct_9_genexpr;
  PyTypeObject *__pyx_ptype_7_amplpy___pyx_scope_struct_10_genexpr;
  PyTypeObject *__pyx_ptype_7_amplpy___pyx_scope_struct_11_set_values;
  PyTypeObject *__pyx_ptype_7_amplpy___pyx_scope_struct_12_genexpr;
  PyTypeObject *__pyx_ptype_7_amplpy___pyx_scope_struct_13_genexpr;
  PyTypeObject *__pyx_ptype_7_amplpy___pyx_scope_struct_14_genexpr;
  PyTypeObject *__pyx_ptype_7_amplpy___pyx_scope_struct_15_genexpr;
  PyObject *__pyx_kp_u_75;
  PyObject *__pyx_n_s_AMPL;
  PyObject *__pyx_n_s_AMPLException;
  PyObject *__pyx_n_s_AMPLException___init;
  PyObject *__pyx_n_s_AMPLException___str;
  PyObject *__pyx_n_s_AMPLException_get_line_number;
  PyObject *__pyx_n_s_AMPLException_get_message;
  PyObject *__pyx_n_s_AMPLException_get_offset;
  PyObject *__pyx_n_s_AMPLException_get_source_name;
  PyObject *__pyx_kp_u_AMPL_AMPL_INVALID_SUBSCRIPT_EXCE;
  PyObject *__pyx_kp_u_AMPL_AMPL_NO_DATA_EXCEPTION;
  PyObject *__pyx_kp_u_AMPL_AMPL_SYNTAX_ERROR_EXCEPTION;
  PyObject *__pyx_n_s_AMPL_NOT_FOUND_MESSAGE;
  PyObject *__pyx_n_s_AMPL___reduce_cython;
  PyObject *__pyx_n_s_AMPL___setstate_cython;
  PyObject *__pyx_n_s_AMPL__con;
  PyObject *__pyx_n_s_AMPL__load_session;
  PyObject *__pyx_n_s_AMPL__obj;
  PyObject *__pyx_n_s_AMPL__option;
  PyObject *__pyx_n_s_AMPL__param;
  PyObject *__pyx_n_s_AMPL__set;
  PyObject *__pyx_n_s_AMPL__start_recording;
  PyObject *__pyx_n_s_AMPL__stop_recording;
  PyObject *__pyx_n_s_AMPL__var;
  PyObject *__pyx_n_s_AMPL_cd;
  PyObject *__pyx_n_s_AMPL_close;
  PyObject *__pyx_kp_u_AMPL_could_not_be_started;
  PyObject *__pyx_n_s_AMPL_display;
  PyObject *__pyx_n_s_AMPL_eval;
  PyObject *__pyx_n_s_AMPL_export_data;
  PyObject *__pyx_n_s_AMPL_export_model;
  PyObject *__pyx_n_s_AMPL_get_constraint;
  PyObject *__pyx_n_s_AMPL_get_constraints;
  PyObject *__pyx_n_s_AMPL_get_current_objective;
  PyObject *__pyx_n_s_AMPL_get_data;
  PyObject *__pyx_n_s_AMPL_get_entity;
  PyObject *__pyx_n_s_AMPL_get_error_handler;
  PyObject *__pyx_n_s_AMPL_get_iis;
  PyObject *__pyx_n_s_AMPL_get_objective;
  PyObject *__pyx_n_s_AMPL_get_objectives;
  PyObject *__pyx_n_s_AMPL_get_option;
  PyObject *__pyx_n_s_AMPL_get_output;
  PyObject *__pyx_n_s_AMPL_get_output_handler;
  PyObject *__pyx_n_s_AMPL_get_parameter;
  PyObject *__pyx_n_s_AMPL_get_parameters;
  PyObject *__pyx_n_s_AMPL_get_set;
  PyObject *__pyx_n_s_AMPL_get_sets;
  PyObject *__pyx_n_s_AMPL_get_solution;
  PyObject *__pyx_n_s_AMPL_get_value;
  PyObject *__pyx_n_s_AMPL_get_variable;
  PyObject *__pyx_n_s_AMPL_get_variables;
  PyObject *__pyx_n_s_AMPL_is_running;
  PyObject *__pyx_n_s_AMPL_read;
  PyObject *__pyx_n_s_AMPL_read_data;
  PyObject *__pyx_n_s_AMPL_read_table;
  PyObject *__pyx_n_s_AMPL_reset;
  PyObject *__pyx_n_s_AMPL_set_data;
  PyObject *__pyx_n_s_AMPL_set_error_handler;
  PyObject *__pyx_n_s_AMPL_set_option;
  PyObject *__pyx_n_s_AMPL_set_output_handler;
  PyObject *__pyx_n_s_AMPL_snapshot;
  PyObject *__pyx_n_s_AMPL_solve;
  PyObject *__pyx_kp_u_AMPL_unknown_return_code;
  PyObject *__pyx_n_s_AMPL_write;
  PyObject *__pyx_n_s_AMPL_write_table;
  PyObject *__pyx_kp_u_A_constraint_called_name_cannot;
  PyObject *__pyx_kp_u_A_parameter_called_name_cannot_b;
  PyObject *__pyx_kp_u_A_set_called_name_cannot_be_foun;
  PyObject *__pyx_kp_u_A_variable_called_name_cannot_be;
  PyObject *__pyx_kp_u_All_values_must_be_either_number;
  PyObject *__pyx_kp_u_An_objective_called_name_cannot;
  PyObject *__pyx_n_s_AssertionError;
  PyObject *__pyx_n_s_AttributeError;
  PyObject *__pyx_n_s_BREAK;
  PyObject *__pyx_n_s_BREAKPOINT;
  PyObject *__pyx_n_s_CALL;
  PyObject *__pyx_n_s_CD;
  PyObject *__pyx_n_s_CHECK;
  PyObject *__pyx_n_s_CLOSE;
  PyObject *__pyx_n_s_COMMANDS;
  PyObject *__pyx_n_s_CONTINUE;
  PyObject *__pyx_n_s_ColIterator;
  PyObject *__pyx_n_s_ColIterator___reduce_cython;
  PyObject *__pyx_n_s_ColIterator___setstate_cython;
  PyObject *__pyx_n_s_Column;
  PyObject *__pyx_n_s_Column___reduce_cython;
  PyObject *__pyx_n_s_Column___setstate_cython;
  PyObject *__pyx_n_s_Column_to_list;
  PyObject *__pyx_n_s_Column_to_string;
  PyObject *__pyx_n_s_Constraint;
  PyObject *__pyx_n_s_Constraint___reduce_cython;
  PyObject *__pyx_n_s_Constraint___setstate_cython;
  PyObject *__pyx_n_s_Constraint_astatus;
  PyObject *__pyx_n_s_Constraint_body;
  PyObject *__pyx_n_s_Constraint_defvar;
  PyObject *__pyx_n_s_Constraint_dinit;
  PyObject *__pyx_n_s_Constraint_dinit0;
  PyObject *__pyx_n_s_Constraint_drop;
  PyObject *__pyx_n_s_Constraint_dual;
  PyObject *__pyx_n_s_Constraint_is_logical;
  PyObject *__pyx_n_s_Constraint_lb;
  PyObject *__pyx_n_s_Constraint_lbs;
  PyObject *__pyx_n_s_Constraint_ldual;
  PyObject *__pyx_n_s_Constraint_lslack;
  PyObject *__pyx_n_s_Constraint_restore;
  PyObject *__pyx_n_s_Constraint_set_dual;
  PyObject *__pyx_n_s_Constraint_slack;
  PyObject *__pyx_n_s_Constraint_sstatus;
  PyObject *__pyx_n_s_Constraint_status;
  PyObject *__pyx_n_s_Constraint_ub;
  PyObject *__pyx_n_s_Constraint_ubs;
  PyObject *__pyx_n_s_Constraint_udual;
  PyObject *__pyx_n_s_Constraint_uslack;
  PyObject *__pyx_n_s_Constraint_val;
  PyObject *__pyx_n_s_Constraints;
  PyObject *__pyx_n_s_DATA;
  PyObject *__pyx_n_s_DELETECMD;
  PyObject *__pyx_n_s_DISPLAY;
  PyObject *__pyx_n_s_DROP;
  PyObject *__pyx_n_s_DROP_OR_RESTORE_ALL;
  PyObject *__pyx_n_s_DataFrame;
  PyObject *__pyx_n_s_DataFrame___reduce_cython;
  PyObject *__pyx_n_s_DataFrame___setstate_cython;
  PyObject *__pyx_n_s_DataFrame__add_column;
  PyObject *__pyx_n_s_DataFrame__add_row;
  PyObject *__pyx_n_s_DataFrame__from_data_frame_ref;
  PyObject *__pyx_n_s_DataFrame__get_column;
  PyObject *__pyx_n_s_DataFrame__get_headers;
  PyObject *__pyx_n_s_DataFrame__get_num_cols;
  PyObject *__pyx_n_s_DataFrame__get_num_indices;
  PyObject *__pyx_n_s_DataFrame__get_num_rows;
  PyObject *__pyx_n_s_DataFrame__get_row;
  PyObject *__pyx_n_s_DataFrame__get_row_by_index;
  PyObject *__pyx_n_s_DataFrame__set_column;
  PyObject *__pyx_n_s_DataFrame__set_values;
  PyObject *__pyx_n_s_DataFrame_from_dict;
  PyObject *__pyx_n_s_DataFrame_from_numpy;
  PyObject *__pyx_n_s_DataFrame_from_pandas;
  PyObject *__pyx_n_s_DataFrame_to_dict;
  PyObject *__pyx_n_s_DataFrame_to_list;
  PyObject *__pyx_n_s_DataFrame_to_pandas;
  PyObject *__pyx_n_s_DataFrame_to_string;
  PyObject *__pyx_kp_u_Dictionary_must_contain_either_a;
  PyObject *__pyx_n_s_ELSE;
  PyObject *__pyx_n_s_ELSE_CHECK;
  PyObject *__pyx_n_s_ENDIF;
  PyObject *__pyx_n_s_ENVIRON;
  PyObject *__pyx_n_s_EXIT;
  PyObject *__pyx_n_s_EXPAND;
  PyObject *__pyx_n_s_Entity;
  PyObject *__pyx_n_s_EntityMap;
  PyObject *__pyx_n_s_EntityMap___reduce_cython;
  PyObject *__pyx_n_s_EntityMap___setstate_cython;
  PyObject *__pyx_n_s_EntityMap_size;
  PyObject *__pyx_n_s_Entity___reduce_cython;
  PyObject *__pyx_n_s_Entity___setstate_cython;
  PyObject *__pyx_n_s_Entity_find;
  PyObject *__pyx_n_s_Entity_get;
  PyObject *__pyx_n_s_Entity_get_indexing_sets;
  PyObject *__pyx_n_s_Entity_get_values;
  PyObject *__pyx_n_s_Entity_indexarity;
  PyObject *__pyx_n_s_Entity_instances;
  PyObject *__pyx_n_s_Entity_is_scalar;
  PyObject *__pyx_n_s_Entity_name;
  PyObject *__pyx_n_s_Entity_num_instances;
  PyObject *__pyx_n_s_Entity_set_values;
  PyObject *__pyx_n_s_Entity_to_dict;
  PyObject *__pyx_n_s_Entity_to_list;
  PyObject *__pyx_n_s_Entity_to_pandas;
  PyObject *__pyx_n_s_Entity_to_string;
  PyObject *__pyx_n_s_Entity_xref;
  PyObject *__pyx_n_s_Enum;
  PyObject *__pyx_n_s_EnvIterator;
  PyObject *__pyx_n_s_EnvIterator___reduce_cython;
  PyObject *__pyx_n_s_EnvIterator___setstate_cython;
  PyObject *__pyx_n_s_Environment;
  PyObject *__pyx_n_s_Environment___reduce_cython;
  PyObject *__pyx_n_s_Environment___setstate_cython;
  PyObject *__pyx_n_s_Environment_get_bin_dir;
  PyObject *__pyx_n_s_Environment_get_bin_name;
  PyObject *__pyx_n_s_Environment_set_bin_dir;
  PyObject *__pyx_n_s_Environment_set_bin_name;
  PyObject *__pyx_n_s_Environment_to_string;
  PyObject *__pyx_kp_u_Error;
  PyObject *__pyx_n_s_ErrorHandler;
  PyObject *__pyx_n_s_ErrorHandler___reduce_cython;
  PyObject *__pyx_n_s_ErrorHandler___setstate_cython;
  PyObject *__pyx_n_s_ErrorHandler_error;
  PyObject *__pyx_n_s_ErrorHandler_warning;
  PyObject *__pyx_kp_u_Excepted_dictionary_of_set_membe;
  PyObject *__pyx_kp_u_Excepted_string_or_real;
  PyObject *__pyx_kp_u_Excepted_tuple_of_arity;
  PyObject *__pyx_kp_u_Expected_a_dictionary;
  PyObject *__pyx_kp_u_Expected_tuples_of_arity;
  PyObject *__pyx_n_s_FIX;
  PyObject *__pyx_n_s_FOR;
  PyObject *__pyx_kp_u_Failed_to_access_value;
  PyObject *__pyx_n_s_IF;
  PyObject *__pyx_n_s_IOError;
  PyObject *__pyx_n_s_ImportError;
  PyObject *__pyx_kp_s_Incompatible_checksums_0x_x_vs_0;
  PyObject *__pyx_n_s_InfeasibilityException;
  PyObject *__pyx_kp_u_InfeasibilityException_2;
  PyObject *__pyx_n_s_InstanceIterator;
  PyObject *__pyx_n_s_InstanceIterator___reduce_cython;
  PyObject *__pyx_n_s_InstanceIterator___setstate_cyth;
  PyObject *__pyx_n_s_InstanceIterator_size;
  PyObject *__pyx_n_s_Iterable;
  PyObject *__pyx_n_s_KeyError;
  PyObject *__pyx_n_s_Kind;
  PyObject *__pyx_n_s_LET;
  PyObject *__pyx_n_s_LOAD;
  PyObject *__pyx_n_s_LOOPEND;
  PyObject *__pyx_n_s_MISC;
  PyObject *__pyx_n_s_MemberRangeIterator;
  PyObject *__pyx_n_s_MemberRangeIterator___reduce_cyt;
  PyObject *__pyx_n_s_MemberRangeIterator___setstate_c;
  PyObject *__pyx_n_s_MemberRangeIterator_size;
  PyObject *__pyx_n_s_MemoryError;
  PyObject *__pyx_n_s_MultiIndex;
  PyObject *__pyx_n_s_NotImplementedError;
  PyObject *__pyx_n_s_OBJECTIVE;
  PyObject *__pyx_n_s_OPTION;
  PyObject *__pyx_n_s_OPTION_RESET;
  PyObject *__pyx_n_s_Objective;
  PyObject *__pyx_n_s_Objective___reduce_cython;
  PyObject *__pyx_n_s_Objective___setstate_cython;
  PyObject *__pyx_n_s_Objective_astatus;
  PyObject *__pyx_n_s_Objective_drop;
  PyObject *__pyx_n_s_Objective_exitcode;
  PyObject *__pyx_n_s_Objective_message;
  PyObject *__pyx_n_s_Objective_minimization;
  PyObject *__pyx_n_s_Objective_restore;
  PyObject *__pyx_n_s_Objective_result;
  PyObject *__pyx_n_s_Objective_sstatus;
  PyObject *__pyx_n_s_Objective_value;
  PyObject *__pyx_n_s_Objectives;
  PyObject *__pyx_n_s_Options;
  PyObject *__pyx_n_s_OutputHandler;
  PyObject *__pyx_n_s_OutputHandler___reduce_cython;
  PyObject *__pyx_n_s_OutputHandler___setstate_cython;
  PyObject *__pyx_n_s_OutputHandler_output;
  PyObject *__pyx_n_s_PRINT;
  PyObject *__pyx_n_s_PRINTF;
  PyObject *__pyx_n_s_PROBLEM;
  PyObject *__pyx_n_s_PROMPT;
  PyObject *__pyx_n_s_PURGE;
  PyObject *__pyx_n_s_Parameter;
  PyObject *__pyx_n_s_Parameter___reduce_cython;
  PyObject *__pyx_n_s_Parameter___setstate_cython;
  PyObject *__pyx_n_s_Parameter_has_default;
  PyObject *__pyx_n_s_Parameter_is_symbolic;
  PyObject *__pyx_n_s_Parameter_set;
  PyObject *__pyx_n_s_Parameter_set_values;
  PyObject *__pyx_n_s_Parameter_value;
  PyObject *__pyx_n_s_Parameters;
  PyObject *__pyx_n_s_PickleError;
  PyObject *__pyx_kp_u_Please_make_sure_that_the_AMPL;
  PyObject *__pyx_n_s_PresolveException;
  PyObject *__pyx_kp_u_PresolveException_2;
  PyObject *__pyx_n_s_RBRACE;
  PyObject *__pyx_n_s_READ;
  PyObject *__pyx_n_s_READTABLE;
  PyObject *__pyx_n_s_READ_TABLE;
  PyObject *__pyx_n_s_RELOAD;
  PyObject *__pyx_n_s_REMOVE;
  PyObject *__pyx_n_s_REPEAT;
  PyObject *__pyx_n_s_REPEAT_END;
  PyObject *__pyx_n_s_RESET;
  PyObject *__pyx_n_s_RESTORE;
  PyObject *__pyx_n_s_RUN_ARGS;
  PyObject *__pyx_n_s_Real;
  PyObject *__pyx_kp_s_Represent_an_exception_generate;
  PyObject *__pyx_kp_s_Represents_the_type_of_the_outp;
  PyObject *__pyx_n_s_Row;
  PyObject *__pyx_n_s_RowIterator;
  PyObject *__pyx_n_s_RowIterator___reduce_cython;
  PyObject *__pyx_n_s_RowIterator___setstate_cython;
  PyObject *__pyx_n_s_Row___reduce_cython;
  PyObject *__pyx_n_s_Row___setstate_cython;
  PyObject *__pyx_n_s_Row_to_string;
  PyObject *__pyx_n_s_RuntimeError;
  PyObject *__pyx_n_s_SEMICOLON;
  PyObject *__pyx_n_s_SHELL_MESSAGE;
  PyObject *__pyx_n_s_SHELL_OUTPUT;
  PyObject *__pyx_n_s_SHOW;
  PyObject *__pyx_n_s_SOLUTION;
  PyObject *__pyx_n_s_SOLVE;
  PyObject *__pyx_n_s_SSTEP;
  PyObject *__pyx_n_s_SUPPORT_MESSAGE;
  PyObject *__pyx_n_s_Series;
  PyObject *__pyx_n_s_Set;
  PyObject *__pyx_n_s_Set___reduce_cython;
  PyObject *__pyx_n_s_Set___setstate_cython;
  PyObject *__pyx_n_s_Set_arity;
  PyObject *__pyx_n_s_Set_contains;
  PyObject *__pyx_n_s_Set_get_values;
  PyObject *__pyx_n_s_Set_instances;
  PyObject *__pyx_n_s_Set_members;
  PyObject *__pyx_n_s_Set_set_values;
  PyObject *__pyx_n_s_Set_size;
  PyObject *__pyx_n_s_Sets;
  PyObject *__pyx_n_s_StopIteration;
  PyObject *__pyx_n_s_SystemError;
  PyObject *__pyx_n_s_THEN;
  PyObject *__pyx_kp_u_Trying_to_assign_tuples_to_set_o;
  PyObject *__pyx_n_s_TypeError;
  PyObject *__pyx_n_s_UNFIX;
  PyObject *__pyx_n_s_UNLOAD;
  PyObject *__pyx_n_s_UPDATE;
  PyObject *__pyx_kp_u_Unable_to_allocate_memory_for_ar;
  PyObject *__pyx_kp_u_Unexpected_data_type;
  PyObject *__pyx_kp_u_Unknown_entity_class;
  PyObject *__pyx_n_s_ValueError;
  PyObject *__pyx_n_s_Variable;
  PyObject *__pyx_n_s_Variable___reduce_cython;
  PyObject *__pyx_n_s_Variable___setstate_cython;
  PyObject *__pyx_n_s_Variable_astatus;
  PyObject *__pyx_n_s_Variable_defeqn;
  PyObject *__pyx_n_s_Variable_dual;
  PyObject *__pyx_n_s_Variable_fix;
  PyObject *__pyx_n_s_Variable_init;
  PyObject *__pyx_n_s_Variable_init0;
  PyObject *__pyx_n_s_Variable_lb;
  PyObject *__pyx_n_s_Variable_lb0;
  PyObject *__pyx_n_s_Variable_lb1;
  PyObject *__pyx_n_s_Variable_lb2;
  PyObject *__pyx_n_s_Variable_lrc;
  PyObject *__pyx_n_s_Variable_lslack;
  PyObject *__pyx_n_s_Variable_rc;
  PyObject *__pyx_n_s_Variable_set_value;
  PyObject *__pyx_n_s_Variable_slack;
  PyObject *__pyx_n_s_Variable_sstatus;
  PyObject *__pyx_n_s_Variable_status;
  PyObject *__pyx_n_s_Variable_ub;
  PyObject *__pyx_n_s_Variable_ub0;
  PyObject *__pyx_n_s_Variable_ub1;
  PyObject *__pyx_n_s_Variable_ub2;
  PyObject *__pyx_n_s_Variable_unfix;
  PyObject *__pyx_n_s_Variable_urc;
  PyObject *__pyx_n_s_Variable_uslack;
  PyObject *__pyx_n_s_Variable_value;
  PyObject *__pyx_n_s_Variables;
  PyObject *__pyx_n_s_WAITING;
  PyObject *__pyx_n_s_WRITE;
  PyObject *__pyx_n_s_WRITETABLE;
  PyObject *__pyx_n_s_WRITE_TABLE;
  PyObject *__pyx_kp_u_Warning;
  PyObject *__pyx_n_s_XREF;
  PyObject *__pyx_kp_u__21;
  PyObject *__pyx_kp_u__22;
  PyObject *__pyx_kp_u__24;
  PyObject *__pyx_kp_u__25;
  PyObject *__pyx_kp_u__26;
  PyObject *__pyx_kp_u__33;
  PyObject *__pyx_kp_u__34;
  PyObject *__pyx_kp_u__35;
  PyObject *__pyx_kp_u__36;
  PyObject *__pyx_kp_u__38;
  PyObject *__pyx_kp_u__39;
  PyObject *__pyx_n_s__390;
  PyObject *__pyx_kp_u__40;
  PyObject *__pyx_kp_u__41;
  PyObject *__pyx_n_s__84;
  PyObject *__pyx_n_s_addColumn;
  PyObject *__pyx_n_s_addRow;
  PyObject *__pyx_n_s_add_column;
  PyObject *__pyx_n_s_add_column_locals_genexpr;
  PyObject *__pyx_n_s_add_row;
  PyObject *__pyx_n_s_ampl;
  PyObject *__pyx_n_s_ampl_expressions;
  PyObject *__pyx_n_u_ampl_libpath;
  PyObject *__pyx_n_s_amplpy;
  PyObject *__pyx_kp_s_amplpy_ampl_pyx;
  PyObject *__pyx_kp_s_amplpy_constraint_pxi;
  PyObject *__pyx_kp_s_amplpy_dataframe_pxi;
  PyObject *__pyx_kp_s_amplpy_entity_pxi;
  PyObject *__pyx_kp_s_amplpy_environment_pxi;
  PyObject *__pyx_kp_s_amplpy_errorhandler_pxi;
  PyObject *__pyx_kp_s_amplpy_exceptions_pxi;
  PyObject *__pyx_kp_s_amplpy_iterators_pxi;
  PyObject *__pyx_kp_s_amplpy_objective_pxi;
  PyObject *__pyx_kp_s_amplpy_outputhandler_pxi;
  PyObject *__pyx_kp_s_amplpy_parameter_pxi;
  PyObject *__pyx_kp_s_amplpy_set_pxi;
  PyObject *__pyx_kp_s_amplpy_variable_pxi;
  PyObject *__pyx_n_s_args;
  PyObject *__pyx_n_s_arity;
  PyObject *__pyx_n_s_array;
  PyObject *__pyx_n_s_ast;
  PyObject *__pyx_n_s_astatus;
  PyObject *__pyx_n_s_asyncio_coroutines;
  PyObject *__pyx_n_s_auxfiles;
  PyObject *__pyx_n_s_bin_dir;
  PyObject *__pyx_n_s_bin_dir_c;
  PyObject *__pyx_n_s_bin_name;
  PyObject *__pyx_n_s_bin_name_c;
  PyObject *__pyx_n_s_binary_directory;
  PyObject *__pyx_n_s_binary_name;
  PyObject *__pyx_n_s_body;
  PyObject *__pyx_n_u_c;
  PyObject *__pyx_n_s_c_double_array;
  PyObject *__pyx_n_s_c_string_array;
  PyObject *__pyx_kp_u_cannot_convert_to_dictionary_wit;
  PyObject *__pyx_n_s_cast_row;
  PyObject *__pyx_n_s_cast_value;
  PyObject *__pyx_n_s_cd;
  PyObject *__pyx_n_s_chain;
  PyObject *__pyx_n_s_cindex;
  PyObject *__pyx_n_s_class_getitem;
  PyObject *__pyx_n_s_cline_in_traceback;
  PyObject *__pyx_n_s_close;
  PyObject *__pyx_n_s_cls;
  PyObject *__pyx_n_s_cname;
  PyObject *__pyx_n_s_col;
  PyObject *__pyx_n_s_collections_abc;
  PyObject *__pyx_n_s_column;
  PyObject *__pyx_n_s_column_names;
  PyObject *__pyx_n_s_columns;
  PyObject *__pyx_n_s_con;
  PyObject *__pyx_n_s_con_2;
  PyObject *__pyx_n_s_con_locals_Constraints;
  PyObject *__pyx_n_s_con_locals_Constraints___getite;
  PyObject *__pyx_n_s_con_locals_Constraints___init;
  PyObject *__pyx_n_s_con_locals_Constraints___iter;
  PyObject *__pyx_n_s_con_locals_Constraints___setite;
  PyObject *__pyx_n_s_contains;
  PyObject *__pyx_n_s_contains_c;
  PyObject *__pyx_n_s_conv_to_list;
  PyObject *__pyx_n_s_d;
  PyObject *__pyx_n_s_data;
  PyObject *__pyx_n_s_data_c;
  PyObject *__pyx_n_s_data_frame;
  PyObject *__pyx_n_s_defeqn;
  PyObject *__pyx_n_s_defvar;
  PyObject *__pyx_n_s_df;
  PyObject *__pyx_n_s_df_c;
  PyObject *__pyx_n_s_df_ref;
  PyObject *__pyx_n_s_dic;
  PyObject *__pyx_n_s_dict;
  PyObject *__pyx_n_s_dict_2;
  PyObject *__pyx_n_s_dimen;
  PyObject *__pyx_n_s_dinit;
  PyObject *__pyx_n_s_dinit0;
  PyObject *__pyx_kp_u_disable;
  PyObject *__pyx_n_s_display;
  PyObject *__pyx_n_u_display;
  PyObject *__pyx_n_s_display_error_message;
  PyObject *__pyx_n_s_doc;
  PyObject *__pyx_n_s_drop;
  PyObject *__pyx_n_s_dual;
  PyObject *__pyx_n_s_e;
  PyObject *__pyx_kp_u_enable;
  PyObject *__pyx_n_s_encode;
  PyObject *__pyx_n_s_end;
  PyObject *__pyx_n_s_endswith;
  PyObject *__pyx_n_s_entity;
  PyObject *__pyx_n_s_entitytype;
  PyObject *__pyx_n_s_enum;
  PyObject *__pyx_n_s_enumerate;
  PyObject *__pyx_n_s_environ;
  PyObject *__pyx_n_s_environment;
  PyObject *__pyx_n_s_error;
  PyObject *__pyx_n_s_error_handler;
  PyObject *__pyx_n_s_errorinfo;
  PyObject *__pyx_n_s_eval;
  PyObject *__pyx_n_s_exception;
  PyObject *__pyx_n_s_exists;
  PyObject *__pyx_n_s_exitcode;
  PyObject *__pyx_n_s_exp;
  PyObject *__pyx_n_s_exportData;
  PyObject *__pyx_n_s_exportModel;
  PyObject *__pyx_n_s_export_data;
  PyObject *__pyx_n_s_export_model;
  PyObject *__pyx_n_s_exprs;
  PyObject *__pyx_kp_u_file;
  PyObject *__pyx_n_s_file_2;
  PyObject *__pyx_n_s_filename;
  PyObject *__pyx_n_s_find;
  PyObject *__pyx_n_s_fix;
  PyObject *__pyx_n_s_flat;
  PyObject *__pyx_n_s_flush;
  PyObject *__pyx_n_s_fromDict;
  PyObject *__pyx_n_s_fromNumpy;
  PyObject *__pyx_n_s_fromPandas;
  PyObject *__pyx_n_s_from_arrays;
  PyObject *__pyx_n_s_from_data_frame_ref;
  PyObject *__pyx_n_s_from_dict;
  PyObject *__pyx_n_s_from_dict_locals_genexpr;
  PyObject *__pyx_n_s_from_dict_locals_to_tuple;
  PyObject *__pyx_n_s_from_numpy;
  PyObject *__pyx_n_s_from_pandas;
  PyObject *__pyx_n_s_from_tuples;
  PyObject *__pyx_kp_u_gc;
  PyObject *__pyx_n_s_genexpr;
  PyObject *__pyx_n_s_get;
  PyObject *__pyx_n_s_getBinDir;
  PyObject *__pyx_n_s_getBinName;
  PyObject *__pyx_n_s_getColumn;
  PyObject *__pyx_n_s_getConstraint;
  PyObject *__pyx_n_s_getConstraints;
  PyObject *__pyx_n_s_getCurrentObjective;
  PyObject *__pyx_n_s_getData;
  PyObject *__pyx_n_s_getEntity;
  PyObject *__pyx_n_s_getErrorHandler;
  PyObject *__pyx_n_s_getHeaders;
  PyObject *__pyx_n_s_getIndexingSets;
  PyObject *__pyx_n_s_getLineNumber;
  PyObject *__pyx_n_s_getMessage;
  PyObject *__pyx_n_s_getNumCols;
  PyObject *__pyx_n_s_getNumIndices;
  PyObject *__pyx_n_s_getNumRows;
  PyObject *__pyx_n_s_getObjective;
  PyObject *__pyx_n_s_getObjectives;
  PyObject *__pyx_n_s_getOffset;
  PyObject *__pyx_n_s_getOption;
  PyObject *__pyx_n_s_getOutput;
  PyObject *__pyx_n_s_getOutputHandler;
  PyObject *__pyx_n_s_getParameter;
  PyObject *__pyx_n_s_getParameters;
  PyObject *__pyx_n_s_getRow;
  PyObject *__pyx_n_s_getRowByIndex;
  PyObject *__pyx_n_s_getSet;
  PyObject *__pyx_n_s_getSets;
  PyObject *__pyx_n_s_getSourceName;
  PyObject *__pyx_n_s_getValue;
  PyObject *__pyx_n_s_getValues;
  PyObject *__pyx_n_s_getVariable;
  PyObject *__pyx_n_s_getVariables;
  PyObject *__pyx_n_s_get_bin_dir;
  PyObject *__pyx_n_s_get_bin_name;
  PyObject *__pyx_n_s_get_column;
  PyObject *__pyx_n_s_get_constraint;
  PyObject *__pyx_n_s_get_constraints;
  PyObject *__pyx_n_s_get_current_objective;
  PyObject *__pyx_n_s_get_data;
  PyObject *__pyx_n_s_get_entity;
  PyObject *__pyx_n_s_get_error_handler;
  PyObject *__pyx_n_s_get_headers;
  PyObject *__pyx_n_s_get_headers_locals_genexpr;
  PyObject *__pyx_n_s_get_iis;
  PyObject *__pyx_n_s_get_indexing_sets;
  PyObject *__pyx_n_s_get_line_number;
  PyObject *__pyx_n_s_get_message;
  PyObject *__pyx_n_s_get_num_cols;
  PyObject *__pyx_n_s_get_num_indices;
  PyObject *__pyx_n_s_get_num_rows;
  PyObject *__pyx_n_s_get_objective;
  PyObject *__pyx_n_s_get_objectives;
  PyObject *__pyx_n_s_get_offset;
  PyObject *__pyx_n_s_get_option;
  PyObject *__pyx_n_s_get_output;
  PyObject *__pyx_n_s_get_output_handler;
  PyObject *__pyx_n_s_get_parameter;
  PyObject *__pyx_n_s_get_parameters;
  PyObject *__pyx_n_s_get_row;
  PyObject *__pyx_n_s_get_row_by_index;
  PyObject *__pyx_n_s_get_set;
  PyObject *__pyx_n_s_get_sets;
  PyObject *__pyx_n_s_get_solution;
  PyObject *__pyx_n_s_get_source_name;
  PyObject *__pyx_n_s_get_value;
  PyObject *__pyx_n_s_get_values;
  PyObject *__pyx_n_s_get_variable;
  PyObject *__pyx_n_s_get_variables;
  PyObject *__pyx_n_s_getitem;
  PyObject *__pyx_n_s_getstate;
  PyObject *__pyx_n_s_hasDefault;
  PyObject *__pyx_n_s_has_default;
  PyObject *__pyx_n_s_header;
  PyObject *__pyx_n_s_headers;
  PyObject *__pyx_n_s_headers_py;
  PyObject *__pyx_n_s_i;
  PyObject *__pyx_kp_u_i_in_1__ncons__con_i_iis_non__c;
  PyObject *__pyx_kp_u_i_in_1__nvars__var_i_iis_non__v;
  PyObject *__pyx_kp_u_i_in_1__nvars__var_i_val_0__var;
  PyObject *__pyx_kp_u_i_in_1__nvars__varname_i__var_i;
  PyObject *__pyx_n_s_iis_con;
  PyObject *__pyx_n_s_iis_var;
  PyObject *__pyx_n_s_impl;
  PyObject *__pyx_n_s_import;
  PyObject *__pyx_n_s_index;
  PyObject *__pyx_n_u_index;
  PyObject *__pyx_n_s_index_c;
  PyObject *__pyx_n_s_index_names;
  PyObject *__pyx_n_s_indexarity;
  PyObject *__pyx_n_s_indices_c;
  PyObject *__pyx_n_s_init;
  PyObject *__pyx_n_s_init0;
  PyObject *__pyx_n_s_init_2;
  PyObject *__pyx_n_s_init_subclass;
  PyObject *__pyx_n_s_initializing;
  PyObject *__pyx_n_s_instances;
  PyObject *__pyx_n_s_isLogical;
  PyObject *__pyx_n_s_isRunning;
  PyObject *__pyx_n_s_isScalar;
  PyObject *__pyx_n_s_isSymbolic;
  PyObject *__pyx_n_s_is_coroutine;
  PyObject *__pyx_n_s_is_logical;
  PyObject *__pyx_n_s_is_running;
  PyObject *__pyx_n_s_is_scalar;
  PyObject *__pyx_n_s_is_symbolic;
  PyObject *__pyx_kp_u_isenabled;
  PyObject *__pyx_n_s_isrunning;
  PyObject *__pyx_n_s_items;
  PyObject *__pyx_n_s_iter;
  PyObject *__pyx_n_s_iter___locals_genexpr;
  PyObject *__pyx_n_s_itertools;
  PyObject *__pyx_n_s_j;
  PyObject *__pyx_n_s_key;
  PyObject *__pyx_n_s_keys;
  PyObject *__pyx_n_s_kind;
  PyObject *__pyx_n_s_kwargs;
  PyObject *__pyx_n_s_lb;
  PyObject *__pyx_n_s_lb0;
  PyObject *__pyx_n_s_lb1;
  PyObject *__pyx_n_s_lb2;
  PyObject *__pyx_n_s_lbs;
  PyObject *__pyx_n_s_ldual;
  PyObject *__pyx_n_s_line_number;
  PyObject *__pyx_n_s_literal_eval;
  PyObject *__pyx_n_s_loadSession;
  PyObject *__pyx_n_s_load_session;
  PyObject *__pyx_n_s_lrc;
  PyObject *__pyx_n_s_lslack;
  PyObject *__pyx_n_s_lst;
  PyObject *__pyx_n_s_lst_columns;
  PyObject *__pyx_n_s_lst_index;
  PyObject *__pyx_n_s_lst_solution;
  PyObject *__pyx_n_s_main;
  PyObject *__pyx_n_s_map;
  PyObject *__pyx_n_s_members;
  PyObject *__pyx_n_s_message;
  PyObject *__pyx_n_s_metaclass;
  PyObject *__pyx_n_s_minimization;
  PyObject *__pyx_n_u_minimize;
  PyObject *__pyx_n_s_model;
  PyObject *__pyx_n_s_model_c;
  PyObject *__pyx_n_s_module;
  PyObject *__pyx_n_s_mro_entries;
  PyObject *__pyx_n_s_msg;
  PyObject *__pyx_n_s_multi_index;
  PyObject *__pyx_n_s_n;
  PyObject *__pyx_n_s_name;
  PyObject *__pyx_n_s_name_2;
  PyObject *__pyx_n_s_name_c;
  PyObject *__pyx_n_s_name_c_2;
  PyObject *__pyx_n_s_names;
  PyObject *__pyx_n_s_ncols;
  PyObject *__pyx_n_s_ncolumns;
  PyObject *__pyx_n_s_ndarray;
  PyObject *__pyx_n_s_nested;
  PyObject *__pyx_n_s_nested_dict_of_suffixes;
  PyObject *__pyx_n_s_new;
  PyObject *__pyx_n_s_nindices;
  PyObject *__pyx_n_s_nlevels;
  PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
  PyObject *__pyx_n_s_np;
  PyObject *__pyx_n_u_nt;
  PyObject *__pyx_n_s_num;
  PyObject *__pyx_n_s_numInstances;
  PyObject *__pyx_n_s_num_instances;
  PyObject *__pyx_n_s_numbers;
  PyObject *__pyx_n_s_numpy;
  PyObject *__pyx_n_s_obj;
  PyObject *__pyx_n_s_obj_2;
  PyObject *__pyx_n_s_obj_locals_Objectives;
  PyObject *__pyx_n_s_obj_locals_Objectives___getitem;
  PyObject *__pyx_n_s_obj_locals_Objectives___init;
  PyObject *__pyx_n_s_obj_locals_Objectives___iter;
  PyObject *__pyx_n_s_object;
  PyObject *__pyx_n_s_objname;
  PyObject *__pyx_n_s_objname_c;
  PyObject *__pyx_n_s_offset;
  PyObject *__pyx_n_s_open;
  PyObject *__pyx_n_s_option;
  PyObject *__pyx_n_s_option_2;
  PyObject *__pyx_n_s_option_locals_Options;
  PyObject *__pyx_n_s_option_locals_Options___getitem;
  PyObject *__pyx_n_s_option_locals_Options___init;
  PyObject *__pyx_n_s_option_locals_Options___setitem;
  PyObject *__pyx_n_u_options;
  PyObject *__pyx_n_s_options_2;
  PyObject *__pyx_n_s_options_c;
  PyObject *__pyx_n_s_os;
  PyObject *__pyx_n_s_output;
  PyObject *__pyx_n_s_output_c;
  PyObject *__pyx_n_s_output_handler;
  PyObject *__pyx_n_s_p;
  PyObject *__pyx_n_s_pandas;
  PyObject *__pyx_n_s_param;
  PyObject *__pyx_n_s_param_2;
  PyObject *__pyx_n_s_param_locals_Parameters;
  PyObject *__pyx_n_s_param_locals_Parameters___getit;
  PyObject *__pyx_n_s_param_locals_Parameters___init;
  PyObject *__pyx_n_s_param_locals_Parameters___iter;
  PyObject *__pyx_n_s_param_locals_Parameters___setit;
  PyObject *__pyx_n_s_path;
  PyObject *__pyx_n_s_pd;
  PyObject *__pyx_n_s_pickle;
  PyObject *__pyx_n_s_prepare;
  PyObject *__pyx_n_s_print;
  PyObject *__pyx_n_s_problem;
  PyObject *__pyx_n_s_property;
  PyObject *__pyx_n_s_py_list;
  PyObject *__pyx_n_s_py_variant;
  PyObject *__pyx_n_s_pylist;
  PyObject *__pyx_n_s_pyx_PickleError;
  PyObject *__pyx_n_s_pyx_checksum;
  PyObject *__pyx_n_s_pyx_result;
  PyObject *__pyx_n_s_pyx_state;
  PyObject *__pyx_n_s_pyx_type;
  PyObject *__pyx_n_s_pyx_unpickle_ErrorHandler;
  PyObject *__pyx_n_s_pyx_unpickle_OutputHandler;
  PyObject *__pyx_n_s_pyx_vtable;
  PyObject *__pyx_n_s_qualname;
  PyObject *__pyx_n_s_range;
  PyObject *__pyx_n_s_rc;
  PyObject *__pyx_n_s_read;
  PyObject *__pyx_n_s_readData;
  PyObject *__pyx_n_s_readTable;
  PyObject *__pyx_n_s_read_data;
  PyObject *__pyx_n_s_read_table;
  PyObject *__pyx_n_s_reduce;
  PyObject *__pyx_n_s_reduce_cython;
  PyObject *__pyx_n_s_reduce_ex;
  PyObject *__pyx_n_s_reset;
  PyObject *__pyx_n_s_restore;
  PyObject *__pyx_n_s_result;
  PyObject *__pyx_n_s_return_output;
  PyObject *__pyx_n_s_row;
  PyObject *__pyx_n_s_rowindex;
  PyObject *__pyx_n_s_scalar_expression;
  PyObject *__pyx_n_s_self;
  PyObject *__pyx_kp_s_self__c_ampl_cannot_be_converted;
  PyObject *__pyx_kp_s_self__c_ampl_self__index_cannot;
  PyObject *__pyx_kp_s_self__c_ampl_self__index_self_be;
  PyObject *__pyx_kp_s_self__c_ampl_self_begin_self_end;
  PyObject *__pyx_kp_s_self__df_cannot_be_converted_to;
  PyObject *__pyx_kp_s_self_begin_self_end_self_env_c_s;
  PyObject *__pyx_n_s_send;
  PyObject *__pyx_n_s_set;
  PyObject *__pyx_n_s_setBinDir;
  PyObject *__pyx_n_s_setBinName;
  PyObject *__pyx_n_s_setColumn;
  PyObject *__pyx_n_s_setData;
  PyObject *__pyx_n_s_setDual;
  PyObject *__pyx_n_s_setErrorHandler;
  PyObject *__pyx_n_s_setOption;
  PyObject *__pyx_n_s_setOutputHandler;
  PyObject *__pyx_n_s_setValue;
  PyObject *__pyx_n_s_setValues;
  PyObject *__pyx_n_s_setValues_2;
  PyObject *__pyx_n_s_set_2;
  PyObject *__pyx_n_s_set_bin_dir;
  PyObject *__pyx_n_s_set_bin_name;
  PyObject *__pyx_n_s_set_column;
  PyObject *__pyx_n_s_set_data;
  PyObject *__pyx_n_s_set_dual;
  PyObject *__pyx_n_s_set_error_handler;
  PyObject *__pyx_n_s_set_locals_Sets;
  PyObject *__pyx_n_s_set_locals_Sets___getitem;
  PyObject *__pyx_n_s_set_locals_Sets___init;
  PyObject *__pyx_n_s_set_locals_Sets___iter;
  PyObject *__pyx_n_s_set_locals_Sets___setitem;
  PyObject *__pyx_n_s_set_name;
  PyObject *__pyx_n_s_set_name_2;
  PyObject *__pyx_n_s_set_option;
  PyObject *__pyx_n_s_set_output_handler;
  PyObject *__pyx_n_s_set_value;
  PyObject *__pyx_n_s_set_values;
  PyObject *__pyx_n_s_set_values_2;
  PyObject *__pyx_n_s_set_values_locals_cast_row;
  PyObject *__pyx_n_s_set_values_locals_cast_value;
  PyObject *__pyx_n_s_set_values_locals_conv_to_list;
  PyObject *__pyx_n_s_set_values_locals_genexpr;
  PyObject *__pyx_n_s_setitem;
  PyObject *__pyx_n_s_sets;
  PyObject *__pyx_n_s_setstate;
  PyObject *__pyx_n_s_setstate_cython;
  PyObject *__pyx_n_s_shape;
  PyObject *__pyx_n_s_size;
  PyObject *__pyx_n_s_skip_index;
  PyObject *__pyx_n_s_slack;
  PyObject *__pyx_n_s_snapshot;
  PyObject *__pyx_kp_u_solve;
  PyObject *__pyx_n_s_solve_2;
  PyObject *__pyx_n_u_solve_result;
  PyObject *__pyx_n_u_solve_result_num;
  PyObject *__pyx_n_s_solver;
  PyObject *__pyx_n_u_solver;
  PyObject *__pyx_n_s_source_name;
  PyObject *__pyx_n_s_spec;
  PyObject *__pyx_n_s_split;
  PyObject *__pyx_n_s_sstatus;
  PyObject *__pyx_n_s_stack;
  PyObject *__pyx_n_s_startRecording;
  PyObject *__pyx_n_s_start_recording;
  PyObject *__pyx_n_s_state;
  PyObject *__pyx_n_s_statements;
  PyObject *__pyx_n_s_statements_c;
  PyObject *__pyx_n_s_status;
  PyObject *__pyx_n_s_stderr;
  PyObject *__pyx_n_s_stmt;
  PyObject *__pyx_n_s_stopRecording;
  PyObject *__pyx_n_s_stop_recording;
  PyObject *__pyx_n_s_str;
  PyObject *__pyx_kp_s_stringsource;
  PyObject *__pyx_n_s_suffixes;
  PyObject *__pyx_n_s_suffixes_c;
  PyObject *__pyx_n_s_super;
  PyObject *__pyx_n_s_sys;
  PyObject *__pyx_n_s_t;
  PyObject *__pyx_n_s_t_c;
  PyObject *__pyx_n_s_table_name;
  PyObject *__pyx_n_s_test;
  PyObject *__pyx_n_s_throw;
  PyObject *__pyx_n_s_toDict;
  PyObject *__pyx_n_s_toList;
  PyObject *__pyx_n_s_toPandas;
  PyObject *__pyx_n_s_toString;
  PyObject *__pyx_n_s_to_dict;
  PyObject *__pyx_n_s_to_list;
  PyObject *__pyx_n_s_to_pandas;
  PyObject *__pyx_n_s_to_string;
  PyObject *__pyx_n_s_to_string_c;
  PyObject *__pyx_n_s_to_tuple;
  PyObject *__pyx_n_s_tolist;
  PyObject *__pyx_n_s_tools;
  PyObject *__pyx_n_s_tuple;
  PyObject *__pyx_n_s_tuple_c;
  PyObject *__pyx_n_s_ub;
  PyObject *__pyx_n_s_ub0;
  PyObject *__pyx_n_s_ub1;
  PyObject *__pyx_n_s_ub2;
  PyObject *__pyx_n_s_ubs;
  PyObject *__pyx_n_s_udual;
  PyObject *__pyx_n_s_unfix;
  PyObject *__pyx_kp_u_unsupported_type;
  PyObject *__pyx_n_s_update;
  PyObject *__pyx_n_s_urc;
  PyObject *__pyx_n_s_use_setstate;
  PyObject *__pyx_n_s_uslack;
  PyObject *__pyx_kp_u_utf_8;
  PyObject *__pyx_n_s_v;
  PyObject *__pyx_n_s_val;
  PyObject *__pyx_n_s_value;
  PyObject *__pyx_n_u_value;
  PyObject *__pyx_n_s_value_c;
  PyObject *__pyx_n_s_values;
  PyObject *__pyx_n_s_var;
  PyObject *__pyx_n_s_var_2;
  PyObject *__pyx_n_s_var_locals_Variables;
  PyObject *__pyx_n_s_var_locals_Variables___getitem;
  PyObject *__pyx_n_s_var_locals_Variables___init;
  PyObject *__pyx_n_s_var_locals_Variables___iter;
  PyObject *__pyx_n_s_var_locals_Variables___setitem;
  PyObject *__pyx_n_s_verbose;
  PyObject *__pyx_n_s_warning;
  PyObject *__pyx_n_s_workdir;
  PyObject *__pyx_n_s_workdir_c;
  PyObject *__pyx_n_s_write;
  PyObject *__pyx_n_s_writeTable;
  PyObject *__pyx_n_s_write_table;
  PyObject *__pyx_n_s_xref;
  PyObject *__pyx_n_s_zeros;
  PyObject *__pyx_n_s_zip;
  PyObject *__pyx_int_0;
  PyObject *__pyx_int_1;
  PyObject *__pyx_int_222419149;
  PyObject *__pyx_int_228825662;
  PyObject *__pyx_int_238750788;
  PyObject *__pyx_k__14;
  PyObject *__pyx_tuple_;
  PyObject *__pyx_tuple__2;
  PyObject *__pyx_tuple__3;
  PyObject *__pyx_tuple__4;
  PyObject *__pyx_tuple__5;
  PyObject *__pyx_tuple__6;
  PyObject *__pyx_tuple__7;
  PyObject *__pyx_tuple__8;
  PyObject *__pyx_tuple__9;
  PyObject *__pyx_tuple__10;
  PyObject *__pyx_tuple__11;
  PyObject *__pyx_tuple__12;
  PyObject *__pyx_tuple__13;
  PyObject *__pyx_tuple__15;
  PyObject *__pyx_tuple__17;
  PyObject *__pyx_tuple__18;
  PyObject *__pyx_tuple__20;
  PyObject *__pyx_tuple__23;
  PyObject *__pyx_tuple__27;
  PyObject *__pyx_tuple__28;
  PyObject *__pyx_tuple__29;
  PyObject *__pyx_tuple__31;
  PyObject *__pyx_tuple__37;
  PyObject *__pyx_tuple__42;
  PyObject *__pyx_tuple__43;
  PyObject *__pyx_tuple__44;
  PyObject *__pyx_tuple__45;
  PyObject *__pyx_tuple__46;
  PyObject *__pyx_tuple__48;
  PyObject *__pyx_tuple__50;
  PyObject *__pyx_tuple__52;
  PyObject *__pyx_tuple__54;
  PyObject *__pyx_tuple__55;
  PyObject *__pyx_tuple__60;
  PyObject *__pyx_tuple__61;
  PyObject *__pyx_tuple__65;
  PyObject *__pyx_tuple__66;
  PyObject *__pyx_tuple__69;
  PyObject *__pyx_tuple__72;
  PyObject *__pyx_tuple__73;
  PyObject *__pyx_tuple__78;
  PyObject *__pyx_tuple__79;
  PyObject *__pyx_tuple__83;
  PyObject *__pyx_tuple__85;
  PyObject *__pyx_tuple__90;
  PyObject *__pyx_tuple__107;
  PyObject *__pyx_tuple__111;
  PyObject *__pyx_tuple__117;
  PyObject *__pyx_tuple__121;
  PyObject *__pyx_tuple__123;
  PyObject *__pyx_tuple__127;
  PyObject *__pyx_tuple__129;
  PyObject *__pyx_tuple__131;
  PyObject *__pyx_tuple__132;
  PyObject *__pyx_tuple__134;
  PyObject *__pyx_tuple__136;
  PyObject *__pyx_tuple__138;
  PyObject *__pyx_tuple__140;
  PyObject *__pyx_tuple__142;
  PyObject *__pyx_tuple__144;
  PyObject *__pyx_tuple__146;
  PyObject *__pyx_tuple__148;
  PyObject *__pyx_tuple__149;
  PyObject *__pyx_tuple__151;
  PyObject *__pyx_tuple__152;
  PyObject *__pyx_tuple__154;
  PyObject *__pyx_tuple__156;
  PyObject *__pyx_tuple__158;
  PyObject *__pyx_tuple__162;
  PyObject *__pyx_tuple__164;
  PyObject *__pyx_tuple__166;
  PyObject *__pyx_tuple__170;
  PyObject *__pyx_tuple__173;
  PyObject *__pyx_tuple__175;
  PyObject *__pyx_tuple__177;
  PyObject *__pyx_tuple__179;
  PyObject *__pyx_tuple__181;
  PyObject *__pyx_tuple__185;
  PyObject *__pyx_tuple__189;
  PyObject *__pyx_tuple__191;
  PyObject *__pyx_tuple__193;
  PyObject *__pyx_tuple__195;
  PyObject *__pyx_tuple__197;
  PyObject *__pyx_tuple__201;
  PyObject *__pyx_tuple__203;
  PyObject *__pyx_tuple__206;
  PyObject *__pyx_tuple__209;
  PyObject *__pyx_tuple__216;
  PyObject *__pyx_tuple__217;
  PyObject *__pyx_tuple__218;
  PyObject *__pyx_tuple__219;
  PyObject *__pyx_tuple__246;
  PyObject *__pyx_tuple__250;
  PyObject *__pyx_tuple__251;
  PyObject *__pyx_tuple__254;
  PyObject *__pyx_tuple__256;
  PyObject *__pyx_tuple__258;
  PyObject *__pyx_tuple__263;
  PyObject *__pyx_tuple__265;
  PyObject *__pyx_tuple__269;
  PyObject *__pyx_tuple__271;
  PyObject *__pyx_tuple__302;
  PyObject *__pyx_tuple__304;
  PyObject *__pyx_tuple__306;
  PyObject *__pyx_tuple__308;
  PyObject *__pyx_tuple__314;
  PyObject *__pyx_tuple__316;
  PyObject *__pyx_tuple__320;
  PyObject *__pyx_tuple__322;
  PyObject *__pyx_tuple__324;
  PyObject *__pyx_tuple__325;
  PyObject *__pyx_tuple__328;
  PyObject *__pyx_tuple__330;
  PyObject *__pyx_tuple__333;
  PyObject *__pyx_tuple__335;
  PyObject *__pyx_tuple__337;
  PyObject *__pyx_tuple__340;
  PyObject *__pyx_tuple__342;
  PyObject *__pyx_tuple__344;
  PyObject *__pyx_tuple__353;
  PyObject *__pyx_tuple__355;
  PyObject *__pyx_tuple__357;
  PyObject *__pyx_tuple__359;
  PyObject *__pyx_tuple__361;
  PyObject *__pyx_tuple__363;
  PyObject *__pyx_tuple__365;
  PyObject *__pyx_tuple__367;
  PyObject *__pyx_tuple__369;
  PyObject *__pyx_tuple__371;
  PyObject *__pyx_tuple__373;
  PyObject *__pyx_tuple__374;
  PyObject *__pyx_tuple__376;
  PyObject *__pyx_tuple__378;
  PyObject *__pyx_tuple__380;
  PyObject *__pyx_tuple__383;
  PyObject *__pyx_tuple__387;
  PyObject *__pyx_codeobj__16;
  PyObject *__pyx_codeobj__19;
  PyObject *__pyx_codeobj__30;
  PyObject *__pyx_codeobj__32;
  PyObject *__pyx_codeobj__47;
  PyObject *__pyx_codeobj__49;
  PyObject *__pyx_codeobj__51;
  PyObject *__pyx_codeobj__53;
  PyObject *__pyx_codeobj__56;
  PyObject *__pyx_codeobj__57;
  PyObject *__pyx_codeobj__58;
  PyObject *__pyx_codeobj__59;
  PyObject *__pyx_codeobj__62;
  PyObject *__pyx_codeobj__63;
  PyObject *__pyx_codeobj__64;
  PyObject *__pyx_codeobj__67;
  PyObject *__pyx_codeobj__68;
  PyObject *__pyx_codeobj__70;
  PyObject *__pyx_codeobj__71;
  PyObject *__pyx_codeobj__74;
  PyObject *__pyx_codeobj__75;
  PyObject *__pyx_codeobj__76;
  PyObject *__pyx_codeobj__77;
  PyObject *__pyx_codeobj__80;
  PyObject *__pyx_codeobj__81;
  PyObject *__pyx_codeobj__82;
  PyObject *__pyx_codeobj__86;
  PyObject *__pyx_codeobj__87;
  PyObject *__pyx_codeobj__88;
  PyObject *__pyx_codeobj__89;
  PyObject *__pyx_codeobj__91;
  PyObject *__pyx_codeobj__92;
  PyObject *__pyx_codeobj__93;
  PyObject *__pyx_codeobj__94;
  PyObject *__pyx_codeobj__95;
  PyObject *__pyx_codeobj__96;
  PyObject *__pyx_codeobj__97;
  PyObject *__pyx_codeobj__98;
  PyObject *__pyx_codeobj__99;
  PyObject *__pyx_codeobj__100;
  PyObject *__pyx_codeobj__101;
  PyObject *__pyx_codeobj__102;
  PyObject *__pyx_codeobj__103;
  PyObject *__pyx_codeobj__104;
  PyObject *__pyx_codeobj__105;
  PyObject *__pyx_codeobj__106;
  PyObject *__pyx_codeobj__108;
  PyObject *__pyx_codeobj__109;
  PyObject *__pyx_codeobj__110;
  PyObject *__pyx_codeobj__112;
  PyObject *__pyx_codeobj__113;
  PyObject *__pyx_codeobj__114;
  PyObject *__pyx_codeobj__115;
  PyObject *__pyx_codeobj__116;
  PyObject *__pyx_codeobj__118;
  PyObject *__pyx_codeobj__119;
  PyObject *__pyx_codeobj__120;
  PyObject *__pyx_codeobj__122;
  PyObject *__pyx_codeobj__124;
  PyObject *__pyx_codeobj__125;
  PyObject *__pyx_codeobj__126;
  PyObject *__pyx_codeobj__128;
  PyObject *__pyx_codeobj__130;
  PyObject *__pyx_codeobj__133;
  PyObject *__pyx_codeobj__135;
  PyObject *__pyx_codeobj__137;
  PyObject *__pyx_codeobj__139;
  PyObject *__pyx_codeobj__141;
  PyObject *__pyx_codeobj__143;
  PyObject *__pyx_codeobj__145;
  PyObject *__pyx_codeobj__147;
  PyObject *__pyx_codeobj__150;
  PyObject *__pyx_codeobj__153;
  PyObject *__pyx_codeobj__155;
  PyObject *__pyx_codeobj__157;
  PyObject *__pyx_codeobj__159;
  PyObject *__pyx_codeobj__160;
  PyObject *__pyx_codeobj__161;
  PyObject *__pyx_codeobj__163;
  PyObject *__pyx_codeobj__165;
  PyObject *__pyx_codeobj__167;
  PyObject *__pyx_codeobj__168;
  PyObject *__pyx_codeobj__169;
  PyObject *__pyx_codeobj__171;
  PyObject *__pyx_codeobj__172;
  PyObject *__pyx_codeobj__174;
  PyObject *__pyx_codeobj__176;
  PyObject *__pyx_codeobj__178;
  PyObject *__pyx_codeobj__180;
  PyObject *__pyx_codeobj__182;
  PyObject *__pyx_codeobj__183;
  PyObject *__pyx_codeobj__184;
  PyObject *__pyx_codeobj__186;
  PyObject *__pyx_codeobj__187;
  PyObject *__pyx_codeobj__188;
  PyObject *__pyx_codeobj__190;
  PyObject *__pyx_codeobj__192;
  PyObject *__pyx_codeobj__194;
  PyObject *__pyx_codeobj__196;
  PyObject *__pyx_codeobj__198;
  PyObject *__pyx_codeobj__199;
  PyObject *__pyx_codeobj__200;
  PyObject *__pyx_codeobj__202;
  PyObject *__pyx_codeobj__204;
  PyObject *__pyx_codeobj__205;
  PyObject *__pyx_codeobj__207;
  PyObject *__pyx_codeobj__208;
  PyObject *__pyx_codeobj__210;
  PyObject *__pyx_codeobj__211;
  PyObject *__pyx_codeobj__212;
  PyObject *__pyx_codeobj__213;
  PyObject *__pyx_codeobj__214;
  PyObject *__pyx_codeobj__215;
  PyObject *__pyx_codeobj__220;
  PyObject *__pyx_codeobj__221;
  PyObject *__pyx_codeobj__222;
  PyObject *__pyx_codeobj__223;
  PyObject *__pyx_codeobj__224;
  PyObject *__pyx_codeobj__225;
  PyObject *__pyx_codeobj__226;
  PyObject *__pyx_codeobj__227;
  PyObject *__pyx_codeobj__228;
  PyObject *__pyx_codeobj__229;
  PyObject *__pyx_codeobj__230;
  PyObject *__pyx_codeobj__231;
  PyObject *__pyx_codeobj__232;
  PyObject *__pyx_codeobj__233;
  PyObject *__pyx_codeobj__234;
  PyObject *__pyx_codeobj__235;
  PyObject *__pyx_codeobj__236;
  PyObject *__pyx_codeobj__237;
  PyObject *__pyx_codeobj__238;
  PyObject *__pyx_codeobj__239;
  PyObject *__pyx_codeobj__240;
  PyObject *__pyx_codeobj__241;
  PyObject *__pyx_codeobj__242;
  PyObject *__pyx_codeobj__243;
  PyObject *__pyx_codeobj__244;
  PyObject *__pyx_codeobj__245;
  PyObject *__pyx_codeobj__247;
  PyObject *__pyx_codeobj__248;
  PyObject *__pyx_codeobj__249;
  PyObject *__pyx_codeobj__252;
  PyObject *__pyx_codeobj__253;
  PyObject *__pyx_codeobj__255;
  PyObject *__pyx_codeobj__257;
  PyObject *__pyx_codeobj__259;
  PyObject *__pyx_codeobj__260;
  PyObject *__pyx_codeobj__261;
  PyObject *__pyx_codeobj__262;
  PyObject *__pyx_codeobj__264;
  PyObject *__pyx_codeobj__266;
  PyObject *__pyx_codeobj__267;
  PyObject *__pyx_codeobj__268;
  PyObject *__pyx_codeobj__270;
  PyObject *__pyx_codeobj__272;
  PyObject *__pyx_codeobj__273;
  PyObject *__pyx_codeobj__274;
  PyObject *__pyx_codeobj__275;
  PyObject *__pyx_codeobj__276;
  PyObject *__pyx_codeobj__277;
  PyObject *__pyx_codeobj__278;
  PyObject *__pyx_codeobj__279;
  PyObject *__pyx_codeobj__280;
  PyObject *__pyx_codeobj__281;
  PyObject *__pyx_codeobj__282;
  PyObject *__pyx_codeobj__283;
  PyObject *__pyx_codeobj__284;
  PyObject *__pyx_codeobj__285;
  PyObject *__pyx_codeobj__286;
  PyObject *__pyx_codeobj__287;
  PyObject *__pyx_codeobj__288;
  PyObject *__pyx_codeobj__289;
  PyObject *__pyx_codeobj__290;
  PyObject *__pyx_codeobj__291;
  PyObject *__pyx_codeobj__292;
  PyObject *__pyx_codeobj__293;
  PyObject *__pyx_codeobj__294;
  PyObject *__pyx_codeobj__295;
  PyObject *__pyx_codeobj__296;
  PyObject *__pyx_codeobj__297;
  PyObject *__pyx_codeobj__298;
  PyObject *__pyx_codeobj__299;
  PyObject *__pyx_codeobj__300;
  PyObject *__pyx_codeobj__301;
  PyObject *__pyx_codeobj__303;
  PyObject *__pyx_codeobj__305;
  PyObject *__pyx_codeobj__307;
  PyObject *__pyx_codeobj__309;
  PyObject *__pyx_codeobj__310;
  PyObject *__pyx_codeobj__311;
  PyObject *__pyx_codeobj__312;
  PyObject *__pyx_codeobj__313;
  PyObject *__pyx_codeobj__315;
  PyObject *__pyx_codeobj__317;
  PyObject *__pyx_codeobj__318;
  PyObject *__pyx_codeobj__319;
  PyObject *__pyx_codeobj__321;
  PyObject *__pyx_codeobj__323;
  PyObject *__pyx_codeobj__326;
  PyObject *__pyx_codeobj__327;
  PyObject *__pyx_codeobj__329;
  PyObject *__pyx_codeobj__331;
  PyObject *__pyx_codeobj__332;
  PyObject *__pyx_codeobj__334;
  PyObject *__pyx_codeobj__336;
  PyObject *__pyx_codeobj__338;
  PyObject *__pyx_codeobj__339;
  PyObject *__pyx_codeobj__341;
  PyObject *__pyx_codeobj__343;
  PyObject *__pyx_codeobj__345;
  PyObject *__pyx_codeobj__346;
  PyObject *__pyx_codeobj__347;
  PyObject *__pyx_codeobj__348;
  PyObject *__pyx_codeobj__349;
  PyObject *__pyx_codeobj__350;
  PyObject *__pyx_codeobj__351;
  PyObject *__pyx_codeobj__352;
  PyObject *__pyx_codeobj__354;
  PyObject *__pyx_codeobj__356;
  PyObject *__pyx_codeobj__358;
  PyObject *__pyx_codeobj__360;
  PyObject *__pyx_codeobj__362;
  PyObject *__pyx_codeobj__364;
  PyObject *__pyx_codeobj__366;
  PyObject *__pyx_codeobj__368;
  PyObject *__pyx_codeobj__370;
  PyObject *__pyx_codeobj__372;
  PyObject *__pyx_codeobj__375;
  PyObject *__pyx_codeobj__377;
  PyObject *__pyx_codeobj__379;
  PyObject *__pyx_codeobj__381;
  PyObject *__pyx_codeobj__382;
  PyObject *__pyx_codeobj__384;
  PyObject *__pyx_codeobj__385;
  PyObject *__pyx_codeobj__386;
  PyObject *__pyx_codeobj__388;
  PyObject *__pyx_codeobj__389;
} __pyx_mstate;

#if CYTHON_USE_MODULE_STATE
#ifdef __cplusplus
namespace {
  extern struct PyModuleDef __pyx_moduledef;
} /* anonymous namespace */
#else
static struct PyModuleDef __pyx_moduledef;
#endif

#define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o))

#define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef)))

#define __pyx_m (PyState_FindModule(&__pyx_moduledef))
#else
static __pyx_mstate __pyx_mstate_global_static =
#ifdef __cplusplus
    {};
#else
    {0};
#endif
static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static;
#endif
/* #### Code section: module_state_clear ### */
#if CYTHON_USE_MODULE_STATE
static int __pyx_m_clear(PyObject *m) {
  __pyx_mstate *clear_module_state = __pyx_mstate(m);
  if (!clear_module_state) return 0;
  Py_CLEAR(clear_module_state->__pyx_d);
  Py_CLEAR(clear_module_state->__pyx_b);
  Py_CLEAR(clear_module_state->__pyx_cython_runtime);
  Py_CLEAR(clear_module_state->__pyx_empty_tuple);
  Py_CLEAR(clear_module_state->__pyx_empty_bytes);
  Py_CLEAR(clear_module_state->__pyx_empty_unicode);
  #ifdef __Pyx_CyFunction_USED
  Py_CLEAR(clear_module_state->__pyx_CyFunctionType);
  #endif
  #ifdef __Pyx_FusedFunction_USED
  Py_CLEAR(clear_module_state->__pyx_FusedFunctionType);
  #endif
  Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_4bool_bool);
  Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_4type_type);
  Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_7complex_complex);
  Py_CLEAR(clear_module_state->__pyx_ptype_7_amplpy_Row);
  Py_CLEAR(clear_module_state->__pyx_type_7_amplpy_Row);
  Py_CLEAR(clear_module_state->__pyx_ptype_7_amplpy_Column);
  Py_CLEAR(clear_module_state->__pyx_type_7_amplpy_Column);
  Py_CLEAR(clear_module_state->__pyx_ptype_7_amplpy_DataFrame);
  Py_CLEAR(clear_module_state->__pyx_type_7_amplpy_DataFrame);
  Py_CLEAR(clear_module_state->__pyx_ptype_7_amplpy_Entity);
  Py_CLEAR(clear_module_state->__pyx_type_7_amplpy_Entity);
  Py_CLEAR(clear_module_state->__pyx_ptype_7_amplpy_Constraint);
  Py_CLEAR(clear_module_state->__pyx_type_7_amplpy_Constraint);
  Py_CLEAR(clear_module_state->__pyx_ptype_7_amplpy_Environment);
  Py_CLEAR(clear_module_state->__pyx_type_7_amplpy_Environment);
  Py_CLEAR(clear_module_state->__pyx_ptype_7_amplpy_ErrorHandler);
  Py_CLEAR(clear_module_state->__pyx_type_7_amplpy_ErrorHandler);
  Py_CLEAR(clear_module_state->__pyx_ptype_7_amplpy_EnvIterator);
  Py_CLEAR(clear_module_state->__pyx_type_7_amplpy_EnvIterator);
  Py_CLEAR(clear_module_state->__pyx_ptype_7_amplpy_EntityMap);
  Py_CLEAR(clear_module_state->__pyx_type_7_amplpy_EntityMap);
  Py_CLEAR(clear_module_state->__pyx_ptype_7_amplpy_InstanceIterator);
  Py_CLEAR(clear_module_state->__pyx_type_7_amplpy_InstanceIterator);
  Py_CLEAR(clear_module_state->__pyx_ptype_7_amplpy_MemberRangeIterator);
  Py_CLEAR(clear_module_state->__pyx_type_7_amplpy_MemberRangeIterator);
  Py_CLEAR(clear_module_state->__pyx_ptype_7_amplpy_ColIterator);
  Py_CLEAR(clear_module_state->__pyx_type_7_amplpy_ColIterator);
  Py_CLEAR(clear_module_state->__pyx_ptype_7_amplpy_RowIterator);
  Py_CLEAR(clear_module_state->__pyx_type_7_amplpy_RowIterator);
  Py_CLEAR(clear_module_state->__pyx_ptype_7_amplpy_Objective);
  Py_CLEAR(clear_module_state->__pyx_type_7_amplpy_Objective);
  Py_CLEAR(clear_module_state->__pyx_ptype_7_amplpy_OutputHandler);
  Py_CLEAR(clear_module_state->__pyx_type_7_amplpy_OutputHandler);
  Py_CLEAR(clear_module_state->__pyx_ptype_7_amplpy_Parameter);
  Py_CLEAR(clear_module_state->__pyx_type_7_amplpy_Parameter);
  Py_CLEAR(clear_module_state->__pyx_ptype_7_amplpy_Set);
  Py_CLEAR(clear_module_state->__pyx_type_7_amplpy_Set);
  Py_CLEAR(clear_module_state->__pyx_ptype_7_amplpy_Variable);
  Py_CLEAR(clear_module_state->__pyx_type_7_amplpy_Variable);
  Py_CLEAR(clear_module_state->__pyx_ptype_7_amplpy_AMPL);
  Py_CLEAR(clear_module_state->__pyx_type_7_amplpy_AMPL);
  Py_CLEAR(clear_module_state->__pyx_ptype_7_amplpy___pyx_scope_struct____iter__);
  Py_CLEAR(clear_module_state->__pyx_type_7_amplpy___pyx_scope_struct____iter__);
  Py_CLEAR(clear_module_state->__pyx_ptype_7_amplpy___pyx_scope_struct_1_genexpr);
  Py_CLEAR(clear_module_state->__pyx_type_7_amplpy___pyx_scope_struct_1_genexpr);
  Py_CLEAR(clear_module_state->__pyx_ptype_7_amplpy___pyx_scope_struct_2_genexpr);
  Py_CLEAR(clear_module_state->__pyx_type_7_amplpy___pyx_scope_struct_2_genexpr);
  Py_CLEAR(clear_module_state->__pyx_ptype_7_amplpy___pyx_scope_struct_3_genexpr);
  Py_CLEAR(clear_module_state->__pyx_type_7_amplpy___pyx_scope_struct_3_genexpr);
  Py_CLEAR(clear_module_state->__pyx_ptype_7_amplpy___pyx_scope_struct_4__get_headers);
  Py_CLEAR(clear_module_state->__pyx_type_7_amplpy___pyx_scope_struct_4__get_headers);
  Py_CLEAR(clear_module_state->__pyx_ptype_7_amplpy___pyx_scope_struct_5_genexpr);
  Py_CLEAR(clear_module_state->__pyx_type_7_amplpy___pyx_scope_struct_5_genexpr);
  Py_CLEAR(clear_module_state->__pyx_ptype_7_amplpy___pyx_scope_struct_6_from_dict);
  Py_CLEAR(clear_module_state->__pyx_type_7_amplpy___pyx_scope_struct_6_from_dict);
  Py_CLEAR(clear_module_state->__pyx_ptype_7_amplpy___pyx_scope_struct_7_genexpr);
  Py_CLEAR(clear_module_state->__pyx_type_7_amplpy___pyx_scope_struct_7_genexpr);
  Py_CLEAR(clear_module_state->__pyx_ptype_7_amplpy___pyx_scope_struct_8_genexpr);
  Py_CLEAR(clear_module_state->__pyx_type_7_amplpy___pyx_scope_struct_8_genexpr);
  Py_CLEAR(clear_module_state->__pyx_ptype_7_amplpy___pyx_scope_struct_9_genexpr);
  Py_CLEAR(clear_module_state->__pyx_type_7_amplpy___pyx_scope_struct_9_genexpr);
  Py_CLEAR(clear_module_state->__pyx_ptype_7_amplpy___pyx_scope_struct_10_genexpr);
  Py_CLEAR(clear_module_state->__pyx_type_7_amplpy___pyx_scope_struct_10_genexpr);
  Py_CLEAR(clear_module_state->__pyx_ptype_7_amplpy___pyx_scope_struct_11_set_values);
  Py_CLEAR(clear_module_state->__pyx_type_7_amplpy___pyx_scope_struct_11_set_values);
  Py_CLEAR(clear_module_state->__pyx_ptype_7_amplpy___pyx_scope_struct_12_genexpr);
  Py_CLEAR(clear_module_state->__pyx_type_7_amplpy___pyx_scope_struct_12_genexpr);
  Py_CLEAR(clear_module_state->__pyx_ptype_7_amplpy___pyx_scope_struct_13_genexpr);
  Py_CLEAR(clear_module_state->__pyx_type_7_amplpy___pyx_scope_struct_13_genexpr);
  Py_CLEAR(clear_module_state->__pyx_ptype_7_amplpy___pyx_scope_struct_14_genexpr);
  Py_CLEAR(clear_module_state->__pyx_type_7_amplpy___pyx_scope_struct_14_genexpr);
  Py_CLEAR(clear_module_state->__pyx_ptype_7_amplpy___pyx_scope_struct_15_genexpr);
  Py_CLEAR(clear_module_state->__pyx_type_7_amplpy___pyx_scope_struct_15_genexpr);
  Py_CLEAR(clear_module_state->__pyx_kp_u_75);
  Py_CLEAR(clear_module_state->__pyx_n_s_AMPL);
  Py_CLEAR(clear_module_state->__pyx_n_s_AMPLException);
  Py_CLEAR(clear_module_state->__pyx_n_s_AMPLException___init);
  Py_CLEAR(clear_module_state->__pyx_n_s_AMPLException___str);
  Py_CLEAR(clear_module_state->__pyx_n_s_AMPLException_get_line_number);
  Py_CLEAR(clear_module_state->__pyx_n_s_AMPLException_get_message);
  Py_CLEAR(clear_module_state->__pyx_n_s_AMPLException_get_offset);
  Py_CLEAR(clear_module_state->__pyx_n_s_AMPLException_get_source_name);
  Py_CLEAR(clear_module_state->__pyx_kp_u_AMPL_AMPL_INVALID_SUBSCRIPT_EXCE);
  Py_CLEAR(clear_module_state->__pyx_kp_u_AMPL_AMPL_NO_DATA_EXCEPTION);
  Py_CLEAR(clear_module_state->__pyx_kp_u_AMPL_AMPL_SYNTAX_ERROR_EXCEPTION);
  Py_CLEAR(clear_module_state->__pyx_n_s_AMPL_NOT_FOUND_MESSAGE);
  Py_CLEAR(clear_module_state->__pyx_n_s_AMPL___reduce_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_AMPL___setstate_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_AMPL__con);
  Py_CLEAR(clear_module_state->__pyx_n_s_AMPL__load_session);
  Py_CLEAR(clear_module_state->__pyx_n_s_AMPL__obj);
  Py_CLEAR(clear_module_state->__pyx_n_s_AMPL__option);
  Py_CLEAR(clear_module_state->__pyx_n_s_AMPL__param);
  Py_CLEAR(clear_module_state->__pyx_n_s_AMPL__set);
  Py_CLEAR(clear_module_state->__pyx_n_s_AMPL__start_recording);
  Py_CLEAR(clear_module_state->__pyx_n_s_AMPL__stop_recording);
  Py_CLEAR(clear_module_state->__pyx_n_s_AMPL__var);
  Py_CLEAR(clear_module_state->__pyx_n_s_AMPL_cd);
  Py_CLEAR(clear_module_state->__pyx_n_s_AMPL_close);
  Py_CLEAR(clear_module_state->__pyx_kp_u_AMPL_could_not_be_started);
  Py_CLEAR(clear_module_state->__pyx_n_s_AMPL_display);
  Py_CLEAR(clear_module_state->__pyx_n_s_AMPL_eval);
  Py_CLEAR(clear_module_state->__pyx_n_s_AMPL_export_data);
  Py_CLEAR(clear_module_state->__pyx_n_s_AMPL_export_model);
  Py_CLEAR(clear_module_state->__pyx_n_s_AMPL_get_constraint);
  Py_CLEAR(clear_module_state->__pyx_n_s_AMPL_get_constraints);
  Py_CLEAR(clear_module_state->__pyx_n_s_AMPL_get_current_objective);
  Py_CLEAR(clear_module_state->__pyx_n_s_AMPL_get_data);
  Py_CLEAR(clear_module_state->__pyx_n_s_AMPL_get_entity);
  Py_CLEAR(clear_module_state->__pyx_n_s_AMPL_get_error_handler);
  Py_CLEAR(clear_module_state->__pyx_n_s_AMPL_get_iis);
  Py_CLEAR(clear_module_state->__pyx_n_s_AMPL_get_objective);
  Py_CLEAR(clear_module_state->__pyx_n_s_AMPL_get_objectives);
  Py_CLEAR(clear_module_state->__pyx_n_s_AMPL_get_option);
  Py_CLEAR(clear_module_state->__pyx_n_s_AMPL_get_output);
  Py_CLEAR(clear_module_state->__pyx_n_s_AMPL_get_output_handler);
  Py_CLEAR(clear_module_state->__pyx_n_s_AMPL_get_parameter);
  Py_CLEAR(clear_module_state->__pyx_n_s_AMPL_get_parameters);
  Py_CLEAR(clear_module_state->__pyx_n_s_AMPL_get_set);
  Py_CLEAR(clear_module_state->__pyx_n_s_AMPL_get_sets);
  Py_CLEAR(clear_module_state->__pyx_n_s_AMPL_get_solution);
  Py_CLEAR(clear_module_state->__pyx_n_s_AMPL_get_value);
  Py_CLEAR(clear_module_state->__pyx_n_s_AMPL_get_variable);
  Py_CLEAR(clear_module_state->__pyx_n_s_AMPL_get_variables);
  Py_CLEAR(clear_module_state->__pyx_n_s_AMPL_is_running);
  Py_CLEAR(clear_module_state->__pyx_n_s_AMPL_read);
  Py_CLEAR(clear_module_state->__pyx_n_s_AMPL_read_data);
  Py_CLEAR(clear_module_state->__pyx_n_s_AMPL_read_table);
  Py_CLEAR(clear_module_state->__pyx_n_s_AMPL_reset);
  Py_CLEAR(clear_module_state->__pyx_n_s_AMPL_set_data);
  Py_CLEAR(clear_module_state->__pyx_n_s_AMPL_set_error_handler);
  Py_CLEAR(clear_module_state->__pyx_n_s_AMPL_set_option);
  Py_CLEAR(clear_module_state->__pyx_n_s_AMPL_set_output_handler);
  Py_CLEAR(clear_module_state->__pyx_n_s_AMPL_snapshot);
  Py_CLEAR(clear_module_state->__pyx_n_s_AMPL_solve);
  Py_CLEAR(clear_module_state->__pyx_kp_u_AMPL_unknown_return_code);
  Py_CLEAR(clear_module_state->__pyx_n_s_AMPL_write);
  Py_CLEAR(clear_module_state->__pyx_n_s_AMPL_write_table);
  Py_CLEAR(clear_module_state->__pyx_kp_u_A_constraint_called_name_cannot);
  Py_CLEAR(clear_module_state->__pyx_kp_u_A_parameter_called_name_cannot_b);
  Py_CLEAR(clear_module_state->__pyx_kp_u_A_set_called_name_cannot_be_foun);
  Py_CLEAR(clear_module_state->__pyx_kp_u_A_variable_called_name_cannot_be);
  Py_CLEAR(clear_module_state->__pyx_kp_u_All_values_must_be_either_number);
  Py_CLEAR(clear_module_state->__pyx_kp_u_An_objective_called_name_cannot);
  Py_CLEAR(clear_module_state->__pyx_n_s_AssertionError);
  Py_CLEAR(clear_module_state->__pyx_n_s_AttributeError);
  Py_CLEAR(clear_module_state->__pyx_n_s_BREAK);
  Py_CLEAR(clear_module_state->__pyx_n_s_BREAKPOINT);
  Py_CLEAR(clear_module_state->__pyx_n_s_CALL);
  Py_CLEAR(clear_module_state->__pyx_n_s_CD);
  Py_CLEAR(clear_module_state->__pyx_n_s_CHECK);
  Py_CLEAR(clear_module_state->__pyx_n_s_CLOSE);
  Py_CLEAR(clear_module_state->__pyx_n_s_COMMANDS);
  Py_CLEAR(clear_module_state->__pyx_n_s_CONTINUE);
  Py_CLEAR(clear_module_state->__pyx_n_s_ColIterator);
  Py_CLEAR(clear_module_state->__pyx_n_s_ColIterator___reduce_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_ColIterator___setstate_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_Column);
  Py_CLEAR(clear_module_state->__pyx_n_s_Column___reduce_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_Column___setstate_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_Column_to_list);
  Py_CLEAR(clear_module_state->__pyx_n_s_Column_to_string);
  Py_CLEAR(clear_module_state->__pyx_n_s_Constraint);
  Py_CLEAR(clear_module_state->__pyx_n_s_Constraint___reduce_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_Constraint___setstate_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_Constraint_astatus);
  Py_CLEAR(clear_module_state->__pyx_n_s_Constraint_body);
  Py_CLEAR(clear_module_state->__pyx_n_s_Constraint_defvar);
  Py_CLEAR(clear_module_state->__pyx_n_s_Constraint_dinit);
  Py_CLEAR(clear_module_state->__pyx_n_s_Constraint_dinit0);
  Py_CLEAR(clear_module_state->__pyx_n_s_Constraint_drop);
  Py_CLEAR(clear_module_state->__pyx_n_s_Constraint_dual);
  Py_CLEAR(clear_module_state->__pyx_n_s_Constraint_is_logical);
  Py_CLEAR(clear_module_state->__pyx_n_s_Constraint_lb);
  Py_CLEAR(clear_module_state->__pyx_n_s_Constraint_lbs);
  Py_CLEAR(clear_module_state->__pyx_n_s_Constraint_ldual);
  Py_CLEAR(clear_module_state->__pyx_n_s_Constraint_lslack);
  Py_CLEAR(clear_module_state->__pyx_n_s_Constraint_restore);
  Py_CLEAR(clear_module_state->__pyx_n_s_Constraint_set_dual);
  Py_CLEAR(clear_module_state->__pyx_n_s_Constraint_slack);
  Py_CLEAR(clear_module_state->__pyx_n_s_Constraint_sstatus);
  Py_CLEAR(clear_module_state->__pyx_n_s_Constraint_status);
  Py_CLEAR(clear_module_state->__pyx_n_s_Constraint_ub);
  Py_CLEAR(clear_module_state->__pyx_n_s_Constraint_ubs);
  Py_CLEAR(clear_module_state->__pyx_n_s_Constraint_udual);
  Py_CLEAR(clear_module_state->__pyx_n_s_Constraint_uslack);
  Py_CLEAR(clear_module_state->__pyx_n_s_Constraint_val);
  Py_CLEAR(clear_module_state->__pyx_n_s_Constraints);
  Py_CLEAR(clear_module_state->__pyx_n_s_DATA);
  Py_CLEAR(clear_module_state->__pyx_n_s_DELETECMD);
  Py_CLEAR(clear_module_state->__pyx_n_s_DISPLAY);
  Py_CLEAR(clear_module_state->__pyx_n_s_DROP);
  Py_CLEAR(clear_module_state->__pyx_n_s_DROP_OR_RESTORE_ALL);
  Py_CLEAR(clear_module_state->__pyx_n_s_DataFrame);
  Py_CLEAR(clear_module_state->__pyx_n_s_DataFrame___reduce_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_DataFrame___setstate_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_DataFrame__add_column);
  Py_CLEAR(clear_module_state->__pyx_n_s_DataFrame__add_row);
  Py_CLEAR(clear_module_state->__pyx_n_s_DataFrame__from_data_frame_ref);
  Py_CLEAR(clear_module_state->__pyx_n_s_DataFrame__get_column);
  Py_CLEAR(clear_module_state->__pyx_n_s_DataFrame__get_headers);
  Py_CLEAR(clear_module_state->__pyx_n_s_DataFrame__get_num_cols);
  Py_CLEAR(clear_module_state->__pyx_n_s_DataFrame__get_num_indices);
  Py_CLEAR(clear_module_state->__pyx_n_s_DataFrame__get_num_rows);
  Py_CLEAR(clear_module_state->__pyx_n_s_DataFrame__get_row);
  Py_CLEAR(clear_module_state->__pyx_n_s_DataFrame__get_row_by_index);
  Py_CLEAR(clear_module_state->__pyx_n_s_DataFrame__set_column);
  Py_CLEAR(clear_module_state->__pyx_n_s_DataFrame__set_values);
  Py_CLEAR(clear_module_state->__pyx_n_s_DataFrame_from_dict);
  Py_CLEAR(clear_module_state->__pyx_n_s_DataFrame_from_numpy);
  Py_CLEAR(clear_module_state->__pyx_n_s_DataFrame_from_pandas);
  Py_CLEAR(clear_module_state->__pyx_n_s_DataFrame_to_dict);
  Py_CLEAR(clear_module_state->__pyx_n_s_DataFrame_to_list);
  Py_CLEAR(clear_module_state->__pyx_n_s_DataFrame_to_pandas);
  Py_CLEAR(clear_module_state->__pyx_n_s_DataFrame_to_string);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Dictionary_must_contain_either_a);
  Py_CLEAR(clear_module_state->__pyx_n_s_ELSE);
  Py_CLEAR(clear_module_state->__pyx_n_s_ELSE_CHECK);
  Py_CLEAR(clear_module_state->__pyx_n_s_ENDIF);
  Py_CLEAR(clear_module_state->__pyx_n_s_ENVIRON);
  Py_CLEAR(clear_module_state->__pyx_n_s_EXIT);
  Py_CLEAR(clear_module_state->__pyx_n_s_EXPAND);
  Py_CLEAR(clear_module_state->__pyx_n_s_Entity);
  Py_CLEAR(clear_module_state->__pyx_n_s_EntityMap);
  Py_CLEAR(clear_module_state->__pyx_n_s_EntityMap___reduce_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_EntityMap___setstate_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_EntityMap_size);
  Py_CLEAR(clear_module_state->__pyx_n_s_Entity___reduce_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_Entity___setstate_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_Entity_find);
  Py_CLEAR(clear_module_state->__pyx_n_s_Entity_get);
  Py_CLEAR(clear_module_state->__pyx_n_s_Entity_get_indexing_sets);
  Py_CLEAR(clear_module_state->__pyx_n_s_Entity_get_values);
  Py_CLEAR(clear_module_state->__pyx_n_s_Entity_indexarity);
  Py_CLEAR(clear_module_state->__pyx_n_s_Entity_instances);
  Py_CLEAR(clear_module_state->__pyx_n_s_Entity_is_scalar);
  Py_CLEAR(clear_module_state->__pyx_n_s_Entity_name);
  Py_CLEAR(clear_module_state->__pyx_n_s_Entity_num_instances);
  Py_CLEAR(clear_module_state->__pyx_n_s_Entity_set_values);
  Py_CLEAR(clear_module_state->__pyx_n_s_Entity_to_dict);
  Py_CLEAR(clear_module_state->__pyx_n_s_Entity_to_list);
  Py_CLEAR(clear_module_state->__pyx_n_s_Entity_to_pandas);
  Py_CLEAR(clear_module_state->__pyx_n_s_Entity_to_string);
  Py_CLEAR(clear_module_state->__pyx_n_s_Entity_xref);
  Py_CLEAR(clear_module_state->__pyx_n_s_Enum);
  Py_CLEAR(clear_module_state->__pyx_n_s_EnvIterator);
  Py_CLEAR(clear_module_state->__pyx_n_s_EnvIterator___reduce_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_EnvIterator___setstate_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_Environment);
  Py_CLEAR(clear_module_state->__pyx_n_s_Environment___reduce_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_Environment___setstate_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_Environment_get_bin_dir);
  Py_CLEAR(clear_module_state->__pyx_n_s_Environment_get_bin_name);
  Py_CLEAR(clear_module_state->__pyx_n_s_Environment_set_bin_dir);
  Py_CLEAR(clear_module_state->__pyx_n_s_Environment_set_bin_name);
  Py_CLEAR(clear_module_state->__pyx_n_s_Environment_to_string);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Error);
  Py_CLEAR(clear_module_state->__pyx_n_s_ErrorHandler);
  Py_CLEAR(clear_module_state->__pyx_n_s_ErrorHandler___reduce_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_ErrorHandler___setstate_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_ErrorHandler_error);
  Py_CLEAR(clear_module_state->__pyx_n_s_ErrorHandler_warning);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Excepted_dictionary_of_set_membe);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Excepted_string_or_real);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Excepted_tuple_of_arity);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Expected_a_dictionary);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Expected_tuples_of_arity);
  Py_CLEAR(clear_module_state->__pyx_n_s_FIX);
  Py_CLEAR(clear_module_state->__pyx_n_s_FOR);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Failed_to_access_value);
  Py_CLEAR(clear_module_state->__pyx_n_s_IF);
  Py_CLEAR(clear_module_state->__pyx_n_s_IOError);
  Py_CLEAR(clear_module_state->__pyx_n_s_ImportError);
  Py_CLEAR(clear_module_state->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0);
  Py_CLEAR(clear_module_state->__pyx_n_s_InfeasibilityException);
  Py_CLEAR(clear_module_state->__pyx_kp_u_InfeasibilityException_2);
  Py_CLEAR(clear_module_state->__pyx_n_s_InstanceIterator);
  Py_CLEAR(clear_module_state->__pyx_n_s_InstanceIterator___reduce_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_InstanceIterator___setstate_cyth);
  Py_CLEAR(clear_module_state->__pyx_n_s_InstanceIterator_size);
  Py_CLEAR(clear_module_state->__pyx_n_s_Iterable);
  Py_CLEAR(clear_module_state->__pyx_n_s_KeyError);
  Py_CLEAR(clear_module_state->__pyx_n_s_Kind);
  Py_CLEAR(clear_module_state->__pyx_n_s_LET);
  Py_CLEAR(clear_module_state->__pyx_n_s_LOAD);
  Py_CLEAR(clear_module_state->__pyx_n_s_LOOPEND);
  Py_CLEAR(clear_module_state->__pyx_n_s_MISC);
  Py_CLEAR(clear_module_state->__pyx_n_s_MemberRangeIterator);
  Py_CLEAR(clear_module_state->__pyx_n_s_MemberRangeIterator___reduce_cyt);
  Py_CLEAR(clear_module_state->__pyx_n_s_MemberRangeIterator___setstate_c);
  Py_CLEAR(clear_module_state->__pyx_n_s_MemberRangeIterator_size);
  Py_CLEAR(clear_module_state->__pyx_n_s_MemoryError);
  Py_CLEAR(clear_module_state->__pyx_n_s_MultiIndex);
  Py_CLEAR(clear_module_state->__pyx_n_s_NotImplementedError);
  Py_CLEAR(clear_module_state->__pyx_n_s_OBJECTIVE);
  Py_CLEAR(clear_module_state->__pyx_n_s_OPTION);
  Py_CLEAR(clear_module_state->__pyx_n_s_OPTION_RESET);
  Py_CLEAR(clear_module_state->__pyx_n_s_Objective);
  Py_CLEAR(clear_module_state->__pyx_n_s_Objective___reduce_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_Objective___setstate_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_Objective_astatus);
  Py_CLEAR(clear_module_state->__pyx_n_s_Objective_drop);
  Py_CLEAR(clear_module_state->__pyx_n_s_Objective_exitcode);
  Py_CLEAR(clear_module_state->__pyx_n_s_Objective_message);
  Py_CLEAR(clear_module_state->__pyx_n_s_Objective_minimization);
  Py_CLEAR(clear_module_state->__pyx_n_s_Objective_restore);
  Py_CLEAR(clear_module_state->__pyx_n_s_Objective_result);
  Py_CLEAR(clear_module_state->__pyx_n_s_Objective_sstatus);
  Py_CLEAR(clear_module_state->__pyx_n_s_Objective_value);
  Py_CLEAR(clear_module_state->__pyx_n_s_Objectives);
  Py_CLEAR(clear_module_state->__pyx_n_s_Options);
  Py_CLEAR(clear_module_state->__pyx_n_s_OutputHandler);
  Py_CLEAR(clear_module_state->__pyx_n_s_OutputHandler___reduce_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_OutputHandler___setstate_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_OutputHandler_output);
  Py_CLEAR(clear_module_state->__pyx_n_s_PRINT);
  Py_CLEAR(clear_module_state->__pyx_n_s_PRINTF);
  Py_CLEAR(clear_module_state->__pyx_n_s_PROBLEM);
  Py_CLEAR(clear_module_state->__pyx_n_s_PROMPT);
  Py_CLEAR(clear_module_state->__pyx_n_s_PURGE);
  Py_CLEAR(clear_module_state->__pyx_n_s_Parameter);
  Py_CLEAR(clear_module_state->__pyx_n_s_Parameter___reduce_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_Parameter___setstate_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_Parameter_has_default);
  Py_CLEAR(clear_module_state->__pyx_n_s_Parameter_is_symbolic);
  Py_CLEAR(clear_module_state->__pyx_n_s_Parameter_set);
  Py_CLEAR(clear_module_state->__pyx_n_s_Parameter_set_values);
  Py_CLEAR(clear_module_state->__pyx_n_s_Parameter_value);
  Py_CLEAR(clear_module_state->__pyx_n_s_Parameters);
  Py_CLEAR(clear_module_state->__pyx_n_s_PickleError);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Please_make_sure_that_the_AMPL);
  Py_CLEAR(clear_module_state->__pyx_n_s_PresolveException);
  Py_CLEAR(clear_module_state->__pyx_kp_u_PresolveException_2);
  Py_CLEAR(clear_module_state->__pyx_n_s_RBRACE);
  Py_CLEAR(clear_module_state->__pyx_n_s_READ);
  Py_CLEAR(clear_module_state->__pyx_n_s_READTABLE);
  Py_CLEAR(clear_module_state->__pyx_n_s_READ_TABLE);
  Py_CLEAR(clear_module_state->__pyx_n_s_RELOAD);
  Py_CLEAR(clear_module_state->__pyx_n_s_REMOVE);
  Py_CLEAR(clear_module_state->__pyx_n_s_REPEAT);
  Py_CLEAR(clear_module_state->__pyx_n_s_REPEAT_END);
  Py_CLEAR(clear_module_state->__pyx_n_s_RESET);
  Py_CLEAR(clear_module_state->__pyx_n_s_RESTORE);
  Py_CLEAR(clear_module_state->__pyx_n_s_RUN_ARGS);
  Py_CLEAR(clear_module_state->__pyx_n_s_Real);
  Py_CLEAR(clear_module_state->__pyx_kp_s_Represent_an_exception_generate);
  Py_CLEAR(clear_module_state->__pyx_kp_s_Represents_the_type_of_the_outp);
  Py_CLEAR(clear_module_state->__pyx_n_s_Row);
  Py_CLEAR(clear_module_state->__pyx_n_s_RowIterator);
  Py_CLEAR(clear_module_state->__pyx_n_s_RowIterator___reduce_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_RowIterator___setstate_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_Row___reduce_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_Row___setstate_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_Row_to_string);
  Py_CLEAR(clear_module_state->__pyx_n_s_RuntimeError);
  Py_CLEAR(clear_module_state->__pyx_n_s_SEMICOLON);
  Py_CLEAR(clear_module_state->__pyx_n_s_SHELL_MESSAGE);
  Py_CLEAR(clear_module_state->__pyx_n_s_SHELL_OUTPUT);
  Py_CLEAR(clear_module_state->__pyx_n_s_SHOW);
  Py_CLEAR(clear_module_state->__pyx_n_s_SOLUTION);
  Py_CLEAR(clear_module_state->__pyx_n_s_SOLVE);
  Py_CLEAR(clear_module_state->__pyx_n_s_SSTEP);
  Py_CLEAR(clear_module_state->__pyx_n_s_SUPPORT_MESSAGE);
  Py_CLEAR(clear_module_state->__pyx_n_s_Series);
  Py_CLEAR(clear_module_state->__pyx_n_s_Set);
  Py_CLEAR(clear_module_state->__pyx_n_s_Set___reduce_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_Set___setstate_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_Set_arity);
  Py_CLEAR(clear_module_state->__pyx_n_s_Set_contains);
  Py_CLEAR(clear_module_state->__pyx_n_s_Set_get_values);
  Py_CLEAR(clear_module_state->__pyx_n_s_Set_instances);
  Py_CLEAR(clear_module_state->__pyx_n_s_Set_members);
  Py_CLEAR(clear_module_state->__pyx_n_s_Set_set_values);
  Py_CLEAR(clear_module_state->__pyx_n_s_Set_size);
  Py_CLEAR(clear_module_state->__pyx_n_s_Sets);
  Py_CLEAR(clear_module_state->__pyx_n_s_StopIteration);
  Py_CLEAR(clear_module_state->__pyx_n_s_SystemError);
  Py_CLEAR(clear_module_state->__pyx_n_s_THEN);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Trying_to_assign_tuples_to_set_o);
  Py_CLEAR(clear_module_state->__pyx_n_s_TypeError);
  Py_CLEAR(clear_module_state->__pyx_n_s_UNFIX);
  Py_CLEAR(clear_module_state->__pyx_n_s_UNLOAD);
  Py_CLEAR(clear_module_state->__pyx_n_s_UPDATE);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Unable_to_allocate_memory_for_ar);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Unexpected_data_type);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Unknown_entity_class);
  Py_CLEAR(clear_module_state->__pyx_n_s_ValueError);
  Py_CLEAR(clear_module_state->__pyx_n_s_Variable);
  Py_CLEAR(clear_module_state->__pyx_n_s_Variable___reduce_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_Variable___setstate_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_Variable_astatus);
  Py_CLEAR(clear_module_state->__pyx_n_s_Variable_defeqn);
  Py_CLEAR(clear_module_state->__pyx_n_s_Variable_dual);
  Py_CLEAR(clear_module_state->__pyx_n_s_Variable_fix);
  Py_CLEAR(clear_module_state->__pyx_n_s_Variable_init);
  Py_CLEAR(clear_module_state->__pyx_n_s_Variable_init0);
  Py_CLEAR(clear_module_state->__pyx_n_s_Variable_lb);
  Py_CLEAR(clear_module_state->__pyx_n_s_Variable_lb0);
  Py_CLEAR(clear_module_state->__pyx_n_s_Variable_lb1);
  Py_CLEAR(clear_module_state->__pyx_n_s_Variable_lb2);
  Py_CLEAR(clear_module_state->__pyx_n_s_Variable_lrc);
  Py_CLEAR(clear_module_state->__pyx_n_s_Variable_lslack);
  Py_CLEAR(clear_module_state->__pyx_n_s_Variable_rc);
  Py_CLEAR(clear_module_state->__pyx_n_s_Variable_set_value);
  Py_CLEAR(clear_module_state->__pyx_n_s_Variable_slack);
  Py_CLEAR(clear_module_state->__pyx_n_s_Variable_sstatus);
  Py_CLEAR(clear_module_state->__pyx_n_s_Variable_status);
  Py_CLEAR(clear_module_state->__pyx_n_s_Variable_ub);
  Py_CLEAR(clear_module_state->__pyx_n_s_Variable_ub0);
  Py_CLEAR(clear_module_state->__pyx_n_s_Variable_ub1);
  Py_CLEAR(clear_module_state->__pyx_n_s_Variable_ub2);
  Py_CLEAR(clear_module_state->__pyx_n_s_Variable_unfix);
  Py_CLEAR(clear_module_state->__pyx_n_s_Variable_urc);
  Py_CLEAR(clear_module_state->__pyx_n_s_Variable_uslack);
  Py_CLEAR(clear_module_state->__pyx_n_s_Variable_value);
  Py_CLEAR(clear_module_state->__pyx_n_s_Variables);
  Py_CLEAR(clear_module_state->__pyx_n_s_WAITING);
  Py_CLEAR(clear_module_state->__pyx_n_s_WRITE);
  Py_CLEAR(clear_module_state->__pyx_n_s_WRITETABLE);
  Py_CLEAR(clear_module_state->__pyx_n_s_WRITE_TABLE);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Warning);
  Py_CLEAR(clear_module_state->__pyx_n_s_XREF);
  Py_CLEAR(clear_module_state->__pyx_kp_u__21);
  Py_CLEAR(clear_module_state->__pyx_kp_u__22);
  Py_CLEAR(clear_module_state->__pyx_kp_u__24);
  Py_CLEAR(clear_module_state->__pyx_kp_u__25);
  Py_CLEAR(clear_module_state->__pyx_kp_u__26);
  Py_CLEAR(clear_module_state->__pyx_kp_u__33);
  Py_CLEAR(clear_module_state->__pyx_kp_u__34);
  Py_CLEAR(clear_module_state->__pyx_kp_u__35);
  Py_CLEAR(clear_module_state->__pyx_kp_u__36);
  Py_CLEAR(clear_module_state->__pyx_kp_u__38);
  Py_CLEAR(clear_module_state->__pyx_kp_u__39);
  Py_CLEAR(clear_module_state->__pyx_n_s__390);
  Py_CLEAR(clear_module_state->__pyx_kp_u__40);
  Py_CLEAR(clear_module_state->__pyx_kp_u__41);
  Py_CLEAR(clear_module_state->__pyx_n_s__84);
  Py_CLEAR(clear_module_state->__pyx_n_s_addColumn);
  Py_CLEAR(clear_module_state->__pyx_n_s_addRow);
  Py_CLEAR(clear_module_state->__pyx_n_s_add_column);
  Py_CLEAR(clear_module_state->__pyx_n_s_add_column_locals_genexpr);
  Py_CLEAR(clear_module_state->__pyx_n_s_add_row);
  Py_CLEAR(clear_module_state->__pyx_n_s_ampl);
  Py_CLEAR(clear_module_state->__pyx_n_s_ampl_expressions);
  Py_CLEAR(clear_module_state->__pyx_n_u_ampl_libpath);
  Py_CLEAR(clear_module_state->__pyx_n_s_amplpy);
  Py_CLEAR(clear_module_state->__pyx_kp_s_amplpy_ampl_pyx);
  Py_CLEAR(clear_module_state->__pyx_kp_s_amplpy_constraint_pxi);
  Py_CLEAR(clear_module_state->__pyx_kp_s_amplpy_dataframe_pxi);
  Py_CLEAR(clear_module_state->__pyx_kp_s_amplpy_entity_pxi);
  Py_CLEAR(clear_module_state->__pyx_kp_s_amplpy_environment_pxi);
  Py_CLEAR(clear_module_state->__pyx_kp_s_amplpy_errorhandler_pxi);
  Py_CLEAR(clear_module_state->__pyx_kp_s_amplpy_exceptions_pxi);
  Py_CLEAR(clear_module_state->__pyx_kp_s_amplpy_iterators_pxi);
  Py_CLEAR(clear_module_state->__pyx_kp_s_amplpy_objective_pxi);
  Py_CLEAR(clear_module_state->__pyx_kp_s_amplpy_outputhandler_pxi);
  Py_CLEAR(clear_module_state->__pyx_kp_s_amplpy_parameter_pxi);
  Py_CLEAR(clear_module_state->__pyx_kp_s_amplpy_set_pxi);
  Py_CLEAR(clear_module_state->__pyx_kp_s_amplpy_variable_pxi);
  Py_CLEAR(clear_module_state->__pyx_n_s_args);
  Py_CLEAR(clear_module_state->__pyx_n_s_arity);
  Py_CLEAR(clear_module_state->__pyx_n_s_array);
  Py_CLEAR(clear_module_state->__pyx_n_s_ast);
  Py_CLEAR(clear_module_state->__pyx_n_s_astatus);
  Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines);
  Py_CLEAR(clear_module_state->__pyx_n_s_auxfiles);
  Py_CLEAR(clear_module_state->__pyx_n_s_bin_dir);
  Py_CLEAR(clear_module_state->__pyx_n_s_bin_dir_c);
  Py_CLEAR(clear_module_state->__pyx_n_s_bin_name);
  Py_CLEAR(clear_module_state->__pyx_n_s_bin_name_c);
  Py_CLEAR(clear_module_state->__pyx_n_s_binary_directory);
  Py_CLEAR(clear_module_state->__pyx_n_s_binary_name);
  Py_CLEAR(clear_module_state->__pyx_n_s_body);
  Py_CLEAR(clear_module_state->__pyx_n_u_c);
  Py_CLEAR(clear_module_state->__pyx_n_s_c_double_array);
  Py_CLEAR(clear_module_state->__pyx_n_s_c_string_array);
  Py_CLEAR(clear_module_state->__pyx_kp_u_cannot_convert_to_dictionary_wit);
  Py_CLEAR(clear_module_state->__pyx_n_s_cast_row);
  Py_CLEAR(clear_module_state->__pyx_n_s_cast_value);
  Py_CLEAR(clear_module_state->__pyx_n_s_cd);
  Py_CLEAR(clear_module_state->__pyx_n_s_chain);
  Py_CLEAR(clear_module_state->__pyx_n_s_cindex);
  Py_CLEAR(clear_module_state->__pyx_n_s_class_getitem);
  Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback);
  Py_CLEAR(clear_module_state->__pyx_n_s_close);
  Py_CLEAR(clear_module_state->__pyx_n_s_cls);
  Py_CLEAR(clear_module_state->__pyx_n_s_cname);
  Py_CLEAR(clear_module_state->__pyx_n_s_col);
  Py_CLEAR(clear_module_state->__pyx_n_s_collections_abc);
  Py_CLEAR(clear_module_state->__pyx_n_s_column);
  Py_CLEAR(clear_module_state->__pyx_n_s_column_names);
  Py_CLEAR(clear_module_state->__pyx_n_s_columns);
  Py_CLEAR(clear_module_state->__pyx_n_s_con);
  Py_CLEAR(clear_module_state->__pyx_n_s_con_2);
  Py_CLEAR(clear_module_state->__pyx_n_s_con_locals_Constraints);
  Py_CLEAR(clear_module_state->__pyx_n_s_con_locals_Constraints___getite);
  Py_CLEAR(clear_module_state->__pyx_n_s_con_locals_Constraints___init);
  Py_CLEAR(clear_module_state->__pyx_n_s_con_locals_Constraints___iter);
  Py_CLEAR(clear_module_state->__pyx_n_s_con_locals_Constraints___setite);
  Py_CLEAR(clear_module_state->__pyx_n_s_contains);
  Py_CLEAR(clear_module_state->__pyx_n_s_contains_c);
  Py_CLEAR(clear_module_state->__pyx_n_s_conv_to_list);
  Py_CLEAR(clear_module_state->__pyx_n_s_d);
  Py_CLEAR(clear_module_state->__pyx_n_s_data);
  Py_CLEAR(clear_module_state->__pyx_n_s_data_c);
  Py_CLEAR(clear_module_state->__pyx_n_s_data_frame);
  Py_CLEAR(clear_module_state->__pyx_n_s_defeqn);
  Py_CLEAR(clear_module_state->__pyx_n_s_defvar);
  Py_CLEAR(clear_module_state->__pyx_n_s_df);
  Py_CLEAR(clear_module_state->__pyx_n_s_df_c);
  Py_CLEAR(clear_module_state->__pyx_n_s_df_ref);
  Py_CLEAR(clear_module_state->__pyx_n_s_dic);
  Py_CLEAR(clear_module_state->__pyx_n_s_dict);
  Py_CLEAR(clear_module_state->__pyx_n_s_dict_2);
  Py_CLEAR(clear_module_state->__pyx_n_s_dimen);
  Py_CLEAR(clear_module_state->__pyx_n_s_dinit);
  Py_CLEAR(clear_module_state->__pyx_n_s_dinit0);
  Py_CLEAR(clear_module_state->__pyx_kp_u_disable);
  Py_CLEAR(clear_module_state->__pyx_n_s_display);
  Py_CLEAR(clear_module_state->__pyx_n_u_display);
  Py_CLEAR(clear_module_state->__pyx_n_s_display_error_message);
  Py_CLEAR(clear_module_state->__pyx_n_s_doc);
  Py_CLEAR(clear_module_state->__pyx_n_s_drop);
  Py_CLEAR(clear_module_state->__pyx_n_s_dual);
  Py_CLEAR(clear_module_state->__pyx_n_s_e);
  Py_CLEAR(clear_module_state->__pyx_kp_u_enable);
  Py_CLEAR(clear_module_state->__pyx_n_s_encode);
  Py_CLEAR(clear_module_state->__pyx_n_s_end);
  Py_CLEAR(clear_module_state->__pyx_n_s_endswith);
  Py_CLEAR(clear_module_state->__pyx_n_s_entity);
  Py_CLEAR(clear_module_state->__pyx_n_s_entitytype);
  Py_CLEAR(clear_module_state->__pyx_n_s_enum);
  Py_CLEAR(clear_module_state->__pyx_n_s_enumerate);
  Py_CLEAR(clear_module_state->__pyx_n_s_environ);
  Py_CLEAR(clear_module_state->__pyx_n_s_environment);
  Py_CLEAR(clear_module_state->__pyx_n_s_error);
  Py_CLEAR(clear_module_state->__pyx_n_s_error_handler);
  Py_CLEAR(clear_module_state->__pyx_n_s_errorinfo);
  Py_CLEAR(clear_module_state->__pyx_n_s_eval);
  Py_CLEAR(clear_module_state->__pyx_n_s_exception);
  Py_CLEAR(clear_module_state->__pyx_n_s_exists);
  Py_CLEAR(clear_module_state->__pyx_n_s_exitcode);
  Py_CLEAR(clear_module_state->__pyx_n_s_exp);
  Py_CLEAR(clear_module_state->__pyx_n_s_exportData);
  Py_CLEAR(clear_module_state->__pyx_n_s_exportModel);
  Py_CLEAR(clear_module_state->__pyx_n_s_export_data);
  Py_CLEAR(clear_module_state->__pyx_n_s_export_model);
  Py_CLEAR(clear_module_state->__pyx_n_s_exprs);
  Py_CLEAR(clear_module_state->__pyx_kp_u_file);
  Py_CLEAR(clear_module_state->__pyx_n_s_file_2);
  Py_CLEAR(clear_module_state->__pyx_n_s_filename);
  Py_CLEAR(clear_module_state->__pyx_n_s_find);
  Py_CLEAR(clear_module_state->__pyx_n_s_fix);
  Py_CLEAR(clear_module_state->__pyx_n_s_flat);
  Py_CLEAR(clear_module_state->__pyx_n_s_flush);
  Py_CLEAR(clear_module_state->__pyx_n_s_fromDict);
  Py_CLEAR(clear_module_state->__pyx_n_s_fromNumpy);
  Py_CLEAR(clear_module_state->__pyx_n_s_fromPandas);
  Py_CLEAR(clear_module_state->__pyx_n_s_from_arrays);
  Py_CLEAR(clear_module_state->__pyx_n_s_from_data_frame_ref);
  Py_CLEAR(clear_module_state->__pyx_n_s_from_dict);
  Py_CLEAR(clear_module_state->__pyx_n_s_from_dict_locals_genexpr);
  Py_CLEAR(clear_module_state->__pyx_n_s_from_dict_locals_to_tuple);
  Py_CLEAR(clear_module_state->__pyx_n_s_from_numpy);
  Py_CLEAR(clear_module_state->__pyx_n_s_from_pandas);
  Py_CLEAR(clear_module_state->__pyx_n_s_from_tuples);
  Py_CLEAR(clear_module_state->__pyx_kp_u_gc);
  Py_CLEAR(clear_module_state->__pyx_n_s_genexpr);
  Py_CLEAR(clear_module_state->__pyx_n_s_get);
  Py_CLEAR(clear_module_state->__pyx_n_s_getBinDir);
  Py_CLEAR(clear_module_state->__pyx_n_s_getBinName);
  Py_CLEAR(clear_module_state->__pyx_n_s_getColumn);
  Py_CLEAR(clear_module_state->__pyx_n_s_getConstraint);
  Py_CLEAR(clear_module_state->__pyx_n_s_getConstraints);
  Py_CLEAR(clear_module_state->__pyx_n_s_getCurrentObjective);
  Py_CLEAR(clear_module_state->__pyx_n_s_getData);
  Py_CLEAR(clear_module_state->__pyx_n_s_getEntity);
  Py_CLEAR(clear_module_state->__pyx_n_s_getErrorHandler);
  Py_CLEAR(clear_module_state->__pyx_n_s_getHeaders);
  Py_CLEAR(clear_module_state->__pyx_n_s_getIndexingSets);
  Py_CLEAR(clear_module_state->__pyx_n_s_getLineNumber);
  Py_CLEAR(clear_module_state->__pyx_n_s_getMessage);
  Py_CLEAR(clear_module_state->__pyx_n_s_getNumCols);
  Py_CLEAR(clear_module_state->__pyx_n_s_getNumIndices);
  Py_CLEAR(clear_module_state->__pyx_n_s_getNumRows);
  Py_CLEAR(clear_module_state->__pyx_n_s_getObjective);
  Py_CLEAR(clear_module_state->__pyx_n_s_getObjectives);
  Py_CLEAR(clear_module_state->__pyx_n_s_getOffset);
  Py_CLEAR(clear_module_state->__pyx_n_s_getOption);
  Py_CLEAR(clear_module_state->__pyx_n_s_getOutput);
  Py_CLEAR(clear_module_state->__pyx_n_s_getOutputHandler);
  Py_CLEAR(clear_module_state->__pyx_n_s_getParameter);
  Py_CLEAR(clear_module_state->__pyx_n_s_getParameters);
  Py_CLEAR(clear_module_state->__pyx_n_s_getRow);
  Py_CLEAR(clear_module_state->__pyx_n_s_getRowByIndex);
  Py_CLEAR(clear_module_state->__pyx_n_s_getSet);
  Py_CLEAR(clear_module_state->__pyx_n_s_getSets);
  Py_CLEAR(clear_module_state->__pyx_n_s_getSourceName);
  Py_CLEAR(clear_module_state->__pyx_n_s_getValue);
  Py_CLEAR(clear_module_state->__pyx_n_s_getValues);
  Py_CLEAR(clear_module_state->__pyx_n_s_getVariable);
  Py_CLEAR(clear_module_state->__pyx_n_s_getVariables);
  Py_CLEAR(clear_module_state->__pyx_n_s_get_bin_dir);
  Py_CLEAR(clear_module_state->__pyx_n_s_get_bin_name);
  Py_CLEAR(clear_module_state->__pyx_n_s_get_column);
  Py_CLEAR(clear_module_state->__pyx_n_s_get_constraint);
  Py_CLEAR(clear_module_state->__pyx_n_s_get_constraints);
  Py_CLEAR(clear_module_state->__pyx_n_s_get_current_objective);
  Py_CLEAR(clear_module_state->__pyx_n_s_get_data);
  Py_CLEAR(clear_module_state->__pyx_n_s_get_entity);
  Py_CLEAR(clear_module_state->__pyx_n_s_get_error_handler);
  Py_CLEAR(clear_module_state->__pyx_n_s_get_headers);
  Py_CLEAR(clear_module_state->__pyx_n_s_get_headers_locals_genexpr);
  Py_CLEAR(clear_module_state->__pyx_n_s_get_iis);
  Py_CLEAR(clear_module_state->__pyx_n_s_get_indexing_sets);
  Py_CLEAR(clear_module_state->__pyx_n_s_get_line_number);
  Py_CLEAR(clear_module_state->__pyx_n_s_get_message);
  Py_CLEAR(clear_module_state->__pyx_n_s_get_num_cols);
  Py_CLEAR(clear_module_state->__pyx_n_s_get_num_indices);
  Py_CLEAR(clear_module_state->__pyx_n_s_get_num_rows);
  Py_CLEAR(clear_module_state->__pyx_n_s_get_objective);
  Py_CLEAR(clear_module_state->__pyx_n_s_get_objectives);
  Py_CLEAR(clear_module_state->__pyx_n_s_get_offset);
  Py_CLEAR(clear_module_state->__pyx_n_s_get_option);
  Py_CLEAR(clear_module_state->__pyx_n_s_get_output);
  Py_CLEAR(clear_module_state->__pyx_n_s_get_output_handler);
  Py_CLEAR(clear_module_state->__pyx_n_s_get_parameter);
  Py_CLEAR(clear_module_state->__pyx_n_s_get_parameters);
  Py_CLEAR(clear_module_state->__pyx_n_s_get_row);
  Py_CLEAR(clear_module_state->__pyx_n_s_get_row_by_index);
  Py_CLEAR(clear_module_state->__pyx_n_s_get_set);
  Py_CLEAR(clear_module_state->__pyx_n_s_get_sets);
  Py_CLEAR(clear_module_state->__pyx_n_s_get_solution);
  Py_CLEAR(clear_module_state->__pyx_n_s_get_source_name);
  Py_CLEAR(clear_module_state->__pyx_n_s_get_value);
  Py_CLEAR(clear_module_state->__pyx_n_s_get_values);
  Py_CLEAR(clear_module_state->__pyx_n_s_get_variable);
  Py_CLEAR(clear_module_state->__pyx_n_s_get_variables);
  Py_CLEAR(clear_module_state->__pyx_n_s_getitem);
  Py_CLEAR(clear_module_state->__pyx_n_s_getstate);
  Py_CLEAR(clear_module_state->__pyx_n_s_hasDefault);
  Py_CLEAR(clear_module_state->__pyx_n_s_has_default);
  Py_CLEAR(clear_module_state->__pyx_n_s_header);
  Py_CLEAR(clear_module_state->__pyx_n_s_headers);
  Py_CLEAR(clear_module_state->__pyx_n_s_headers_py);
  Py_CLEAR(clear_module_state->__pyx_n_s_i);
  Py_CLEAR(clear_module_state->__pyx_kp_u_i_in_1__ncons__con_i_iis_non__c);
  Py_CLEAR(clear_module_state->__pyx_kp_u_i_in_1__nvars__var_i_iis_non__v);
  Py_CLEAR(clear_module_state->__pyx_kp_u_i_in_1__nvars__var_i_val_0__var);
  Py_CLEAR(clear_module_state->__pyx_kp_u_i_in_1__nvars__varname_i__var_i);
  Py_CLEAR(clear_module_state->__pyx_n_s_iis_con);
  Py_CLEAR(clear_module_state->__pyx_n_s_iis_var);
  Py_CLEAR(clear_module_state->__pyx_n_s_impl);
  Py_CLEAR(clear_module_state->__pyx_n_s_import);
  Py_CLEAR(clear_module_state->__pyx_n_s_index);
  Py_CLEAR(clear_module_state->__pyx_n_u_index);
  Py_CLEAR(clear_module_state->__pyx_n_s_index_c);
  Py_CLEAR(clear_module_state->__pyx_n_s_index_names);
  Py_CLEAR(clear_module_state->__pyx_n_s_indexarity);
  Py_CLEAR(clear_module_state->__pyx_n_s_indices_c);
  Py_CLEAR(clear_module_state->__pyx_n_s_init);
  Py_CLEAR(clear_module_state->__pyx_n_s_init0);
  Py_CLEAR(clear_module_state->__pyx_n_s_init_2);
  Py_CLEAR(clear_module_state->__pyx_n_s_init_subclass);
  Py_CLEAR(clear_module_state->__pyx_n_s_initializing);
  Py_CLEAR(clear_module_state->__pyx_n_s_instances);
  Py_CLEAR(clear_module_state->__pyx_n_s_isLogical);
  Py_CLEAR(clear_module_state->__pyx_n_s_isRunning);
  Py_CLEAR(clear_module_state->__pyx_n_s_isScalar);
  Py_CLEAR(clear_module_state->__pyx_n_s_isSymbolic);
  Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine);
  Py_CLEAR(clear_module_state->__pyx_n_s_is_logical);
  Py_CLEAR(clear_module_state->__pyx_n_s_is_running);
  Py_CLEAR(clear_module_state->__pyx_n_s_is_scalar);
  Py_CLEAR(clear_module_state->__pyx_n_s_is_symbolic);
  Py_CLEAR(clear_module_state->__pyx_kp_u_isenabled);
  Py_CLEAR(clear_module_state->__pyx_n_s_isrunning);
  Py_CLEAR(clear_module_state->__pyx_n_s_items);
  Py_CLEAR(clear_module_state->__pyx_n_s_iter);
  Py_CLEAR(clear_module_state->__pyx_n_s_iter___locals_genexpr);
  Py_CLEAR(clear_module_state->__pyx_n_s_itertools);
  Py_CLEAR(clear_module_state->__pyx_n_s_j);
  Py_CLEAR(clear_module_state->__pyx_n_s_key);
  Py_CLEAR(clear_module_state->__pyx_n_s_keys);
  Py_CLEAR(clear_module_state->__pyx_n_s_kind);
  Py_CLEAR(clear_module_state->__pyx_n_s_kwargs);
  Py_CLEAR(clear_module_state->__pyx_n_s_lb);
  Py_CLEAR(clear_module_state->__pyx_n_s_lb0);
  Py_CLEAR(clear_module_state->__pyx_n_s_lb1);
  Py_CLEAR(clear_module_state->__pyx_n_s_lb2);
  Py_CLEAR(clear_module_state->__pyx_n_s_lbs);
  Py_CLEAR(clear_module_state->__pyx_n_s_ldual);
  Py_CLEAR(clear_module_state->__pyx_n_s_line_number);
  Py_CLEAR(clear_module_state->__pyx_n_s_literal_eval);
  Py_CLEAR(clear_module_state->__pyx_n_s_loadSession);
  Py_CLEAR(clear_module_state->__pyx_n_s_load_session);
  Py_CLEAR(clear_module_state->__pyx_n_s_lrc);
  Py_CLEAR(clear_module_state->__pyx_n_s_lslack);
  Py_CLEAR(clear_module_state->__pyx_n_s_lst);
  Py_CLEAR(clear_module_state->__pyx_n_s_lst_columns);
  Py_CLEAR(clear_module_state->__pyx_n_s_lst_index);
  Py_CLEAR(clear_module_state->__pyx_n_s_lst_solution);
  Py_CLEAR(clear_module_state->__pyx_n_s_main);
  Py_CLEAR(clear_module_state->__pyx_n_s_map);
  Py_CLEAR(clear_module_state->__pyx_n_s_members);
  Py_CLEAR(clear_module_state->__pyx_n_s_message);
  Py_CLEAR(clear_module_state->__pyx_n_s_metaclass);
  Py_CLEAR(clear_module_state->__pyx_n_s_minimization);
  Py_CLEAR(clear_module_state->__pyx_n_u_minimize);
  Py_CLEAR(clear_module_state->__pyx_n_s_model);
  Py_CLEAR(clear_module_state->__pyx_n_s_model_c);
  Py_CLEAR(clear_module_state->__pyx_n_s_module);
  Py_CLEAR(clear_module_state->__pyx_n_s_mro_entries);
  Py_CLEAR(clear_module_state->__pyx_n_s_msg);
  Py_CLEAR(clear_module_state->__pyx_n_s_multi_index);
  Py_CLEAR(clear_module_state->__pyx_n_s_n);
  Py_CLEAR(clear_module_state->__pyx_n_s_name);
  Py_CLEAR(clear_module_state->__pyx_n_s_name_2);
  Py_CLEAR(clear_module_state->__pyx_n_s_name_c);
  Py_CLEAR(clear_module_state->__pyx_n_s_name_c_2);
  Py_CLEAR(clear_module_state->__pyx_n_s_names);
  Py_CLEAR(clear_module_state->__pyx_n_s_ncols);
  Py_CLEAR(clear_module_state->__pyx_n_s_ncolumns);
  Py_CLEAR(clear_module_state->__pyx_n_s_ndarray);
  Py_CLEAR(clear_module_state->__pyx_n_s_nested);
  Py_CLEAR(clear_module_state->__pyx_n_s_nested_dict_of_suffixes);
  Py_CLEAR(clear_module_state->__pyx_n_s_new);
  Py_CLEAR(clear_module_state->__pyx_n_s_nindices);
  Py_CLEAR(clear_module_state->__pyx_n_s_nlevels);
  Py_CLEAR(clear_module_state->__pyx_kp_s_no_default___reduce___due_to_non);
  Py_CLEAR(clear_module_state->__pyx_n_s_np);
  Py_CLEAR(clear_module_state->__pyx_n_u_nt);
  Py_CLEAR(clear_module_state->__pyx_n_s_num);
  Py_CLEAR(clear_module_state->__pyx_n_s_numInstances);
  Py_CLEAR(clear_module_state->__pyx_n_s_num_instances);
  Py_CLEAR(clear_module_state->__pyx_n_s_numbers);
  Py_CLEAR(clear_module_state->__pyx_n_s_numpy);
  Py_CLEAR(clear_module_state->__pyx_n_s_obj);
  Py_CLEAR(clear_module_state->__pyx_n_s_obj_2);
  Py_CLEAR(clear_module_state->__pyx_n_s_obj_locals_Objectives);
  Py_CLEAR(clear_module_state->__pyx_n_s_obj_locals_Objectives___getitem);
  Py_CLEAR(clear_module_state->__pyx_n_s_obj_locals_Objectives___init);
  Py_CLEAR(clear_module_state->__pyx_n_s_obj_locals_Objectives___iter);
  Py_CLEAR(clear_module_state->__pyx_n_s_object);
  Py_CLEAR(clear_module_state->__pyx_n_s_objname);
  Py_CLEAR(clear_module_state->__pyx_n_s_objname_c);
  Py_CLEAR(clear_module_state->__pyx_n_s_offset);
  Py_CLEAR(clear_module_state->__pyx_n_s_open);
  Py_CLEAR(clear_module_state->__pyx_n_s_option);
  Py_CLEAR(clear_module_state->__pyx_n_s_option_2);
  Py_CLEAR(clear_module_state->__pyx_n_s_option_locals_Options);
  Py_CLEAR(clear_module_state->__pyx_n_s_option_locals_Options___getitem);
  Py_CLEAR(clear_module_state->__pyx_n_s_option_locals_Options___init);
  Py_CLEAR(clear_module_state->__pyx_n_s_option_locals_Options___setitem);
  Py_CLEAR(clear_module_state->__pyx_n_u_options);
  Py_CLEAR(clear_module_state->__pyx_n_s_options_2);
  Py_CLEAR(clear_module_state->__pyx_n_s_options_c);
  Py_CLEAR(clear_module_state->__pyx_n_s_os);
  Py_CLEAR(clear_module_state->__pyx_n_s_output);
  Py_CLEAR(clear_module_state->__pyx_n_s_output_c);
  Py_CLEAR(clear_module_state->__pyx_n_s_output_handler);
  Py_CLEAR(clear_module_state->__pyx_n_s_p);
  Py_CLEAR(clear_module_state->__pyx_n_s_pandas);
  Py_CLEAR(clear_module_state->__pyx_n_s_param);
  Py_CLEAR(clear_module_state->__pyx_n_s_param_2);
  Py_CLEAR(clear_module_state->__pyx_n_s_param_locals_Parameters);
  Py_CLEAR(clear_module_state->__pyx_n_s_param_locals_Parameters___getit);
  Py_CLEAR(clear_module_state->__pyx_n_s_param_locals_Parameters___init);
  Py_CLEAR(clear_module_state->__pyx_n_s_param_locals_Parameters___iter);
  Py_CLEAR(clear_module_state->__pyx_n_s_param_locals_Parameters___setit);
  Py_CLEAR(clear_module_state->__pyx_n_s_path);
  Py_CLEAR(clear_module_state->__pyx_n_s_pd);
  Py_CLEAR(clear_module_state->__pyx_n_s_pickle);
  Py_CLEAR(clear_module_state->__pyx_n_s_prepare);
  Py_CLEAR(clear_module_state->__pyx_n_s_print);
  Py_CLEAR(clear_module_state->__pyx_n_s_problem);
  Py_CLEAR(clear_module_state->__pyx_n_s_property);
  Py_CLEAR(clear_module_state->__pyx_n_s_py_list);
  Py_CLEAR(clear_module_state->__pyx_n_s_py_variant);
  Py_CLEAR(clear_module_state->__pyx_n_s_pylist);
  Py_CLEAR(clear_module_state->__pyx_n_s_pyx_PickleError);
  Py_CLEAR(clear_module_state->__pyx_n_s_pyx_checksum);
  Py_CLEAR(clear_module_state->__pyx_n_s_pyx_result);
  Py_CLEAR(clear_module_state->__pyx_n_s_pyx_state);
  Py_CLEAR(clear_module_state->__pyx_n_s_pyx_type);
  Py_CLEAR(clear_module_state->__pyx_n_s_pyx_unpickle_ErrorHandler);
  Py_CLEAR(clear_module_state->__pyx_n_s_pyx_unpickle_OutputHandler);
  Py_CLEAR(clear_module_state->__pyx_n_s_pyx_vtable);
  Py_CLEAR(clear_module_state->__pyx_n_s_qualname);
  Py_CLEAR(clear_module_state->__pyx_n_s_range);
  Py_CLEAR(clear_module_state->__pyx_n_s_rc);
  Py_CLEAR(clear_module_state->__pyx_n_s_read);
  Py_CLEAR(clear_module_state->__pyx_n_s_readData);
  Py_CLEAR(clear_module_state->__pyx_n_s_readTable);
  Py_CLEAR(clear_module_state->__pyx_n_s_read_data);
  Py_CLEAR(clear_module_state->__pyx_n_s_read_table);
  Py_CLEAR(clear_module_state->__pyx_n_s_reduce);
  Py_CLEAR(clear_module_state->__pyx_n_s_reduce_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_reduce_ex);
  Py_CLEAR(clear_module_state->__pyx_n_s_reset);
  Py_CLEAR(clear_module_state->__pyx_n_s_restore);
  Py_CLEAR(clear_module_state->__pyx_n_s_result);
  Py_CLEAR(clear_module_state->__pyx_n_s_return_output);
  Py_CLEAR(clear_module_state->__pyx_n_s_row);
  Py_CLEAR(clear_module_state->__pyx_n_s_rowindex);
  Py_CLEAR(clear_module_state->__pyx_n_s_scalar_expression);
  Py_CLEAR(clear_module_state->__pyx_n_s_self);
  Py_CLEAR(clear_module_state->__pyx_kp_s_self__c_ampl_cannot_be_converted);
  Py_CLEAR(clear_module_state->__pyx_kp_s_self__c_ampl_self__index_cannot);
  Py_CLEAR(clear_module_state->__pyx_kp_s_self__c_ampl_self__index_self_be);
  Py_CLEAR(clear_module_state->__pyx_kp_s_self__c_ampl_self_begin_self_end);
  Py_CLEAR(clear_module_state->__pyx_kp_s_self__df_cannot_be_converted_to);
  Py_CLEAR(clear_module_state->__pyx_kp_s_self_begin_self_end_self_env_c_s);
  Py_CLEAR(clear_module_state->__pyx_n_s_send);
  Py_CLEAR(clear_module_state->__pyx_n_s_set);
  Py_CLEAR(clear_module_state->__pyx_n_s_setBinDir);
  Py_CLEAR(clear_module_state->__pyx_n_s_setBinName);
  Py_CLEAR(clear_module_state->__pyx_n_s_setColumn);
  Py_CLEAR(clear_module_state->__pyx_n_s_setData);
  Py_CLEAR(clear_module_state->__pyx_n_s_setDual);
  Py_CLEAR(clear_module_state->__pyx_n_s_setErrorHandler);
  Py_CLEAR(clear_module_state->__pyx_n_s_setOption);
  Py_CLEAR(clear_module_state->__pyx_n_s_setOutputHandler);
  Py_CLEAR(clear_module_state->__pyx_n_s_setValue);
  Py_CLEAR(clear_module_state->__pyx_n_s_setValues);
  Py_CLEAR(clear_module_state->__pyx_n_s_setValues_2);
  Py_CLEAR(clear_module_state->__pyx_n_s_set_2);
  Py_CLEAR(clear_module_state->__pyx_n_s_set_bin_dir);
  Py_CLEAR(clear_module_state->__pyx_n_s_set_bin_name);
  Py_CLEAR(clear_module_state->__pyx_n_s_set_column);
  Py_CLEAR(clear_module_state->__pyx_n_s_set_data);
  Py_CLEAR(clear_module_state->__pyx_n_s_set_dual);
  Py_CLEAR(clear_module_state->__pyx_n_s_set_error_handler);
  Py_CLEAR(clear_module_state->__pyx_n_s_set_locals_Sets);
  Py_CLEAR(clear_module_state->__pyx_n_s_set_locals_Sets___getitem);
  Py_CLEAR(clear_module_state->__pyx_n_s_set_locals_Sets___init);
  Py_CLEAR(clear_module_state->__pyx_n_s_set_locals_Sets___iter);
  Py_CLEAR(clear_module_state->__pyx_n_s_set_locals_Sets___setitem);
  Py_CLEAR(clear_module_state->__pyx_n_s_set_name);
  Py_CLEAR(clear_module_state->__pyx_n_s_set_name_2);
  Py_CLEAR(clear_module_state->__pyx_n_s_set_option);
  Py_CLEAR(clear_module_state->__pyx_n_s_set_output_handler);
  Py_CLEAR(clear_module_state->__pyx_n_s_set_value);
  Py_CLEAR(clear_module_state->__pyx_n_s_set_values);
  Py_CLEAR(clear_module_state->__pyx_n_s_set_values_2);
  Py_CLEAR(clear_module_state->__pyx_n_s_set_values_locals_cast_row);
  Py_CLEAR(clear_module_state->__pyx_n_s_set_values_locals_cast_value);
  Py_CLEAR(clear_module_state->__pyx_n_s_set_values_locals_conv_to_list);
  Py_CLEAR(clear_module_state->__pyx_n_s_set_values_locals_genexpr);
  Py_CLEAR(clear_module_state->__pyx_n_s_setitem);
  Py_CLEAR(clear_module_state->__pyx_n_s_sets);
  Py_CLEAR(clear_module_state->__pyx_n_s_setstate);
  Py_CLEAR(clear_module_state->__pyx_n_s_setstate_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_shape);
  Py_CLEAR(clear_module_state->__pyx_n_s_size);
  Py_CLEAR(clear_module_state->__pyx_n_s_skip_index);
  Py_CLEAR(clear_module_state->__pyx_n_s_slack);
  Py_CLEAR(clear_module_state->__pyx_n_s_snapshot);
  Py_CLEAR(clear_module_state->__pyx_kp_u_solve);
  Py_CLEAR(clear_module_state->__pyx_n_s_solve_2);
  Py_CLEAR(clear_module_state->__pyx_n_u_solve_result);
  Py_CLEAR(clear_module_state->__pyx_n_u_solve_result_num);
  Py_CLEAR(clear_module_state->__pyx_n_s_solver);
  Py_CLEAR(clear_module_state->__pyx_n_u_solver);
  Py_CLEAR(clear_module_state->__pyx_n_s_source_name);
  Py_CLEAR(clear_module_state->__pyx_n_s_spec);
  Py_CLEAR(clear_module_state->__pyx_n_s_split);
  Py_CLEAR(clear_module_state->__pyx_n_s_sstatus);
  Py_CLEAR(clear_module_state->__pyx_n_s_stack);
  Py_CLEAR(clear_module_state->__pyx_n_s_startRecording);
  Py_CLEAR(clear_module_state->__pyx_n_s_start_recording);
  Py_CLEAR(clear_module_state->__pyx_n_s_state);
  Py_CLEAR(clear_module_state->__pyx_n_s_statements);
  Py_CLEAR(clear_module_state->__pyx_n_s_statements_c);
  Py_CLEAR(clear_module_state->__pyx_n_s_status);
  Py_CLEAR(clear_module_state->__pyx_n_s_stderr);
  Py_CLEAR(clear_module_state->__pyx_n_s_stmt);
  Py_CLEAR(clear_module_state->__pyx_n_s_stopRecording);
  Py_CLEAR(clear_module_state->__pyx_n_s_stop_recording);
  Py_CLEAR(clear_module_state->__pyx_n_s_str);
  Py_CLEAR(clear_module_state->__pyx_kp_s_stringsource);
  Py_CLEAR(clear_module_state->__pyx_n_s_suffixes);
  Py_CLEAR(clear_module_state->__pyx_n_s_suffixes_c);
  Py_CLEAR(clear_module_state->__pyx_n_s_super);
  Py_CLEAR(clear_module_state->__pyx_n_s_sys);
  Py_CLEAR(clear_module_state->__pyx_n_s_t);
  Py_CLEAR(clear_module_state->__pyx_n_s_t_c);
  Py_CLEAR(clear_module_state->__pyx_n_s_table_name);
  Py_CLEAR(clear_module_state->__pyx_n_s_test);
  Py_CLEAR(clear_module_state->__pyx_n_s_throw);
  Py_CLEAR(clear_module_state->__pyx_n_s_toDict);
  Py_CLEAR(clear_module_state->__pyx_n_s_toList);
  Py_CLEAR(clear_module_state->__pyx_n_s_toPandas);
  Py_CLEAR(clear_module_state->__pyx_n_s_toString);
  Py_CLEAR(clear_module_state->__pyx_n_s_to_dict);
  Py_CLEAR(clear_module_state->__pyx_n_s_to_list);
  Py_CLEAR(clear_module_state->__pyx_n_s_to_pandas);
  Py_CLEAR(clear_module_state->__pyx_n_s_to_string);
  Py_CLEAR(clear_module_state->__pyx_n_s_to_string_c);
  Py_CLEAR(clear_module_state->__pyx_n_s_to_tuple);
  Py_CLEAR(clear_module_state->__pyx_n_s_tolist);
  Py_CLEAR(clear_module_state->__pyx_n_s_tools);
  Py_CLEAR(clear_module_state->__pyx_n_s_tuple);
  Py_CLEAR(clear_module_state->__pyx_n_s_tuple_c);
  Py_CLEAR(clear_module_state->__pyx_n_s_ub);
  Py_CLEAR(clear_module_state->__pyx_n_s_ub0);
  Py_CLEAR(clear_module_state->__pyx_n_s_ub1);
  Py_CLEAR(clear_module_state->__pyx_n_s_ub2);
  Py_CLEAR(clear_module_state->__pyx_n_s_ubs);
  Py_CLEAR(clear_module_state->__pyx_n_s_udual);
  Py_CLEAR(clear_module_state->__pyx_n_s_unfix);
  Py_CLEAR(clear_module_state->__pyx_kp_u_unsupported_type);
  Py_CLEAR(clear_module_state->__pyx_n_s_update);
  Py_CLEAR(clear_module_state->__pyx_n_s_urc);
  Py_CLEAR(clear_module_state->__pyx_n_s_use_setstate);
  Py_CLEAR(clear_module_state->__pyx_n_s_uslack);
  Py_CLEAR(clear_module_state->__pyx_kp_u_utf_8);
  Py_CLEAR(clear_module_state->__pyx_n_s_v);
  Py_CLEAR(clear_module_state->__pyx_n_s_val);
  Py_CLEAR(clear_module_state->__pyx_n_s_value);
  Py_CLEAR(clear_module_state->__pyx_n_u_value);
  Py_CLEAR(clear_module_state->__pyx_n_s_value_c);
  Py_CLEAR(clear_module_state->__pyx_n_s_values);
  Py_CLEAR(clear_module_state->__pyx_n_s_var);
  Py_CLEAR(clear_module_state->__pyx_n_s_var_2);
  Py_CLEAR(clear_module_state->__pyx_n_s_var_locals_Variables);
  Py_CLEAR(clear_module_state->__pyx_n_s_var_locals_Variables___getitem);
  Py_CLEAR(clear_module_state->__pyx_n_s_var_locals_Variables___init);
  Py_CLEAR(clear_module_state->__pyx_n_s_var_locals_Variables___iter);
  Py_CLEAR(clear_module_state->__pyx_n_s_var_locals_Variables___setitem);
  Py_CLEAR(clear_module_state->__pyx_n_s_verbose);
  Py_CLEAR(clear_module_state->__pyx_n_s_warning);
  Py_CLEAR(clear_module_state->__pyx_n_s_workdir);
  Py_CLEAR(clear_module_state->__pyx_n_s_workdir_c);
  Py_CLEAR(clear_module_state->__pyx_n_s_write);
  Py_CLEAR(clear_module_state->__pyx_n_s_writeTable);
  Py_CLEAR(clear_module_state->__pyx_n_s_write_table);
  Py_CLEAR(clear_module_state->__pyx_n_s_xref);
  Py_CLEAR(clear_module_state->__pyx_n_s_zeros);
  Py_CLEAR(clear_module_state->__pyx_n_s_zip);
  Py_CLEAR(clear_module_state->__pyx_int_0);
  Py_CLEAR(clear_module_state->__pyx_int_1);
  Py_CLEAR(clear_module_state->__pyx_int_222419149);
  Py_CLEAR(clear_module_state->__pyx_int_228825662);
  Py_CLEAR(clear_module_state->__pyx_int_238750788);
  Py_CLEAR(clear_module_state->__pyx_k__14);
  Py_CLEAR(clear_module_state->__pyx_tuple_);
  Py_CLEAR(clear_module_state->__pyx_tuple__2);
  Py_CLEAR(clear_module_state->__pyx_tuple__3);
  Py_CLEAR(clear_module_state->__pyx_tuple__4);
  Py_CLEAR(clear_module_state->__pyx_tuple__5);
  Py_CLEAR(clear_module_state->__pyx_tuple__6);
  Py_CLEAR(clear_module_state->__pyx_tuple__7);
  Py_CLEAR(clear_module_state->__pyx_tuple__8);
  Py_CLEAR(clear_module_state->__pyx_tuple__9);
  Py_CLEAR(clear_module_state->__pyx_tuple__10);
  Py_CLEAR(clear_module_state->__pyx_tuple__11);
  Py_CLEAR(clear_module_state->__pyx_tuple__12);
  Py_CLEAR(clear_module_state->__pyx_tuple__13);
  Py_CLEAR(clear_module_state->__pyx_tuple__15);
  Py_CLEAR(clear_module_state->__pyx_tuple__17);
  Py_CLEAR(clear_module_state->__pyx_tuple__18);
  Py_CLEAR(clear_module_state->__pyx_tuple__20);
  Py_CLEAR(clear_module_state->__pyx_tuple__23);
  Py_CLEAR(clear_module_state->__pyx_tuple__27);
  Py_CLEAR(clear_module_state->__pyx_tuple__28);
  Py_CLEAR(clear_module_state->__pyx_tuple__29);
  Py_CLEAR(clear_module_state->__pyx_tuple__31);
  Py_CLEAR(clear_module_state->__pyx_tuple__37);
  Py_CLEAR(clear_module_state->__pyx_tuple__42);
  Py_CLEAR(clear_module_state->__pyx_tuple__43);
  Py_CLEAR(clear_module_state->__pyx_tuple__44);
  Py_CLEAR(clear_module_state->__pyx_tuple__45);
  Py_CLEAR(clear_module_state->__pyx_tuple__46);
  Py_CLEAR(clear_module_state->__pyx_tuple__48);
  Py_CLEAR(clear_module_state->__pyx_tuple__50);
  Py_CLEAR(clear_module_state->__pyx_tuple__52);
  Py_CLEAR(clear_module_state->__pyx_tuple__54);
  Py_CLEAR(clear_module_state->__pyx_tuple__55);
  Py_CLEAR(clear_module_state->__pyx_tuple__60);
  Py_CLEAR(clear_module_state->__pyx_tuple__61);
  Py_CLEAR(clear_module_state->__pyx_tuple__65);
  Py_CLEAR(clear_module_state->__pyx_tuple__66);
  Py_CLEAR(clear_module_state->__pyx_tuple__69);
  Py_CLEAR(clear_module_state->__pyx_tuple__72);
  Py_CLEAR(clear_module_state->__pyx_tuple__73);
  Py_CLEAR(clear_module_state->__pyx_tuple__78);
  Py_CLEAR(clear_module_state->__pyx_tuple__79);
  Py_CLEAR(clear_module_state->__pyx_tuple__83);
  Py_CLEAR(clear_module_state->__pyx_tuple__85);
  Py_CLEAR(clear_module_state->__pyx_tuple__90);
  Py_CLEAR(clear_module_state->__pyx_tuple__107);
  Py_CLEAR(clear_module_state->__pyx_tuple__111);
  Py_CLEAR(clear_module_state->__pyx_tuple__117);
  Py_CLEAR(clear_module_state->__pyx_tuple__121);
  Py_CLEAR(clear_module_state->__pyx_tuple__123);
  Py_CLEAR(clear_module_state->__pyx_tuple__127);
  Py_CLEAR(clear_module_state->__pyx_tuple__129);
  Py_CLEAR(clear_module_state->__pyx_tuple__131);
  Py_CLEAR(clear_module_state->__pyx_tuple__132);
  Py_CLEAR(clear_module_state->__pyx_tuple__134);
  Py_CLEAR(clear_module_state->__pyx_tuple__136);
  Py_CLEAR(clear_module_state->__pyx_tuple__138);
  Py_CLEAR(clear_module_state->__pyx_tuple__140);
  Py_CLEAR(clear_module_state->__pyx_tuple__142);
  Py_CLEAR(clear_module_state->__pyx_tuple__144);
  Py_CLEAR(clear_module_state->__pyx_tuple__146);
  Py_CLEAR(clear_module_state->__pyx_tuple__148);
  Py_CLEAR(clear_module_state->__pyx_tuple__149);
  Py_CLEAR(clear_module_state->__pyx_tuple__151);
  Py_CLEAR(clear_module_state->__pyx_tuple__152);
  Py_CLEAR(clear_module_state->__pyx_tuple__154);
  Py_CLEAR(clear_module_state->__pyx_tuple__156);
  Py_CLEAR(clear_module_state->__pyx_tuple__158);
  Py_CLEAR(clear_module_state->__pyx_tuple__162);
  Py_CLEAR(clear_module_state->__pyx_tuple__164);
  Py_CLEAR(clear_module_state->__pyx_tuple__166);
  Py_CLEAR(clear_module_state->__pyx_tuple__170);
  Py_CLEAR(clear_module_state->__pyx_tuple__173);
  Py_CLEAR(clear_module_state->__pyx_tuple__175);
  Py_CLEAR(clear_module_state->__pyx_tuple__177);
  Py_CLEAR(clear_module_state->__pyx_tuple__179);
  Py_CLEAR(clear_module_state->__pyx_tuple__181);
  Py_CLEAR(clear_module_state->__pyx_tuple__185);
  Py_CLEAR(clear_module_state->__pyx_tuple__189);
  Py_CLEAR(clear_module_state->__pyx_tuple__191);
  Py_CLEAR(clear_module_state->__pyx_tuple__193);
  Py_CLEAR(clear_module_state->__pyx_tuple__195);
  Py_CLEAR(clear_module_state->__pyx_tuple__197);
  Py_CLEAR(clear_module_state->__pyx_tuple__201);
  Py_CLEAR(clear_module_state->__pyx_tuple__203);
  Py_CLEAR(clear_module_state->__pyx_tuple__206);
  Py_CLEAR(clear_module_state->__pyx_tuple__209);
  Py_CLEAR(clear_module_state->__pyx_tuple__216);
  Py_CLEAR(clear_module_state->__pyx_tuple__217);
  Py_CLEAR(clear_module_state->__pyx_tuple__218);
  Py_CLEAR(clear_module_state->__pyx_tuple__219);
  Py_CLEAR(clear_module_state->__pyx_tuple__246);
  Py_CLEAR(clear_module_state->__pyx_tuple__250);
  Py_CLEAR(clear_module_state->__pyx_tuple__251);
  Py_CLEAR(clear_module_state->__pyx_tuple__254);
  Py_CLEAR(clear_module_state->__pyx_tuple__256);
  Py_CLEAR(clear_module_state->__pyx_tuple__258);
  Py_CLEAR(clear_module_state->__pyx_tuple__263);
  Py_CLEAR(clear_module_state->__pyx_tuple__265);
  Py_CLEAR(clear_module_state->__pyx_tuple__269);
  Py_CLEAR(clear_module_state->__pyx_tuple__271);
  Py_CLEAR(clear_module_state->__pyx_tuple__302);
  Py_CLEAR(clear_module_state->__pyx_tuple__304);
  Py_CLEAR(clear_module_state->__pyx_tuple__306);
  Py_CLEAR(clear_module_state->__pyx_tuple__308);
  Py_CLEAR(clear_module_state->__pyx_tuple__314);
  Py_CLEAR(clear_module_state->__pyx_tuple__316);
  Py_CLEAR(clear_module_state->__pyx_tuple__320);
  Py_CLEAR(clear_module_state->__pyx_tuple__322);
  Py_CLEAR(clear_module_state->__pyx_tuple__324);
  Py_CLEAR(clear_module_state->__pyx_tuple__325);
  Py_CLEAR(clear_module_state->__pyx_tuple__328);
  Py_CLEAR(clear_module_state->__pyx_tuple__330);
  Py_CLEAR(clear_module_state->__pyx_tuple__333);
  Py_CLEAR(clear_module_state->__pyx_tuple__335);
  Py_CLEAR(clear_module_state->__pyx_tuple__337);
  Py_CLEAR(clear_module_state->__pyx_tuple__340);
  Py_CLEAR(clear_module_state->__pyx_tuple__342);
  Py_CLEAR(clear_module_state->__pyx_tuple__344);
  Py_CLEAR(clear_module_state->__pyx_tuple__353);
  Py_CLEAR(clear_module_state->__pyx_tuple__355);
  Py_CLEAR(clear_module_state->__pyx_tuple__357);
  Py_CLEAR(clear_module_state->__pyx_tuple__359);
  Py_CLEAR(clear_module_state->__pyx_tuple__361);
  Py_CLEAR(clear_module_state->__pyx_tuple__363);
  Py_CLEAR(clear_module_state->__pyx_tuple__365);
  Py_CLEAR(clear_module_state->__pyx_tuple__367);
  Py_CLEAR(clear_module_state->__pyx_tuple__369);
  Py_CLEAR(clear_module_state->__pyx_tuple__371);
  Py_CLEAR(clear_module_state->__pyx_tuple__373);
  Py_CLEAR(clear_module_state->__pyx_tuple__374);
  Py_CLEAR(clear_module_state->__pyx_tuple__376);
  Py_CLEAR(clear_module_state->__pyx_tuple__378);
  Py_CLEAR(clear_module_state->__pyx_tuple__380);
  Py_CLEAR(clear_module_state->__pyx_tuple__383);
  Py_CLEAR(clear_module_state->__pyx_tuple__387);
  Py_CLEAR(clear_module_state->__pyx_codeobj__16);
  Py_CLEAR(clear_module_state->__pyx_codeobj__19);
  Py_CLEAR(clear_module_state->__pyx_codeobj__30);
  Py_CLEAR(clear_module_state->__pyx_codeobj__32);
  Py_CLEAR(clear_module_state->__pyx_codeobj__47);
  Py_CLEAR(clear_module_state->__pyx_codeobj__49);
  Py_CLEAR(clear_module_state->__pyx_codeobj__51);
  Py_CLEAR(clear_module_state->__pyx_codeobj__53);
  Py_CLEAR(clear_module_state->__pyx_codeobj__56);
  Py_CLEAR(clear_module_state->__pyx_codeobj__57);
  Py_CLEAR(clear_module_state->__pyx_codeobj__58);
  Py_CLEAR(clear_module_state->__pyx_codeobj__59);
  Py_CLEAR(clear_module_state->__pyx_codeobj__62);
  Py_CLEAR(clear_module_state->__pyx_codeobj__63);
  Py_CLEAR(clear_module_state->__pyx_codeobj__64);
  Py_CLEAR(clear_module_state->__pyx_codeobj__67);
  Py_CLEAR(clear_module_state->__pyx_codeobj__68);
  Py_CLEAR(clear_module_state->__pyx_codeobj__70);
  Py_CLEAR(clear_module_state->__pyx_codeobj__71);
  Py_CLEAR(clear_module_state->__pyx_codeobj__74);
  Py_CLEAR(clear_module_state->__pyx_codeobj__75);
  Py_CLEAR(clear_module_state->__pyx_codeobj__76);
  Py_CLEAR(clear_module_state->__pyx_codeobj__77);
  Py_CLEAR(clear_module_state->__pyx_codeobj__80);
  Py_CLEAR(clear_module_state->__pyx_codeobj__81);
  Py_CLEAR(clear_module_state->__pyx_codeobj__82);
  Py_CLEAR(clear_module_state->__pyx_codeobj__86);
  Py_CLEAR(clear_module_state->__pyx_codeobj__87);
  Py_CLEAR(clear_module_state->__pyx_codeobj__88);
  Py_CLEAR(clear_module_state->__pyx_codeobj__89);
  Py_CLEAR(clear_module_state->__pyx_codeobj__91);
  Py_CLEAR(clear_module_state->__pyx_codeobj__92);
  Py_CLEAR(clear_module_state->__pyx_codeobj__93);
  Py_CLEAR(clear_module_state->__pyx_codeobj__94);
  Py_CLEAR(clear_module_state->__pyx_codeobj__95);
  Py_CLEAR(clear_module_state->__pyx_codeobj__96);
  Py_CLEAR(clear_module_state->__pyx_codeobj__97);
  Py_CLEAR(clear_module_state->__pyx_codeobj__98);
  Py_CLEAR(clear_module_state->__pyx_codeobj__99);
  Py_CLEAR(clear_module_state->__pyx_codeobj__100);
  Py_CLEAR(clear_module_state->__pyx_codeobj__101);
  Py_CLEAR(clear_module_state->__pyx_codeobj__102);
  Py_CLEAR(clear_module_state->__pyx_codeobj__103);
  Py_CLEAR(clear_module_state->__pyx_codeobj__104);
  Py_CLEAR(clear_module_state->__pyx_codeobj__105);
  Py_CLEAR(clear_module_state->__pyx_codeobj__106);
  Py_CLEAR(clear_module_state->__pyx_codeobj__108);
  Py_CLEAR(clear_module_state->__pyx_codeobj__109);
  Py_CLEAR(clear_module_state->__pyx_codeobj__110);
  Py_CLEAR(clear_module_state->__pyx_codeobj__112);
  Py_CLEAR(clear_module_state->__pyx_codeobj__113);
  Py_CLEAR(clear_module_state->__pyx_codeobj__114);
  Py_CLEAR(clear_module_state->__pyx_codeobj__115);
  Py_CLEAR(clear_module_state->__pyx_codeobj__116);
  Py_CLEAR(clear_module_state->__pyx_codeobj__118);
  Py_CLEAR(clear_module_state->__pyx_codeobj__119);
  Py_CLEAR(clear_module_state->__pyx_codeobj__120);
  Py_CLEAR(clear_module_state->__pyx_codeobj__122);
  Py_CLEAR(clear_module_state->__pyx_codeobj__124);
  Py_CLEAR(clear_module_state->__pyx_codeobj__125);
  Py_CLEAR(clear_module_state->__pyx_codeobj__126);
  Py_CLEAR(clear_module_state->__pyx_codeobj__128);
  Py_CLEAR(clear_module_state->__pyx_codeobj__130);
  Py_CLEAR(clear_module_state->__pyx_codeobj__133);
  Py_CLEAR(clear_module_state->__pyx_codeobj__135);
  Py_CLEAR(clear_module_state->__pyx_codeobj__137);
  Py_CLEAR(clear_module_state->__pyx_codeobj__139);
  Py_CLEAR(clear_module_state->__pyx_codeobj__141);
  Py_CLEAR(clear_module_state->__pyx_codeobj__143);
  Py_CLEAR(clear_module_state->__pyx_codeobj__145);
  Py_CLEAR(clear_module_state->__pyx_codeobj__147);
  Py_CLEAR(clear_module_state->__pyx_codeobj__150);
  Py_CLEAR(clear_module_state->__pyx_codeobj__153);
  Py_CLEAR(clear_module_state->__pyx_codeobj__155);
  Py_CLEAR(clear_module_state->__pyx_codeobj__157);
  Py_CLEAR(clear_module_state->__pyx_codeobj__159);
  Py_CLEAR(clear_module_state->__pyx_codeobj__160);
  Py_CLEAR(clear_module_state->__pyx_codeobj__161);
  Py_CLEAR(clear_module_state->__pyx_codeobj__163);
  Py_CLEAR(clear_module_state->__pyx_codeobj__165);
  Py_CLEAR(clear_module_state->__pyx_codeobj__167);
  Py_CLEAR(clear_module_state->__pyx_codeobj__168);
  Py_CLEAR(clear_module_state->__pyx_codeobj__169);
  Py_CLEAR(clear_module_state->__pyx_codeobj__171);
  Py_CLEAR(clear_module_state->__pyx_codeobj__172);
  Py_CLEAR(clear_module_state->__pyx_codeobj__174);
  Py_CLEAR(clear_module_state->__pyx_codeobj__176);
  Py_CLEAR(clear_module_state->__pyx_codeobj__178);
  Py_CLEAR(clear_module_state->__pyx_codeobj__180);
  Py_CLEAR(clear_module_state->__pyx_codeobj__182);
  Py_CLEAR(clear_module_state->__pyx_codeobj__183);
  Py_CLEAR(clear_module_state->__pyx_codeobj__184);
  Py_CLEAR(clear_module_state->__pyx_codeobj__186);
  Py_CLEAR(clear_module_state->__pyx_codeobj__187);
  Py_CLEAR(clear_module_state->__pyx_codeobj__188);
  Py_CLEAR(clear_module_state->__pyx_codeobj__190);
  Py_CLEAR(clear_module_state->__pyx_codeobj__192);
  Py_CLEAR(clear_module_state->__pyx_codeobj__194);
  Py_CLEAR(clear_module_state->__pyx_codeobj__196);
  Py_CLEAR(clear_module_state->__pyx_codeobj__198);
  Py_CLEAR(clear_module_state->__pyx_codeobj__199);
  Py_CLEAR(clear_module_state->__pyx_codeobj__200);
  Py_CLEAR(clear_module_state->__pyx_codeobj__202);
  Py_CLEAR(clear_module_state->__pyx_codeobj__204);
  Py_CLEAR(clear_module_state->__pyx_codeobj__205);
  Py_CLEAR(clear_module_state->__pyx_codeobj__207);
  Py_CLEAR(clear_module_state->__pyx_codeobj__208);
  Py_CLEAR(clear_module_state->__pyx_codeobj__210);
  Py_CLEAR(clear_module_state->__pyx_codeobj__211);
  Py_CLEAR(clear_module_state->__pyx_codeobj__212);
  Py_CLEAR(clear_module_state->__pyx_codeobj__213);
  Py_CLEAR(clear_module_state->__pyx_codeobj__214);
  Py_CLEAR(clear_module_state->__pyx_codeobj__215);
  Py_CLEAR(clear_module_state->__pyx_codeobj__220);
  Py_CLEAR(clear_module_state->__pyx_codeobj__221);
  Py_CLEAR(clear_module_state->__pyx_codeobj__222);
  Py_CLEAR(clear_module_state->__pyx_codeobj__223);
  Py_CLEAR(clear_module_state->__pyx_codeobj__224);
  Py_CLEAR(clear_module_state->__pyx_codeobj__225);
  Py_CLEAR(clear_module_state->__pyx_codeobj__226);
  Py_CLEAR(clear_module_state->__pyx_codeobj__227);
  Py_CLEAR(clear_module_state->__pyx_codeobj__228);
  Py_CLEAR(clear_module_state->__pyx_codeobj__229);
  Py_CLEAR(clear_module_state->__pyx_codeobj__230);
  Py_CLEAR(clear_module_state->__pyx_codeobj__231);
  Py_CLEAR(clear_module_state->__pyx_codeobj__232);
  Py_CLEAR(clear_module_state->__pyx_codeobj__233);
  Py_CLEAR(clear_module_state->__pyx_codeobj__234);
  Py_CLEAR(clear_module_state->__pyx_codeobj__235);
  Py_CLEAR(clear_module_state->__pyx_codeobj__236);
  Py_CLEAR(clear_module_state->__pyx_codeobj__237);
  Py_CLEAR(clear_module_state->__pyx_codeobj__238);
  Py_CLEAR(clear_module_state->__pyx_codeobj__239);
  Py_CLEAR(clear_module_state->__pyx_codeobj__240);
  Py_CLEAR(clear_module_state->__pyx_codeobj__241);
  Py_CLEAR(clear_module_state->__pyx_codeobj__242);
  Py_CLEAR(clear_module_state->__pyx_codeobj__243);
  Py_CLEAR(clear_module_state->__pyx_codeobj__244);
  Py_CLEAR(clear_module_state->__pyx_codeobj__245);
  Py_CLEAR(clear_module_state->__pyx_codeobj__247);
  Py_CLEAR(clear_module_state->__pyx_codeobj__248);
  Py_CLEAR(clear_module_state->__pyx_codeobj__249);
  Py_CLEAR(clear_module_state->__pyx_codeobj__252);
  Py_CLEAR(clear_module_state->__pyx_codeobj__253);
  Py_CLEAR(clear_module_state->__pyx_codeobj__255);
  Py_CLEAR(clear_module_state->__pyx_codeobj__257);
  Py_CLEAR(clear_module_state->__pyx_codeobj__259);
  Py_CLEAR(clear_module_state->__pyx_codeobj__260);
  Py_CLEAR(clear_module_state->__pyx_codeobj__261);
  Py_CLEAR(clear_module_state->__pyx_codeobj__262);
  Py_CLEAR(clear_module_state->__pyx_codeobj__264);
  Py_CLEAR(clear_module_state->__pyx_codeobj__266);
  Py_CLEAR(clear_module_state->__pyx_codeobj__267);
  Py_CLEAR(clear_module_state->__pyx_codeobj__268);
  Py_CLEAR(clear_module_state->__pyx_codeobj__270);
  Py_CLEAR(clear_module_state->__pyx_codeobj__272);
  Py_CLEAR(clear_module_state->__pyx_codeobj__273);
  Py_CLEAR(clear_module_state->__pyx_codeobj__274);
  Py_CLEAR(clear_module_state->__pyx_codeobj__275);
  Py_CLEAR(clear_module_state->__pyx_codeobj__276);
  Py_CLEAR(clear_module_state->__pyx_codeobj__277);
  Py_CLEAR(clear_module_state->__pyx_codeobj__278);
  Py_CLEAR(clear_module_state->__pyx_codeobj__279);
  Py_CLEAR(clear_module_state->__pyx_codeobj__280);
  Py_CLEAR(clear_module_state->__pyx_codeobj__281);
  Py_CLEAR(clear_module_state->__pyx_codeobj__282);
  Py_CLEAR(clear_module_state->__pyx_codeobj__283);
  Py_CLEAR(clear_module_state->__pyx_codeobj__284);
  Py_CLEAR(clear_module_state->__pyx_codeobj__285);
  Py_CLEAR(clear_module_state->__pyx_codeobj__286);
  Py_CLEAR(clear_module_state->__pyx_codeobj__287);
  Py_CLEAR(clear_module_state->__pyx_codeobj__288);
  Py_CLEAR(clear_module_state->__pyx_codeobj__289);
  Py_CLEAR(clear_module_state->__pyx_codeobj__290);
  Py_CLEAR(clear_module_state->__pyx_codeobj__291);
  Py_CLEAR(clear_module_state->__pyx_codeobj__292);
  Py_CLEAR(clear_module_state->__pyx_codeobj__293);
  Py_CLEAR(clear_module_state->__pyx_codeobj__294);
  Py_CLEAR(clear_module_state->__pyx_codeobj__295);
  Py_CLEAR(clear_module_state->__pyx_codeobj__296);
  Py_CLEAR(clear_module_state->__pyx_codeobj__297);
  Py_CLEAR(clear_module_state->__pyx_codeobj__298);
  Py_CLEAR(clear_module_state->__pyx_codeobj__299);
  Py_CLEAR(clear_module_state->__pyx_codeobj__300);
  Py_CLEAR(clear_module_state->__pyx_codeobj__301);
  Py_CLEAR(clear_module_state->__pyx_codeobj__303);
  Py_CLEAR(clear_module_state->__pyx_codeobj__305);
  Py_CLEAR(clear_module_state->__pyx_codeobj__307);
  Py_CLEAR(clear_module_state->__pyx_codeobj__309);
  Py_CLEAR(clear_module_state->__pyx_codeobj__310);
  Py_CLEAR(clear_module_state->__pyx_codeobj__311);
  Py_CLEAR(clear_module_state->__pyx_codeobj__312);
  Py_CLEAR(clear_module_state->__pyx_codeobj__313);
  Py_CLEAR(clear_module_state->__pyx_codeobj__315);
  Py_CLEAR(clear_module_state->__pyx_codeobj__317);
  Py_CLEAR(clear_module_state->__pyx_codeobj__318);
  Py_CLEAR(clear_module_state->__pyx_codeobj__319);
  Py_CLEAR(clear_module_state->__pyx_codeobj__321);
  Py_CLEAR(clear_module_state->__pyx_codeobj__323);
  Py_CLEAR(clear_module_state->__pyx_codeobj__326);
  Py_CLEAR(clear_module_state->__pyx_codeobj__327);
  Py_CLEAR(clear_module_state->__pyx_codeobj__329);
  Py_CLEAR(clear_module_state->__pyx_codeobj__331);
  Py_CLEAR(clear_module_state->__pyx_codeobj__332);
  Py_CLEAR(clear_module_state->__pyx_codeobj__334);
  Py_CLEAR(clear_module_state->__pyx_codeobj__336);
  Py_CLEAR(clear_module_state->__pyx_codeobj__338);
  Py_CLEAR(clear_module_state->__pyx_codeobj__339);
  Py_CLEAR(clear_module_state->__pyx_codeobj__341);
  Py_CLEAR(clear_module_state->__pyx_codeobj__343);
  Py_CLEAR(clear_module_state->__pyx_codeobj__345);
  Py_CLEAR(clear_module_state->__pyx_codeobj__346);
  Py_CLEAR(clear_module_state->__pyx_codeobj__347);
  Py_CLEAR(clear_module_state->__pyx_codeobj__348);
  Py_CLEAR(clear_module_state->__pyx_codeobj__349);
  Py_CLEAR(clear_module_state->__pyx_codeobj__350);
  Py_CLEAR(clear_module_state->__pyx_codeobj__351);
  Py_CLEAR(clear_module_state->__pyx_codeobj__352);
  Py_CLEAR(clear_module_state->__pyx_codeobj__354);
  Py_CLEAR(clear_module_state->__pyx_codeobj__356);
  Py_CLEAR(clear_module_state->__pyx_codeobj__358);
  Py_CLEAR(clear_module_state->__pyx_codeobj__360);
  Py_CLEAR(clear_module_state->__pyx_codeobj__362);
  Py_CLEAR(clear_module_state->__pyx_codeobj__364);
  Py_CLEAR(clear_module_state->__pyx_codeobj__366);
  Py_CLEAR(clear_module_state->__pyx_codeobj__368);
  Py_CLEAR(clear_module_state->__pyx_codeobj__370);
  Py_CLEAR(clear_module_state->__pyx_codeobj__372);
  Py_CLEAR(clear_module_state->__pyx_codeobj__375);
  Py_CLEAR(clear_module_state->__pyx_codeobj__377);
  Py_CLEAR(clear_module_state->__pyx_codeobj__379);
  Py_CLEAR(clear_module_state->__pyx_codeobj__381);
  Py_CLEAR(clear_module_state->__pyx_codeobj__382);
  Py_CLEAR(clear_module_state->__pyx_codeobj__384);
  Py_CLEAR(clear_module_state->__pyx_codeobj__385);
  Py_CLEAR(clear_module_state->__pyx_codeobj__386);
  Py_CLEAR(clear_module_state->__pyx_codeobj__388);
  Py_CLEAR(clear_module_state->__pyx_codeobj__389);
  return 0;
}
#endif
/* #### Code section: module_state_traverse ### */
#if CYTHON_USE_MODULE_STATE
static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) {
  __pyx_mstate *traverse_module_state = __pyx_mstate(m);
  if (!traverse_module_state) return 0;
  Py_VISIT(traverse_module_state->__pyx_d);
  Py_VISIT(traverse_module_state->__pyx_b);
  Py_VISIT(traverse_module_state->__pyx_cython_runtime);
  Py_VISIT(traverse_module_state->__pyx_empty_tuple);
  Py_VISIT(traverse_module_state->__pyx_empty_bytes);
  Py_VISIT(traverse_module_state->__pyx_empty_unicode);
  #ifdef __Pyx_CyFunction_USED
  Py_VISIT(traverse_module_state->__pyx_CyFunctionType);
  #endif
  #ifdef __Pyx_FusedFunction_USED
  Py_VISIT(traverse_module_state->__pyx_FusedFunctionType);
  #endif
  Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_4bool_bool);
  Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_4type_type);
  Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_7complex_complex);
  Py_VISIT(traverse_module_state->__pyx_ptype_7_amplpy_Row);
  Py_VISIT(traverse_module_state->__pyx_type_7_amplpy_Row);
  Py_VISIT(traverse_module_state->__pyx_ptype_7_amplpy_Column);
  Py_VISIT(traverse_module_state->__pyx_type_7_amplpy_Column);
  Py_VISIT(traverse_module_state->__pyx_ptype_7_amplpy_DataFrame);
  Py_VISIT(traverse_module_state->__pyx_type_7_amplpy_DataFrame);
  Py_VISIT(traverse_module_state->__pyx_ptype_7_amplpy_Entity);
  Py_VISIT(traverse_module_state->__pyx_type_7_amplpy_Entity);
  Py_VISIT(traverse_module_state->__pyx_ptype_7_amplpy_Constraint);
  Py_VISIT(traverse_module_state->__pyx_type_7_amplpy_Constraint);
  Py_VISIT(traverse_module_state->__pyx_ptype_7_amplpy_Environment);
  Py_VISIT(traverse_module_state->__pyx_type_7_amplpy_Environment);
  Py_VISIT(traverse_module_state->__pyx_ptype_7_amplpy_ErrorHandler);
  Py_VISIT(traverse_module_state->__pyx_type_7_amplpy_ErrorHandler);
  Py_VISIT(traverse_module_state->__pyx_ptype_7_amplpy_EnvIterator);
  Py_VISIT(traverse_module_state->__pyx_type_7_amplpy_EnvIterator);
  Py_VISIT(traverse_module_state->__pyx_ptype_7_amplpy_EntityMap);
  Py_VISIT(traverse_module_state->__pyx_type_7_amplpy_EntityMap);
  Py_VISIT(traverse_module_state->__pyx_ptype_7_amplpy_InstanceIterator);
  Py_VISIT(traverse_module_state->__pyx_type_7_amplpy_InstanceIterator);
  Py_VISIT(traverse_module_state->__pyx_ptype_7_amplpy_MemberRangeIterator);
  Py_VISIT(traverse_module_state->__pyx_type_7_amplpy_MemberRangeIterator);
  Py_VISIT(traverse_module_state->__pyx_ptype_7_amplpy_ColIterator);
  Py_VISIT(traverse_module_state->__pyx_type_7_amplpy_ColIterator);
  Py_VISIT(traverse_module_state->__pyx_ptype_7_amplpy_RowIterator);
  Py_VISIT(traverse_module_state->__pyx_type_7_amplpy_RowIterator);
  Py_VISIT(traverse_module_state->__pyx_ptype_7_amplpy_Objective);
  Py_VISIT(traverse_module_state->__pyx_type_7_amplpy_Objective);
  Py_VISIT(traverse_module_state->__pyx_ptype_7_amplpy_OutputHandler);
  Py_VISIT(traverse_module_state->__pyx_type_7_amplpy_OutputHandler);
  Py_VISIT(traverse_module_state->__pyx_ptype_7_amplpy_Parameter);
  Py_VISIT(traverse_module_state->__pyx_type_7_amplpy_Parameter);
  Py_VISIT(traverse_module_state->__pyx_ptype_7_amplpy_Set);
  Py_VISIT(traverse_module_state->__pyx_type_7_amplpy_Set);
  Py_VISIT(traverse_module_state->__pyx_ptype_7_amplpy_Variable);
  Py_VISIT(traverse_module_state->__pyx_type_7_amplpy_Variable);
  Py_VISIT(traverse_module_state->__pyx_ptype_7_amplpy_AMPL);
  Py_VISIT(traverse_module_state->__pyx_type_7_amplpy_AMPL);
  Py_VISIT(traverse_module_state->__pyx_ptype_7_amplpy___pyx_scope_struct____iter__);
  Py_VISIT(traverse_module_state->__pyx_type_7_amplpy___pyx_scope_struct____iter__);
  Py_VISIT(traverse_module_state->__pyx_ptype_7_amplpy___pyx_scope_struct_1_genexpr);
  Py_VISIT(traverse_module_state->__pyx_type_7_amplpy___pyx_scope_struct_1_genexpr);
  Py_VISIT(traverse_module_state->__pyx_ptype_7_amplpy___pyx_scope_struct_2_genexpr);
  Py_VISIT(traverse_module_state->__pyx_type_7_amplpy___pyx_scope_struct_2_genexpr);
  Py_VISIT(traverse_module_state->__pyx_ptype_7_amplpy___pyx_scope_struct_3_genexpr);
  Py_VISIT(traverse_module_state->__pyx_type_7_amplpy___pyx_scope_struct_3_genexpr);
  Py_VISIT(traverse_module_state->__pyx_ptype_7_amplpy___pyx_scope_struct_4__get_headers);
  Py_VISIT(traverse_module_state->__pyx_type_7_amplpy___pyx_scope_struct_4__get_headers);
  Py_VISIT(traverse_module_state->__pyx_ptype_7_amplpy___pyx_scope_struct_5_genexpr);
  Py_VISIT(traverse_module_state->__pyx_type_7_amplpy___pyx_scope_struct_5_genexpr);
  Py_VISIT(traverse_module_state->__pyx_ptype_7_amplpy___pyx_scope_struct_6_from_dict);
  Py_VISIT(traverse_module_state->__pyx_type_7_amplpy___pyx_scope_struct_6_from_dict);
  Py_VISIT(traverse_module_state->__pyx_ptype_7_amplpy___pyx_scope_struct_7_genexpr);
  Py_VISIT(traverse_module_state->__pyx_type_7_amplpy___pyx_scope_struct_7_genexpr);
  Py_VISIT(traverse_module_state->__pyx_ptype_7_amplpy___pyx_scope_struct_8_genexpr);
  Py_VISIT(traverse_module_state->__pyx_type_7_amplpy___pyx_scope_struct_8_genexpr);
  Py_VISIT(traverse_module_state->__pyx_ptype_7_amplpy___pyx_scope_struct_9_genexpr);
  Py_VISIT(traverse_module_state->__pyx_type_7_amplpy___pyx_scope_struct_9_genexpr);
  Py_VISIT(traverse_module_state->__pyx_ptype_7_amplpy___pyx_scope_struct_10_genexpr);
  Py_VISIT(traverse_module_state->__pyx_type_7_amplpy___pyx_scope_struct_10_genexpr);
  Py_VISIT(traverse_module_state->__pyx_ptype_7_amplpy___pyx_scope_struct_11_set_values);
  Py_VISIT(traverse_module_state->__pyx_type_7_amplpy___pyx_scope_struct_11_set_values);
  Py_VISIT(traverse_module_state->__pyx_ptype_7_amplpy___pyx_scope_struct_12_genexpr);
  Py_VISIT(traverse_module_state->__pyx_type_7_amplpy___pyx_scope_struct_12_genexpr);
  Py_VISIT(traverse_module_state->__pyx_ptype_7_amplpy___pyx_scope_struct_13_genexpr);
  Py_VISIT(traverse_module_state->__pyx_type_7_amplpy___pyx_scope_struct_13_genexpr);
  Py_VISIT(traverse_module_state->__pyx_ptype_7_amplpy___pyx_scope_struct_14_genexpr);
  Py_VISIT(traverse_module_state->__pyx_type_7_amplpy___pyx_scope_struct_14_genexpr);
  Py_VISIT(traverse_module_state->__pyx_ptype_7_amplpy___pyx_scope_struct_15_genexpr);
  Py_VISIT(traverse_module_state->__pyx_type_7_amplpy___pyx_scope_struct_15_genexpr);
  Py_VISIT(traverse_module_state->__pyx_kp_u_75);
  Py_VISIT(traverse_module_state->__pyx_n_s_AMPL);
  Py_VISIT(traverse_module_state->__pyx_n_s_AMPLException);
  Py_VISIT(traverse_module_state->__pyx_n_s_AMPLException___init);
  Py_VISIT(traverse_module_state->__pyx_n_s_AMPLException___str);
  Py_VISIT(traverse_module_state->__pyx_n_s_AMPLException_get_line_number);
  Py_VISIT(traverse_module_state->__pyx_n_s_AMPLException_get_message);
  Py_VISIT(traverse_module_state->__pyx_n_s_AMPLException_get_offset);
  Py_VISIT(traverse_module_state->__pyx_n_s_AMPLException_get_source_name);
  Py_VISIT(traverse_module_state->__pyx_kp_u_AMPL_AMPL_INVALID_SUBSCRIPT_EXCE);
  Py_VISIT(traverse_module_state->__pyx_kp_u_AMPL_AMPL_NO_DATA_EXCEPTION);
  Py_VISIT(traverse_module_state->__pyx_kp_u_AMPL_AMPL_SYNTAX_ERROR_EXCEPTION);
  Py_VISIT(traverse_module_state->__pyx_n_s_AMPL_NOT_FOUND_MESSAGE);
  Py_VISIT(traverse_module_state->__pyx_n_s_AMPL___reduce_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_AMPL___setstate_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_AMPL__con);
  Py_VISIT(traverse_module_state->__pyx_n_s_AMPL__load_session);
  Py_VISIT(traverse_module_state->__pyx_n_s_AMPL__obj);
  Py_VISIT(traverse_module_state->__pyx_n_s_AMPL__option);
  Py_VISIT(traverse_module_state->__pyx_n_s_AMPL__param);
  Py_VISIT(traverse_module_state->__pyx_n_s_AMPL__set);
  Py_VISIT(traverse_module_state->__pyx_n_s_AMPL__start_recording);
  Py_VISIT(traverse_module_state->__pyx_n_s_AMPL__stop_recording);
  Py_VISIT(traverse_module_state->__pyx_n_s_AMPL__var);
  Py_VISIT(traverse_module_state->__pyx_n_s_AMPL_cd);
  Py_VISIT(traverse_module_state->__pyx_n_s_AMPL_close);
  Py_VISIT(traverse_module_state->__pyx_kp_u_AMPL_could_not_be_started);
  Py_VISIT(traverse_module_state->__pyx_n_s_AMPL_display);
  Py_VISIT(traverse_module_state->__pyx_n_s_AMPL_eval);
  Py_VISIT(traverse_module_state->__pyx_n_s_AMPL_export_data);
  Py_VISIT(traverse_module_state->__pyx_n_s_AMPL_export_model);
  Py_VISIT(traverse_module_state->__pyx_n_s_AMPL_get_constraint);
  Py_VISIT(traverse_module_state->__pyx_n_s_AMPL_get_constraints);
  Py_VISIT(traverse_module_state->__pyx_n_s_AMPL_get_current_objective);
  Py_VISIT(traverse_module_state->__pyx_n_s_AMPL_get_data);
  Py_VISIT(traverse_module_state->__pyx_n_s_AMPL_get_entity);
  Py_VISIT(traverse_module_state->__pyx_n_s_AMPL_get_error_handler);
  Py_VISIT(traverse_module_state->__pyx_n_s_AMPL_get_iis);
  Py_VISIT(traverse_module_state->__pyx_n_s_AMPL_get_objective);
  Py_VISIT(traverse_module_state->__pyx_n_s_AMPL_get_objectives);
  Py_VISIT(traverse_module_state->__pyx_n_s_AMPL_get_option);
  Py_VISIT(traverse_module_state->__pyx_n_s_AMPL_get_output);
  Py_VISIT(traverse_module_state->__pyx_n_s_AMPL_get_output_handler);
  Py_VISIT(traverse_module_state->__pyx_n_s_AMPL_get_parameter);
  Py_VISIT(traverse_module_state->__pyx_n_s_AMPL_get_parameters);
  Py_VISIT(traverse_module_state->__pyx_n_s_AMPL_get_set);
  Py_VISIT(traverse_module_state->__pyx_n_s_AMPL_get_sets);
  Py_VISIT(traverse_module_state->__pyx_n_s_AMPL_get_solution);
  Py_VISIT(traverse_module_state->__pyx_n_s_AMPL_get_value);
  Py_VISIT(traverse_module_state->__pyx_n_s_AMPL_get_variable);
  Py_VISIT(traverse_module_state->__pyx_n_s_AMPL_get_variables);
  Py_VISIT(traverse_module_state->__pyx_n_s_AMPL_is_running);
  Py_VISIT(traverse_module_state->__pyx_n_s_AMPL_read);
  Py_VISIT(traverse_module_state->__pyx_n_s_AMPL_read_data);
  Py_VISIT(traverse_module_state->__pyx_n_s_AMPL_read_table);
  Py_VISIT(traverse_module_state->__pyx_n_s_AMPL_reset);
  Py_VISIT(traverse_module_state->__pyx_n_s_AMPL_set_data);
  Py_VISIT(traverse_module_state->__pyx_n_s_AMPL_set_error_handler);
  Py_VISIT(traverse_module_state->__pyx_n_s_AMPL_set_option);
  Py_VISIT(traverse_module_state->__pyx_n_s_AMPL_set_output_handler);
  Py_VISIT(traverse_module_state->__pyx_n_s_AMPL_snapshot);
  Py_VISIT(traverse_module_state->__pyx_n_s_AMPL_solve);
  Py_VISIT(traverse_module_state->__pyx_kp_u_AMPL_unknown_return_code);
  Py_VISIT(traverse_module_state->__pyx_n_s_AMPL_write);
  Py_VISIT(traverse_module_state->__pyx_n_s_AMPL_write_table);
  Py_VISIT(traverse_module_state->__pyx_kp_u_A_constraint_called_name_cannot);
  Py_VISIT(traverse_module_state->__pyx_kp_u_A_parameter_called_name_cannot_b);
  Py_VISIT(traverse_module_state->__pyx_kp_u_A_set_called_name_cannot_be_foun);
  Py_VISIT(traverse_module_state->__pyx_kp_u_A_variable_called_name_cannot_be);
  Py_VISIT(traverse_module_state->__pyx_kp_u_All_values_must_be_either_number);
  Py_VISIT(traverse_module_state->__pyx_kp_u_An_objective_called_name_cannot);
  Py_VISIT(traverse_module_state->__pyx_n_s_AssertionError);
  Py_VISIT(traverse_module_state->__pyx_n_s_AttributeError);
  Py_VISIT(traverse_module_state->__pyx_n_s_BREAK);
  Py_VISIT(traverse_module_state->__pyx_n_s_BREAKPOINT);
  Py_VISIT(traverse_module_state->__pyx_n_s_CALL);
  Py_VISIT(traverse_module_state->__pyx_n_s_CD);
  Py_VISIT(traverse_module_state->__pyx_n_s_CHECK);
  Py_VISIT(traverse_module_state->__pyx_n_s_CLOSE);
  Py_VISIT(traverse_module_state->__pyx_n_s_COMMANDS);
  Py_VISIT(traverse_module_state->__pyx_n_s_CONTINUE);
  Py_VISIT(traverse_module_state->__pyx_n_s_ColIterator);
  Py_VISIT(traverse_module_state->__pyx_n_s_ColIterator___reduce_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_ColIterator___setstate_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_Column);
  Py_VISIT(traverse_module_state->__pyx_n_s_Column___reduce_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_Column___setstate_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_Column_to_list);
  Py_VISIT(traverse_module_state->__pyx_n_s_Column_to_string);
  Py_VISIT(traverse_module_state->__pyx_n_s_Constraint);
  Py_VISIT(traverse_module_state->__pyx_n_s_Constraint___reduce_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_Constraint___setstate_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_Constraint_astatus);
  Py_VISIT(traverse_module_state->__pyx_n_s_Constraint_body);
  Py_VISIT(traverse_module_state->__pyx_n_s_Constraint_defvar);
  Py_VISIT(traverse_module_state->__pyx_n_s_Constraint_dinit);
  Py_VISIT(traverse_module_state->__pyx_n_s_Constraint_dinit0);
  Py_VISIT(traverse_module_state->__pyx_n_s_Constraint_drop);
  Py_VISIT(traverse_module_state->__pyx_n_s_Constraint_dual);
  Py_VISIT(traverse_module_state->__pyx_n_s_Constraint_is_logical);
  Py_VISIT(traverse_module_state->__pyx_n_s_Constraint_lb);
  Py_VISIT(traverse_module_state->__pyx_n_s_Constraint_lbs);
  Py_VISIT(traverse_module_state->__pyx_n_s_Constraint_ldual);
  Py_VISIT(traverse_module_state->__pyx_n_s_Constraint_lslack);
  Py_VISIT(traverse_module_state->__pyx_n_s_Constraint_restore);
  Py_VISIT(traverse_module_state->__pyx_n_s_Constraint_set_dual);
  Py_VISIT(traverse_module_state->__pyx_n_s_Constraint_slack);
  Py_VISIT(traverse_module_state->__pyx_n_s_Constraint_sstatus);
  Py_VISIT(traverse_module_state->__pyx_n_s_Constraint_status);
  Py_VISIT(traverse_module_state->__pyx_n_s_Constraint_ub);
  Py_VISIT(traverse_module_state->__pyx_n_s_Constraint_ubs);
  Py_VISIT(traverse_module_state->__pyx_n_s_Constraint_udual);
  Py_VISIT(traverse_module_state->__pyx_n_s_Constraint_uslack);
  Py_VISIT(traverse_module_state->__pyx_n_s_Constraint_val);
  Py_VISIT(traverse_module_state->__pyx_n_s_Constraints);
  Py_VISIT(traverse_module_state->__pyx_n_s_DATA);
  Py_VISIT(traverse_module_state->__pyx_n_s_DELETECMD);
  Py_VISIT(traverse_module_state->__pyx_n_s_DISPLAY);
  Py_VISIT(traverse_module_state->__pyx_n_s_DROP);
  Py_VISIT(traverse_module_state->__pyx_n_s_DROP_OR_RESTORE_ALL);
  Py_VISIT(traverse_module_state->__pyx_n_s_DataFrame);
  Py_VISIT(traverse_module_state->__pyx_n_s_DataFrame___reduce_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_DataFrame___setstate_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_DataFrame__add_column);
  Py_VISIT(traverse_module_state->__pyx_n_s_DataFrame__add_row);
  Py_VISIT(traverse_module_state->__pyx_n_s_DataFrame__from_data_frame_ref);
  Py_VISIT(traverse_module_state->__pyx_n_s_DataFrame__get_column);
  Py_VISIT(traverse_module_state->__pyx_n_s_DataFrame__get_headers);
  Py_VISIT(traverse_module_state->__pyx_n_s_DataFrame__get_num_cols);
  Py_VISIT(traverse_module_state->__pyx_n_s_DataFrame__get_num_indices);
  Py_VISIT(traverse_module_state->__pyx_n_s_DataFrame__get_num_rows);
  Py_VISIT(traverse_module_state->__pyx_n_s_DataFrame__get_row);
  Py_VISIT(traverse_module_state->__pyx_n_s_DataFrame__get_row_by_index);
  Py_VISIT(traverse_module_state->__pyx_n_s_DataFrame__set_column);
  Py_VISIT(traverse_module_state->__pyx_n_s_DataFrame__set_values);
  Py_VISIT(traverse_module_state->__pyx_n_s_DataFrame_from_dict);
  Py_VISIT(traverse_module_state->__pyx_n_s_DataFrame_from_numpy);
  Py_VISIT(traverse_module_state->__pyx_n_s_DataFrame_from_pandas);
  Py_VISIT(traverse_module_state->__pyx_n_s_DataFrame_to_dict);
  Py_VISIT(traverse_module_state->__pyx_n_s_DataFrame_to_list);
  Py_VISIT(traverse_module_state->__pyx_n_s_DataFrame_to_pandas);
  Py_VISIT(traverse_module_state->__pyx_n_s_DataFrame_to_string);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Dictionary_must_contain_either_a);
  Py_VISIT(traverse_module_state->__pyx_n_s_ELSE);
  Py_VISIT(traverse_module_state->__pyx_n_s_ELSE_CHECK);
  Py_VISIT(traverse_module_state->__pyx_n_s_ENDIF);
  Py_VISIT(traverse_module_state->__pyx_n_s_ENVIRON);
  Py_VISIT(traverse_module_state->__pyx_n_s_EXIT);
  Py_VISIT(traverse_module_state->__pyx_n_s_EXPAND);
  Py_VISIT(traverse_module_state->__pyx_n_s_Entity);
  Py_VISIT(traverse_module_state->__pyx_n_s_EntityMap);
  Py_VISIT(traverse_module_state->__pyx_n_s_EntityMap___reduce_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_EntityMap___setstate_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_EntityMap_size);
  Py_VISIT(traverse_module_state->__pyx_n_s_Entity___reduce_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_Entity___setstate_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_Entity_find);
  Py_VISIT(traverse_module_state->__pyx_n_s_Entity_get);
  Py_VISIT(traverse_module_state->__pyx_n_s_Entity_get_indexing_sets);
  Py_VISIT(traverse_module_state->__pyx_n_s_Entity_get_values);
  Py_VISIT(traverse_module_state->__pyx_n_s_Entity_indexarity);
  Py_VISIT(traverse_module_state->__pyx_n_s_Entity_instances);
  Py_VISIT(traverse_module_state->__pyx_n_s_Entity_is_scalar);
  Py_VISIT(traverse_module_state->__pyx_n_s_Entity_name);
  Py_VISIT(traverse_module_state->__pyx_n_s_Entity_num_instances);
  Py_VISIT(traverse_module_state->__pyx_n_s_Entity_set_values);
  Py_VISIT(traverse_module_state->__pyx_n_s_Entity_to_dict);
  Py_VISIT(traverse_module_state->__pyx_n_s_Entity_to_list);
  Py_VISIT(traverse_module_state->__pyx_n_s_Entity_to_pandas);
  Py_VISIT(traverse_module_state->__pyx_n_s_Entity_to_string);
  Py_VISIT(traverse_module_state->__pyx_n_s_Entity_xref);
  Py_VISIT(traverse_module_state->__pyx_n_s_Enum);
  Py_VISIT(traverse_module_state->__pyx_n_s_EnvIterator);
  Py_VISIT(traverse_module_state->__pyx_n_s_EnvIterator___reduce_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_EnvIterator___setstate_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_Environment);
  Py_VISIT(traverse_module_state->__pyx_n_s_Environment___reduce_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_Environment___setstate_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_Environment_get_bin_dir);
  Py_VISIT(traverse_module_state->__pyx_n_s_Environment_get_bin_name);
  Py_VISIT(traverse_module_state->__pyx_n_s_Environment_set_bin_dir);
  Py_VISIT(traverse_module_state->__pyx_n_s_Environment_set_bin_name);
  Py_VISIT(traverse_module_state->__pyx_n_s_Environment_to_string);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Error);
  Py_VISIT(traverse_module_state->__pyx_n_s_ErrorHandler);
  Py_VISIT(traverse_module_state->__pyx_n_s_ErrorHandler___reduce_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_ErrorHandler___setstate_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_ErrorHandler_error);
  Py_VISIT(traverse_module_state->__pyx_n_s_ErrorHandler_warning);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Excepted_dictionary_of_set_membe);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Excepted_string_or_real);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Excepted_tuple_of_arity);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Expected_a_dictionary);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Expected_tuples_of_arity);
  Py_VISIT(traverse_module_state->__pyx_n_s_FIX);
  Py_VISIT(traverse_module_state->__pyx_n_s_FOR);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Failed_to_access_value);
  Py_VISIT(traverse_module_state->__pyx_n_s_IF);
  Py_VISIT(traverse_module_state->__pyx_n_s_IOError);
  Py_VISIT(traverse_module_state->__pyx_n_s_ImportError);
  Py_VISIT(traverse_module_state->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0);
  Py_VISIT(traverse_module_state->__pyx_n_s_InfeasibilityException);
  Py_VISIT(traverse_module_state->__pyx_kp_u_InfeasibilityException_2);
  Py_VISIT(traverse_module_state->__pyx_n_s_InstanceIterator);
  Py_VISIT(traverse_module_state->__pyx_n_s_InstanceIterator___reduce_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_InstanceIterator___setstate_cyth);
  Py_VISIT(traverse_module_state->__pyx_n_s_InstanceIterator_size);
  Py_VISIT(traverse_module_state->__pyx_n_s_Iterable);
  Py_VISIT(traverse_module_state->__pyx_n_s_KeyError);
  Py_VISIT(traverse_module_state->__pyx_n_s_Kind);
  Py_VISIT(traverse_module_state->__pyx_n_s_LET);
  Py_VISIT(traverse_module_state->__pyx_n_s_LOAD);
  Py_VISIT(traverse_module_state->__pyx_n_s_LOOPEND);
  Py_VISIT(traverse_module_state->__pyx_n_s_MISC);
  Py_VISIT(traverse_module_state->__pyx_n_s_MemberRangeIterator);
  Py_VISIT(traverse_module_state->__pyx_n_s_MemberRangeIterator___reduce_cyt);
  Py_VISIT(traverse_module_state->__pyx_n_s_MemberRangeIterator___setstate_c);
  Py_VISIT(traverse_module_state->__pyx_n_s_MemberRangeIterator_size);
  Py_VISIT(traverse_module_state->__pyx_n_s_MemoryError);
  Py_VISIT(traverse_module_state->__pyx_n_s_MultiIndex);
  Py_VISIT(traverse_module_state->__pyx_n_s_NotImplementedError);
  Py_VISIT(traverse_module_state->__pyx_n_s_OBJECTIVE);
  Py_VISIT(traverse_module_state->__pyx_n_s_OPTION);
  Py_VISIT(traverse_module_state->__pyx_n_s_OPTION_RESET);
  Py_VISIT(traverse_module_state->__pyx_n_s_Objective);
  Py_VISIT(traverse_module_state->__pyx_n_s_Objective___reduce_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_Objective___setstate_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_Objective_astatus);
  Py_VISIT(traverse_module_state->__pyx_n_s_Objective_drop);
  Py_VISIT(traverse_module_state->__pyx_n_s_Objective_exitcode);
  Py_VISIT(traverse_module_state->__pyx_n_s_Objective_message);
  Py_VISIT(traverse_module_state->__pyx_n_s_Objective_minimization);
  Py_VISIT(traverse_module_state->__pyx_n_s_Objective_restore);
  Py_VISIT(traverse_module_state->__pyx_n_s_Objective_result);
  Py_VISIT(traverse_module_state->__pyx_n_s_Objective_sstatus);
  Py_VISIT(traverse_module_state->__pyx_n_s_Objective_value);
  Py_VISIT(traverse_module_state->__pyx_n_s_Objectives);
  Py_VISIT(traverse_module_state->__pyx_n_s_Options);
  Py_VISIT(traverse_module_state->__pyx_n_s_OutputHandler);
  Py_VISIT(traverse_module_state->__pyx_n_s_OutputHandler___reduce_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_OutputHandler___setstate_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_OutputHandler_output);
  Py_VISIT(traverse_module_state->__pyx_n_s_PRINT);
  Py_VISIT(traverse_module_state->__pyx_n_s_PRINTF);
  Py_VISIT(traverse_module_state->__pyx_n_s_PROBLEM);
  Py_VISIT(traverse_module_state->__pyx_n_s_PROMPT);
  Py_VISIT(traverse_module_state->__pyx_n_s_PURGE);
  Py_VISIT(traverse_module_state->__pyx_n_s_Parameter);
  Py_VISIT(traverse_module_state->__pyx_n_s_Parameter___reduce_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_Parameter___setstate_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_Parameter_has_default);
  Py_VISIT(traverse_module_state->__pyx_n_s_Parameter_is_symbolic);
  Py_VISIT(traverse_module_state->__pyx_n_s_Parameter_set);
  Py_VISIT(traverse_module_state->__pyx_n_s_Parameter_set_values);
  Py_VISIT(traverse_module_state->__pyx_n_s_Parameter_value);
  Py_VISIT(traverse_module_state->__pyx_n_s_Parameters);
  Py_VISIT(traverse_module_state->__pyx_n_s_PickleError);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Please_make_sure_that_the_AMPL);
  Py_VISIT(traverse_module_state->__pyx_n_s_PresolveException);
  Py_VISIT(traverse_module_state->__pyx_kp_u_PresolveException_2);
  Py_VISIT(traverse_module_state->__pyx_n_s_RBRACE);
  Py_VISIT(traverse_module_state->__pyx_n_s_READ);
  Py_VISIT(traverse_module_state->__pyx_n_s_READTABLE);
  Py_VISIT(traverse_module_state->__pyx_n_s_READ_TABLE);
  Py_VISIT(traverse_module_state->__pyx_n_s_RELOAD);
  Py_VISIT(traverse_module_state->__pyx_n_s_REMOVE);
  Py_VISIT(traverse_module_state->__pyx_n_s_REPEAT);
  Py_VISIT(traverse_module_state->__pyx_n_s_REPEAT_END);
  Py_VISIT(traverse_module_state->__pyx_n_s_RESET);
  Py_VISIT(traverse_module_state->__pyx_n_s_RESTORE);
  Py_VISIT(traverse_module_state->__pyx_n_s_RUN_ARGS);
  Py_VISIT(traverse_module_state->__pyx_n_s_Real);
  Py_VISIT(traverse_module_state->__pyx_kp_s_Represent_an_exception_generate);
  Py_VISIT(traverse_module_state->__pyx_kp_s_Represents_the_type_of_the_outp);
  Py_VISIT(traverse_module_state->__pyx_n_s_Row);
  Py_VISIT(traverse_module_state->__pyx_n_s_RowIterator);
  Py_VISIT(traverse_module_state->__pyx_n_s_RowIterator___reduce_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_RowIterator___setstate_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_Row___reduce_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_Row___setstate_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_Row_to_string);
  Py_VISIT(traverse_module_state->__pyx_n_s_RuntimeError);
  Py_VISIT(traverse_module_state->__pyx_n_s_SEMICOLON);
  Py_VISIT(traverse_module_state->__pyx_n_s_SHELL_MESSAGE);
  Py_VISIT(traverse_module_state->__pyx_n_s_SHELL_OUTPUT);
  Py_VISIT(traverse_module_state->__pyx_n_s_SHOW);
  Py_VISIT(traverse_module_state->__pyx_n_s_SOLUTION);
  Py_VISIT(traverse_module_state->__pyx_n_s_SOLVE);
  Py_VISIT(traverse_module_state->__pyx_n_s_SSTEP);
  Py_VISIT(traverse_module_state->__pyx_n_s_SUPPORT_MESSAGE);
  Py_VISIT(traverse_module_state->__pyx_n_s_Series);
  Py_VISIT(traverse_module_state->__pyx_n_s_Set);
  Py_VISIT(traverse_module_state->__pyx_n_s_Set___reduce_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_Set___setstate_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_Set_arity);
  Py_VISIT(traverse_module_state->__pyx_n_s_Set_contains);
  Py_VISIT(traverse_module_state->__pyx_n_s_Set_get_values);
  Py_VISIT(traverse_module_state->__pyx_n_s_Set_instances);
  Py_VISIT(traverse_module_state->__pyx_n_s_Set_members);
  Py_VISIT(traverse_module_state->__pyx_n_s_Set_set_values);
  Py_VISIT(traverse_module_state->__pyx_n_s_Set_size);
  Py_VISIT(traverse_module_state->__pyx_n_s_Sets);
  Py_VISIT(traverse_module_state->__pyx_n_s_StopIteration);
  Py_VISIT(traverse_module_state->__pyx_n_s_SystemError);
  Py_VISIT(traverse_module_state->__pyx_n_s_THEN);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Trying_to_assign_tuples_to_set_o);
  Py_VISIT(traverse_module_state->__pyx_n_s_TypeError);
  Py_VISIT(traverse_module_state->__pyx_n_s_UNFIX);
  Py_VISIT(traverse_module_state->__pyx_n_s_UNLOAD);
  Py_VISIT(traverse_module_state->__pyx_n_s_UPDATE);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Unable_to_allocate_memory_for_ar);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Unexpected_data_type);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Unknown_entity_class);
  Py_VISIT(traverse_module_state->__pyx_n_s_ValueError);
  Py_VISIT(traverse_module_state->__pyx_n_s_Variable);
  Py_VISIT(traverse_module_state->__pyx_n_s_Variable___reduce_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_Variable___setstate_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_Variable_astatus);
  Py_VISIT(traverse_module_state->__pyx_n_s_Variable_defeqn);
  Py_VISIT(traverse_module_state->__pyx_n_s_Variable_dual);
  Py_VISIT(traverse_module_state->__pyx_n_s_Variable_fix);
  Py_VISIT(traverse_module_state->__pyx_n_s_Variable_init);
  Py_VISIT(traverse_module_state->__pyx_n_s_Variable_init0);
  Py_VISIT(traverse_module_state->__pyx_n_s_Variable_lb);
  Py_VISIT(traverse_module_state->__pyx_n_s_Variable_lb0);
  Py_VISIT(traverse_module_state->__pyx_n_s_Variable_lb1);
  Py_VISIT(traverse_module_state->__pyx_n_s_Variable_lb2);
  Py_VISIT(traverse_module_state->__pyx_n_s_Variable_lrc);
  Py_VISIT(traverse_module_state->__pyx_n_s_Variable_lslack);
  Py_VISIT(traverse_module_state->__pyx_n_s_Variable_rc);
  Py_VISIT(traverse_module_state->__pyx_n_s_Variable_set_value);
  Py_VISIT(traverse_module_state->__pyx_n_s_Variable_slack);
  Py_VISIT(traverse_module_state->__pyx_n_s_Variable_sstatus);
  Py_VISIT(traverse_module_state->__pyx_n_s_Variable_status);
  Py_VISIT(traverse_module_state->__pyx_n_s_Variable_ub);
  Py_VISIT(traverse_module_state->__pyx_n_s_Variable_ub0);
  Py_VISIT(traverse_module_state->__pyx_n_s_Variable_ub1);
  Py_VISIT(traverse_module_state->__pyx_n_s_Variable_ub2);
  Py_VISIT(traverse_module_state->__pyx_n_s_Variable_unfix);
  Py_VISIT(traverse_module_state->__pyx_n_s_Variable_urc);
  Py_VISIT(traverse_module_state->__pyx_n_s_Variable_uslack);
  Py_VISIT(traverse_module_state->__pyx_n_s_Variable_value);
  Py_VISIT(traverse_module_state->__pyx_n_s_Variables);
  Py_VISIT(traverse_module_state->__pyx_n_s_WAITING);
  Py_VISIT(traverse_module_state->__pyx_n_s_WRITE);
  Py_VISIT(traverse_module_state->__pyx_n_s_WRITETABLE);
  Py_VISIT(traverse_module_state->__pyx_n_s_WRITE_TABLE);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Warning);
  Py_VISIT(traverse_module_state->__pyx_n_s_XREF);
  Py_VISIT(traverse_module_state->__pyx_kp_u__21);
  Py_VISIT(traverse_module_state->__pyx_kp_u__22);
  Py_VISIT(traverse_module_state->__pyx_kp_u__24);
  Py_VISIT(traverse_module_state->__pyx_kp_u__25);
  Py_VISIT(traverse_module_state->__pyx_kp_u__26);
  Py_VISIT(traverse_module_state->__pyx_kp_u__33);
  Py_VISIT(traverse_module_state->__pyx_kp_u__34);
  Py_VISIT(traverse_module_state->__pyx_kp_u__35);
  Py_VISIT(traverse_module_state->__pyx_kp_u__36);
  Py_VISIT(traverse_module_state->__pyx_kp_u__38);
  Py_VISIT(traverse_module_state->__pyx_kp_u__39);
  Py_VISIT(traverse_module_state->__pyx_n_s__390);
  Py_VISIT(traverse_module_state->__pyx_kp_u__40);
  Py_VISIT(traverse_module_state->__pyx_kp_u__41);
  Py_VISIT(traverse_module_state->__pyx_n_s__84);
  Py_VISIT(traverse_module_state->__pyx_n_s_addColumn);
  Py_VISIT(traverse_module_state->__pyx_n_s_addRow);
  Py_VISIT(traverse_module_state->__pyx_n_s_add_column);
  Py_VISIT(traverse_module_state->__pyx_n_s_add_column_locals_genexpr);
  Py_VISIT(traverse_module_state->__pyx_n_s_add_row);
  Py_VISIT(traverse_module_state->__pyx_n_s_ampl);
  Py_VISIT(traverse_module_state->__pyx_n_s_ampl_expressions);
  Py_VISIT(traverse_module_state->__pyx_n_u_ampl_libpath);
  Py_VISIT(traverse_module_state->__pyx_n_s_amplpy);
  Py_VISIT(traverse_module_state->__pyx_kp_s_amplpy_ampl_pyx);
  Py_VISIT(traverse_module_state->__pyx_kp_s_amplpy_constraint_pxi);
  Py_VISIT(traverse_module_state->__pyx_kp_s_amplpy_dataframe_pxi);
  Py_VISIT(traverse_module_state->__pyx_kp_s_amplpy_entity_pxi);
  Py_VISIT(traverse_module_state->__pyx_kp_s_amplpy_environment_pxi);
  Py_VISIT(traverse_module_state->__pyx_kp_s_amplpy_errorhandler_pxi);
  Py_VISIT(traverse_module_state->__pyx_kp_s_amplpy_exceptions_pxi);
  Py_VISIT(traverse_module_state->__pyx_kp_s_amplpy_iterators_pxi);
  Py_VISIT(traverse_module_state->__pyx_kp_s_amplpy_objective_pxi);
  Py_VISIT(traverse_module_state->__pyx_kp_s_amplpy_outputhandler_pxi);
  Py_VISIT(traverse_module_state->__pyx_kp_s_amplpy_parameter_pxi);
  Py_VISIT(traverse_module_state->__pyx_kp_s_amplpy_set_pxi);
  Py_VISIT(traverse_module_state->__pyx_kp_s_amplpy_variable_pxi);
  Py_VISIT(traverse_module_state->__pyx_n_s_args);
  Py_VISIT(traverse_module_state->__pyx_n_s_arity);
  Py_VISIT(traverse_module_state->__pyx_n_s_array);
  Py_VISIT(traverse_module_state->__pyx_n_s_ast);
  Py_VISIT(traverse_module_state->__pyx_n_s_astatus);
  Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines);
  Py_VISIT(traverse_module_state->__pyx_n_s_auxfiles);
  Py_VISIT(traverse_module_state->__pyx_n_s_bin_dir);
  Py_VISIT(traverse_module_state->__pyx_n_s_bin_dir_c);
  Py_VISIT(traverse_module_state->__pyx_n_s_bin_name);
  Py_VISIT(traverse_module_state->__pyx_n_s_bin_name_c);
  Py_VISIT(traverse_module_state->__pyx_n_s_binary_directory);
  Py_VISIT(traverse_module_state->__pyx_n_s_binary_name);
  Py_VISIT(traverse_module_state->__pyx_n_s_body);
  Py_VISIT(traverse_module_state->__pyx_n_u_c);
  Py_VISIT(traverse_module_state->__pyx_n_s_c_double_array);
  Py_VISIT(traverse_module_state->__pyx_n_s_c_string_array);
  Py_VISIT(traverse_module_state->__pyx_kp_u_cannot_convert_to_dictionary_wit);
  Py_VISIT(traverse_module_state->__pyx_n_s_cast_row);
  Py_VISIT(traverse_module_state->__pyx_n_s_cast_value);
  Py_VISIT(traverse_module_state->__pyx_n_s_cd);
  Py_VISIT(traverse_module_state->__pyx_n_s_chain);
  Py_VISIT(traverse_module_state->__pyx_n_s_cindex);
  Py_VISIT(traverse_module_state->__pyx_n_s_class_getitem);
  Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback);
  Py_VISIT(traverse_module_state->__pyx_n_s_close);
  Py_VISIT(traverse_module_state->__pyx_n_s_cls);
  Py_VISIT(traverse_module_state->__pyx_n_s_cname);
  Py_VISIT(traverse_module_state->__pyx_n_s_col);
  Py_VISIT(traverse_module_state->__pyx_n_s_collections_abc);
  Py_VISIT(traverse_module_state->__pyx_n_s_column);
  Py_VISIT(traverse_module_state->__pyx_n_s_column_names);
  Py_VISIT(traverse_module_state->__pyx_n_s_columns);
  Py_VISIT(traverse_module_state->__pyx_n_s_con);
  Py_VISIT(traverse_module_state->__pyx_n_s_con_2);
  Py_VISIT(traverse_module_state->__pyx_n_s_con_locals_Constraints);
  Py_VISIT(traverse_module_state->__pyx_n_s_con_locals_Constraints___getite);
  Py_VISIT(traverse_module_state->__pyx_n_s_con_locals_Constraints___init);
  Py_VISIT(traverse_module_state->__pyx_n_s_con_locals_Constraints___iter);
  Py_VISIT(traverse_module_state->__pyx_n_s_con_locals_Constraints___setite);
  Py_VISIT(traverse_module_state->__pyx_n_s_contains);
  Py_VISIT(traverse_module_state->__pyx_n_s_contains_c);
  Py_VISIT(traverse_module_state->__pyx_n_s_conv_to_list);
  Py_VISIT(traverse_module_state->__pyx_n_s_d);
  Py_VISIT(traverse_module_state->__pyx_n_s_data);
  Py_VISIT(traverse_module_state->__pyx_n_s_data_c);
  Py_VISIT(traverse_module_state->__pyx_n_s_data_frame);
  Py_VISIT(traverse_module_state->__pyx_n_s_defeqn);
  Py_VISIT(traverse_module_state->__pyx_n_s_defvar);
  Py_VISIT(traverse_module_state->__pyx_n_s_df);
  Py_VISIT(traverse_module_state->__pyx_n_s_df_c);
  Py_VISIT(traverse_module_state->__pyx_n_s_df_ref);
  Py_VISIT(traverse_module_state->__pyx_n_s_dic);
  Py_VISIT(traverse_module_state->__pyx_n_s_dict);
  Py_VISIT(traverse_module_state->__pyx_n_s_dict_2);
  Py_VISIT(traverse_module_state->__pyx_n_s_dimen);
  Py_VISIT(traverse_module_state->__pyx_n_s_dinit);
  Py_VISIT(traverse_module_state->__pyx_n_s_dinit0);
  Py_VISIT(traverse_module_state->__pyx_kp_u_disable);
  Py_VISIT(traverse_module_state->__pyx_n_s_display);
  Py_VISIT(traverse_module_state->__pyx_n_u_display);
  Py_VISIT(traverse_module_state->__pyx_n_s_display_error_message);
  Py_VISIT(traverse_module_state->__pyx_n_s_doc);
  Py_VISIT(traverse_module_state->__pyx_n_s_drop);
  Py_VISIT(traverse_module_state->__pyx_n_s_dual);
  Py_VISIT(traverse_module_state->__pyx_n_s_e);
  Py_VISIT(traverse_module_state->__pyx_kp_u_enable);
  Py_VISIT(traverse_module_state->__pyx_n_s_encode);
  Py_VISIT(traverse_module_state->__pyx_n_s_end);
  Py_VISIT(traverse_module_state->__pyx_n_s_endswith);
  Py_VISIT(traverse_module_state->__pyx_n_s_entity);
  Py_VISIT(traverse_module_state->__pyx_n_s_entitytype);
  Py_VISIT(traverse_module_state->__pyx_n_s_enum);
  Py_VISIT(traverse_module_state->__pyx_n_s_enumerate);
  Py_VISIT(traverse_module_state->__pyx_n_s_environ);
  Py_VISIT(traverse_module_state->__pyx_n_s_environment);
  Py_VISIT(traverse_module_state->__pyx_n_s_error);
  Py_VISIT(traverse_module_state->__pyx_n_s_error_handler);
  Py_VISIT(traverse_module_state->__pyx_n_s_errorinfo);
  Py_VISIT(traverse_module_state->__pyx_n_s_eval);
  Py_VISIT(traverse_module_state->__pyx_n_s_exception);
  Py_VISIT(traverse_module_state->__pyx_n_s_exists);
  Py_VISIT(traverse_module_state->__pyx_n_s_exitcode);
  Py_VISIT(traverse_module_state->__pyx_n_s_exp);
  Py_VISIT(traverse_module_state->__pyx_n_s_exportData);
  Py_VISIT(traverse_module_state->__pyx_n_s_exportModel);
  Py_VISIT(traverse_module_state->__pyx_n_s_export_data);
  Py_VISIT(traverse_module_state->__pyx_n_s_export_model);
  Py_VISIT(traverse_module_state->__pyx_n_s_exprs);
  Py_VISIT(traverse_module_state->__pyx_kp_u_file);
  Py_VISIT(traverse_module_state->__pyx_n_s_file_2);
  Py_VISIT(traverse_module_state->__pyx_n_s_filename);
  Py_VISIT(traverse_module_state->__pyx_n_s_find);
  Py_VISIT(traverse_module_state->__pyx_n_s_fix);
  Py_VISIT(traverse_module_state->__pyx_n_s_flat);
  Py_VISIT(traverse_module_state->__pyx_n_s_flush);
  Py_VISIT(traverse_module_state->__pyx_n_s_fromDict);
  Py_VISIT(traverse_module_state->__pyx_n_s_fromNumpy);
  Py_VISIT(traverse_module_state->__pyx_n_s_fromPandas);
  Py_VISIT(traverse_module_state->__pyx_n_s_from_arrays);
  Py_VISIT(traverse_module_state->__pyx_n_s_from_data_frame_ref);
  Py_VISIT(traverse_module_state->__pyx_n_s_from_dict);
  Py_VISIT(traverse_module_state->__pyx_n_s_from_dict_locals_genexpr);
  Py_VISIT(traverse_module_state->__pyx_n_s_from_dict_locals_to_tuple);
  Py_VISIT(traverse_module_state->__pyx_n_s_from_numpy);
  Py_VISIT(traverse_module_state->__pyx_n_s_from_pandas);
  Py_VISIT(traverse_module_state->__pyx_n_s_from_tuples);
  Py_VISIT(traverse_module_state->__pyx_kp_u_gc);
  Py_VISIT(traverse_module_state->__pyx_n_s_genexpr);
  Py_VISIT(traverse_module_state->__pyx_n_s_get);
  Py_VISIT(traverse_module_state->__pyx_n_s_getBinDir);
  Py_VISIT(traverse_module_state->__pyx_n_s_getBinName);
  Py_VISIT(traverse_module_state->__pyx_n_s_getColumn);
  Py_VISIT(traverse_module_state->__pyx_n_s_getConstraint);
  Py_VISIT(traverse_module_state->__pyx_n_s_getConstraints);
  Py_VISIT(traverse_module_state->__pyx_n_s_getCurrentObjective);
  Py_VISIT(traverse_module_state->__pyx_n_s_getData);
  Py_VISIT(traverse_module_state->__pyx_n_s_getEntity);
  Py_VISIT(traverse_module_state->__pyx_n_s_getErrorHandler);
  Py_VISIT(traverse_module_state->__pyx_n_s_getHeaders);
  Py_VISIT(traverse_module_state->__pyx_n_s_getIndexingSets);
  Py_VISIT(traverse_module_state->__pyx_n_s_getLineNumber);
  Py_VISIT(traverse_module_state->__pyx_n_s_getMessage);
  Py_VISIT(traverse_module_state->__pyx_n_s_getNumCols);
  Py_VISIT(traverse_module_state->__pyx_n_s_getNumIndices);
  Py_VISIT(traverse_module_state->__pyx_n_s_getNumRows);
  Py_VISIT(traverse_module_state->__pyx_n_s_getObjective);
  Py_VISIT(traverse_module_state->__pyx_n_s_getObjectives);
  Py_VISIT(traverse_module_state->__pyx_n_s_getOffset);
  Py_VISIT(traverse_module_state->__pyx_n_s_getOption);
  Py_VISIT(traverse_module_state->__pyx_n_s_getOutput);
  Py_VISIT(traverse_module_state->__pyx_n_s_getOutputHandler);
  Py_VISIT(traverse_module_state->__pyx_n_s_getParameter);
  Py_VISIT(traverse_module_state->__pyx_n_s_getParameters);
  Py_VISIT(traverse_module_state->__pyx_n_s_getRow);
  Py_VISIT(traverse_module_state->__pyx_n_s_getRowByIndex);
  Py_VISIT(traverse_module_state->__pyx_n_s_getSet);
  Py_VISIT(traverse_module_state->__pyx_n_s_getSets);
  Py_VISIT(traverse_module_state->__pyx_n_s_getSourceName);
  Py_VISIT(traverse_module_state->__pyx_n_s_getValue);
  Py_VISIT(traverse_module_state->__pyx_n_s_getValues);
  Py_VISIT(traverse_module_state->__pyx_n_s_getVariable);
  Py_VISIT(traverse_module_state->__pyx_n_s_getVariables);
  Py_VISIT(traverse_module_state->__pyx_n_s_get_bin_dir);
  Py_VISIT(traverse_module_state->__pyx_n_s_get_bin_name);
  Py_VISIT(traverse_module_state->__pyx_n_s_get_column);
  Py_VISIT(traverse_module_state->__pyx_n_s_get_constraint);
  Py_VISIT(traverse_module_state->__pyx_n_s_get_constraints);
  Py_VISIT(traverse_module_state->__pyx_n_s_get_current_objective);
  Py_VISIT(traverse_module_state->__pyx_n_s_get_data);
  Py_VISIT(traverse_module_state->__pyx_n_s_get_entity);
  Py_VISIT(traverse_module_state->__pyx_n_s_get_error_handler);
  Py_VISIT(traverse_module_state->__pyx_n_s_get_headers);
  Py_VISIT(traverse_module_state->__pyx_n_s_get_headers_locals_genexpr);
  Py_VISIT(traverse_module_state->__pyx_n_s_get_iis);
  Py_VISIT(traverse_module_state->__pyx_n_s_get_indexing_sets);
  Py_VISIT(traverse_module_state->__pyx_n_s_get_line_number);
  Py_VISIT(traverse_module_state->__pyx_n_s_get_message);
  Py_VISIT(traverse_module_state->__pyx_n_s_get_num_cols);
  Py_VISIT(traverse_module_state->__pyx_n_s_get_num_indices);
  Py_VISIT(traverse_module_state->__pyx_n_s_get_num_rows);
  Py_VISIT(traverse_module_state->__pyx_n_s_get_objective);
  Py_VISIT(traverse_module_state->__pyx_n_s_get_objectives);
  Py_VISIT(traverse_module_state->__pyx_n_s_get_offset);
  Py_VISIT(traverse_module_state->__pyx_n_s_get_option);
  Py_VISIT(traverse_module_state->__pyx_n_s_get_output);
  Py_VISIT(traverse_module_state->__pyx_n_s_get_output_handler);
  Py_VISIT(traverse_module_state->__pyx_n_s_get_parameter);
  Py_VISIT(traverse_module_state->__pyx_n_s_get_parameters);
  Py_VISIT(traverse_module_state->__pyx_n_s_get_row);
  Py_VISIT(traverse_module_state->__pyx_n_s_get_row_by_index);
  Py_VISIT(traverse_module_state->__pyx_n_s_get_set);
  Py_VISIT(traverse_module_state->__pyx_n_s_get_sets);
  Py_VISIT(traverse_module_state->__pyx_n_s_get_solution);
  Py_VISIT(traverse_module_state->__pyx_n_s_get_source_name);
  Py_VISIT(traverse_module_state->__pyx_n_s_get_value);
  Py_VISIT(traverse_module_state->__pyx_n_s_get_values);
  Py_VISIT(traverse_module_state->__pyx_n_s_get_variable);
  Py_VISIT(traverse_module_state->__pyx_n_s_get_variables);
  Py_VISIT(traverse_module_state->__pyx_n_s_getitem);
  Py_VISIT(traverse_module_state->__pyx_n_s_getstate);
  Py_VISIT(traverse_module_state->__pyx_n_s_hasDefault);
  Py_VISIT(traverse_module_state->__pyx_n_s_has_default);
  Py_VISIT(traverse_module_state->__pyx_n_s_header);
  Py_VISIT(traverse_module_state->__pyx_n_s_headers);
  Py_VISIT(traverse_module_state->__pyx_n_s_headers_py);
  Py_VISIT(traverse_module_state->__pyx_n_s_i);
  Py_VISIT(traverse_module_state->__pyx_kp_u_i_in_1__ncons__con_i_iis_non__c);
  Py_VISIT(traverse_module_state->__pyx_kp_u_i_in_1__nvars__var_i_iis_non__v);
  Py_VISIT(traverse_module_state->__pyx_kp_u_i_in_1__nvars__var_i_val_0__var);
  Py_VISIT(traverse_module_state->__pyx_kp_u_i_in_1__nvars__varname_i__var_i);
  Py_VISIT(traverse_module_state->__pyx_n_s_iis_con);
  Py_VISIT(traverse_module_state->__pyx_n_s_iis_var);
  Py_VISIT(traverse_module_state->__pyx_n_s_impl);
  Py_VISIT(traverse_module_state->__pyx_n_s_import);
  Py_VISIT(traverse_module_state->__pyx_n_s_index);
  Py_VISIT(traverse_module_state->__pyx_n_u_index);
  Py_VISIT(traverse_module_state->__pyx_n_s_index_c);
  Py_VISIT(traverse_module_state->__pyx_n_s_index_names);
  Py_VISIT(traverse_module_state->__pyx_n_s_indexarity);
  Py_VISIT(traverse_module_state->__pyx_n_s_indices_c);
  Py_VISIT(traverse_module_state->__pyx_n_s_init);
  Py_VISIT(traverse_module_state->__pyx_n_s_init0);
  Py_VISIT(traverse_module_state->__pyx_n_s_init_2);
  Py_VISIT(traverse_module_state->__pyx_n_s_init_subclass);
  Py_VISIT(traverse_module_state->__pyx_n_s_initializing);
  Py_VISIT(traverse_module_state->__pyx_n_s_instances);
  Py_VISIT(traverse_module_state->__pyx_n_s_isLogical);
  Py_VISIT(traverse_module_state->__pyx_n_s_isRunning);
  Py_VISIT(traverse_module_state->__pyx_n_s_isScalar);
  Py_VISIT(traverse_module_state->__pyx_n_s_isSymbolic);
  Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine);
  Py_VISIT(traverse_module_state->__pyx_n_s_is_logical);
  Py_VISIT(traverse_module_state->__pyx_n_s_is_running);
  Py_VISIT(traverse_module_state->__pyx_n_s_is_scalar);
  Py_VISIT(traverse_module_state->__pyx_n_s_is_symbolic);
  Py_VISIT(traverse_module_state->__pyx_kp_u_isenabled);
  Py_VISIT(traverse_module_state->__pyx_n_s_isrunning);
  Py_VISIT(traverse_module_state->__pyx_n_s_items);
  Py_VISIT(traverse_module_state->__pyx_n_s_iter);
  Py_VISIT(traverse_module_state->__pyx_n_s_iter___locals_genexpr);
  Py_VISIT(traverse_module_state->__pyx_n_s_itertools);
  Py_VISIT(traverse_module_state->__pyx_n_s_j);
  Py_VISIT(traverse_module_state->__pyx_n_s_key);
  Py_VISIT(traverse_module_state->__pyx_n_s_keys);
  Py_VISIT(traverse_module_state->__pyx_n_s_kind);
  Py_VISIT(traverse_module_state->__pyx_n_s_kwargs);
  Py_VISIT(traverse_module_state->__pyx_n_s_lb);
  Py_VISIT(traverse_module_state->__pyx_n_s_lb0);
  Py_VISIT(traverse_module_state->__pyx_n_s_lb1);
  Py_VISIT(traverse_module_state->__pyx_n_s_lb2);
  Py_VISIT(traverse_module_state->__pyx_n_s_lbs);
  Py_VISIT(traverse_module_state->__pyx_n_s_ldual);
  Py_VISIT(traverse_module_state->__pyx_n_s_line_number);
  Py_VISIT(traverse_module_state->__pyx_n_s_literal_eval);
  Py_VISIT(traverse_module_state->__pyx_n_s_loadSession);
  Py_VISIT(traverse_module_state->__pyx_n_s_load_session);
  Py_VISIT(traverse_module_state->__pyx_n_s_lrc);
  Py_VISIT(traverse_module_state->__pyx_n_s_lslack);
  Py_VISIT(traverse_module_state->__pyx_n_s_lst);
  Py_VISIT(traverse_module_state->__pyx_n_s_lst_columns);
  Py_VISIT(traverse_module_state->__pyx_n_s_lst_index);
  Py_VISIT(traverse_module_state->__pyx_n_s_lst_solution);
  Py_VISIT(traverse_module_state->__pyx_n_s_main);
  Py_VISIT(traverse_module_state->__pyx_n_s_map);
  Py_VISIT(traverse_module_state->__pyx_n_s_members);
  Py_VISIT(traverse_module_state->__pyx_n_s_message);
  Py_VISIT(traverse_module_state->__pyx_n_s_metaclass);
  Py_VISIT(traverse_module_state->__pyx_n_s_minimization);
  Py_VISIT(traverse_module_state->__pyx_n_u_minimize);
  Py_VISIT(traverse_module_state->__pyx_n_s_model);
  Py_VISIT(traverse_module_state->__pyx_n_s_model_c);
  Py_VISIT(traverse_module_state->__pyx_n_s_module);
  Py_VISIT(traverse_module_state->__pyx_n_s_mro_entries);
  Py_VISIT(traverse_module_state->__pyx_n_s_msg);
  Py_VISIT(traverse_module_state->__pyx_n_s_multi_index);
  Py_VISIT(traverse_module_state->__pyx_n_s_n);
  Py_VISIT(traverse_module_state->__pyx_n_s_name);
  Py_VISIT(traverse_module_state->__pyx_n_s_name_2);
  Py_VISIT(traverse_module_state->__pyx_n_s_name_c);
  Py_VISIT(traverse_module_state->__pyx_n_s_name_c_2);
  Py_VISIT(traverse_module_state->__pyx_n_s_names);
  Py_VISIT(traverse_module_state->__pyx_n_s_ncols);
  Py_VISIT(traverse_module_state->__pyx_n_s_ncolumns);
  Py_VISIT(traverse_module_state->__pyx_n_s_ndarray);
  Py_VISIT(traverse_module_state->__pyx_n_s_nested);
  Py_VISIT(traverse_module_state->__pyx_n_s_nested_dict_of_suffixes);
  Py_VISIT(traverse_module_state->__pyx_n_s_new);
  Py_VISIT(traverse_module_state->__pyx_n_s_nindices);
  Py_VISIT(traverse_module_state->__pyx_n_s_nlevels);
  Py_VISIT(traverse_module_state->__pyx_kp_s_no_default___reduce___due_to_non);
  Py_VISIT(traverse_module_state->__pyx_n_s_np);
  Py_VISIT(traverse_module_state->__pyx_n_u_nt);
  Py_VISIT(traverse_module_state->__pyx_n_s_num);
  Py_VISIT(traverse_module_state->__pyx_n_s_numInstances);
  Py_VISIT(traverse_module_state->__pyx_n_s_num_instances);
  Py_VISIT(traverse_module_state->__pyx_n_s_numbers);
  Py_VISIT(traverse_module_state->__pyx_n_s_numpy);
  Py_VISIT(traverse_module_state->__pyx_n_s_obj);
  Py_VISIT(traverse_module_state->__pyx_n_s_obj_2);
  Py_VISIT(traverse_module_state->__pyx_n_s_obj_locals_Objectives);
  Py_VISIT(traverse_module_state->__pyx_n_s_obj_locals_Objectives___getitem);
  Py_VISIT(traverse_module_state->__pyx_n_s_obj_locals_Objectives___init);
  Py_VISIT(traverse_module_state->__pyx_n_s_obj_locals_Objectives___iter);
  Py_VISIT(traverse_module_state->__pyx_n_s_object);
  Py_VISIT(traverse_module_state->__pyx_n_s_objname);
  Py_VISIT(traverse_module_state->__pyx_n_s_objname_c);
  Py_VISIT(traverse_module_state->__pyx_n_s_offset);
  Py_VISIT(traverse_module_state->__pyx_n_s_open);
  Py_VISIT(traverse_module_state->__pyx_n_s_option);
  Py_VISIT(traverse_module_state->__pyx_n_s_option_2);
  Py_VISIT(traverse_module_state->__pyx_n_s_option_locals_Options);
  Py_VISIT(traverse_module_state->__pyx_n_s_option_locals_Options___getitem);
  Py_VISIT(traverse_module_state->__pyx_n_s_option_locals_Options___init);
  Py_VISIT(traverse_module_state->__pyx_n_s_option_locals_Options___setitem);
  Py_VISIT(traverse_module_state->__pyx_n_u_options);
  Py_VISIT(traverse_module_state->__pyx_n_s_options_2);
  Py_VISIT(traverse_module_state->__pyx_n_s_options_c);
  Py_VISIT(traverse_module_state->__pyx_n_s_os);
  Py_VISIT(traverse_module_state->__pyx_n_s_output);
  Py_VISIT(traverse_module_state->__pyx_n_s_output_c);
  Py_VISIT(traverse_module_state->__pyx_n_s_output_handler);
  Py_VISIT(traverse_module_state->__pyx_n_s_p);
  Py_VISIT(traverse_module_state->__pyx_n_s_pandas);
  Py_VISIT(traverse_module_state->__pyx_n_s_param);
  Py_VISIT(traverse_module_state->__pyx_n_s_param_2);
  Py_VISIT(traverse_module_state->__pyx_n_s_param_locals_Parameters);
  Py_VISIT(traverse_module_state->__pyx_n_s_param_locals_Parameters___getit);
  Py_VISIT(traverse_module_state->__pyx_n_s_param_locals_Parameters___init);
  Py_VISIT(traverse_module_state->__pyx_n_s_param_locals_Parameters___iter);
  Py_VISIT(traverse_module_state->__pyx_n_s_param_locals_Parameters___setit);
  Py_VISIT(traverse_module_state->__pyx_n_s_path);
  Py_VISIT(traverse_module_state->__pyx_n_s_pd);
  Py_VISIT(traverse_module_state->__pyx_n_s_pickle);
  Py_VISIT(traverse_module_state->__pyx_n_s_prepare);
  Py_VISIT(traverse_module_state->__pyx_n_s_print);
  Py_VISIT(traverse_module_state->__pyx_n_s_problem);
  Py_VISIT(traverse_module_state->__pyx_n_s_property);
  Py_VISIT(traverse_module_state->__pyx_n_s_py_list);
  Py_VISIT(traverse_module_state->__pyx_n_s_py_variant);
  Py_VISIT(traverse_module_state->__pyx_n_s_pylist);
  Py_VISIT(traverse_module_state->__pyx_n_s_pyx_PickleError);
  Py_VISIT(traverse_module_state->__pyx_n_s_pyx_checksum);
  Py_VISIT(traverse_module_state->__pyx_n_s_pyx_result);
  Py_VISIT(traverse_module_state->__pyx_n_s_pyx_state);
  Py_VISIT(traverse_module_state->__pyx_n_s_pyx_type);
  Py_VISIT(traverse_module_state->__pyx_n_s_pyx_unpickle_ErrorHandler);
  Py_VISIT(traverse_module_state->__pyx_n_s_pyx_unpickle_OutputHandler);
  Py_VISIT(traverse_module_state->__pyx_n_s_pyx_vtable);
  Py_VISIT(traverse_module_state->__pyx_n_s_qualname);
  Py_VISIT(traverse_module_state->__pyx_n_s_range);
  Py_VISIT(traverse_module_state->__pyx_n_s_rc);
  Py_VISIT(traverse_module_state->__pyx_n_s_read);
  Py_VISIT(traverse_module_state->__pyx_n_s_readData);
  Py_VISIT(traverse_module_state->__pyx_n_s_readTable);
  Py_VISIT(traverse_module_state->__pyx_n_s_read_data);
  Py_VISIT(traverse_module_state->__pyx_n_s_read_table);
  Py_VISIT(traverse_module_state->__pyx_n_s_reduce);
  Py_VISIT(traverse_module_state->__pyx_n_s_reduce_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_reduce_ex);
  Py_VISIT(traverse_module_state->__pyx_n_s_reset);
  Py_VISIT(traverse_module_state->__pyx_n_s_restore);
  Py_VISIT(traverse_module_state->__pyx_n_s_result);
  Py_VISIT(traverse_module_state->__pyx_n_s_return_output);
  Py_VISIT(traverse_module_state->__pyx_n_s_row);
  Py_VISIT(traverse_module_state->__pyx_n_s_rowindex);
  Py_VISIT(traverse_module_state->__pyx_n_s_scalar_expression);
  Py_VISIT(traverse_module_state->__pyx_n_s_self);
  Py_VISIT(traverse_module_state->__pyx_kp_s_self__c_ampl_cannot_be_converted);
  Py_VISIT(traverse_module_state->__pyx_kp_s_self__c_ampl_self__index_cannot);
  Py_VISIT(traverse_module_state->__pyx_kp_s_self__c_ampl_self__index_self_be);
  Py_VISIT(traverse_module_state->__pyx_kp_s_self__c_ampl_self_begin_self_end);
  Py_VISIT(traverse_module_state->__pyx_kp_s_self__df_cannot_be_converted_to);
  Py_VISIT(traverse_module_state->__pyx_kp_s_self_begin_self_end_self_env_c_s);
  Py_VISIT(traverse_module_state->__pyx_n_s_send);
  Py_VISIT(traverse_module_state->__pyx_n_s_set);
  Py_VISIT(traverse_module_state->__pyx_n_s_setBinDir);
  Py_VISIT(traverse_module_state->__pyx_n_s_setBinName);
  Py_VISIT(traverse_module_state->__pyx_n_s_setColumn);
  Py_VISIT(traverse_module_state->__pyx_n_s_setData);
  Py_VISIT(traverse_module_state->__pyx_n_s_setDual);
  Py_VISIT(traverse_module_state->__pyx_n_s_setErrorHandler);
  Py_VISIT(traverse_module_state->__pyx_n_s_setOption);
  Py_VISIT(traverse_module_state->__pyx_n_s_setOutputHandler);
  Py_VISIT(traverse_module_state->__pyx_n_s_setValue);
  Py_VISIT(traverse_module_state->__pyx_n_s_setValues);
  Py_VISIT(traverse_module_state->__pyx_n_s_setValues_2);
  Py_VISIT(traverse_module_state->__pyx_n_s_set_2);
  Py_VISIT(traverse_module_state->__pyx_n_s_set_bin_dir);
  Py_VISIT(traverse_module_state->__pyx_n_s_set_bin_name);
  Py_VISIT(traverse_module_state->__pyx_n_s_set_column);
  Py_VISIT(traverse_module_state->__pyx_n_s_set_data);
  Py_VISIT(traverse_module_state->__pyx_n_s_set_dual);
  Py_VISIT(traverse_module_state->__pyx_n_s_set_error_handler);
  Py_VISIT(traverse_module_state->__pyx_n_s_set_locals_Sets);
  Py_VISIT(traverse_module_state->__pyx_n_s_set_locals_Sets___getitem);
  Py_VISIT(traverse_module_state->__pyx_n_s_set_locals_Sets___init);
  Py_VISIT(traverse_module_state->__pyx_n_s_set_locals_Sets___iter);
  Py_VISIT(traverse_module_state->__pyx_n_s_set_locals_Sets___setitem);
  Py_VISIT(traverse_module_state->__pyx_n_s_set_name);
  Py_VISIT(traverse_module_state->__pyx_n_s_set_name_2);
  Py_VISIT(traverse_module_state->__pyx_n_s_set_option);
  Py_VISIT(traverse_module_state->__pyx_n_s_set_output_handler);
  Py_VISIT(traverse_module_state->__pyx_n_s_set_value);
  Py_VISIT(traverse_module_state->__pyx_n_s_set_values);
  Py_VISIT(traverse_module_state->__pyx_n_s_set_values_2);
  Py_VISIT(traverse_module_state->__pyx_n_s_set_values_locals_cast_row);
  Py_VISIT(traverse_module_state->__pyx_n_s_set_values_locals_cast_value);
  Py_VISIT(traverse_module_state->__pyx_n_s_set_values_locals_conv_to_list);
  Py_VISIT(traverse_module_state->__pyx_n_s_set_values_locals_genexpr);
  Py_VISIT(traverse_module_state->__pyx_n_s_setitem);
  Py_VISIT(traverse_module_state->__pyx_n_s_sets);
  Py_VISIT(traverse_module_state->__pyx_n_s_setstate);
  Py_VISIT(traverse_module_state->__pyx_n_s_setstate_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_shape);
  Py_VISIT(traverse_module_state->__pyx_n_s_size);
  Py_VISIT(traverse_module_state->__pyx_n_s_skip_index);
  Py_VISIT(traverse_module_state->__pyx_n_s_slack);
  Py_VISIT(traverse_module_state->__pyx_n_s_snapshot);
  Py_VISIT(traverse_module_state->__pyx_kp_u_solve);
  Py_VISIT(traverse_module_state->__pyx_n_s_solve_2);
  Py_VISIT(traverse_module_state->__pyx_n_u_solve_result);
  Py_VISIT(traverse_module_state->__pyx_n_u_solve_result_num);
  Py_VISIT(traverse_module_state->__pyx_n_s_solver);
  Py_VISIT(traverse_module_state->__pyx_n_u_solver);
  Py_VISIT(traverse_module_state->__pyx_n_s_source_name);
  Py_VISIT(traverse_module_state->__pyx_n_s_spec);
  Py_VISIT(traverse_module_state->__pyx_n_s_split);
  Py_VISIT(traverse_module_state->__pyx_n_s_sstatus);
  Py_VISIT(traverse_module_state->__pyx_n_s_stack);
  Py_VISIT(traverse_module_state->__pyx_n_s_startRecording);
  Py_VISIT(traverse_module_state->__pyx_n_s_start_recording);
  Py_VISIT(traverse_module_state->__pyx_n_s_state);
  Py_VISIT(traverse_module_state->__pyx_n_s_statements);
  Py_VISIT(traverse_module_state->__pyx_n_s_statements_c);
  Py_VISIT(traverse_module_state->__pyx_n_s_status);
  Py_VISIT(traverse_module_state->__pyx_n_s_stderr);
  Py_VISIT(traverse_module_state->__pyx_n_s_stmt);
  Py_VISIT(traverse_module_state->__pyx_n_s_stopRecording);
  Py_VISIT(traverse_module_state->__pyx_n_s_stop_recording);
  Py_VISIT(traverse_module_state->__pyx_n_s_str);
  Py_VISIT(traverse_module_state->__pyx_kp_s_stringsource);
  Py_VISIT(traverse_module_state->__pyx_n_s_suffixes);
  Py_VISIT(traverse_module_state->__pyx_n_s_suffixes_c);
  Py_VISIT(traverse_module_state->__pyx_n_s_super);
  Py_VISIT(traverse_module_state->__pyx_n_s_sys);
  Py_VISIT(traverse_module_state->__pyx_n_s_t);
  Py_VISIT(traverse_module_state->__pyx_n_s_t_c);
  Py_VISIT(traverse_module_state->__pyx_n_s_table_name);
  Py_VISIT(traverse_module_state->__pyx_n_s_test);
  Py_VISIT(traverse_module_state->__pyx_n_s_throw);
  Py_VISIT(traverse_module_state->__pyx_n_s_toDict);
  Py_VISIT(traverse_module_state->__pyx_n_s_toList);
  Py_VISIT(traverse_module_state->__pyx_n_s_toPandas);
  Py_VISIT(traverse_module_state->__pyx_n_s_toString);
  Py_VISIT(traverse_module_state->__pyx_n_s_to_dict);
  Py_VISIT(traverse_module_state->__pyx_n_s_to_list);
  Py_VISIT(traverse_module_state->__pyx_n_s_to_pandas);
  Py_VISIT(traverse_module_state->__pyx_n_s_to_string);
  Py_VISIT(traverse_module_state->__pyx_n_s_to_string_c);
  Py_VISIT(traverse_module_state->__pyx_n_s_to_tuple);
  Py_VISIT(traverse_module_state->__pyx_n_s_tolist);
  Py_VISIT(traverse_module_state->__pyx_n_s_tools);
  Py_VISIT(traverse_module_state->__pyx_n_s_tuple);
  Py_VISIT(traverse_module_state->__pyx_n_s_tuple_c);
  Py_VISIT(traverse_module_state->__pyx_n_s_ub);
  Py_VISIT(traverse_module_state->__pyx_n_s_ub0);
  Py_VISIT(traverse_module_state->__pyx_n_s_ub1);
  Py_VISIT(traverse_module_state->__pyx_n_s_ub2);
  Py_VISIT(traverse_module_state->__pyx_n_s_ubs);
  Py_VISIT(traverse_module_state->__pyx_n_s_udual);
  Py_VISIT(traverse_module_state->__pyx_n_s_unfix);
  Py_VISIT(traverse_module_state->__pyx_kp_u_unsupported_type);
  Py_VISIT(traverse_module_state->__pyx_n_s_update);
  Py_VISIT(traverse_module_state->__pyx_n_s_urc);
  Py_VISIT(traverse_module_state->__pyx_n_s_use_setstate);
  Py_VISIT(traverse_module_state->__pyx_n_s_uslack);
  Py_VISIT(traverse_module_state->__pyx_kp_u_utf_8);
  Py_VISIT(traverse_module_state->__pyx_n_s_v);
  Py_VISIT(traverse_module_state->__pyx_n_s_val);
  Py_VISIT(traverse_module_state->__pyx_n_s_value);
  Py_VISIT(traverse_module_state->__pyx_n_u_value);
  Py_VISIT(traverse_module_state->__pyx_n_s_value_c);
  Py_VISIT(traverse_module_state->__pyx_n_s_values);
  Py_VISIT(traverse_module_state->__pyx_n_s_var);
  Py_VISIT(traverse_module_state->__pyx_n_s_var_2);
  Py_VISIT(traverse_module_state->__pyx_n_s_var_locals_Variables);
  Py_VISIT(traverse_module_state->__pyx_n_s_var_locals_Variables___getitem);
  Py_VISIT(traverse_module_state->__pyx_n_s_var_locals_Variables___init);
  Py_VISIT(traverse_module_state->__pyx_n_s_var_locals_Variables___iter);
  Py_VISIT(traverse_module_state->__pyx_n_s_var_locals_Variables___setitem);
  Py_VISIT(traverse_module_state->__pyx_n_s_verbose);
  Py_VISIT(traverse_module_state->__pyx_n_s_warning);
  Py_VISIT(traverse_module_state->__pyx_n_s_workdir);
  Py_VISIT(traverse_module_state->__pyx_n_s_workdir_c);
  Py_VISIT(traverse_module_state->__pyx_n_s_write);
  Py_VISIT(traverse_module_state->__pyx_n_s_writeTable);
  Py_VISIT(traverse_module_state->__pyx_n_s_write_table);
  Py_VISIT(traverse_module_state->__pyx_n_s_xref);
  Py_VISIT(traverse_module_state->__pyx_n_s_zeros);
  Py_VISIT(traverse_module_state->__pyx_n_s_zip);
  Py_VISIT(traverse_module_state->__pyx_int_0);
  Py_VISIT(traverse_module_state->__pyx_int_1);
  Py_VISIT(traverse_module_state->__pyx_int_222419149);
  Py_VISIT(traverse_module_state->__pyx_int_228825662);
  Py_VISIT(traverse_module_state->__pyx_int_238750788);
  Py_VISIT(traverse_module_state->__pyx_k__14);
  Py_VISIT(traverse_module_state->__pyx_tuple_);
  Py_VISIT(traverse_module_state->__pyx_tuple__2);
  Py_VISIT(traverse_module_state->__pyx_tuple__3);
  Py_VISIT(traverse_module_state->__pyx_tuple__4);
  Py_VISIT(traverse_module_state->__pyx_tuple__5);
  Py_VISIT(traverse_module_state->__pyx_tuple__6);
  Py_VISIT(traverse_module_state->__pyx_tuple__7);
  Py_VISIT(traverse_module_state->__pyx_tuple__8);
  Py_VISIT(traverse_module_state->__pyx_tuple__9);
  Py_VISIT(traverse_module_state->__pyx_tuple__10);
  Py_VISIT(traverse_module_state->__pyx_tuple__11);
  Py_VISIT(traverse_module_state->__pyx_tuple__12);
  Py_VISIT(traverse_module_state->__pyx_tuple__13);
  Py_VISIT(traverse_module_state->__pyx_tuple__15);
  Py_VISIT(traverse_module_state->__pyx_tuple__17);
  Py_VISIT(traverse_module_state->__pyx_tuple__18);
  Py_VISIT(traverse_module_state->__pyx_tuple__20);
  Py_VISIT(traverse_module_state->__pyx_tuple__23);
  Py_VISIT(traverse_module_state->__pyx_tuple__27);
  Py_VISIT(traverse_module_state->__pyx_tuple__28);
  Py_VISIT(traverse_module_state->__pyx_tuple__29);
  Py_VISIT(traverse_module_state->__pyx_tuple__31);
  Py_VISIT(traverse_module_state->__pyx_tuple__37);
  Py_VISIT(traverse_module_state->__pyx_tuple__42);
  Py_VISIT(traverse_module_state->__pyx_tuple__43);
  Py_VISIT(traverse_module_state->__pyx_tuple__44);
  Py_VISIT(traverse_module_state->__pyx_tuple__45);
  Py_VISIT(traverse_module_state->__pyx_tuple__46);
  Py_VISIT(traverse_module_state->__pyx_tuple__48);
  Py_VISIT(traverse_module_state->__pyx_tuple__50);
  Py_VISIT(traverse_module_state->__pyx_tuple__52);
  Py_VISIT(traverse_module_state->__pyx_tuple__54);
  Py_VISIT(traverse_module_state->__pyx_tuple__55);
  Py_VISIT(traverse_module_state->__pyx_tuple__60);
  Py_VISIT(traverse_module_state->__pyx_tuple__61);
  Py_VISIT(traverse_module_state->__pyx_tuple__65);
  Py_VISIT(traverse_module_state->__pyx_tuple__66);
  Py_VISIT(traverse_module_state->__pyx_tuple__69);
  Py_VISIT(traverse_module_state->__pyx_tuple__72);
  Py_VISIT(traverse_module_state->__pyx_tuple__73);
  Py_VISIT(traverse_module_state->__pyx_tuple__78);
  Py_VISIT(traverse_module_state->__pyx_tuple__79);
  Py_VISIT(traverse_module_state->__pyx_tuple__83);
  Py_VISIT(traverse_module_state->__pyx_tuple__85);
  Py_VISIT(traverse_module_state->__pyx_tuple__90);
  Py_VISIT(traverse_module_state->__pyx_tuple__107);
  Py_VISIT(traverse_module_state->__pyx_tuple__111);
  Py_VISIT(traverse_module_state->__pyx_tuple__117);
  Py_VISIT(traverse_module_state->__pyx_tuple__121);
  Py_VISIT(traverse_module_state->__pyx_tuple__123);
  Py_VISIT(traverse_module_state->__pyx_tuple__127);
  Py_VISIT(traverse_module_state->__pyx_tuple__129);
  Py_VISIT(traverse_module_state->__pyx_tuple__131);
  Py_VISIT(traverse_module_state->__pyx_tuple__132);
  Py_VISIT(traverse_module_state->__pyx_tuple__134);
  Py_VISIT(traverse_module_state->__pyx_tuple__136);
  Py_VISIT(traverse_module_state->__pyx_tuple__138);
  Py_VISIT(traverse_module_state->__pyx_tuple__140);
  Py_VISIT(traverse_module_state->__pyx_tuple__142);
  Py_VISIT(traverse_module_state->__pyx_tuple__144);
  Py_VISIT(traverse_module_state->__pyx_tuple__146);
  Py_VISIT(traverse_module_state->__pyx_tuple__148);
  Py_VISIT(traverse_module_state->__pyx_tuple__149);
  Py_VISIT(traverse_module_state->__pyx_tuple__151);
  Py_VISIT(traverse_module_state->__pyx_tuple__152);
  Py_VISIT(traverse_module_state->__pyx_tuple__154);
  Py_VISIT(traverse_module_state->__pyx_tuple__156);
  Py_VISIT(traverse_module_state->__pyx_tuple__158);
  Py_VISIT(traverse_module_state->__pyx_tuple__162);
  Py_VISIT(traverse_module_state->__pyx_tuple__164);
  Py_VISIT(traverse_module_state->__pyx_tuple__166);
  Py_VISIT(traverse_module_state->__pyx_tuple__170);
  Py_VISIT(traverse_module_state->__pyx_tuple__173);
  Py_VISIT(traverse_module_state->__pyx_tuple__175);
  Py_VISIT(traverse_module_state->__pyx_tuple__177);
  Py_VISIT(traverse_module_state->__pyx_tuple__179);
  Py_VISIT(traverse_module_state->__pyx_tuple__181);
  Py_VISIT(traverse_module_state->__pyx_tuple__185);
  Py_VISIT(traverse_module_state->__pyx_tuple__189);
  Py_VISIT(traverse_module_state->__pyx_tuple__191);
  Py_VISIT(traverse_module_state->__pyx_tuple__193);
  Py_VISIT(traverse_module_state->__pyx_tuple__195);
  Py_VISIT(traverse_module_state->__pyx_tuple__197);
  Py_VISIT(traverse_module_state->__pyx_tuple__201);
  Py_VISIT(traverse_module_state->__pyx_tuple__203);
  Py_VISIT(traverse_module_state->__pyx_tuple__206);
  Py_VISIT(traverse_module_state->__pyx_tuple__209);
  Py_VISIT(traverse_module_state->__pyx_tuple__216);
  Py_VISIT(traverse_module_state->__pyx_tuple__217);
  Py_VISIT(traverse_module_state->__pyx_tuple__218);
  Py_VISIT(traverse_module_state->__pyx_tuple__219);
  Py_VISIT(traverse_module_state->__pyx_tuple__246);
  Py_VISIT(traverse_module_state->__pyx_tuple__250);
  Py_VISIT(traverse_module_state->__pyx_tuple__251);
  Py_VISIT(traverse_module_state->__pyx_tuple__254);
  Py_VISIT(traverse_module_state->__pyx_tuple__256);
  Py_VISIT(traverse_module_state->__pyx_tuple__258);
  Py_VISIT(traverse_module_state->__pyx_tuple__263);
  Py_VISIT(traverse_module_state->__pyx_tuple__265);
  Py_VISIT(traverse_module_state->__pyx_tuple__269);
  Py_VISIT(traverse_module_state->__pyx_tuple__271);
  Py_VISIT(traverse_module_state->__pyx_tuple__302);
  Py_VISIT(traverse_module_state->__pyx_tuple__304);
  Py_VISIT(traverse_module_state->__pyx_tuple__306);
  Py_VISIT(traverse_module_state->__pyx_tuple__308);
  Py_VISIT(traverse_module_state->__pyx_tuple__314);
  Py_VISIT(traverse_module_state->__pyx_tuple__316);
  Py_VISIT(traverse_module_state->__pyx_tuple__320);
  Py_VISIT(traverse_module_state->__pyx_tuple__322);
  Py_VISIT(traverse_module_state->__pyx_tuple__324);
  Py_VISIT(traverse_module_state->__pyx_tuple__325);
  Py_VISIT(traverse_module_state->__pyx_tuple__328);
  Py_VISIT(traverse_module_state->__pyx_tuple__330);
  Py_VISIT(traverse_module_state->__pyx_tuple__333);
  Py_VISIT(traverse_module_state->__pyx_tuple__335);
  Py_VISIT(traverse_module_state->__pyx_tuple__337);
  Py_VISIT(traverse_module_state->__pyx_tuple__340);
  Py_VISIT(traverse_module_state->__pyx_tuple__342);
  Py_VISIT(traverse_module_state->__pyx_tuple__344);
  Py_VISIT(traverse_module_state->__pyx_tuple__353);
  Py_VISIT(traverse_module_state->__pyx_tuple__355);
  Py_VISIT(traverse_module_state->__pyx_tuple__357);
  Py_VISIT(traverse_module_state->__pyx_tuple__359);
  Py_VISIT(traverse_module_state->__pyx_tuple__361);
  Py_VISIT(traverse_module_state->__pyx_tuple__363);
  Py_VISIT(traverse_module_state->__pyx_tuple__365);
  Py_VISIT(traverse_module_state->__pyx_tuple__367);
  Py_VISIT(traverse_module_state->__pyx_tuple__369);
  Py_VISIT(traverse_module_state->__pyx_tuple__371);
  Py_VISIT(traverse_module_state->__pyx_tuple__373);
  Py_VISIT(traverse_module_state->__pyx_tuple__374);
  Py_VISIT(traverse_module_state->__pyx_tuple__376);
  Py_VISIT(traverse_module_state->__pyx_tuple__378);
  Py_VISIT(traverse_module_state->__pyx_tuple__380);
  Py_VISIT(traverse_module_state->__pyx_tuple__383);
  Py_VISIT(traverse_module_state->__pyx_tuple__387);
  Py_VISIT(traverse_module_state->__pyx_codeobj__16);
  Py_VISIT(traverse_module_state->__pyx_codeobj__19);
  Py_VISIT(traverse_module_state->__pyx_codeobj__30);
  Py_VISIT(traverse_module_state->__pyx_codeobj__32);
  Py_VISIT(traverse_module_state->__pyx_codeobj__47);
  Py_VISIT(traverse_module_state->__pyx_codeobj__49);
  Py_VISIT(traverse_module_state->__pyx_codeobj__51);
  Py_VISIT(traverse_module_state->__pyx_codeobj__53);
  Py_VISIT(traverse_module_state->__pyx_codeobj__56);
  Py_VISIT(traverse_module_state->__pyx_codeobj__57);
  Py_VISIT(traverse_module_state->__pyx_codeobj__58);
  Py_VISIT(traverse_module_state->__pyx_codeobj__59);
  Py_VISIT(traverse_module_state->__pyx_codeobj__62);
  Py_VISIT(traverse_module_state->__pyx_codeobj__63);
  Py_VISIT(traverse_module_state->__pyx_codeobj__64);
  Py_VISIT(traverse_module_state->__pyx_codeobj__67);
  Py_VISIT(traverse_module_state->__pyx_codeobj__68);
  Py_VISIT(traverse_module_state->__pyx_codeobj__70);
  Py_VISIT(traverse_module_state->__pyx_codeobj__71);
  Py_VISIT(traverse_module_state->__pyx_codeobj__74);
  Py_VISIT(traverse_module_state->__pyx_codeobj__75);
  Py_VISIT(traverse_module_state->__pyx_codeobj__76);
  Py_VISIT(traverse_module_state->__pyx_codeobj__77);
  Py_VISIT(traverse_module_state->__pyx_codeobj__80);
  Py_VISIT(traverse_module_state->__pyx_codeobj__81);
  Py_VISIT(traverse_module_state->__pyx_codeobj__82);
  Py_VISIT(traverse_module_state->__pyx_codeobj__86);
  Py_VISIT(traverse_module_state->__pyx_codeobj__87);
  Py_VISIT(traverse_module_state->__pyx_codeobj__88);
  Py_VISIT(traverse_module_state->__pyx_codeobj__89);
  Py_VISIT(traverse_module_state->__pyx_codeobj__91);
  Py_VISIT(traverse_module_state->__pyx_codeobj__92);
  Py_VISIT(traverse_module_state->__pyx_codeobj__93);
  Py_VISIT(traverse_module_state->__pyx_codeobj__94);
  Py_VISIT(traverse_module_state->__pyx_codeobj__95);
  Py_VISIT(traverse_module_state->__pyx_codeobj__96);
  Py_VISIT(traverse_module_state->__pyx_codeobj__97);
  Py_VISIT(traverse_module_state->__pyx_codeobj__98);
  Py_VISIT(traverse_module_state->__pyx_codeobj__99);
  Py_VISIT(traverse_module_state->__pyx_codeobj__100);
  Py_VISIT(traverse_module_state->__pyx_codeobj__101);
  Py_VISIT(traverse_module_state->__pyx_codeobj__102);
  Py_VISIT(traverse_module_state->__pyx_codeobj__103);
  Py_VISIT(traverse_module_state->__pyx_codeobj__104);
  Py_VISIT(traverse_module_state->__pyx_codeobj__105);
  Py_VISIT(traverse_module_state->__pyx_codeobj__106);
  Py_VISIT(traverse_module_state->__pyx_codeobj__108);
  Py_VISIT(traverse_module_state->__pyx_codeobj__109);
  Py_VISIT(traverse_module_state->__pyx_codeobj__110);
  Py_VISIT(traverse_module_state->__pyx_codeobj__112);
  Py_VISIT(traverse_module_state->__pyx_codeobj__113);
  Py_VISIT(traverse_module_state->__pyx_codeobj__114);
  Py_VISIT(traverse_module_state->__pyx_codeobj__115);
  Py_VISIT(traverse_module_state->__pyx_codeobj__116);
  Py_VISIT(traverse_module_state->__pyx_codeobj__118);
  Py_VISIT(traverse_module_state->__pyx_codeobj__119);
  Py_VISIT(traverse_module_state->__pyx_codeobj__120);
  Py_VISIT(traverse_module_state->__pyx_codeobj__122);
  Py_VISIT(traverse_module_state->__pyx_codeobj__124);
  Py_VISIT(traverse_module_state->__pyx_codeobj__125);
  Py_VISIT(traverse_module_state->__pyx_codeobj__126);
  Py_VISIT(traverse_module_state->__pyx_codeobj__128);
  Py_VISIT(traverse_module_state->__pyx_codeobj__130);
  Py_VISIT(traverse_module_state->__pyx_codeobj__133);
  Py_VISIT(traverse_module_state->__pyx_codeobj__135);
  Py_VISIT(traverse_module_state->__pyx_codeobj__137);
  Py_VISIT(traverse_module_state->__pyx_codeobj__139);
  Py_VISIT(traverse_module_state->__pyx_codeobj__141);
  Py_VISIT(traverse_module_state->__pyx_codeobj__143);
  Py_VISIT(traverse_module_state->__pyx_codeobj__145);
  Py_VISIT(traverse_module_state->__pyx_codeobj__147);
  Py_VISIT(traverse_module_state->__pyx_codeobj__150);
  Py_VISIT(traverse_module_state->__pyx_codeobj__153);
  Py_VISIT(traverse_module_state->__pyx_codeobj__155);
  Py_VISIT(traverse_module_state->__pyx_codeobj__157);
  Py_VISIT(traverse_module_state->__pyx_codeobj__159);
  Py_VISIT(traverse_module_state->__pyx_codeobj__160);
  Py_VISIT(traverse_module_state->__pyx_codeobj__161);
  Py_VISIT(traverse_module_state->__pyx_codeobj__163);
  Py_VISIT(traverse_module_state->__pyx_codeobj__165);
  Py_VISIT(traverse_module_state->__pyx_codeobj__167);
  Py_VISIT(traverse_module_state->__pyx_codeobj__168);
  Py_VISIT(traverse_module_state->__pyx_codeobj__169);
  Py_VISIT(traverse_module_state->__pyx_codeobj__171);
  Py_VISIT(traverse_module_state->__pyx_codeobj__172);
  Py_VISIT(traverse_module_state->__pyx_codeobj__174);
  Py_VISIT(traverse_module_state->__pyx_codeobj__176);
  Py_VISIT(traverse_module_state->__pyx_codeobj__178);
  Py_VISIT(traverse_module_state->__pyx_codeobj__180);
  Py_VISIT(traverse_module_state->__pyx_codeobj__182);
  Py_VISIT(traverse_module_state->__pyx_codeobj__183);
  Py_VISIT(traverse_module_state->__pyx_codeobj__184);
  Py_VISIT(traverse_module_state->__pyx_codeobj__186);
  Py_VISIT(traverse_module_state->__pyx_codeobj__187);
  Py_VISIT(traverse_module_state->__pyx_codeobj__188);
  Py_VISIT(traverse_module_state->__pyx_codeobj__190);
  Py_VISIT(traverse_module_state->__pyx_codeobj__192);
  Py_VISIT(traverse_module_state->__pyx_codeobj__194);
  Py_VISIT(traverse_module_state->__pyx_codeobj__196);
  Py_VISIT(traverse_module_state->__pyx_codeobj__198);
  Py_VISIT(traverse_module_state->__pyx_codeobj__199);
  Py_VISIT(traverse_module_state->__pyx_codeobj__200);
  Py_VISIT(traverse_module_state->__pyx_codeobj__202);
  Py_VISIT(traverse_module_state->__pyx_codeobj__204);
  Py_VISIT(traverse_module_state->__pyx_codeobj__205);
  Py_VISIT(traverse_module_state->__pyx_codeobj__207);
  Py_VISIT(traverse_module_state->__pyx_codeobj__208);
  Py_VISIT(traverse_module_state->__pyx_codeobj__210);
  Py_VISIT(traverse_module_state->__pyx_codeobj__211);
  Py_VISIT(traverse_module_state->__pyx_codeobj__212);
  Py_VISIT(traverse_module_state->__pyx_codeobj__213);
  Py_VISIT(traverse_module_state->__pyx_codeobj__214);
  Py_VISIT(traverse_module_state->__pyx_codeobj__215);
  Py_VISIT(traverse_module_state->__pyx_codeobj__220);
  Py_VISIT(traverse_module_state->__pyx_codeobj__221);
  Py_VISIT(traverse_module_state->__pyx_codeobj__222);
  Py_VISIT(traverse_module_state->__pyx_codeobj__223);
  Py_VISIT(traverse_module_state->__pyx_codeobj__224);
  Py_VISIT(traverse_module_state->__pyx_codeobj__225);
  Py_VISIT(traverse_module_state->__pyx_codeobj__226);
  Py_VISIT(traverse_module_state->__pyx_codeobj__227);
  Py_VISIT(traverse_module_state->__pyx_codeobj__228);
  Py_VISIT(traverse_module_state->__pyx_codeobj__229);
  Py_VISIT(traverse_module_state->__pyx_codeobj__230);
  Py_VISIT(traverse_module_state->__pyx_codeobj__231);
  Py_VISIT(traverse_module_state->__pyx_codeobj__232);
  Py_VISIT(traverse_module_state->__pyx_codeobj__233);
  Py_VISIT(traverse_module_state->__pyx_codeobj__234);
  Py_VISIT(traverse_module_state->__pyx_codeobj__235);
  Py_VISIT(traverse_module_state->__pyx_codeobj__236);
  Py_VISIT(traverse_module_state->__pyx_codeobj__237);
  Py_VISIT(traverse_module_state->__pyx_codeobj__238);
  Py_VISIT(traverse_module_state->__pyx_codeobj__239);
  Py_VISIT(traverse_module_state->__pyx_codeobj__240);
  Py_VISIT(traverse_module_state->__pyx_codeobj__241);
  Py_VISIT(traverse_module_state->__pyx_codeobj__242);
  Py_VISIT(traverse_module_state->__pyx_codeobj__243);
  Py_VISIT(traverse_module_state->__pyx_codeobj__244);
  Py_VISIT(traverse_module_state->__pyx_codeobj__245);
  Py_VISIT(traverse_module_state->__pyx_codeobj__247);
  Py_VISIT(traverse_module_state->__pyx_codeobj__248);
  Py_VISIT(traverse_module_state->__pyx_codeobj__249);
  Py_VISIT(traverse_module_state->__pyx_codeobj__252);
  Py_VISIT(traverse_module_state->__pyx_codeobj__253);
  Py_VISIT(traverse_module_state->__pyx_codeobj__255);
  Py_VISIT(traverse_module_state->__pyx_codeobj__257);
  Py_VISIT(traverse_module_state->__pyx_codeobj__259);
  Py_VISIT(traverse_module_state->__pyx_codeobj__260);
  Py_VISIT(traverse_module_state->__pyx_codeobj__261);
  Py_VISIT(traverse_module_state->__pyx_codeobj__262);
  Py_VISIT(traverse_module_state->__pyx_codeobj__264);
  Py_VISIT(traverse_module_state->__pyx_codeobj__266);
  Py_VISIT(traverse_module_state->__pyx_codeobj__267);
  Py_VISIT(traverse_module_state->__pyx_codeobj__268);
  Py_VISIT(traverse_module_state->__pyx_codeobj__270);
  Py_VISIT(traverse_module_state->__pyx_codeobj__272);
  Py_VISIT(traverse_module_state->__pyx_codeobj__273);
  Py_VISIT(traverse_module_state->__pyx_codeobj__274);
  Py_VISIT(traverse_module_state->__pyx_codeobj__275);
  Py_VISIT(traverse_module_state->__pyx_codeobj__276);
  Py_VISIT(traverse_module_state->__pyx_codeobj__277);
  Py_VISIT(traverse_module_state->__pyx_codeobj__278);
  Py_VISIT(traverse_module_state->__pyx_codeobj__279);
  Py_VISIT(traverse_module_state->__pyx_codeobj__280);
  Py_VISIT(traverse_module_state->__pyx_codeobj__281);
  Py_VISIT(traverse_module_state->__pyx_codeobj__282);
  Py_VISIT(traverse_module_state->__pyx_codeobj__283);
  Py_VISIT(traverse_module_state->__pyx_codeobj__284);
  Py_VISIT(traverse_module_state->__pyx_codeobj__285);
  Py_VISIT(traverse_module_state->__pyx_codeobj__286);
  Py_VISIT(traverse_module_state->__pyx_codeobj__287);
  Py_VISIT(traverse_module_state->__pyx_codeobj__288);
  Py_VISIT(traverse_module_state->__pyx_codeobj__289);
  Py_VISIT(traverse_module_state->__pyx_codeobj__290);
  Py_VISIT(traverse_module_state->__pyx_codeobj__291);
  Py_VISIT(traverse_module_state->__pyx_codeobj__292);
  Py_VISIT(traverse_module_state->__pyx_codeobj__293);
  Py_VISIT(traverse_module_state->__pyx_codeobj__294);
  Py_VISIT(traverse_module_state->__pyx_codeobj__295);
  Py_VISIT(traverse_module_state->__pyx_codeobj__296);
  Py_VISIT(traverse_module_state->__pyx_codeobj__297);
  Py_VISIT(traverse_module_state->__pyx_codeobj__298);
  Py_VISIT(traverse_module_state->__pyx_codeobj__299);
  Py_VISIT(traverse_module_state->__pyx_codeobj__300);
  Py_VISIT(traverse_module_state->__pyx_codeobj__301);
  Py_VISIT(traverse_module_state->__pyx_codeobj__303);
  Py_VISIT(traverse_module_state->__pyx_codeobj__305);
  Py_VISIT(traverse_module_state->__pyx_codeobj__307);
  Py_VISIT(traverse_module_state->__pyx_codeobj__309);
  Py_VISIT(traverse_module_state->__pyx_codeobj__310);
  Py_VISIT(traverse_module_state->__pyx_codeobj__311);
  Py_VISIT(traverse_module_state->__pyx_codeobj__312);
  Py_VISIT(traverse_module_state->__pyx_codeobj__313);
  Py_VISIT(traverse_module_state->__pyx_codeobj__315);
  Py_VISIT(traverse_module_state->__pyx_codeobj__317);
  Py_VISIT(traverse_module_state->__pyx_codeobj__318);
  Py_VISIT(traverse_module_state->__pyx_codeobj__319);
  Py_VISIT(traverse_module_state->__pyx_codeobj__321);
  Py_VISIT(traverse_module_state->__pyx_codeobj__323);
  Py_VISIT(traverse_module_state->__pyx_codeobj__326);
  Py_VISIT(traverse_module_state->__pyx_codeobj__327);
  Py_VISIT(traverse_module_state->__pyx_codeobj__329);
  Py_VISIT(traverse_module_state->__pyx_codeobj__331);
  Py_VISIT(traverse_module_state->__pyx_codeobj__332);
  Py_VISIT(traverse_module_state->__pyx_codeobj__334);
  Py_VISIT(traverse_module_state->__pyx_codeobj__336);
  Py_VISIT(traverse_module_state->__pyx_codeobj__338);
  Py_VISIT(traverse_module_state->__pyx_codeobj__339);
  Py_VISIT(traverse_module_state->__pyx_codeobj__341);
  Py_VISIT(traverse_module_state->__pyx_codeobj__343);
  Py_VISIT(traverse_module_state->__pyx_codeobj__345);
  Py_VISIT(traverse_module_state->__pyx_codeobj__346);
  Py_VISIT(traverse_module_state->__pyx_codeobj__347);
  Py_VISIT(traverse_module_state->__pyx_codeobj__348);
  Py_VISIT(traverse_module_state->__pyx_codeobj__349);
  Py_VISIT(traverse_module_state->__pyx_codeobj__350);
  Py_VISIT(traverse_module_state->__pyx_codeobj__351);
  Py_VISIT(traverse_module_state->__pyx_codeobj__352);
  Py_VISIT(traverse_module_state->__pyx_codeobj__354);
  Py_VISIT(traverse_module_state->__pyx_codeobj__356);
  Py_VISIT(traverse_module_state->__pyx_codeobj__358);
  Py_VISIT(traverse_module_state->__pyx_codeobj__360);
  Py_VISIT(traverse_module_state->__pyx_codeobj__362);
  Py_VISIT(traverse_module_state->__pyx_codeobj__364);
  Py_VISIT(traverse_module_state->__pyx_codeobj__366);
  Py_VISIT(traverse_module_state->__pyx_codeobj__368);
  Py_VISIT(traverse_module_state->__pyx_codeobj__370);
  Py_VISIT(traverse_module_state->__pyx_codeobj__372);
  Py_VISIT(traverse_module_state->__pyx_codeobj__375);
  Py_VISIT(traverse_module_state->__pyx_codeobj__377);
  Py_VISIT(traverse_module_state->__pyx_codeobj__379);
  Py_VISIT(traverse_module_state->__pyx_codeobj__381);
  Py_VISIT(traverse_module_state->__pyx_codeobj__382);
  Py_VISIT(traverse_module_state->__pyx_codeobj__384);
  Py_VISIT(traverse_module_state->__pyx_codeobj__385);
  Py_VISIT(traverse_module_state->__pyx_codeobj__386);
  Py_VISIT(traverse_module_state->__pyx_codeobj__388);
  Py_VISIT(traverse_module_state->__pyx_codeobj__389);
  return 0;
}
#endif
/* #### Code section: module_state_defines ### */
#define __pyx_d __pyx_mstate_global->__pyx_d
#define __pyx_b __pyx_mstate_global->__pyx_b
#define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime
#define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple
#define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes
#define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode
#ifdef __Pyx_CyFunction_USED
#define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType
#endif
#ifdef __Pyx_FusedFunction_USED
#define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType
#endif
#ifdef __Pyx_Generator_USED
#define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType
#endif
#ifdef __Pyx_IterableCoroutine_USED
#define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType
#endif
#ifdef __Pyx_Coroutine_USED
#define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType
#endif
#ifdef __Pyx_Coroutine_USED
#define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#define __pyx_ptype_7cpython_4bool_bool __pyx_mstate_global->__pyx_ptype_7cpython_4bool_bool
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#define __pyx_ptype_7cpython_4type_type __pyx_mstate_global->__pyx_ptype_7cpython_4type_type
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#define __pyx_ptype_7cpython_7complex_complex __pyx_mstate_global->__pyx_ptype_7cpython_7complex_complex
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#define __pyx_type_7_amplpy_Row __pyx_mstate_global->__pyx_type_7_amplpy_Row
#define __pyx_type_7_amplpy_Column __pyx_mstate_global->__pyx_type_7_amplpy_Column
#define __pyx_type_7_amplpy_DataFrame __pyx_mstate_global->__pyx_type_7_amplpy_DataFrame
#define __pyx_type_7_amplpy_Entity __pyx_mstate_global->__pyx_type_7_amplpy_Entity
#define __pyx_type_7_amplpy_Constraint __pyx_mstate_global->__pyx_type_7_amplpy_Constraint
#define __pyx_type_7_amplpy_Environment __pyx_mstate_global->__pyx_type_7_amplpy_Environment
#define __pyx_type_7_amplpy_ErrorHandler __pyx_mstate_global->__pyx_type_7_amplpy_ErrorHandler
#define __pyx_type_7_amplpy_EnvIterator __pyx_mstate_global->__pyx_type_7_amplpy_EnvIterator
#define __pyx_type_7_amplpy_EntityMap __pyx_mstate_global->__pyx_type_7_amplpy_EntityMap
#define __pyx_type_7_amplpy_InstanceIterator __pyx_mstate_global->__pyx_type_7_amplpy_InstanceIterator
#define __pyx_type_7_amplpy_MemberRangeIterator __pyx_mstate_global->__pyx_type_7_amplpy_MemberRangeIterator
#define __pyx_type_7_amplpy_ColIterator __pyx_mstate_global->__pyx_type_7_amplpy_ColIterator
#define __pyx_type_7_amplpy_RowIterator __pyx_mstate_global->__pyx_type_7_amplpy_RowIterator
#define __pyx_type_7_amplpy_Objective __pyx_mstate_global->__pyx_type_7_amplpy_Objective
#define __pyx_type_7_amplpy_OutputHandler __pyx_mstate_global->__pyx_type_7_amplpy_OutputHandler
#define __pyx_type_7_amplpy_Parameter __pyx_mstate_global->__pyx_type_7_amplpy_Parameter
#define __pyx_type_7_amplpy_Set __pyx_mstate_global->__pyx_type_7_amplpy_Set
#define __pyx_type_7_amplpy_Variable __pyx_mstate_global->__pyx_type_7_amplpy_Variable
#define __pyx_type_7_amplpy_AMPL __pyx_mstate_global->__pyx_type_7_amplpy_AMPL
#define __pyx_type_7_amplpy___pyx_scope_struct____iter__ __pyx_mstate_global->__pyx_type_7_amplpy___pyx_scope_struct____iter__
#define __pyx_type_7_amplpy___pyx_scope_struct_1_genexpr __pyx_mstate_global->__pyx_type_7_amplpy___pyx_scope_struct_1_genexpr
#define __pyx_type_7_amplpy___pyx_scope_struct_2_genexpr __pyx_mstate_global->__pyx_type_7_amplpy___pyx_scope_struct_2_genexpr
#define __pyx_type_7_amplpy___pyx_scope_struct_3_genexpr __pyx_mstate_global->__pyx_type_7_amplpy___pyx_scope_struct_3_genexpr
#define __pyx_type_7_amplpy___pyx_scope_struct_4__get_headers __pyx_mstate_global->__pyx_type_7_amplpy___pyx_scope_struct_4__get_headers
#define __pyx_type_7_amplpy___pyx_scope_struct_5_genexpr __pyx_mstate_global->__pyx_type_7_amplpy___pyx_scope_struct_5_genexpr
#define __pyx_type_7_amplpy___pyx_scope_struct_6_from_dict __pyx_mstate_global->__pyx_type_7_amplpy___pyx_scope_struct_6_from_dict
#define __pyx_type_7_amplpy___pyx_scope_struct_7_genexpr __pyx_mstate_global->__pyx_type_7_amplpy___pyx_scope_struct_7_genexpr
#define __pyx_type_7_amplpy___pyx_scope_struct_8_genexpr __pyx_mstate_global->__pyx_type_7_amplpy___pyx_scope_struct_8_genexpr
#define __pyx_type_7_amplpy___pyx_scope_struct_9_genexpr __pyx_mstate_global->__pyx_type_7_amplpy___pyx_scope_struct_9_genexpr
#define __pyx_type_7_amplpy___pyx_scope_struct_10_genexpr __pyx_mstate_global->__pyx_type_7_amplpy___pyx_scope_struct_10_genexpr
#define __pyx_type_7_amplpy___pyx_scope_struct_11_set_values __pyx_mstate_global->__pyx_type_7_amplpy___pyx_scope_struct_11_set_values
#define __pyx_type_7_amplpy___pyx_scope_struct_12_genexpr __pyx_mstate_global->__pyx_type_7_amplpy___pyx_scope_struct_12_genexpr
#define __pyx_type_7_amplpy___pyx_scope_struct_13_genexpr __pyx_mstate_global->__pyx_type_7_amplpy___pyx_scope_struct_13_genexpr
#define __pyx_type_7_amplpy___pyx_scope_struct_14_genexpr __pyx_mstate_global->__pyx_type_7_amplpy___pyx_scope_struct_14_genexpr
#define __pyx_type_7_amplpy___pyx_scope_struct_15_genexpr __pyx_mstate_global->__pyx_type_7_amplpy___pyx_scope_struct_15_genexpr
#endif
#define __pyx_ptype_7_amplpy_Row __pyx_mstate_global->__pyx_ptype_7_amplpy_Row
#define __pyx_ptype_7_amplpy_Column __pyx_mstate_global->__pyx_ptype_7_amplpy_Column
#define __pyx_ptype_7_amplpy_DataFrame __pyx_mstate_global->__pyx_ptype_7_amplpy_DataFrame
#define __pyx_ptype_7_amplpy_Entity __pyx_mstate_global->__pyx_ptype_7_amplpy_Entity
#define __pyx_ptype_7_amplpy_Constraint __pyx_mstate_global->__pyx_ptype_7_amplpy_Constraint
#define __pyx_ptype_7_amplpy_Environment __pyx_mstate_global->__pyx_ptype_7_amplpy_Environment
#define __pyx_ptype_7_amplpy_ErrorHandler __pyx_mstate_global->__pyx_ptype_7_amplpy_ErrorHandler
#define __pyx_ptype_7_amplpy_EnvIterator __pyx_mstate_global->__pyx_ptype_7_amplpy_EnvIterator
#define __pyx_ptype_7_amplpy_EntityMap __pyx_mstate_global->__pyx_ptype_7_amplpy_EntityMap
#define __pyx_ptype_7_amplpy_InstanceIterator __pyx_mstate_global->__pyx_ptype_7_amplpy_InstanceIterator
#define __pyx_ptype_7_amplpy_MemberRangeIterator __pyx_mstate_global->__pyx_ptype_7_amplpy_MemberRangeIterator
#define __pyx_ptype_7_amplpy_ColIterator __pyx_mstate_global->__pyx_ptype_7_amplpy_ColIterator
#define __pyx_ptype_7_amplpy_RowIterator __pyx_mstate_global->__pyx_ptype_7_amplpy_RowIterator
#define __pyx_ptype_7_amplpy_Objective __pyx_mstate_global->__pyx_ptype_7_amplpy_Objective
#define __pyx_ptype_7_amplpy_OutputHandler __pyx_mstate_global->__pyx_ptype_7_amplpy_OutputHandler
#define __pyx_ptype_7_amplpy_Parameter __pyx_mstate_global->__pyx_ptype_7_amplpy_Parameter
#define __pyx_ptype_7_amplpy_Set __pyx_mstate_global->__pyx_ptype_7_amplpy_Set
#define __pyx_ptype_7_amplpy_Variable __pyx_mstate_global->__pyx_ptype_7_amplpy_Variable
#define __pyx_ptype_7_amplpy_AMPL __pyx_mstate_global->__pyx_ptype_7_amplpy_AMPL
#define __pyx_ptype_7_amplpy___pyx_scope_struct____iter__ __pyx_mstate_global->__pyx_ptype_7_amplpy___pyx_scope_struct____iter__
#define __pyx_ptype_7_amplpy___pyx_scope_struct_1_genexpr __pyx_mstate_global->__pyx_ptype_7_amplpy___pyx_scope_struct_1_genexpr
#define __pyx_ptype_7_amplpy___pyx_scope_struct_2_genexpr __pyx_mstate_global->__pyx_ptype_7_amplpy___pyx_scope_struct_2_genexpr
#define __pyx_ptype_7_amplpy___pyx_scope_struct_3_genexpr __pyx_mstate_global->__pyx_ptype_7_amplpy___pyx_scope_struct_3_genexpr
#define __pyx_ptype_7_amplpy___pyx_scope_struct_4__get_headers __pyx_mstate_global->__pyx_ptype_7_amplpy___pyx_scope_struct_4__get_headers
#define __pyx_ptype_7_amplpy___pyx_scope_struct_5_genexpr __pyx_mstate_global->__pyx_ptype_7_amplpy___pyx_scope_struct_5_genexpr
#define __pyx_ptype_7_amplpy___pyx_scope_struct_6_from_dict __pyx_mstate_global->__pyx_ptype_7_amplpy___pyx_scope_struct_6_from_dict
#define __pyx_ptype_7_amplpy___pyx_scope_struct_7_genexpr __pyx_mstate_global->__pyx_ptype_7_amplpy___pyx_scope_struct_7_genexpr
#define __pyx_ptype_7_amplpy___pyx_scope_struct_8_genexpr __pyx_mstate_global->__pyx_ptype_7_amplpy___pyx_scope_struct_8_genexpr
#define __pyx_ptype_7_amplpy___pyx_scope_struct_9_genexpr __pyx_mstate_global->__pyx_ptype_7_amplpy___pyx_scope_struct_9_genexpr
#define __pyx_ptype_7_amplpy___pyx_scope_struct_10_genexpr __pyx_mstate_global->__pyx_ptype_7_amplpy___pyx_scope_struct_10_genexpr
#define __pyx_ptype_7_amplpy___pyx_scope_struct_11_set_values __pyx_mstate_global->__pyx_ptype_7_amplpy___pyx_scope_struct_11_set_values
#define __pyx_ptype_7_amplpy___pyx_scope_struct_12_genexpr __pyx_mstate_global->__pyx_ptype_7_amplpy___pyx_scope_struct_12_genexpr
#define __pyx_ptype_7_amplpy___pyx_scope_struct_13_genexpr __pyx_mstate_global->__pyx_ptype_7_amplpy___pyx_scope_struct_13_genexpr
#define __pyx_ptype_7_amplpy___pyx_scope_struct_14_genexpr __pyx_mstate_global->__pyx_ptype_7_amplpy___pyx_scope_struct_14_genexpr
#define __pyx_ptype_7_amplpy___pyx_scope_struct_15_genexpr __pyx_mstate_global->__pyx_ptype_7_amplpy___pyx_scope_struct_15_genexpr
#define __pyx_kp_u_75 __pyx_mstate_global->__pyx_kp_u_75
#define __pyx_n_s_AMPL __pyx_mstate_global->__pyx_n_s_AMPL
#define __pyx_n_s_AMPLException __pyx_mstate_global->__pyx_n_s_AMPLException
#define __pyx_n_s_AMPLException___init __pyx_mstate_global->__pyx_n_s_AMPLException___init
#define __pyx_n_s_AMPLException___str __pyx_mstate_global->__pyx_n_s_AMPLException___str
#define __pyx_n_s_AMPLException_get_line_number __pyx_mstate_global->__pyx_n_s_AMPLException_get_line_number
#define __pyx_n_s_AMPLException_get_message __pyx_mstate_global->__pyx_n_s_AMPLException_get_message
#define __pyx_n_s_AMPLException_get_offset __pyx_mstate_global->__pyx_n_s_AMPLException_get_offset
#define __pyx_n_s_AMPLException_get_source_name __pyx_mstate_global->__pyx_n_s_AMPLException_get_source_name
#define __pyx_kp_u_AMPL_AMPL_INVALID_SUBSCRIPT_EXCE __pyx_mstate_global->__pyx_kp_u_AMPL_AMPL_INVALID_SUBSCRIPT_EXCE
#define __pyx_kp_u_AMPL_AMPL_NO_DATA_EXCEPTION __pyx_mstate_global->__pyx_kp_u_AMPL_AMPL_NO_DATA_EXCEPTION
#define __pyx_kp_u_AMPL_AMPL_SYNTAX_ERROR_EXCEPTION __pyx_mstate_global->__pyx_kp_u_AMPL_AMPL_SYNTAX_ERROR_EXCEPTION
#define __pyx_n_s_AMPL_NOT_FOUND_MESSAGE __pyx_mstate_global->__pyx_n_s_AMPL_NOT_FOUND_MESSAGE
#define __pyx_n_s_AMPL___reduce_cython __pyx_mstate_global->__pyx_n_s_AMPL___reduce_cython
#define __pyx_n_s_AMPL___setstate_cython __pyx_mstate_global->__pyx_n_s_AMPL___setstate_cython
#define __pyx_n_s_AMPL__con __pyx_mstate_global->__pyx_n_s_AMPL__con
#define __pyx_n_s_AMPL__load_session __pyx_mstate_global->__pyx_n_s_AMPL__load_session
#define __pyx_n_s_AMPL__obj __pyx_mstate_global->__pyx_n_s_AMPL__obj
#define __pyx_n_s_AMPL__option __pyx_mstate_global->__pyx_n_s_AMPL__option
#define __pyx_n_s_AMPL__param __pyx_mstate_global->__pyx_n_s_AMPL__param
#define __pyx_n_s_AMPL__set __pyx_mstate_global->__pyx_n_s_AMPL__set
#define __pyx_n_s_AMPL__start_recording __pyx_mstate_global->__pyx_n_s_AMPL__start_recording
#define __pyx_n_s_AMPL__stop_recording __pyx_mstate_global->__pyx_n_s_AMPL__stop_recording
#define __pyx_n_s_AMPL__var __pyx_mstate_global->__pyx_n_s_AMPL__var
#define __pyx_n_s_AMPL_cd __pyx_mstate_global->__pyx_n_s_AMPL_cd
#define __pyx_n_s_AMPL_close __pyx_mstate_global->__pyx_n_s_AMPL_close
#define __pyx_kp_u_AMPL_could_not_be_started __pyx_mstate_global->__pyx_kp_u_AMPL_could_not_be_started
#define __pyx_n_s_AMPL_display __pyx_mstate_global->__pyx_n_s_AMPL_display
#define __pyx_n_s_AMPL_eval __pyx_mstate_global->__pyx_n_s_AMPL_eval
#define __pyx_n_s_AMPL_export_data __pyx_mstate_global->__pyx_n_s_AMPL_export_data
#define __pyx_n_s_AMPL_export_model __pyx_mstate_global->__pyx_n_s_AMPL_export_model
#define __pyx_n_s_AMPL_get_constraint __pyx_mstate_global->__pyx_n_s_AMPL_get_constraint
#define __pyx_n_s_AMPL_get_constraints __pyx_mstate_global->__pyx_n_s_AMPL_get_constraints
#define __pyx_n_s_AMPL_get_current_objective __pyx_mstate_global->__pyx_n_s_AMPL_get_current_objective
#define __pyx_n_s_AMPL_get_data __pyx_mstate_global->__pyx_n_s_AMPL_get_data
#define __pyx_n_s_AMPL_get_entity __pyx_mstate_global->__pyx_n_s_AMPL_get_entity
#define __pyx_n_s_AMPL_get_error_handler __pyx_mstate_global->__pyx_n_s_AMPL_get_error_handler
#define __pyx_n_s_AMPL_get_iis __pyx_mstate_global->__pyx_n_s_AMPL_get_iis
#define __pyx_n_s_AMPL_get_objective __pyx_mstate_global->__pyx_n_s_AMPL_get_objective
#define __pyx_n_s_AMPL_get_objectives __pyx_mstate_global->__pyx_n_s_AMPL_get_objectives
#define __pyx_n_s_AMPL_get_option __pyx_mstate_global->__pyx_n_s_AMPL_get_option
#define __pyx_n_s_AMPL_get_output __pyx_mstate_global->__pyx_n_s_AMPL_get_output
#define __pyx_n_s_AMPL_get_output_handler __pyx_mstate_global->__pyx_n_s_AMPL_get_output_handler
#define __pyx_n_s_AMPL_get_parameter __pyx_mstate_global->__pyx_n_s_AMPL_get_parameter
#define __pyx_n_s_AMPL_get_parameters __pyx_mstate_global->__pyx_n_s_AMPL_get_parameters
#define __pyx_n_s_AMPL_get_set __pyx_mstate_global->__pyx_n_s_AMPL_get_set
#define __pyx_n_s_AMPL_get_sets __pyx_mstate_global->__pyx_n_s_AMPL_get_sets
#define __pyx_n_s_AMPL_get_solution __pyx_mstate_global->__pyx_n_s_AMPL_get_solution
#define __pyx_n_s_AMPL_get_value __pyx_mstate_global->__pyx_n_s_AMPL_get_value
#define __pyx_n_s_AMPL_get_variable __pyx_mstate_global->__pyx_n_s_AMPL_get_variable
#define __pyx_n_s_AMPL_get_variables __pyx_mstate_global->__pyx_n_s_AMPL_get_variables
#define __pyx_n_s_AMPL_is_running __pyx_mstate_global->__pyx_n_s_AMPL_is_running
#define __pyx_n_s_AMPL_read __pyx_mstate_global->__pyx_n_s_AMPL_read
#define __pyx_n_s_AMPL_read_data __pyx_mstate_global->__pyx_n_s_AMPL_read_data
#define __pyx_n_s_AMPL_read_table __pyx_mstate_global->__pyx_n_s_AMPL_read_table
#define __pyx_n_s_AMPL_reset __pyx_mstate_global->__pyx_n_s_AMPL_reset
#define __pyx_n_s_AMPL_set_data __pyx_mstate_global->__pyx_n_s_AMPL_set_data
#define __pyx_n_s_AMPL_set_error_handler __pyx_mstate_global->__pyx_n_s_AMPL_set_error_handler
#define __pyx_n_s_AMPL_set_option __pyx_mstate_global->__pyx_n_s_AMPL_set_option
#define __pyx_n_s_AMPL_set_output_handler __pyx_mstate_global->__pyx_n_s_AMPL_set_output_handler
#define __pyx_n_s_AMPL_snapshot __pyx_mstate_global->__pyx_n_s_AMPL_snapshot
#define __pyx_n_s_AMPL_solve __pyx_mstate_global->__pyx_n_s_AMPL_solve
#define __pyx_kp_u_AMPL_unknown_return_code __pyx_mstate_global->__pyx_kp_u_AMPL_unknown_return_code
#define __pyx_n_s_AMPL_write __pyx_mstate_global->__pyx_n_s_AMPL_write
#define __pyx_n_s_AMPL_write_table __pyx_mstate_global->__pyx_n_s_AMPL_write_table
#define __pyx_kp_u_A_constraint_called_name_cannot __pyx_mstate_global->__pyx_kp_u_A_constraint_called_name_cannot
#define __pyx_kp_u_A_parameter_called_name_cannot_b __pyx_mstate_global->__pyx_kp_u_A_parameter_called_name_cannot_b
#define __pyx_kp_u_A_set_called_name_cannot_be_foun __pyx_mstate_global->__pyx_kp_u_A_set_called_name_cannot_be_foun
#define __pyx_kp_u_A_variable_called_name_cannot_be __pyx_mstate_global->__pyx_kp_u_A_variable_called_name_cannot_be
#define __pyx_kp_u_All_values_must_be_either_number __pyx_mstate_global->__pyx_kp_u_All_values_must_be_either_number
#define __pyx_kp_u_An_objective_called_name_cannot __pyx_mstate_global->__pyx_kp_u_An_objective_called_name_cannot
#define __pyx_n_s_AssertionError __pyx_mstate_global->__pyx_n_s_AssertionError
#define __pyx_n_s_AttributeError __pyx_mstate_global->__pyx_n_s_AttributeError
#define __pyx_n_s_BREAK __pyx_mstate_global->__pyx_n_s_BREAK
#define __pyx_n_s_BREAKPOINT __pyx_mstate_global->__pyx_n_s_BREAKPOINT
#define __pyx_n_s_CALL __pyx_mstate_global->__pyx_n_s_CALL
#define __pyx_n_s_CD __pyx_mstate_global->__pyx_n_s_CD
#define __pyx_n_s_CHECK __pyx_mstate_global->__pyx_n_s_CHECK
#define __pyx_n_s_CLOSE __pyx_mstate_global->__pyx_n_s_CLOSE
#define __pyx_n_s_COMMANDS __pyx_mstate_global->__pyx_n_s_COMMANDS
#define __pyx_n_s_CONTINUE __pyx_mstate_global->__pyx_n_s_CONTINUE
#define __pyx_n_s_ColIterator __pyx_mstate_global->__pyx_n_s_ColIterator
#define __pyx_n_s_ColIterator___reduce_cython __pyx_mstate_global->__pyx_n_s_ColIterator___reduce_cython
#define __pyx_n_s_ColIterator___setstate_cython __pyx_mstate_global->__pyx_n_s_ColIterator___setstate_cython
#define __pyx_n_s_Column __pyx_mstate_global->__pyx_n_s_Column
#define __pyx_n_s_Column___reduce_cython __pyx_mstate_global->__pyx_n_s_Column___reduce_cython
#define __pyx_n_s_Column___setstate_cython __pyx_mstate_global->__pyx_n_s_Column___setstate_cython
#define __pyx_n_s_Column_to_list __pyx_mstate_global->__pyx_n_s_Column_to_list
#define __pyx_n_s_Column_to_string __pyx_mstate_global->__pyx_n_s_Column_to_string
#define __pyx_n_s_Constraint __pyx_mstate_global->__pyx_n_s_Constraint
#define __pyx_n_s_Constraint___reduce_cython __pyx_mstate_global->__pyx_n_s_Constraint___reduce_cython
#define __pyx_n_s_Constraint___setstate_cython __pyx_mstate_global->__pyx_n_s_Constraint___setstate_cython
#define __pyx_n_s_Constraint_astatus __pyx_mstate_global->__pyx_n_s_Constraint_astatus
#define __pyx_n_s_Constraint_body __pyx_mstate_global->__pyx_n_s_Constraint_body
#define __pyx_n_s_Constraint_defvar __pyx_mstate_global->__pyx_n_s_Constraint_defvar
#define __pyx_n_s_Constraint_dinit __pyx_mstate_global->__pyx_n_s_Constraint_dinit
#define __pyx_n_s_Constraint_dinit0 __pyx_mstate_global->__pyx_n_s_Constraint_dinit0
#define __pyx_n_s_Constraint_drop __pyx_mstate_global->__pyx_n_s_Constraint_drop
#define __pyx_n_s_Constraint_dual __pyx_mstate_global->__pyx_n_s_Constraint_dual
#define __pyx_n_s_Constraint_is_logical __pyx_mstate_global->__pyx_n_s_Constraint_is_logical
#define __pyx_n_s_Constraint_lb __pyx_mstate_global->__pyx_n_s_Constraint_lb
#define __pyx_n_s_Constraint_lbs __pyx_mstate_global->__pyx_n_s_Constraint_lbs
#define __pyx_n_s_Constraint_ldual __pyx_mstate_global->__pyx_n_s_Constraint_ldual
#define __pyx_n_s_Constraint_lslack __pyx_mstate_global->__pyx_n_s_Constraint_lslack
#define __pyx_n_s_Constraint_restore __pyx_mstate_global->__pyx_n_s_Constraint_restore
#define __pyx_n_s_Constraint_set_dual __pyx_mstate_global->__pyx_n_s_Constraint_set_dual
#define __pyx_n_s_Constraint_slack __pyx_mstate_global->__pyx_n_s_Constraint_slack
#define __pyx_n_s_Constraint_sstatus __pyx_mstate_global->__pyx_n_s_Constraint_sstatus
#define __pyx_n_s_Constraint_status __pyx_mstate_global->__pyx_n_s_Constraint_status
#define __pyx_n_s_Constraint_ub __pyx_mstate_global->__pyx_n_s_Constraint_ub
#define __pyx_n_s_Constraint_ubs __pyx_mstate_global->__pyx_n_s_Constraint_ubs
#define __pyx_n_s_Constraint_udual __pyx_mstate_global->__pyx_n_s_Constraint_udual
#define __pyx_n_s_Constraint_uslack __pyx_mstate_global->__pyx_n_s_Constraint_uslack
#define __pyx_n_s_Constraint_val __pyx_mstate_global->__pyx_n_s_Constraint_val
#define __pyx_n_s_Constraints __pyx_mstate_global->__pyx_n_s_Constraints
#define __pyx_n_s_DATA __pyx_mstate_global->__pyx_n_s_DATA
#define __pyx_n_s_DELETECMD __pyx_mstate_global->__pyx_n_s_DELETECMD
#define __pyx_n_s_DISPLAY __pyx_mstate_global->__pyx_n_s_DISPLAY
#define __pyx_n_s_DROP __pyx_mstate_global->__pyx_n_s_DROP
#define __pyx_n_s_DROP_OR_RESTORE_ALL __pyx_mstate_global->__pyx_n_s_DROP_OR_RESTORE_ALL
#define __pyx_n_s_DataFrame __pyx_mstate_global->__pyx_n_s_DataFrame
#define __pyx_n_s_DataFrame___reduce_cython __pyx_mstate_global->__pyx_n_s_DataFrame___reduce_cython
#define __pyx_n_s_DataFrame___setstate_cython __pyx_mstate_global->__pyx_n_s_DataFrame___setstate_cython
#define __pyx_n_s_DataFrame__add_column __pyx_mstate_global->__pyx_n_s_DataFrame__add_column
#define __pyx_n_s_DataFrame__add_row __pyx_mstate_global->__pyx_n_s_DataFrame__add_row
#define __pyx_n_s_DataFrame__from_data_frame_ref __pyx_mstate_global->__pyx_n_s_DataFrame__from_data_frame_ref
#define __pyx_n_s_DataFrame__get_column __pyx_mstate_global->__pyx_n_s_DataFrame__get_column
#define __pyx_n_s_DataFrame__get_headers __pyx_mstate_global->__pyx_n_s_DataFrame__get_headers
#define __pyx_n_s_DataFrame__get_num_cols __pyx_mstate_global->__pyx_n_s_DataFrame__get_num_cols
#define __pyx_n_s_DataFrame__get_num_indices __pyx_mstate_global->__pyx_n_s_DataFrame__get_num_indices
#define __pyx_n_s_DataFrame__get_num_rows __pyx_mstate_global->__pyx_n_s_DataFrame__get_num_rows
#define __pyx_n_s_DataFrame__get_row __pyx_mstate_global->__pyx_n_s_DataFrame__get_row
#define __pyx_n_s_DataFrame__get_row_by_index __pyx_mstate_global->__pyx_n_s_DataFrame__get_row_by_index
#define __pyx_n_s_DataFrame__set_column __pyx_mstate_global->__pyx_n_s_DataFrame__set_column
#define __pyx_n_s_DataFrame__set_values __pyx_mstate_global->__pyx_n_s_DataFrame__set_values
#define __pyx_n_s_DataFrame_from_dict __pyx_mstate_global->__pyx_n_s_DataFrame_from_dict
#define __pyx_n_s_DataFrame_from_numpy __pyx_mstate_global->__pyx_n_s_DataFrame_from_numpy
#define __pyx_n_s_DataFrame_from_pandas __pyx_mstate_global->__pyx_n_s_DataFrame_from_pandas
#define __pyx_n_s_DataFrame_to_dict __pyx_mstate_global->__pyx_n_s_DataFrame_to_dict
#define __pyx_n_s_DataFrame_to_list __pyx_mstate_global->__pyx_n_s_DataFrame_to_list
#define __pyx_n_s_DataFrame_to_pandas __pyx_mstate_global->__pyx_n_s_DataFrame_to_pandas
#define __pyx_n_s_DataFrame_to_string __pyx_mstate_global->__pyx_n_s_DataFrame_to_string
#define __pyx_kp_u_Dictionary_must_contain_either_a __pyx_mstate_global->__pyx_kp_u_Dictionary_must_contain_either_a
#define __pyx_n_s_ELSE __pyx_mstate_global->__pyx_n_s_ELSE
#define __pyx_n_s_ELSE_CHECK __pyx_mstate_global->__pyx_n_s_ELSE_CHECK
#define __pyx_n_s_ENDIF __pyx_mstate_global->__pyx_n_s_ENDIF
#define __pyx_n_s_ENVIRON __pyx_mstate_global->__pyx_n_s_ENVIRON
#define __pyx_n_s_EXIT __pyx_mstate_global->__pyx_n_s_EXIT
#define __pyx_n_s_EXPAND __pyx_mstate_global->__pyx_n_s_EXPAND
#define __pyx_n_s_Entity __pyx_mstate_global->__pyx_n_s_Entity
#define __pyx_n_s_EntityMap __pyx_mstate_global->__pyx_n_s_EntityMap
#define __pyx_n_s_EntityMap___reduce_cython __pyx_mstate_global->__pyx_n_s_EntityMap___reduce_cython
#define __pyx_n_s_EntityMap___setstate_cython __pyx_mstate_global->__pyx_n_s_EntityMap___setstate_cython
#define __pyx_n_s_EntityMap_size __pyx_mstate_global->__pyx_n_s_EntityMap_size
#define __pyx_n_s_Entity___reduce_cython __pyx_mstate_global->__pyx_n_s_Entity___reduce_cython
#define __pyx_n_s_Entity___setstate_cython __pyx_mstate_global->__pyx_n_s_Entity___setstate_cython
#define __pyx_n_s_Entity_find __pyx_mstate_global->__pyx_n_s_Entity_find
#define __pyx_n_s_Entity_get __pyx_mstate_global->__pyx_n_s_Entity_get
#define __pyx_n_s_Entity_get_indexing_sets __pyx_mstate_global->__pyx_n_s_Entity_get_indexing_sets
#define __pyx_n_s_Entity_get_values __pyx_mstate_global->__pyx_n_s_Entity_get_values
#define __pyx_n_s_Entity_indexarity __pyx_mstate_global->__pyx_n_s_Entity_indexarity
#define __pyx_n_s_Entity_instances __pyx_mstate_global->__pyx_n_s_Entity_instances
#define __pyx_n_s_Entity_is_scalar __pyx_mstate_global->__pyx_n_s_Entity_is_scalar
#define __pyx_n_s_Entity_name __pyx_mstate_global->__pyx_n_s_Entity_name
#define __pyx_n_s_Entity_num_instances __pyx_mstate_global->__pyx_n_s_Entity_num_instances
#define __pyx_n_s_Entity_set_values __pyx_mstate_global->__pyx_n_s_Entity_set_values
#define __pyx_n_s_Entity_to_dict __pyx_mstate_global->__pyx_n_s_Entity_to_dict
#define __pyx_n_s_Entity_to_list __pyx_mstate_global->__pyx_n_s_Entity_to_list
#define __pyx_n_s_Entity_to_pandas __pyx_mstate_global->__pyx_n_s_Entity_to_pandas
#define __pyx_n_s_Entity_to_string __pyx_mstate_global->__pyx_n_s_Entity_to_string
#define __pyx_n_s_Entity_xref __pyx_mstate_global->__pyx_n_s_Entity_xref
#define __pyx_n_s_Enum __pyx_mstate_global->__pyx_n_s_Enum
#define __pyx_n_s_EnvIterator __pyx_mstate_global->__pyx_n_s_EnvIterator
#define __pyx_n_s_EnvIterator___reduce_cython __pyx_mstate_global->__pyx_n_s_EnvIterator___reduce_cython
#define __pyx_n_s_EnvIterator___setstate_cython __pyx_mstate_global->__pyx_n_s_EnvIterator___setstate_cython
#define __pyx_n_s_Environment __pyx_mstate_global->__pyx_n_s_Environment
#define __pyx_n_s_Environment___reduce_cython __pyx_mstate_global->__pyx_n_s_Environment___reduce_cython
#define __pyx_n_s_Environment___setstate_cython __pyx_mstate_global->__pyx_n_s_Environment___setstate_cython
#define __pyx_n_s_Environment_get_bin_dir __pyx_mstate_global->__pyx_n_s_Environment_get_bin_dir
#define __pyx_n_s_Environment_get_bin_name __pyx_mstate_global->__pyx_n_s_Environment_get_bin_name
#define __pyx_n_s_Environment_set_bin_dir __pyx_mstate_global->__pyx_n_s_Environment_set_bin_dir
#define __pyx_n_s_Environment_set_bin_name __pyx_mstate_global->__pyx_n_s_Environment_set_bin_name
#define __pyx_n_s_Environment_to_string __pyx_mstate_global->__pyx_n_s_Environment_to_string
#define __pyx_kp_u_Error __pyx_mstate_global->__pyx_kp_u_Error
#define __pyx_n_s_ErrorHandler __pyx_mstate_global->__pyx_n_s_ErrorHandler
#define __pyx_n_s_ErrorHandler___reduce_cython __pyx_mstate_global->__pyx_n_s_ErrorHandler___reduce_cython
#define __pyx_n_s_ErrorHandler___setstate_cython __pyx_mstate_global->__pyx_n_s_ErrorHandler___setstate_cython
#define __pyx_n_s_ErrorHandler_error __pyx_mstate_global->__pyx_n_s_ErrorHandler_error
#define __pyx_n_s_ErrorHandler_warning __pyx_mstate_global->__pyx_n_s_ErrorHandler_warning
#define __pyx_kp_u_Excepted_dictionary_of_set_membe __pyx_mstate_global->__pyx_kp_u_Excepted_dictionary_of_set_membe
#define __pyx_kp_u_Excepted_string_or_real __pyx_mstate_global->__pyx_kp_u_Excepted_string_or_real
#define __pyx_kp_u_Excepted_tuple_of_arity __pyx_mstate_global->__pyx_kp_u_Excepted_tuple_of_arity
#define __pyx_kp_u_Expected_a_dictionary __pyx_mstate_global->__pyx_kp_u_Expected_a_dictionary
#define __pyx_kp_u_Expected_tuples_of_arity __pyx_mstate_global->__pyx_kp_u_Expected_tuples_of_arity
#define __pyx_n_s_FIX __pyx_mstate_global->__pyx_n_s_FIX
#define __pyx_n_s_FOR __pyx_mstate_global->__pyx_n_s_FOR
#define __pyx_kp_u_Failed_to_access_value __pyx_mstate_global->__pyx_kp_u_Failed_to_access_value
#define __pyx_n_s_IF __pyx_mstate_global->__pyx_n_s_IF
#define __pyx_n_s_IOError __pyx_mstate_global->__pyx_n_s_IOError
#define __pyx_n_s_ImportError __pyx_mstate_global->__pyx_n_s_ImportError
#define __pyx_kp_s_Incompatible_checksums_0x_x_vs_0 __pyx_mstate_global->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0
#define __pyx_n_s_InfeasibilityException __pyx_mstate_global->__pyx_n_s_InfeasibilityException
#define __pyx_kp_u_InfeasibilityException_2 __pyx_mstate_global->__pyx_kp_u_InfeasibilityException_2
#define __pyx_n_s_InstanceIterator __pyx_mstate_global->__pyx_n_s_InstanceIterator
#define __pyx_n_s_InstanceIterator___reduce_cython __pyx_mstate_global->__pyx_n_s_InstanceIterator___reduce_cython
#define __pyx_n_s_InstanceIterator___setstate_cyth __pyx_mstate_global->__pyx_n_s_InstanceIterator___setstate_cyth
#define __pyx_n_s_InstanceIterator_size __pyx_mstate_global->__pyx_n_s_InstanceIterator_size
#define __pyx_n_s_Iterable __pyx_mstate_global->__pyx_n_s_Iterable
#define __pyx_n_s_KeyError __pyx_mstate_global->__pyx_n_s_KeyError
#define __pyx_n_s_Kind __pyx_mstate_global->__pyx_n_s_Kind
#define __pyx_n_s_LET __pyx_mstate_global->__pyx_n_s_LET
#define __pyx_n_s_LOAD __pyx_mstate_global->__pyx_n_s_LOAD
#define __pyx_n_s_LOOPEND __pyx_mstate_global->__pyx_n_s_LOOPEND
#define __pyx_n_s_MISC __pyx_mstate_global->__pyx_n_s_MISC
#define __pyx_n_s_MemberRangeIterator __pyx_mstate_global->__pyx_n_s_MemberRangeIterator
#define __pyx_n_s_MemberRangeIterator___reduce_cyt __pyx_mstate_global->__pyx_n_s_MemberRangeIterator___reduce_cyt
#define __pyx_n_s_MemberRangeIterator___setstate_c __pyx_mstate_global->__pyx_n_s_MemberRangeIterator___setstate_c
#define __pyx_n_s_MemberRangeIterator_size __pyx_mstate_global->__pyx_n_s_MemberRangeIterator_size
#define __pyx_n_s_MemoryError __pyx_mstate_global->__pyx_n_s_MemoryError
#define __pyx_n_s_MultiIndex __pyx_mstate_global->__pyx_n_s_MultiIndex
#define __pyx_n_s_NotImplementedError __pyx_mstate_global->__pyx_n_s_NotImplementedError
#define __pyx_n_s_OBJECTIVE __pyx_mstate_global->__pyx_n_s_OBJECTIVE
#define __pyx_n_s_OPTION __pyx_mstate_global->__pyx_n_s_OPTION
#define __pyx_n_s_OPTION_RESET __pyx_mstate_global->__pyx_n_s_OPTION_RESET
#define __pyx_n_s_Objective __pyx_mstate_global->__pyx_n_s_Objective
#define __pyx_n_s_Objective___reduce_cython __pyx_mstate_global->__pyx_n_s_Objective___reduce_cython
#define __pyx_n_s_Objective___setstate_cython __pyx_mstate_global->__pyx_n_s_Objective___setstate_cython
#define __pyx_n_s_Objective_astatus __pyx_mstate_global->__pyx_n_s_Objective_astatus
#define __pyx_n_s_Objective_drop __pyx_mstate_global->__pyx_n_s_Objective_drop
#define __pyx_n_s_Objective_exitcode __pyx_mstate_global->__pyx_n_s_Objective_exitcode
#define __pyx_n_s_Objective_message __pyx_mstate_global->__pyx_n_s_Objective_message
#define __pyx_n_s_Objective_minimization __pyx_mstate_global->__pyx_n_s_Objective_minimization
#define __pyx_n_s_Objective_restore __pyx_mstate_global->__pyx_n_s_Objective_restore
#define __pyx_n_s_Objective_result __pyx_mstate_global->__pyx_n_s_Objective_result
#define __pyx_n_s_Objective_sstatus __pyx_mstate_global->__pyx_n_s_Objective_sstatus
#define __pyx_n_s_Objective_value __pyx_mstate_global->__pyx_n_s_Objective_value
#define __pyx_n_s_Objectives __pyx_mstate_global->__pyx_n_s_Objectives
#define __pyx_n_s_Options __pyx_mstate_global->__pyx_n_s_Options
#define __pyx_n_s_OutputHandler __pyx_mstate_global->__pyx_n_s_OutputHandler
#define __pyx_n_s_OutputHandler___reduce_cython __pyx_mstate_global->__pyx_n_s_OutputHandler___reduce_cython
#define __pyx_n_s_OutputHandler___setstate_cython __pyx_mstate_global->__pyx_n_s_OutputHandler___setstate_cython
#define __pyx_n_s_OutputHandler_output __pyx_mstate_global->__pyx_n_s_OutputHandler_output
#define __pyx_n_s_PRINT __pyx_mstate_global->__pyx_n_s_PRINT
#define __pyx_n_s_PRINTF __pyx_mstate_global->__pyx_n_s_PRINTF
#define __pyx_n_s_PROBLEM __pyx_mstate_global->__pyx_n_s_PROBLEM
#define __pyx_n_s_PROMPT __pyx_mstate_global->__pyx_n_s_PROMPT
#define __pyx_n_s_PURGE __pyx_mstate_global->__pyx_n_s_PURGE
#define __pyx_n_s_Parameter __pyx_mstate_global->__pyx_n_s_Parameter
#define __pyx_n_s_Parameter___reduce_cython __pyx_mstate_global->__pyx_n_s_Parameter___reduce_cython
#define __pyx_n_s_Parameter___setstate_cython __pyx_mstate_global->__pyx_n_s_Parameter___setstate_cython
#define __pyx_n_s_Parameter_has_default __pyx_mstate_global->__pyx_n_s_Parameter_has_default
#define __pyx_n_s_Parameter_is_symbolic __pyx_mstate_global->__pyx_n_s_Parameter_is_symbolic
#define __pyx_n_s_Parameter_set __pyx_mstate_global->__pyx_n_s_Parameter_set
#define __pyx_n_s_Parameter_set_values __pyx_mstate_global->__pyx_n_s_Parameter_set_values
#define __pyx_n_s_Parameter_value __pyx_mstate_global->__pyx_n_s_Parameter_value
#define __pyx_n_s_Parameters __pyx_mstate_global->__pyx_n_s_Parameters
#define __pyx_n_s_PickleError __pyx_mstate_global->__pyx_n_s_PickleError
#define __pyx_kp_u_Please_make_sure_that_the_AMPL __pyx_mstate_global->__pyx_kp_u_Please_make_sure_that_the_AMPL
#define __pyx_n_s_PresolveException __pyx_mstate_global->__pyx_n_s_PresolveException
#define __pyx_kp_u_PresolveException_2 __pyx_mstate_global->__pyx_kp_u_PresolveException_2
#define __pyx_n_s_RBRACE __pyx_mstate_global->__pyx_n_s_RBRACE
#define __pyx_n_s_READ __pyx_mstate_global->__pyx_n_s_READ
#define __pyx_n_s_READTABLE __pyx_mstate_global->__pyx_n_s_READTABLE
#define __pyx_n_s_READ_TABLE __pyx_mstate_global->__pyx_n_s_READ_TABLE
#define __pyx_n_s_RELOAD __pyx_mstate_global->__pyx_n_s_RELOAD
#define __pyx_n_s_REMOVE __pyx_mstate_global->__pyx_n_s_REMOVE
#define __pyx_n_s_REPEAT __pyx_mstate_global->__pyx_n_s_REPEAT
#define __pyx_n_s_REPEAT_END __pyx_mstate_global->__pyx_n_s_REPEAT_END
#define __pyx_n_s_RESET __pyx_mstate_global->__pyx_n_s_RESET
#define __pyx_n_s_RESTORE __pyx_mstate_global->__pyx_n_s_RESTORE
#define __pyx_n_s_RUN_ARGS __pyx_mstate_global->__pyx_n_s_RUN_ARGS
#define __pyx_n_s_Real __pyx_mstate_global->__pyx_n_s_Real
#define __pyx_kp_s_Represent_an_exception_generate __pyx_mstate_global->__pyx_kp_s_Represent_an_exception_generate
#define __pyx_kp_s_Represents_the_type_of_the_outp __pyx_mstate_global->__pyx_kp_s_Represents_the_type_of_the_outp
#define __pyx_n_s_Row __pyx_mstate_global->__pyx_n_s_Row
#define __pyx_n_s_RowIterator __pyx_mstate_global->__pyx_n_s_RowIterator
#define __pyx_n_s_RowIterator___reduce_cython __pyx_mstate_global->__pyx_n_s_RowIterator___reduce_cython
#define __pyx_n_s_RowIterator___setstate_cython __pyx_mstate_global->__pyx_n_s_RowIterator___setstate_cython
#define __pyx_n_s_Row___reduce_cython __pyx_mstate_global->__pyx_n_s_Row___reduce_cython
#define __pyx_n_s_Row___setstate_cython __pyx_mstate_global->__pyx_n_s_Row___setstate_cython
#define __pyx_n_s_Row_to_string __pyx_mstate_global->__pyx_n_s_Row_to_string
#define __pyx_n_s_RuntimeError __pyx_mstate_global->__pyx_n_s_RuntimeError
#define __pyx_n_s_SEMICOLON __pyx_mstate_global->__pyx_n_s_SEMICOLON
#define __pyx_n_s_SHELL_MESSAGE __pyx_mstate_global->__pyx_n_s_SHELL_MESSAGE
#define __pyx_n_s_SHELL_OUTPUT __pyx_mstate_global->__pyx_n_s_SHELL_OUTPUT
#define __pyx_n_s_SHOW __pyx_mstate_global->__pyx_n_s_SHOW
#define __pyx_n_s_SOLUTION __pyx_mstate_global->__pyx_n_s_SOLUTION
#define __pyx_n_s_SOLVE __pyx_mstate_global->__pyx_n_s_SOLVE
#define __pyx_n_s_SSTEP __pyx_mstate_global->__pyx_n_s_SSTEP
#define __pyx_n_s_SUPPORT_MESSAGE __pyx_mstate_global->__pyx_n_s_SUPPORT_MESSAGE
#define __pyx_n_s_Series __pyx_mstate_global->__pyx_n_s_Series
#define __pyx_n_s_Set __pyx_mstate_global->__pyx_n_s_Set
#define __pyx_n_s_Set___reduce_cython __pyx_mstate_global->__pyx_n_s_Set___reduce_cython
#define __pyx_n_s_Set___setstate_cython __pyx_mstate_global->__pyx_n_s_Set___setstate_cython
#define __pyx_n_s_Set_arity __pyx_mstate_global->__pyx_n_s_Set_arity
#define __pyx_n_s_Set_contains __pyx_mstate_global->__pyx_n_s_Set_contains
#define __pyx_n_s_Set_get_values __pyx_mstate_global->__pyx_n_s_Set_get_values
#define __pyx_n_s_Set_instances __pyx_mstate_global->__pyx_n_s_Set_instances
#define __pyx_n_s_Set_members __pyx_mstate_global->__pyx_n_s_Set_members
#define __pyx_n_s_Set_set_values __pyx_mstate_global->__pyx_n_s_Set_set_values
#define __pyx_n_s_Set_size __pyx_mstate_global->__pyx_n_s_Set_size
#define __pyx_n_s_Sets __pyx_mstate_global->__pyx_n_s_Sets
#define __pyx_n_s_StopIteration __pyx_mstate_global->__pyx_n_s_StopIteration
#define __pyx_n_s_SystemError __pyx_mstate_global->__pyx_n_s_SystemError
#define __pyx_n_s_THEN __pyx_mstate_global->__pyx_n_s_THEN
#define __pyx_kp_u_Trying_to_assign_tuples_to_set_o __pyx_mstate_global->__pyx_kp_u_Trying_to_assign_tuples_to_set_o
#define __pyx_n_s_TypeError __pyx_mstate_global->__pyx_n_s_TypeError
#define __pyx_n_s_UNFIX __pyx_mstate_global->__pyx_n_s_UNFIX
#define __pyx_n_s_UNLOAD __pyx_mstate_global->__pyx_n_s_UNLOAD
#define __pyx_n_s_UPDATE __pyx_mstate_global->__pyx_n_s_UPDATE
#define __pyx_kp_u_Unable_to_allocate_memory_for_ar __pyx_mstate_global->__pyx_kp_u_Unable_to_allocate_memory_for_ar
#define __pyx_kp_u_Unexpected_data_type __pyx_mstate_global->__pyx_kp_u_Unexpected_data_type
#define __pyx_kp_u_Unknown_entity_class __pyx_mstate_global->__pyx_kp_u_Unknown_entity_class
#define __pyx_n_s_ValueError __pyx_mstate_global->__pyx_n_s_ValueError
#define __pyx_n_s_Variable __pyx_mstate_global->__pyx_n_s_Variable
#define __pyx_n_s_Variable___reduce_cython __pyx_mstate_global->__pyx_n_s_Variable___reduce_cython
#define __pyx_n_s_Variable___setstate_cython __pyx_mstate_global->__pyx_n_s_Variable___setstate_cython
#define __pyx_n_s_Variable_astatus __pyx_mstate_global->__pyx_n_s_Variable_astatus
#define __pyx_n_s_Variable_defeqn __pyx_mstate_global->__pyx_n_s_Variable_defeqn
#define __pyx_n_s_Variable_dual __pyx_mstate_global->__pyx_n_s_Variable_dual
#define __pyx_n_s_Variable_fix __pyx_mstate_global->__pyx_n_s_Variable_fix
#define __pyx_n_s_Variable_init __pyx_mstate_global->__pyx_n_s_Variable_init
#define __pyx_n_s_Variable_init0 __pyx_mstate_global->__pyx_n_s_Variable_init0
#define __pyx_n_s_Variable_lb __pyx_mstate_global->__pyx_n_s_Variable_lb
#define __pyx_n_s_Variable_lb0 __pyx_mstate_global->__pyx_n_s_Variable_lb0
#define __pyx_n_s_Variable_lb1 __pyx_mstate_global->__pyx_n_s_Variable_lb1
#define __pyx_n_s_Variable_lb2 __pyx_mstate_global->__pyx_n_s_Variable_lb2
#define __pyx_n_s_Variable_lrc __pyx_mstate_global->__pyx_n_s_Variable_lrc
#define __pyx_n_s_Variable_lslack __pyx_mstate_global->__pyx_n_s_Variable_lslack
#define __pyx_n_s_Variable_rc __pyx_mstate_global->__pyx_n_s_Variable_rc
#define __pyx_n_s_Variable_set_value __pyx_mstate_global->__pyx_n_s_Variable_set_value
#define __pyx_n_s_Variable_slack __pyx_mstate_global->__pyx_n_s_Variable_slack
#define __pyx_n_s_Variable_sstatus __pyx_mstate_global->__pyx_n_s_Variable_sstatus
#define __pyx_n_s_Variable_status __pyx_mstate_global->__pyx_n_s_Variable_status
#define __pyx_n_s_Variable_ub __pyx_mstate_global->__pyx_n_s_Variable_ub
#define __pyx_n_s_Variable_ub0 __pyx_mstate_global->__pyx_n_s_Variable_ub0
#define __pyx_n_s_Variable_ub1 __pyx_mstate_global->__pyx_n_s_Variable_ub1
#define __pyx_n_s_Variable_ub2 __pyx_mstate_global->__pyx_n_s_Variable_ub2
#define __pyx_n_s_Variable_unfix __pyx_mstate_global->__pyx_n_s_Variable_unfix
#define __pyx_n_s_Variable_urc __pyx_mstate_global->__pyx_n_s_Variable_urc
#define __pyx_n_s_Variable_uslack __pyx_mstate_global->__pyx_n_s_Variable_uslack
#define __pyx_n_s_Variable_value __pyx_mstate_global->__pyx_n_s_Variable_value
#define __pyx_n_s_Variables __pyx_mstate_global->__pyx_n_s_Variables
#define __pyx_n_s_WAITING __pyx_mstate_global->__pyx_n_s_WAITING
#define __pyx_n_s_WRITE __pyx_mstate_global->__pyx_n_s_WRITE
#define __pyx_n_s_WRITETABLE __pyx_mstate_global->__pyx_n_s_WRITETABLE
#define __pyx_n_s_WRITE_TABLE __pyx_mstate_global->__pyx_n_s_WRITE_TABLE
#define __pyx_kp_u_Warning __pyx_mstate_global->__pyx_kp_u_Warning
#define __pyx_n_s_XREF __pyx_mstate_global->__pyx_n_s_XREF
#define __pyx_kp_u__21 __pyx_mstate_global->__pyx_kp_u__21
#define __pyx_kp_u__22 __pyx_mstate_global->__pyx_kp_u__22
#define __pyx_kp_u__24 __pyx_mstate_global->__pyx_kp_u__24
#define __pyx_kp_u__25 __pyx_mstate_global->__pyx_kp_u__25
#define __pyx_kp_u__26 __pyx_mstate_global->__pyx_kp_u__26
#define __pyx_kp_u__33 __pyx_mstate_global->__pyx_kp_u__33
#define __pyx_kp_u__34 __pyx_mstate_global->__pyx_kp_u__34
#define __pyx_kp_u__35 __pyx_mstate_global->__pyx_kp_u__35
#define __pyx_kp_u__36 __pyx_mstate_global->__pyx_kp_u__36
#define __pyx_kp_u__38 __pyx_mstate_global->__pyx_kp_u__38
#define __pyx_kp_u__39 __pyx_mstate_global->__pyx_kp_u__39
#define __pyx_n_s__390 __pyx_mstate_global->__pyx_n_s__390
#define __pyx_kp_u__40 __pyx_mstate_global->__pyx_kp_u__40
#define __pyx_kp_u__41 __pyx_mstate_global->__pyx_kp_u__41
#define __pyx_n_s__84 __pyx_mstate_global->__pyx_n_s__84
#define __pyx_n_s_addColumn __pyx_mstate_global->__pyx_n_s_addColumn
#define __pyx_n_s_addRow __pyx_mstate_global->__pyx_n_s_addRow
#define __pyx_n_s_add_column __pyx_mstate_global->__pyx_n_s_add_column
#define __pyx_n_s_add_column_locals_genexpr __pyx_mstate_global->__pyx_n_s_add_column_locals_genexpr
#define __pyx_n_s_add_row __pyx_mstate_global->__pyx_n_s_add_row
#define __pyx_n_s_ampl __pyx_mstate_global->__pyx_n_s_ampl
#define __pyx_n_s_ampl_expressions __pyx_mstate_global->__pyx_n_s_ampl_expressions
#define __pyx_n_u_ampl_libpath __pyx_mstate_global->__pyx_n_u_ampl_libpath
#define __pyx_n_s_amplpy __pyx_mstate_global->__pyx_n_s_amplpy
#define __pyx_kp_s_amplpy_ampl_pyx __pyx_mstate_global->__pyx_kp_s_amplpy_ampl_pyx
#define __pyx_kp_s_amplpy_constraint_pxi __pyx_mstate_global->__pyx_kp_s_amplpy_constraint_pxi
#define __pyx_kp_s_amplpy_dataframe_pxi __pyx_mstate_global->__pyx_kp_s_amplpy_dataframe_pxi
#define __pyx_kp_s_amplpy_entity_pxi __pyx_mstate_global->__pyx_kp_s_amplpy_entity_pxi
#define __pyx_kp_s_amplpy_environment_pxi __pyx_mstate_global->__pyx_kp_s_amplpy_environment_pxi
#define __pyx_kp_s_amplpy_errorhandler_pxi __pyx_mstate_global->__pyx_kp_s_amplpy_errorhandler_pxi
#define __pyx_kp_s_amplpy_exceptions_pxi __pyx_mstate_global->__pyx_kp_s_amplpy_exceptions_pxi
#define __pyx_kp_s_amplpy_iterators_pxi __pyx_mstate_global->__pyx_kp_s_amplpy_iterators_pxi
#define __pyx_kp_s_amplpy_objective_pxi __pyx_mstate_global->__pyx_kp_s_amplpy_objective_pxi
#define __pyx_kp_s_amplpy_outputhandler_pxi __pyx_mstate_global->__pyx_kp_s_amplpy_outputhandler_pxi
#define __pyx_kp_s_amplpy_parameter_pxi __pyx_mstate_global->__pyx_kp_s_amplpy_parameter_pxi
#define __pyx_kp_s_amplpy_set_pxi __pyx_mstate_global->__pyx_kp_s_amplpy_set_pxi
#define __pyx_kp_s_amplpy_variable_pxi __pyx_mstate_global->__pyx_kp_s_amplpy_variable_pxi
#define __pyx_n_s_args __pyx_mstate_global->__pyx_n_s_args
#define __pyx_n_s_arity __pyx_mstate_global->__pyx_n_s_arity
#define __pyx_n_s_array __pyx_mstate_global->__pyx_n_s_array
#define __pyx_n_s_ast __pyx_mstate_global->__pyx_n_s_ast
#define __pyx_n_s_astatus __pyx_mstate_global->__pyx_n_s_astatus
#define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines
#define __pyx_n_s_auxfiles __pyx_mstate_global->__pyx_n_s_auxfiles
#define __pyx_n_s_bin_dir __pyx_mstate_global->__pyx_n_s_bin_dir
#define __pyx_n_s_bin_dir_c __pyx_mstate_global->__pyx_n_s_bin_dir_c
#define __pyx_n_s_bin_name __pyx_mstate_global->__pyx_n_s_bin_name
#define __pyx_n_s_bin_name_c __pyx_mstate_global->__pyx_n_s_bin_name_c
#define __pyx_n_s_binary_directory __pyx_mstate_global->__pyx_n_s_binary_directory
#define __pyx_n_s_binary_name __pyx_mstate_global->__pyx_n_s_binary_name
#define __pyx_n_s_body __pyx_mstate_global->__pyx_n_s_body
#define __pyx_n_u_c __pyx_mstate_global->__pyx_n_u_c
#define __pyx_n_s_c_double_array __pyx_mstate_global->__pyx_n_s_c_double_array
#define __pyx_n_s_c_string_array __pyx_mstate_global->__pyx_n_s_c_string_array
#define __pyx_kp_u_cannot_convert_to_dictionary_wit __pyx_mstate_global->__pyx_kp_u_cannot_convert_to_dictionary_wit
#define __pyx_n_s_cast_row __pyx_mstate_global->__pyx_n_s_cast_row
#define __pyx_n_s_cast_value __pyx_mstate_global->__pyx_n_s_cast_value
#define __pyx_n_s_cd __pyx_mstate_global->__pyx_n_s_cd
#define __pyx_n_s_chain __pyx_mstate_global->__pyx_n_s_chain
#define __pyx_n_s_cindex __pyx_mstate_global->__pyx_n_s_cindex
#define __pyx_n_s_class_getitem __pyx_mstate_global->__pyx_n_s_class_getitem
#define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback
#define __pyx_n_s_close __pyx_mstate_global->__pyx_n_s_close
#define __pyx_n_s_cls __pyx_mstate_global->__pyx_n_s_cls
#define __pyx_n_s_cname __pyx_mstate_global->__pyx_n_s_cname
#define __pyx_n_s_col __pyx_mstate_global->__pyx_n_s_col
#define __pyx_n_s_collections_abc __pyx_mstate_global->__pyx_n_s_collections_abc
#define __pyx_n_s_column __pyx_mstate_global->__pyx_n_s_column
#define __pyx_n_s_column_names __pyx_mstate_global->__pyx_n_s_column_names
#define __pyx_n_s_columns __pyx_mstate_global->__pyx_n_s_columns
#define __pyx_n_s_con __pyx_mstate_global->__pyx_n_s_con
#define __pyx_n_s_con_2 __pyx_mstate_global->__pyx_n_s_con_2
#define __pyx_n_s_con_locals_Constraints __pyx_mstate_global->__pyx_n_s_con_locals_Constraints
#define __pyx_n_s_con_locals_Constraints___getite __pyx_mstate_global->__pyx_n_s_con_locals_Constraints___getite
#define __pyx_n_s_con_locals_Constraints___init __pyx_mstate_global->__pyx_n_s_con_locals_Constraints___init
#define __pyx_n_s_con_locals_Constraints___iter __pyx_mstate_global->__pyx_n_s_con_locals_Constraints___iter
#define __pyx_n_s_con_locals_Constraints___setite __pyx_mstate_global->__pyx_n_s_con_locals_Constraints___setite
#define __pyx_n_s_contains __pyx_mstate_global->__pyx_n_s_contains
#define __pyx_n_s_contains_c __pyx_mstate_global->__pyx_n_s_contains_c
#define __pyx_n_s_conv_to_list __pyx_mstate_global->__pyx_n_s_conv_to_list
#define __pyx_n_s_d __pyx_mstate_global->__pyx_n_s_d
#define __pyx_n_s_data __pyx_mstate_global->__pyx_n_s_data
#define __pyx_n_s_data_c __pyx_mstate_global->__pyx_n_s_data_c
#define __pyx_n_s_data_frame __pyx_mstate_global->__pyx_n_s_data_frame
#define __pyx_n_s_defeqn __pyx_mstate_global->__pyx_n_s_defeqn
#define __pyx_n_s_defvar __pyx_mstate_global->__pyx_n_s_defvar
#define __pyx_n_s_df __pyx_mstate_global->__pyx_n_s_df
#define __pyx_n_s_df_c __pyx_mstate_global->__pyx_n_s_df_c
#define __pyx_n_s_df_ref __pyx_mstate_global->__pyx_n_s_df_ref
#define __pyx_n_s_dic __pyx_mstate_global->__pyx_n_s_dic
#define __pyx_n_s_dict __pyx_mstate_global->__pyx_n_s_dict
#define __pyx_n_s_dict_2 __pyx_mstate_global->__pyx_n_s_dict_2
#define __pyx_n_s_dimen __pyx_mstate_global->__pyx_n_s_dimen
#define __pyx_n_s_dinit __pyx_mstate_global->__pyx_n_s_dinit
#define __pyx_n_s_dinit0 __pyx_mstate_global->__pyx_n_s_dinit0
#define __pyx_kp_u_disable __pyx_mstate_global->__pyx_kp_u_disable
#define __pyx_n_s_display __pyx_mstate_global->__pyx_n_s_display
#define __pyx_n_u_display __pyx_mstate_global->__pyx_n_u_display
#define __pyx_n_s_display_error_message __pyx_mstate_global->__pyx_n_s_display_error_message
#define __pyx_n_s_doc __pyx_mstate_global->__pyx_n_s_doc
#define __pyx_n_s_drop __pyx_mstate_global->__pyx_n_s_drop
#define __pyx_n_s_dual __pyx_mstate_global->__pyx_n_s_dual
#define __pyx_n_s_e __pyx_mstate_global->__pyx_n_s_e
#define __pyx_kp_u_enable __pyx_mstate_global->__pyx_kp_u_enable
#define __pyx_n_s_encode __pyx_mstate_global->__pyx_n_s_encode
#define __pyx_n_s_end __pyx_mstate_global->__pyx_n_s_end
#define __pyx_n_s_endswith __pyx_mstate_global->__pyx_n_s_endswith
#define __pyx_n_s_entity __pyx_mstate_global->__pyx_n_s_entity
#define __pyx_n_s_entitytype __pyx_mstate_global->__pyx_n_s_entitytype
#define __pyx_n_s_enum __pyx_mstate_global->__pyx_n_s_enum
#define __pyx_n_s_enumerate __pyx_mstate_global->__pyx_n_s_enumerate
#define __pyx_n_s_environ __pyx_mstate_global->__pyx_n_s_environ
#define __pyx_n_s_environment __pyx_mstate_global->__pyx_n_s_environment
#define __pyx_n_s_error __pyx_mstate_global->__pyx_n_s_error
#define __pyx_n_s_error_handler __pyx_mstate_global->__pyx_n_s_error_handler
#define __pyx_n_s_errorinfo __pyx_mstate_global->__pyx_n_s_errorinfo
#define __pyx_n_s_eval __pyx_mstate_global->__pyx_n_s_eval
#define __pyx_n_s_exception __pyx_mstate_global->__pyx_n_s_exception
#define __pyx_n_s_exists __pyx_mstate_global->__pyx_n_s_exists
#define __pyx_n_s_exitcode __pyx_mstate_global->__pyx_n_s_exitcode
#define __pyx_n_s_exp __pyx_mstate_global->__pyx_n_s_exp
#define __pyx_n_s_exportData __pyx_mstate_global->__pyx_n_s_exportData
#define __pyx_n_s_exportModel __pyx_mstate_global->__pyx_n_s_exportModel
#define __pyx_n_s_export_data __pyx_mstate_global->__pyx_n_s_export_data
#define __pyx_n_s_export_model __pyx_mstate_global->__pyx_n_s_export_model
#define __pyx_n_s_exprs __pyx_mstate_global->__pyx_n_s_exprs
#define __pyx_kp_u_file __pyx_mstate_global->__pyx_kp_u_file
#define __pyx_n_s_file_2 __pyx_mstate_global->__pyx_n_s_file_2
#define __pyx_n_s_filename __pyx_mstate_global->__pyx_n_s_filename
#define __pyx_n_s_find __pyx_mstate_global->__pyx_n_s_find
#define __pyx_n_s_fix __pyx_mstate_global->__pyx_n_s_fix
#define __pyx_n_s_flat __pyx_mstate_global->__pyx_n_s_flat
#define __pyx_n_s_flush __pyx_mstate_global->__pyx_n_s_flush
#define __pyx_n_s_fromDict __pyx_mstate_global->__pyx_n_s_fromDict
#define __pyx_n_s_fromNumpy __pyx_mstate_global->__pyx_n_s_fromNumpy
#define __pyx_n_s_fromPandas __pyx_mstate_global->__pyx_n_s_fromPandas
#define __pyx_n_s_from_arrays __pyx_mstate_global->__pyx_n_s_from_arrays
#define __pyx_n_s_from_data_frame_ref __pyx_mstate_global->__pyx_n_s_from_data_frame_ref
#define __pyx_n_s_from_dict __pyx_mstate_global->__pyx_n_s_from_dict
#define __pyx_n_s_from_dict_locals_genexpr __pyx_mstate_global->__pyx_n_s_from_dict_locals_genexpr
#define __pyx_n_s_from_dict_locals_to_tuple __pyx_mstate_global->__pyx_n_s_from_dict_locals_to_tuple
#define __pyx_n_s_from_numpy __pyx_mstate_global->__pyx_n_s_from_numpy
#define __pyx_n_s_from_pandas __pyx_mstate_global->__pyx_n_s_from_pandas
#define __pyx_n_s_from_tuples __pyx_mstate_global->__pyx_n_s_from_tuples
#define __pyx_kp_u_gc __pyx_mstate_global->__pyx_kp_u_gc
#define __pyx_n_s_genexpr __pyx_mstate_global->__pyx_n_s_genexpr
#define __pyx_n_s_get __pyx_mstate_global->__pyx_n_s_get
#define __pyx_n_s_getBinDir __pyx_mstate_global->__pyx_n_s_getBinDir
#define __pyx_n_s_getBinName __pyx_mstate_global->__pyx_n_s_getBinName
#define __pyx_n_s_getColumn __pyx_mstate_global->__pyx_n_s_getColumn
#define __pyx_n_s_getConstraint __pyx_mstate_global->__pyx_n_s_getConstraint
#define __pyx_n_s_getConstraints __pyx_mstate_global->__pyx_n_s_getConstraints
#define __pyx_n_s_getCurrentObjective __pyx_mstate_global->__pyx_n_s_getCurrentObjective
#define __pyx_n_s_getData __pyx_mstate_global->__pyx_n_s_getData
#define __pyx_n_s_getEntity __pyx_mstate_global->__pyx_n_s_getEntity
#define __pyx_n_s_getErrorHandler __pyx_mstate_global->__pyx_n_s_getErrorHandler
#define __pyx_n_s_getHeaders __pyx_mstate_global->__pyx_n_s_getHeaders
#define __pyx_n_s_getIndexingSets __pyx_mstate_global->__pyx_n_s_getIndexingSets
#define __pyx_n_s_getLineNumber __pyx_mstate_global->__pyx_n_s_getLineNumber
#define __pyx_n_s_getMessage __pyx_mstate_global->__pyx_n_s_getMessage
#define __pyx_n_s_getNumCols __pyx_mstate_global->__pyx_n_s_getNumCols
#define __pyx_n_s_getNumIndices __pyx_mstate_global->__pyx_n_s_getNumIndices
#define __pyx_n_s_getNumRows __pyx_mstate_global->__pyx_n_s_getNumRows
#define __pyx_n_s_getObjective __pyx_mstate_global->__pyx_n_s_getObjective
#define __pyx_n_s_getObjectives __pyx_mstate_global->__pyx_n_s_getObjectives
#define __pyx_n_s_getOffset __pyx_mstate_global->__pyx_n_s_getOffset
#define __pyx_n_s_getOption __pyx_mstate_global->__pyx_n_s_getOption
#define __pyx_n_s_getOutput __pyx_mstate_global->__pyx_n_s_getOutput
#define __pyx_n_s_getOutputHandler __pyx_mstate_global->__pyx_n_s_getOutputHandler
#define __pyx_n_s_getParameter __pyx_mstate_global->__pyx_n_s_getParameter
#define __pyx_n_s_getParameters __pyx_mstate_global->__pyx_n_s_getParameters
#define __pyx_n_s_getRow __pyx_mstate_global->__pyx_n_s_getRow
#define __pyx_n_s_getRowByIndex __pyx_mstate_global->__pyx_n_s_getRowByIndex
#define __pyx_n_s_getSet __pyx_mstate_global->__pyx_n_s_getSet
#define __pyx_n_s_getSets __pyx_mstate_global->__pyx_n_s_getSets
#define __pyx_n_s_getSourceName __pyx_mstate_global->__pyx_n_s_getSourceName
#define __pyx_n_s_getValue __pyx_mstate_global->__pyx_n_s_getValue
#define __pyx_n_s_getValues __pyx_mstate_global->__pyx_n_s_getValues
#define __pyx_n_s_getVariable __pyx_mstate_global->__pyx_n_s_getVariable
#define __pyx_n_s_getVariables __pyx_mstate_global->__pyx_n_s_getVariables
#define __pyx_n_s_get_bin_dir __pyx_mstate_global->__pyx_n_s_get_bin_dir
#define __pyx_n_s_get_bin_name __pyx_mstate_global->__pyx_n_s_get_bin_name
#define __pyx_n_s_get_column __pyx_mstate_global->__pyx_n_s_get_column
#define __pyx_n_s_get_constraint __pyx_mstate_global->__pyx_n_s_get_constraint
#define __pyx_n_s_get_constraints __pyx_mstate_global->__pyx_n_s_get_constraints
#define __pyx_n_s_get_current_objective __pyx_mstate_global->__pyx_n_s_get_current_objective
#define __pyx_n_s_get_data __pyx_mstate_global->__pyx_n_s_get_data
#define __pyx_n_s_get_entity __pyx_mstate_global->__pyx_n_s_get_entity
#define __pyx_n_s_get_error_handler __pyx_mstate_global->__pyx_n_s_get_error_handler
#define __pyx_n_s_get_headers __pyx_mstate_global->__pyx_n_s_get_headers
#define __pyx_n_s_get_headers_locals_genexpr __pyx_mstate_global->__pyx_n_s_get_headers_locals_genexpr
#define __pyx_n_s_get_iis __pyx_mstate_global->__pyx_n_s_get_iis
#define __pyx_n_s_get_indexing_sets __pyx_mstate_global->__pyx_n_s_get_indexing_sets
#define __pyx_n_s_get_line_number __pyx_mstate_global->__pyx_n_s_get_line_number
#define __pyx_n_s_get_message __pyx_mstate_global->__pyx_n_s_get_message
#define __pyx_n_s_get_num_cols __pyx_mstate_global->__pyx_n_s_get_num_cols
#define __pyx_n_s_get_num_indices __pyx_mstate_global->__pyx_n_s_get_num_indices
#define __pyx_n_s_get_num_rows __pyx_mstate_global->__pyx_n_s_get_num_rows
#define __pyx_n_s_get_objective __pyx_mstate_global->__pyx_n_s_get_objective
#define __pyx_n_s_get_objectives __pyx_mstate_global->__pyx_n_s_get_objectives
#define __pyx_n_s_get_offset __pyx_mstate_global->__pyx_n_s_get_offset
#define __pyx_n_s_get_option __pyx_mstate_global->__pyx_n_s_get_option
#define __pyx_n_s_get_output __pyx_mstate_global->__pyx_n_s_get_output
#define __pyx_n_s_get_output_handler __pyx_mstate_global->__pyx_n_s_get_output_handler
#define __pyx_n_s_get_parameter __pyx_mstate_global->__pyx_n_s_get_parameter
#define __pyx_n_s_get_parameters __pyx_mstate_global->__pyx_n_s_get_parameters
#define __pyx_n_s_get_row __pyx_mstate_global->__pyx_n_s_get_row
#define __pyx_n_s_get_row_by_index __pyx_mstate_global->__pyx_n_s_get_row_by_index
#define __pyx_n_s_get_set __pyx_mstate_global->__pyx_n_s_get_set
#define __pyx_n_s_get_sets __pyx_mstate_global->__pyx_n_s_get_sets
#define __pyx_n_s_get_solution __pyx_mstate_global->__pyx_n_s_get_solution
#define __pyx_n_s_get_source_name __pyx_mstate_global->__pyx_n_s_get_source_name
#define __pyx_n_s_get_value __pyx_mstate_global->__pyx_n_s_get_value
#define __pyx_n_s_get_values __pyx_mstate_global->__pyx_n_s_get_values
#define __pyx_n_s_get_variable __pyx_mstate_global->__pyx_n_s_get_variable
#define __pyx_n_s_get_variables __pyx_mstate_global->__pyx_n_s_get_variables
#define __pyx_n_s_getitem __pyx_mstate_global->__pyx_n_s_getitem
#define __pyx_n_s_getstate __pyx_mstate_global->__pyx_n_s_getstate
#define __pyx_n_s_hasDefault __pyx_mstate_global->__pyx_n_s_hasDefault
#define __pyx_n_s_has_default __pyx_mstate_global->__pyx_n_s_has_default
#define __pyx_n_s_header __pyx_mstate_global->__pyx_n_s_header
#define __pyx_n_s_headers __pyx_mstate_global->__pyx_n_s_headers
#define __pyx_n_s_headers_py __pyx_mstate_global->__pyx_n_s_headers_py
#define __pyx_n_s_i __pyx_mstate_global->__pyx_n_s_i
#define __pyx_kp_u_i_in_1__ncons__con_i_iis_non__c __pyx_mstate_global->__pyx_kp_u_i_in_1__ncons__con_i_iis_non__c
#define __pyx_kp_u_i_in_1__nvars__var_i_iis_non__v __pyx_mstate_global->__pyx_kp_u_i_in_1__nvars__var_i_iis_non__v
#define __pyx_kp_u_i_in_1__nvars__var_i_val_0__var __pyx_mstate_global->__pyx_kp_u_i_in_1__nvars__var_i_val_0__var
#define __pyx_kp_u_i_in_1__nvars__varname_i__var_i __pyx_mstate_global->__pyx_kp_u_i_in_1__nvars__varname_i__var_i
#define __pyx_n_s_iis_con __pyx_mstate_global->__pyx_n_s_iis_con
#define __pyx_n_s_iis_var __pyx_mstate_global->__pyx_n_s_iis_var
#define __pyx_n_s_impl __pyx_mstate_global->__pyx_n_s_impl
#define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import
#define __pyx_n_s_index __pyx_mstate_global->__pyx_n_s_index
#define __pyx_n_u_index __pyx_mstate_global->__pyx_n_u_index
#define __pyx_n_s_index_c __pyx_mstate_global->__pyx_n_s_index_c
#define __pyx_n_s_index_names __pyx_mstate_global->__pyx_n_s_index_names
#define __pyx_n_s_indexarity __pyx_mstate_global->__pyx_n_s_indexarity
#define __pyx_n_s_indices_c __pyx_mstate_global->__pyx_n_s_indices_c
#define __pyx_n_s_init __pyx_mstate_global->__pyx_n_s_init
#define __pyx_n_s_init0 __pyx_mstate_global->__pyx_n_s_init0
#define __pyx_n_s_init_2 __pyx_mstate_global->__pyx_n_s_init_2
#define __pyx_n_s_init_subclass __pyx_mstate_global->__pyx_n_s_init_subclass
#define __pyx_n_s_initializing __pyx_mstate_global->__pyx_n_s_initializing
#define __pyx_n_s_instances __pyx_mstate_global->__pyx_n_s_instances
#define __pyx_n_s_isLogical __pyx_mstate_global->__pyx_n_s_isLogical
#define __pyx_n_s_isRunning __pyx_mstate_global->__pyx_n_s_isRunning
#define __pyx_n_s_isScalar __pyx_mstate_global->__pyx_n_s_isScalar
#define __pyx_n_s_isSymbolic __pyx_mstate_global->__pyx_n_s_isSymbolic
#define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine
#define __pyx_n_s_is_logical __pyx_mstate_global->__pyx_n_s_is_logical
#define __pyx_n_s_is_running __pyx_mstate_global->__pyx_n_s_is_running
#define __pyx_n_s_is_scalar __pyx_mstate_global->__pyx_n_s_is_scalar
#define __pyx_n_s_is_symbolic __pyx_mstate_global->__pyx_n_s_is_symbolic
#define __pyx_kp_u_isenabled __pyx_mstate_global->__pyx_kp_u_isenabled
#define __pyx_n_s_isrunning __pyx_mstate_global->__pyx_n_s_isrunning
#define __pyx_n_s_items __pyx_mstate_global->__pyx_n_s_items
#define __pyx_n_s_iter __pyx_mstate_global->__pyx_n_s_iter
#define __pyx_n_s_iter___locals_genexpr __pyx_mstate_global->__pyx_n_s_iter___locals_genexpr
#define __pyx_n_s_itertools __pyx_mstate_global->__pyx_n_s_itertools
#define __pyx_n_s_j __pyx_mstate_global->__pyx_n_s_j
#define __pyx_n_s_key __pyx_mstate_global->__pyx_n_s_key
#define __pyx_n_s_keys __pyx_mstate_global->__pyx_n_s_keys
#define __pyx_n_s_kind __pyx_mstate_global->__pyx_n_s_kind
#define __pyx_n_s_kwargs __pyx_mstate_global->__pyx_n_s_kwargs
#define __pyx_n_s_lb __pyx_mstate_global->__pyx_n_s_lb
#define __pyx_n_s_lb0 __pyx_mstate_global->__pyx_n_s_lb0
#define __pyx_n_s_lb1 __pyx_mstate_global->__pyx_n_s_lb1
#define __pyx_n_s_lb2 __pyx_mstate_global->__pyx_n_s_lb2
#define __pyx_n_s_lbs __pyx_mstate_global->__pyx_n_s_lbs
#define __pyx_n_s_ldual __pyx_mstate_global->__pyx_n_s_ldual
#define __pyx_n_s_line_number __pyx_mstate_global->__pyx_n_s_line_number
#define __pyx_n_s_literal_eval __pyx_mstate_global->__pyx_n_s_literal_eval
#define __pyx_n_s_loadSession __pyx_mstate_global->__pyx_n_s_loadSession
#define __pyx_n_s_load_session __pyx_mstate_global->__pyx_n_s_load_session
#define __pyx_n_s_lrc __pyx_mstate_global->__pyx_n_s_lrc
#define __pyx_n_s_lslack __pyx_mstate_global->__pyx_n_s_lslack
#define __pyx_n_s_lst __pyx_mstate_global->__pyx_n_s_lst
#define __pyx_n_s_lst_columns __pyx_mstate_global->__pyx_n_s_lst_columns
#define __pyx_n_s_lst_index __pyx_mstate_global->__pyx_n_s_lst_index
#define __pyx_n_s_lst_solution __pyx_mstate_global->__pyx_n_s_lst_solution
#define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main
#define __pyx_n_s_map __pyx_mstate_global->__pyx_n_s_map
#define __pyx_n_s_members __pyx_mstate_global->__pyx_n_s_members
#define __pyx_n_s_message __pyx_mstate_global->__pyx_n_s_message
#define __pyx_n_s_metaclass __pyx_mstate_global->__pyx_n_s_metaclass
#define __pyx_n_s_minimization __pyx_mstate_global->__pyx_n_s_minimization
#define __pyx_n_u_minimize __pyx_mstate_global->__pyx_n_u_minimize
#define __pyx_n_s_model __pyx_mstate_global->__pyx_n_s_model
#define __pyx_n_s_model_c __pyx_mstate_global->__pyx_n_s_model_c
#define __pyx_n_s_module __pyx_mstate_global->__pyx_n_s_module
#define __pyx_n_s_mro_entries __pyx_mstate_global->__pyx_n_s_mro_entries
#define __pyx_n_s_msg __pyx_mstate_global->__pyx_n_s_msg
#define __pyx_n_s_multi_index __pyx_mstate_global->__pyx_n_s_multi_index
#define __pyx_n_s_n __pyx_mstate_global->__pyx_n_s_n
#define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name
#define __pyx_n_s_name_2 __pyx_mstate_global->__pyx_n_s_name_2
#define __pyx_n_s_name_c __pyx_mstate_global->__pyx_n_s_name_c
#define __pyx_n_s_name_c_2 __pyx_mstate_global->__pyx_n_s_name_c_2
#define __pyx_n_s_names __pyx_mstate_global->__pyx_n_s_names
#define __pyx_n_s_ncols __pyx_mstate_global->__pyx_n_s_ncols
#define __pyx_n_s_ncolumns __pyx_mstate_global->__pyx_n_s_ncolumns
#define __pyx_n_s_ndarray __pyx_mstate_global->__pyx_n_s_ndarray
#define __pyx_n_s_nested __pyx_mstate_global->__pyx_n_s_nested
#define __pyx_n_s_nested_dict_of_suffixes __pyx_mstate_global->__pyx_n_s_nested_dict_of_suffixes
#define __pyx_n_s_new __pyx_mstate_global->__pyx_n_s_new
#define __pyx_n_s_nindices __pyx_mstate_global->__pyx_n_s_nindices
#define __pyx_n_s_nlevels __pyx_mstate_global->__pyx_n_s_nlevels
#define __pyx_kp_s_no_default___reduce___due_to_non __pyx_mstate_global->__pyx_kp_s_no_default___reduce___due_to_non
#define __pyx_n_s_np __pyx_mstate_global->__pyx_n_s_np
#define __pyx_n_u_nt __pyx_mstate_global->__pyx_n_u_nt
#define __pyx_n_s_num __pyx_mstate_global->__pyx_n_s_num
#define __pyx_n_s_numInstances __pyx_mstate_global->__pyx_n_s_numInstances
#define __pyx_n_s_num_instances __pyx_mstate_global->__pyx_n_s_num_instances
#define __pyx_n_s_numbers __pyx_mstate_global->__pyx_n_s_numbers
#define __pyx_n_s_numpy __pyx_mstate_global->__pyx_n_s_numpy
#define __pyx_n_s_obj __pyx_mstate_global->__pyx_n_s_obj
#define __pyx_n_s_obj_2 __pyx_mstate_global->__pyx_n_s_obj_2
#define __pyx_n_s_obj_locals_Objectives __pyx_mstate_global->__pyx_n_s_obj_locals_Objectives
#define __pyx_n_s_obj_locals_Objectives___getitem __pyx_mstate_global->__pyx_n_s_obj_locals_Objectives___getitem
#define __pyx_n_s_obj_locals_Objectives___init __pyx_mstate_global->__pyx_n_s_obj_locals_Objectives___init
#define __pyx_n_s_obj_locals_Objectives___iter __pyx_mstate_global->__pyx_n_s_obj_locals_Objectives___iter
#define __pyx_n_s_object __pyx_mstate_global->__pyx_n_s_object
#define __pyx_n_s_objname __pyx_mstate_global->__pyx_n_s_objname
#define __pyx_n_s_objname_c __pyx_mstate_global->__pyx_n_s_objname_c
#define __pyx_n_s_offset __pyx_mstate_global->__pyx_n_s_offset
#define __pyx_n_s_open __pyx_mstate_global->__pyx_n_s_open
#define __pyx_n_s_option __pyx_mstate_global->__pyx_n_s_option
#define __pyx_n_s_option_2 __pyx_mstate_global->__pyx_n_s_option_2
#define __pyx_n_s_option_locals_Options __pyx_mstate_global->__pyx_n_s_option_locals_Options
#define __pyx_n_s_option_locals_Options___getitem __pyx_mstate_global->__pyx_n_s_option_locals_Options___getitem
#define __pyx_n_s_option_locals_Options___init __pyx_mstate_global->__pyx_n_s_option_locals_Options___init
#define __pyx_n_s_option_locals_Options___setitem __pyx_mstate_global->__pyx_n_s_option_locals_Options___setitem
#define __pyx_n_u_options __pyx_mstate_global->__pyx_n_u_options
#define __pyx_n_s_options_2 __pyx_mstate_global->__pyx_n_s_options_2
#define __pyx_n_s_options_c __pyx_mstate_global->__pyx_n_s_options_c
#define __pyx_n_s_os __pyx_mstate_global->__pyx_n_s_os
#define __pyx_n_s_output __pyx_mstate_global->__pyx_n_s_output
#define __pyx_n_s_output_c __pyx_mstate_global->__pyx_n_s_output_c
#define __pyx_n_s_output_handler __pyx_mstate_global->__pyx_n_s_output_handler
#define __pyx_n_s_p __pyx_mstate_global->__pyx_n_s_p
#define __pyx_n_s_pandas __pyx_mstate_global->__pyx_n_s_pandas
#define __pyx_n_s_param __pyx_mstate_global->__pyx_n_s_param
#define __pyx_n_s_param_2 __pyx_mstate_global->__pyx_n_s_param_2
#define __pyx_n_s_param_locals_Parameters __pyx_mstate_global->__pyx_n_s_param_locals_Parameters
#define __pyx_n_s_param_locals_Parameters___getit __pyx_mstate_global->__pyx_n_s_param_locals_Parameters___getit
#define __pyx_n_s_param_locals_Parameters___init __pyx_mstate_global->__pyx_n_s_param_locals_Parameters___init
#define __pyx_n_s_param_locals_Parameters___iter __pyx_mstate_global->__pyx_n_s_param_locals_Parameters___iter
#define __pyx_n_s_param_locals_Parameters___setit __pyx_mstate_global->__pyx_n_s_param_locals_Parameters___setit
#define __pyx_n_s_path __pyx_mstate_global->__pyx_n_s_path
#define __pyx_n_s_pd __pyx_mstate_global->__pyx_n_s_pd
#define __pyx_n_s_pickle __pyx_mstate_global->__pyx_n_s_pickle
#define __pyx_n_s_prepare __pyx_mstate_global->__pyx_n_s_prepare
#define __pyx_n_s_print __pyx_mstate_global->__pyx_n_s_print
#define __pyx_n_s_problem __pyx_mstate_global->__pyx_n_s_problem
#define __pyx_n_s_property __pyx_mstate_global->__pyx_n_s_property
#define __pyx_n_s_py_list __pyx_mstate_global->__pyx_n_s_py_list
#define __pyx_n_s_py_variant __pyx_mstate_global->__pyx_n_s_py_variant
#define __pyx_n_s_pylist __pyx_mstate_global->__pyx_n_s_pylist
#define __pyx_n_s_pyx_PickleError __pyx_mstate_global->__pyx_n_s_pyx_PickleError
#define __pyx_n_s_pyx_checksum __pyx_mstate_global->__pyx_n_s_pyx_checksum
#define __pyx_n_s_pyx_result __pyx_mstate_global->__pyx_n_s_pyx_result
#define __pyx_n_s_pyx_state __pyx_mstate_global->__pyx_n_s_pyx_state
#define __pyx_n_s_pyx_type __pyx_mstate_global->__pyx_n_s_pyx_type
#define __pyx_n_s_pyx_unpickle_ErrorHandler __pyx_mstate_global->__pyx_n_s_pyx_unpickle_ErrorHandler
#define __pyx_n_s_pyx_unpickle_OutputHandler __pyx_mstate_global->__pyx_n_s_pyx_unpickle_OutputHandler
#define __pyx_n_s_pyx_vtable __pyx_mstate_global->__pyx_n_s_pyx_vtable
#define __pyx_n_s_qualname __pyx_mstate_global->__pyx_n_s_qualname
#define __pyx_n_s_range __pyx_mstate_global->__pyx_n_s_range
#define __pyx_n_s_rc __pyx_mstate_global->__pyx_n_s_rc
#define __pyx_n_s_read __pyx_mstate_global->__pyx_n_s_read
#define __pyx_n_s_readData __pyx_mstate_global->__pyx_n_s_readData
#define __pyx_n_s_readTable __pyx_mstate_global->__pyx_n_s_readTable
#define __pyx_n_s_read_data __pyx_mstate_global->__pyx_n_s_read_data
#define __pyx_n_s_read_table __pyx_mstate_global->__pyx_n_s_read_table
#define __pyx_n_s_reduce __pyx_mstate_global->__pyx_n_s_reduce
#define __pyx_n_s_reduce_cython __pyx_mstate_global->__pyx_n_s_reduce_cython
#define __pyx_n_s_reduce_ex __pyx_mstate_global->__pyx_n_s_reduce_ex
#define __pyx_n_s_reset __pyx_mstate_global->__pyx_n_s_reset
#define __pyx_n_s_restore __pyx_mstate_global->__pyx_n_s_restore
#define __pyx_n_s_result __pyx_mstate_global->__pyx_n_s_result
#define __pyx_n_s_return_output __pyx_mstate_global->__pyx_n_s_return_output
#define __pyx_n_s_row __pyx_mstate_global->__pyx_n_s_row
#define __pyx_n_s_rowindex __pyx_mstate_global->__pyx_n_s_rowindex
#define __pyx_n_s_scalar_expression __pyx_mstate_global->__pyx_n_s_scalar_expression
#define __pyx_n_s_self __pyx_mstate_global->__pyx_n_s_self
#define __pyx_kp_s_self__c_ampl_cannot_be_converted __pyx_mstate_global->__pyx_kp_s_self__c_ampl_cannot_be_converted
#define __pyx_kp_s_self__c_ampl_self__index_cannot __pyx_mstate_global->__pyx_kp_s_self__c_ampl_self__index_cannot
#define __pyx_kp_s_self__c_ampl_self__index_self_be __pyx_mstate_global->__pyx_kp_s_self__c_ampl_self__index_self_be
#define __pyx_kp_s_self__c_ampl_self_begin_self_end __pyx_mstate_global->__pyx_kp_s_self__c_ampl_self_begin_self_end
#define __pyx_kp_s_self__df_cannot_be_converted_to __pyx_mstate_global->__pyx_kp_s_self__df_cannot_be_converted_to
#define __pyx_kp_s_self_begin_self_end_self_env_c_s __pyx_mstate_global->__pyx_kp_s_self_begin_self_end_self_env_c_s
#define __pyx_n_s_send __pyx_mstate_global->__pyx_n_s_send
#define __pyx_n_s_set __pyx_mstate_global->__pyx_n_s_set
#define __pyx_n_s_setBinDir __pyx_mstate_global->__pyx_n_s_setBinDir
#define __pyx_n_s_setBinName __pyx_mstate_global->__pyx_n_s_setBinName
#define __pyx_n_s_setColumn __pyx_mstate_global->__pyx_n_s_setColumn
#define __pyx_n_s_setData __pyx_mstate_global->__pyx_n_s_setData
#define __pyx_n_s_setDual __pyx_mstate_global->__pyx_n_s_setDual
#define __pyx_n_s_setErrorHandler __pyx_mstate_global->__pyx_n_s_setErrorHandler
#define __pyx_n_s_setOption __pyx_mstate_global->__pyx_n_s_setOption
#define __pyx_n_s_setOutputHandler __pyx_mstate_global->__pyx_n_s_setOutputHandler
#define __pyx_n_s_setValue __pyx_mstate_global->__pyx_n_s_setValue
#define __pyx_n_s_setValues __pyx_mstate_global->__pyx_n_s_setValues
#define __pyx_n_s_setValues_2 __pyx_mstate_global->__pyx_n_s_setValues_2
#define __pyx_n_s_set_2 __pyx_mstate_global->__pyx_n_s_set_2
#define __pyx_n_s_set_bin_dir __pyx_mstate_global->__pyx_n_s_set_bin_dir
#define __pyx_n_s_set_bin_name __pyx_mstate_global->__pyx_n_s_set_bin_name
#define __pyx_n_s_set_column __pyx_mstate_global->__pyx_n_s_set_column
#define __pyx_n_s_set_data __pyx_mstate_global->__pyx_n_s_set_data
#define __pyx_n_s_set_dual __pyx_mstate_global->__pyx_n_s_set_dual
#define __pyx_n_s_set_error_handler __pyx_mstate_global->__pyx_n_s_set_error_handler
#define __pyx_n_s_set_locals_Sets __pyx_mstate_global->__pyx_n_s_set_locals_Sets
#define __pyx_n_s_set_locals_Sets___getitem __pyx_mstate_global->__pyx_n_s_set_locals_Sets___getitem
#define __pyx_n_s_set_locals_Sets___init __pyx_mstate_global->__pyx_n_s_set_locals_Sets___init
#define __pyx_n_s_set_locals_Sets___iter __pyx_mstate_global->__pyx_n_s_set_locals_Sets___iter
#define __pyx_n_s_set_locals_Sets___setitem __pyx_mstate_global->__pyx_n_s_set_locals_Sets___setitem
#define __pyx_n_s_set_name __pyx_mstate_global->__pyx_n_s_set_name
#define __pyx_n_s_set_name_2 __pyx_mstate_global->__pyx_n_s_set_name_2
#define __pyx_n_s_set_option __pyx_mstate_global->__pyx_n_s_set_option
#define __pyx_n_s_set_output_handler __pyx_mstate_global->__pyx_n_s_set_output_handler
#define __pyx_n_s_set_value __pyx_mstate_global->__pyx_n_s_set_value
#define __pyx_n_s_set_values __pyx_mstate_global->__pyx_n_s_set_values
#define __pyx_n_s_set_values_2 __pyx_mstate_global->__pyx_n_s_set_values_2
#define __pyx_n_s_set_values_locals_cast_row __pyx_mstate_global->__pyx_n_s_set_values_locals_cast_row
#define __pyx_n_s_set_values_locals_cast_value __pyx_mstate_global->__pyx_n_s_set_values_locals_cast_value
#define __pyx_n_s_set_values_locals_conv_to_list __pyx_mstate_global->__pyx_n_s_set_values_locals_conv_to_list
#define __pyx_n_s_set_values_locals_genexpr __pyx_mstate_global->__pyx_n_s_set_values_locals_genexpr
#define __pyx_n_s_setitem __pyx_mstate_global->__pyx_n_s_setitem
#define __pyx_n_s_sets __pyx_mstate_global->__pyx_n_s_sets
#define __pyx_n_s_setstate __pyx_mstate_global->__pyx_n_s_setstate
#define __pyx_n_s_setstate_cython __pyx_mstate_global->__pyx_n_s_setstate_cython
#define __pyx_n_s_shape __pyx_mstate_global->__pyx_n_s_shape
#define __pyx_n_s_size __pyx_mstate_global->__pyx_n_s_size
#define __pyx_n_s_skip_index __pyx_mstate_global->__pyx_n_s_skip_index
#define __pyx_n_s_slack __pyx_mstate_global->__pyx_n_s_slack
#define __pyx_n_s_snapshot __pyx_mstate_global->__pyx_n_s_snapshot
#define __pyx_kp_u_solve __pyx_mstate_global->__pyx_kp_u_solve
#define __pyx_n_s_solve_2 __pyx_mstate_global->__pyx_n_s_solve_2
#define __pyx_n_u_solve_result __pyx_mstate_global->__pyx_n_u_solve_result
#define __pyx_n_u_solve_result_num __pyx_mstate_global->__pyx_n_u_solve_result_num
#define __pyx_n_s_solver __pyx_mstate_global->__pyx_n_s_solver
#define __pyx_n_u_solver __pyx_mstate_global->__pyx_n_u_solver
#define __pyx_n_s_source_name __pyx_mstate_global->__pyx_n_s_source_name
#define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec
#define __pyx_n_s_split __pyx_mstate_global->__pyx_n_s_split
#define __pyx_n_s_sstatus __pyx_mstate_global->__pyx_n_s_sstatus
#define __pyx_n_s_stack __pyx_mstate_global->__pyx_n_s_stack
#define __pyx_n_s_startRecording __pyx_mstate_global->__pyx_n_s_startRecording
#define __pyx_n_s_start_recording __pyx_mstate_global->__pyx_n_s_start_recording
#define __pyx_n_s_state __pyx_mstate_global->__pyx_n_s_state
#define __pyx_n_s_statements __pyx_mstate_global->__pyx_n_s_statements
#define __pyx_n_s_statements_c __pyx_mstate_global->__pyx_n_s_statements_c
#define __pyx_n_s_status __pyx_mstate_global->__pyx_n_s_status
#define __pyx_n_s_stderr __pyx_mstate_global->__pyx_n_s_stderr
#define __pyx_n_s_stmt __pyx_mstate_global->__pyx_n_s_stmt
#define __pyx_n_s_stopRecording __pyx_mstate_global->__pyx_n_s_stopRecording
#define __pyx_n_s_stop_recording __pyx_mstate_global->__pyx_n_s_stop_recording
#define __pyx_n_s_str __pyx_mstate_global->__pyx_n_s_str
#define __pyx_kp_s_stringsource __pyx_mstate_global->__pyx_kp_s_stringsource
#define __pyx_n_s_suffixes __pyx_mstate_global->__pyx_n_s_suffixes
#define __pyx_n_s_suffixes_c __pyx_mstate_global->__pyx_n_s_suffixes_c
#define __pyx_n_s_super __pyx_mstate_global->__pyx_n_s_super
#define __pyx_n_s_sys __pyx_mstate_global->__pyx_n_s_sys
#define __pyx_n_s_t __pyx_mstate_global->__pyx_n_s_t
#define __pyx_n_s_t_c __pyx_mstate_global->__pyx_n_s_t_c
#define __pyx_n_s_table_name __pyx_mstate_global->__pyx_n_s_table_name
#define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test
#define __pyx_n_s_throw __pyx_mstate_global->__pyx_n_s_throw
#define __pyx_n_s_toDict __pyx_mstate_global->__pyx_n_s_toDict
#define __pyx_n_s_toList __pyx_mstate_global->__pyx_n_s_toList
#define __pyx_n_s_toPandas __pyx_mstate_global->__pyx_n_s_toPandas
#define __pyx_n_s_toString __pyx_mstate_global->__pyx_n_s_toString
#define __pyx_n_s_to_dict __pyx_mstate_global->__pyx_n_s_to_dict
#define __pyx_n_s_to_list __pyx_mstate_global->__pyx_n_s_to_list
#define __pyx_n_s_to_pandas __pyx_mstate_global->__pyx_n_s_to_pandas
#define __pyx_n_s_to_string __pyx_mstate_global->__pyx_n_s_to_string
#define __pyx_n_s_to_string_c __pyx_mstate_global->__pyx_n_s_to_string_c
#define __pyx_n_s_to_tuple __pyx_mstate_global->__pyx_n_s_to_tuple
#define __pyx_n_s_tolist __pyx_mstate_global->__pyx_n_s_tolist
#define __pyx_n_s_tools __pyx_mstate_global->__pyx_n_s_tools
#define __pyx_n_s_tuple __pyx_mstate_global->__pyx_n_s_tuple
#define __pyx_n_s_tuple_c __pyx_mstate_global->__pyx_n_s_tuple_c
#define __pyx_n_s_ub __pyx_mstate_global->__pyx_n_s_ub
#define __pyx_n_s_ub0 __pyx_mstate_global->__pyx_n_s_ub0
#define __pyx_n_s_ub1 __pyx_mstate_global->__pyx_n_s_ub1
#define __pyx_n_s_ub2 __pyx_mstate_global->__pyx_n_s_ub2
#define __pyx_n_s_ubs __pyx_mstate_global->__pyx_n_s_ubs
#define __pyx_n_s_udual __pyx_mstate_global->__pyx_n_s_udual
#define __pyx_n_s_unfix __pyx_mstate_global->__pyx_n_s_unfix
#define __pyx_kp_u_unsupported_type __pyx_mstate_global->__pyx_kp_u_unsupported_type
#define __pyx_n_s_update __pyx_mstate_global->__pyx_n_s_update
#define __pyx_n_s_urc __pyx_mstate_global->__pyx_n_s_urc
#define __pyx_n_s_use_setstate __pyx_mstate_global->__pyx_n_s_use_setstate
#define __pyx_n_s_uslack __pyx_mstate_global->__pyx_n_s_uslack
#define __pyx_kp_u_utf_8 __pyx_mstate_global->__pyx_kp_u_utf_8
#define __pyx_n_s_v __pyx_mstate_global->__pyx_n_s_v
#define __pyx_n_s_val __pyx_mstate_global->__pyx_n_s_val
#define __pyx_n_s_value __pyx_mstate_global->__pyx_n_s_value
#define __pyx_n_u_value __pyx_mstate_global->__pyx_n_u_value
#define __pyx_n_s_value_c __pyx_mstate_global->__pyx_n_s_value_c
#define __pyx_n_s_values __pyx_mstate_global->__pyx_n_s_values
#define __pyx_n_s_var __pyx_mstate_global->__pyx_n_s_var
#define __pyx_n_s_var_2 __pyx_mstate_global->__pyx_n_s_var_2
#define __pyx_n_s_var_locals_Variables __pyx_mstate_global->__pyx_n_s_var_locals_Variables
#define __pyx_n_s_var_locals_Variables___getitem __pyx_mstate_global->__pyx_n_s_var_locals_Variables___getitem
#define __pyx_n_s_var_locals_Variables___init __pyx_mstate_global->__pyx_n_s_var_locals_Variables___init
#define __pyx_n_s_var_locals_Variables___iter __pyx_mstate_global->__pyx_n_s_var_locals_Variables___iter
#define __pyx_n_s_var_locals_Variables___setitem __pyx_mstate_global->__pyx_n_s_var_locals_Variables___setitem
#define __pyx_n_s_verbose __pyx_mstate_global->__pyx_n_s_verbose
#define __pyx_n_s_warning __pyx_mstate_global->__pyx_n_s_warning
#define __pyx_n_s_workdir __pyx_mstate_global->__pyx_n_s_workdir
#define __pyx_n_s_workdir_c __pyx_mstate_global->__pyx_n_s_workdir_c
#define __pyx_n_s_write __pyx_mstate_global->__pyx_n_s_write
#define __pyx_n_s_writeTable __pyx_mstate_global->__pyx_n_s_writeTable
#define __pyx_n_s_write_table __pyx_mstate_global->__pyx_n_s_write_table
#define __pyx_n_s_xref __pyx_mstate_global->__pyx_n_s_xref
#define __pyx_n_s_zeros __pyx_mstate_global->__pyx_n_s_zeros
#define __pyx_n_s_zip __pyx_mstate_global->__pyx_n_s_zip
#define __pyx_int_0 __pyx_mstate_global->__pyx_int_0
#define __pyx_int_1 __pyx_mstate_global->__pyx_int_1
#define __pyx_int_222419149 __pyx_mstate_global->__pyx_int_222419149
#define __pyx_int_228825662 __pyx_mstate_global->__pyx_int_228825662
#define __pyx_int_238750788 __pyx_mstate_global->__pyx_int_238750788
#define __pyx_k__14 __pyx_mstate_global->__pyx_k__14
#define __pyx_tuple_ __pyx_mstate_global->__pyx_tuple_
#define __pyx_tuple__2 __pyx_mstate_global->__pyx_tuple__2
#define __pyx_tuple__3 __pyx_mstate_global->__pyx_tuple__3
#define __pyx_tuple__4 __pyx_mstate_global->__pyx_tuple__4
#define __pyx_tuple__5 __pyx_mstate_global->__pyx_tuple__5
#define __pyx_tuple__6 __pyx_mstate_global->__pyx_tuple__6
#define __pyx_tuple__7 __pyx_mstate_global->__pyx_tuple__7
#define __pyx_tuple__8 __pyx_mstate_global->__pyx_tuple__8
#define __pyx_tuple__9 __pyx_mstate_global->__pyx_tuple__9
#define __pyx_tuple__10 __pyx_mstate_global->__pyx_tuple__10
#define __pyx_tuple__11 __pyx_mstate_global->__pyx_tuple__11
#define __pyx_tuple__12 __pyx_mstate_global->__pyx_tuple__12
#define __pyx_tuple__13 __pyx_mstate_global->__pyx_tuple__13
#define __pyx_tuple__15 __pyx_mstate_global->__pyx_tuple__15
#define __pyx_tuple__17 __pyx_mstate_global->__pyx_tuple__17
#define __pyx_tuple__18 __pyx_mstate_global->__pyx_tuple__18
#define __pyx_tuple__20 __pyx_mstate_global->__pyx_tuple__20
#define __pyx_tuple__23 __pyx_mstate_global->__pyx_tuple__23
#define __pyx_tuple__27 __pyx_mstate_global->__pyx_tuple__27
#define __pyx_tuple__28 __pyx_mstate_global->__pyx_tuple__28
#define __pyx_tuple__29 __pyx_mstate_global->__pyx_tuple__29
#define __pyx_tuple__31 __pyx_mstate_global->__pyx_tuple__31
#define __pyx_tuple__37 __pyx_mstate_global->__pyx_tuple__37
#define __pyx_tuple__42 __pyx_mstate_global->__pyx_tuple__42
#define __pyx_tuple__43 __pyx_mstate_global->__pyx_tuple__43
#define __pyx_tuple__44 __pyx_mstate_global->__pyx_tuple__44
#define __pyx_tuple__45 __pyx_mstate_global->__pyx_tuple__45
#define __pyx_tuple__46 __pyx_mstate_global->__pyx_tuple__46
#define __pyx_tuple__48 __pyx_mstate_global->__pyx_tuple__48
#define __pyx_tuple__50 __pyx_mstate_global->__pyx_tuple__50
#define __pyx_tuple__52 __pyx_mstate_global->__pyx_tuple__52
#define __pyx_tuple__54 __pyx_mstate_global->__pyx_tuple__54
#define __pyx_tuple__55 __pyx_mstate_global->__pyx_tuple__55
#define __pyx_tuple__60 __pyx_mstate_global->__pyx_tuple__60
#define __pyx_tuple__61 __pyx_mstate_global->__pyx_tuple__61
#define __pyx_tuple__65 __pyx_mstate_global->__pyx_tuple__65
#define __pyx_tuple__66 __pyx_mstate_global->__pyx_tuple__66
#define __pyx_tuple__69 __pyx_mstate_global->__pyx_tuple__69
#define __pyx_tuple__72 __pyx_mstate_global->__pyx_tuple__72
#define __pyx_tuple__73 __pyx_mstate_global->__pyx_tuple__73
#define __pyx_tuple__78 __pyx_mstate_global->__pyx_tuple__78
#define __pyx_tuple__79 __pyx_mstate_global->__pyx_tuple__79
#define __pyx_tuple__83 __pyx_mstate_global->__pyx_tuple__83
#define __pyx_tuple__85 __pyx_mstate_global->__pyx_tuple__85
#define __pyx_tuple__90 __pyx_mstate_global->__pyx_tuple__90
#define __pyx_tuple__107 __pyx_mstate_global->__pyx_tuple__107
#define __pyx_tuple__111 __pyx_mstate_global->__pyx_tuple__111
#define __pyx_tuple__117 __pyx_mstate_global->__pyx_tuple__117
#define __pyx_tuple__121 __pyx_mstate_global->__pyx_tuple__121
#define __pyx_tuple__123 __pyx_mstate_global->__pyx_tuple__123
#define __pyx_tuple__127 __pyx_mstate_global->__pyx_tuple__127
#define __pyx_tuple__129 __pyx_mstate_global->__pyx_tuple__129
#define __pyx_tuple__131 __pyx_mstate_global->__pyx_tuple__131
#define __pyx_tuple__132 __pyx_mstate_global->__pyx_tuple__132
#define __pyx_tuple__134 __pyx_mstate_global->__pyx_tuple__134
#define __pyx_tuple__136 __pyx_mstate_global->__pyx_tuple__136
#define __pyx_tuple__138 __pyx_mstate_global->__pyx_tuple__138
#define __pyx_tuple__140 __pyx_mstate_global->__pyx_tuple__140
#define __pyx_tuple__142 __pyx_mstate_global->__pyx_tuple__142
#define __pyx_tuple__144 __pyx_mstate_global->__pyx_tuple__144
#define __pyx_tuple__146 __pyx_mstate_global->__pyx_tuple__146
#define __pyx_tuple__148 __pyx_mstate_global->__pyx_tuple__148
#define __pyx_tuple__149 __pyx_mstate_global->__pyx_tuple__149
#define __pyx_tuple__151 __pyx_mstate_global->__pyx_tuple__151
#define __pyx_tuple__152 __pyx_mstate_global->__pyx_tuple__152
#define __pyx_tuple__154 __pyx_mstate_global->__pyx_tuple__154
#define __pyx_tuple__156 __pyx_mstate_global->__pyx_tuple__156
#define __pyx_tuple__158 __pyx_mstate_global->__pyx_tuple__158
#define __pyx_tuple__162 __pyx_mstate_global->__pyx_tuple__162
#define __pyx_tuple__164 __pyx_mstate_global->__pyx_tuple__164
#define __pyx_tuple__166 __pyx_mstate_global->__pyx_tuple__166
#define __pyx_tuple__170 __pyx_mstate_global->__pyx_tuple__170
#define __pyx_tuple__173 __pyx_mstate_global->__pyx_tuple__173
#define __pyx_tuple__175 __pyx_mstate_global->__pyx_tuple__175
#define __pyx_tuple__177 __pyx_mstate_global->__pyx_tuple__177
#define __pyx_tuple__179 __pyx_mstate_global->__pyx_tuple__179
#define __pyx_tuple__181 __pyx_mstate_global->__pyx_tuple__181
#define __pyx_tuple__185 __pyx_mstate_global->__pyx_tuple__185
#define __pyx_tuple__189 __pyx_mstate_global->__pyx_tuple__189
#define __pyx_tuple__191 __pyx_mstate_global->__pyx_tuple__191
#define __pyx_tuple__193 __pyx_mstate_global->__pyx_tuple__193
#define __pyx_tuple__195 __pyx_mstate_global->__pyx_tuple__195
#define __pyx_tuple__197 __pyx_mstate_global->__pyx_tuple__197
#define __pyx_tuple__201 __pyx_mstate_global->__pyx_tuple__201
#define __pyx_tuple__203 __pyx_mstate_global->__pyx_tuple__203
#define __pyx_tuple__206 __pyx_mstate_global->__pyx_tuple__206
#define __pyx_tuple__209 __pyx_mstate_global->__pyx_tuple__209
#define __pyx_tuple__216 __pyx_mstate_global->__pyx_tuple__216
#define __pyx_tuple__217 __pyx_mstate_global->__pyx_tuple__217
#define __pyx_tuple__218 __pyx_mstate_global->__pyx_tuple__218
#define __pyx_tuple__219 __pyx_mstate_global->__pyx_tuple__219
#define __pyx_tuple__246 __pyx_mstate_global->__pyx_tuple__246
#define __pyx_tuple__250 __pyx_mstate_global->__pyx_tuple__250
#define __pyx_tuple__251 __pyx_mstate_global->__pyx_tuple__251
#define __pyx_tuple__254 __pyx_mstate_global->__pyx_tuple__254
#define __pyx_tuple__256 __pyx_mstate_global->__pyx_tuple__256
#define __pyx_tuple__258 __pyx_mstate_global->__pyx_tuple__258
#define __pyx_tuple__263 __pyx_mstate_global->__pyx_tuple__263
#define __pyx_tuple__265 __pyx_mstate_global->__pyx_tuple__265
#define __pyx_tuple__269 __pyx_mstate_global->__pyx_tuple__269
#define __pyx_tuple__271 __pyx_mstate_global->__pyx_tuple__271
#define __pyx_tuple__302 __pyx_mstate_global->__pyx_tuple__302
#define __pyx_tuple__304 __pyx_mstate_global->__pyx_tuple__304
#define __pyx_tuple__306 __pyx_mstate_global->__pyx_tuple__306
#define __pyx_tuple__308 __pyx_mstate_global->__pyx_tuple__308
#define __pyx_tuple__314 __pyx_mstate_global->__pyx_tuple__314
#define __pyx_tuple__316 __pyx_mstate_global->__pyx_tuple__316
#define __pyx_tuple__320 __pyx_mstate_global->__pyx_tuple__320
#define __pyx_tuple__322 __pyx_mstate_global->__pyx_tuple__322
#define __pyx_tuple__324 __pyx_mstate_global->__pyx_tuple__324
#define __pyx_tuple__325 __pyx_mstate_global->__pyx_tuple__325
#define __pyx_tuple__328 __pyx_mstate_global->__pyx_tuple__328
#define __pyx_tuple__330 __pyx_mstate_global->__pyx_tuple__330
#define __pyx_tuple__333 __pyx_mstate_global->__pyx_tuple__333
#define __pyx_tuple__335 __pyx_mstate_global->__pyx_tuple__335
#define __pyx_tuple__337 __pyx_mstate_global->__pyx_tuple__337
#define __pyx_tuple__340 __pyx_mstate_global->__pyx_tuple__340
#define __pyx_tuple__342 __pyx_mstate_global->__pyx_tuple__342
#define __pyx_tuple__344 __pyx_mstate_global->__pyx_tuple__344
#define __pyx_tuple__353 __pyx_mstate_global->__pyx_tuple__353
#define __pyx_tuple__355 __pyx_mstate_global->__pyx_tuple__355
#define __pyx_tuple__357 __pyx_mstate_global->__pyx_tuple__357
#define __pyx_tuple__359 __pyx_mstate_global->__pyx_tuple__359
#define __pyx_tuple__361 __pyx_mstate_global->__pyx_tuple__361
#define __pyx_tuple__363 __pyx_mstate_global->__pyx_tuple__363
#define __pyx_tuple__365 __pyx_mstate_global->__pyx_tuple__365
#define __pyx_tuple__367 __pyx_mstate_global->__pyx_tuple__367
#define __pyx_tuple__369 __pyx_mstate_global->__pyx_tuple__369
#define __pyx_tuple__371 __pyx_mstate_global->__pyx_tuple__371
#define __pyx_tuple__373 __pyx_mstate_global->__pyx_tuple__373
#define __pyx_tuple__374 __pyx_mstate_global->__pyx_tuple__374
#define __pyx_tuple__376 __pyx_mstate_global->__pyx_tuple__376
#define __pyx_tuple__378 __pyx_mstate_global->__pyx_tuple__378
#define __pyx_tuple__380 __pyx_mstate_global->__pyx_tuple__380
#define __pyx_tuple__383 __pyx_mstate_global->__pyx_tuple__383
#define __pyx_tuple__387 __pyx_mstate_global->__pyx_tuple__387
#define __pyx_codeobj__16 __pyx_mstate_global->__pyx_codeobj__16
#define __pyx_codeobj__19 __pyx_mstate_global->__pyx_codeobj__19
#define __pyx_codeobj__30 __pyx_mstate_global->__pyx_codeobj__30
#define __pyx_codeobj__32 __pyx_mstate_global->__pyx_codeobj__32
#define __pyx_codeobj__47 __pyx_mstate_global->__pyx_codeobj__47
#define __pyx_codeobj__49 __pyx_mstate_global->__pyx_codeobj__49
#define __pyx_codeobj__51 __pyx_mstate_global->__pyx_codeobj__51
#define __pyx_codeobj__53 __pyx_mstate_global->__pyx_codeobj__53
#define __pyx_codeobj__56 __pyx_mstate_global->__pyx_codeobj__56
#define __pyx_codeobj__57 __pyx_mstate_global->__pyx_codeobj__57
#define __pyx_codeobj__58 __pyx_mstate_global->__pyx_codeobj__58
#define __pyx_codeobj__59 __pyx_mstate_global->__pyx_codeobj__59
#define __pyx_codeobj__62 __pyx_mstate_global->__pyx_codeobj__62
#define __pyx_codeobj__63 __pyx_mstate_global->__pyx_codeobj__63
#define __pyx_codeobj__64 __pyx_mstate_global->__pyx_codeobj__64
#define __pyx_codeobj__67 __pyx_mstate_global->__pyx_codeobj__67
#define __pyx_codeobj__68 __pyx_mstate_global->__pyx_codeobj__68
#define __pyx_codeobj__70 __pyx_mstate_global->__pyx_codeobj__70
#define __pyx_codeobj__71 __pyx_mstate_global->__pyx_codeobj__71
#define __pyx_codeobj__74 __pyx_mstate_global->__pyx_codeobj__74
#define __pyx_codeobj__75 __pyx_mstate_global->__pyx_codeobj__75
#define __pyx_codeobj__76 __pyx_mstate_global->__pyx_codeobj__76
#define __pyx_codeobj__77 __pyx_mstate_global->__pyx_codeobj__77
#define __pyx_codeobj__80 __pyx_mstate_global->__pyx_codeobj__80
#define __pyx_codeobj__81 __pyx_mstate_global->__pyx_codeobj__81
#define __pyx_codeobj__82 __pyx_mstate_global->__pyx_codeobj__82
#define __pyx_codeobj__86 __pyx_mstate_global->__pyx_codeobj__86
#define __pyx_codeobj__87 __pyx_mstate_global->__pyx_codeobj__87
#define __pyx_codeobj__88 __pyx_mstate_global->__pyx_codeobj__88
#define __pyx_codeobj__89 __pyx_mstate_global->__pyx_codeobj__89
#define __pyx_codeobj__91 __pyx_mstate_global->__pyx_codeobj__91
#define __pyx_codeobj__92 __pyx_mstate_global->__pyx_codeobj__92
#define __pyx_codeobj__93 __pyx_mstate_global->__pyx_codeobj__93
#define __pyx_codeobj__94 __pyx_mstate_global->__pyx_codeobj__94
#define __pyx_codeobj__95 __pyx_mstate_global->__pyx_codeobj__95
#define __pyx_codeobj__96 __pyx_mstate_global->__pyx_codeobj__96
#define __pyx_codeobj__97 __pyx_mstate_global->__pyx_codeobj__97
#define __pyx_codeobj__98 __pyx_mstate_global->__pyx_codeobj__98
#define __pyx_codeobj__99 __pyx_mstate_global->__pyx_codeobj__99
#define __pyx_codeobj__100 __pyx_mstate_global->__pyx_codeobj__100
#define __pyx_codeobj__101 __pyx_mstate_global->__pyx_codeobj__101
#define __pyx_codeobj__102 __pyx_mstate_global->__pyx_codeobj__102
#define __pyx_codeobj__103 __pyx_mstate_global->__pyx_codeobj__103
#define __pyx_codeobj__104 __pyx_mstate_global->__pyx_codeobj__104
#define __pyx_codeobj__105 __pyx_mstate_global->__pyx_codeobj__105
#define __pyx_codeobj__106 __pyx_mstate_global->__pyx_codeobj__106
#define __pyx_codeobj__108 __pyx_mstate_global->__pyx_codeobj__108
#define __pyx_codeobj__109 __pyx_mstate_global->__pyx_codeobj__109
#define __pyx_codeobj__110 __pyx_mstate_global->__pyx_codeobj__110
#define __pyx_codeobj__112 __pyx_mstate_global->__pyx_codeobj__112
#define __pyx_codeobj__113 __pyx_mstate_global->__pyx_codeobj__113
#define __pyx_codeobj__114 __pyx_mstate_global->__pyx_codeobj__114
#define __pyx_codeobj__115 __pyx_mstate_global->__pyx_codeobj__115
#define __pyx_codeobj__116 __pyx_mstate_global->__pyx_codeobj__116
#define __pyx_codeobj__118 __pyx_mstate_global->__pyx_codeobj__118
#define __pyx_codeobj__119 __pyx_mstate_global->__pyx_codeobj__119
#define __pyx_codeobj__120 __pyx_mstate_global->__pyx_codeobj__120
#define __pyx_codeobj__122 __pyx_mstate_global->__pyx_codeobj__122
#define __pyx_codeobj__124 __pyx_mstate_global->__pyx_codeobj__124
#define __pyx_codeobj__125 __pyx_mstate_global->__pyx_codeobj__125
#define __pyx_codeobj__126 __pyx_mstate_global->__pyx_codeobj__126
#define __pyx_codeobj__128 __pyx_mstate_global->__pyx_codeobj__128
#define __pyx_codeobj__130 __pyx_mstate_global->__pyx_codeobj__130
#define __pyx_codeobj__133 __pyx_mstate_global->__pyx_codeobj__133
#define __pyx_codeobj__135 __pyx_mstate_global->__pyx_codeobj__135
#define __pyx_codeobj__137 __pyx_mstate_global->__pyx_codeobj__137
#define __pyx_codeobj__139 __pyx_mstate_global->__pyx_codeobj__139
#define __pyx_codeobj__141 __pyx_mstate_global->__pyx_codeobj__141
#define __pyx_codeobj__143 __pyx_mstate_global->__pyx_codeobj__143
#define __pyx_codeobj__145 __pyx_mstate_global->__pyx_codeobj__145
#define __pyx_codeobj__147 __pyx_mstate_global->__pyx_codeobj__147
#define __pyx_codeobj__150 __pyx_mstate_global->__pyx_codeobj__150
#define __pyx_codeobj__153 __pyx_mstate_global->__pyx_codeobj__153
#define __pyx_codeobj__155 __pyx_mstate_global->__pyx_codeobj__155
#define __pyx_codeobj__157 __pyx_mstate_global->__pyx_codeobj__157
#define __pyx_codeobj__159 __pyx_mstate_global->__pyx_codeobj__159
#define __pyx_codeobj__160 __pyx_mstate_global->__pyx_codeobj__160
#define __pyx_codeobj__161 __pyx_mstate_global->__pyx_codeobj__161
#define __pyx_codeobj__163 __pyx_mstate_global->__pyx_codeobj__163
#define __pyx_codeobj__165 __pyx_mstate_global->__pyx_codeobj__165
#define __pyx_codeobj__167 __pyx_mstate_global->__pyx_codeobj__167
#define __pyx_codeobj__168 __pyx_mstate_global->__pyx_codeobj__168
#define __pyx_codeobj__169 __pyx_mstate_global->__pyx_codeobj__169
#define __pyx_codeobj__171 __pyx_mstate_global->__pyx_codeobj__171
#define __pyx_codeobj__172 __pyx_mstate_global->__pyx_codeobj__172
#define __pyx_codeobj__174 __pyx_mstate_global->__pyx_codeobj__174
#define __pyx_codeobj__176 __pyx_mstate_global->__pyx_codeobj__176
#define __pyx_codeobj__178 __pyx_mstate_global->__pyx_codeobj__178
#define __pyx_codeobj__180 __pyx_mstate_global->__pyx_codeobj__180
#define __pyx_codeobj__182 __pyx_mstate_global->__pyx_codeobj__182
#define __pyx_codeobj__183 __pyx_mstate_global->__pyx_codeobj__183
#define __pyx_codeobj__184 __pyx_mstate_global->__pyx_codeobj__184
#define __pyx_codeobj__186 __pyx_mstate_global->__pyx_codeobj__186
#define __pyx_codeobj__187 __pyx_mstate_global->__pyx_codeobj__187
#define __pyx_codeobj__188 __pyx_mstate_global->__pyx_codeobj__188
#define __pyx_codeobj__190 __pyx_mstate_global->__pyx_codeobj__190
#define __pyx_codeobj__192 __pyx_mstate_global->__pyx_codeobj__192
#define __pyx_codeobj__194 __pyx_mstate_global->__pyx_codeobj__194
#define __pyx_codeobj__196 __pyx_mstate_global->__pyx_codeobj__196
#define __pyx_codeobj__198 __pyx_mstate_global->__pyx_codeobj__198
#define __pyx_codeobj__199 __pyx_mstate_global->__pyx_codeobj__199
#define __pyx_codeobj__200 __pyx_mstate_global->__pyx_codeobj__200
#define __pyx_codeobj__202 __pyx_mstate_global->__pyx_codeobj__202
#define __pyx_codeobj__204 __pyx_mstate_global->__pyx_codeobj__204
#define __pyx_codeobj__205 __pyx_mstate_global->__pyx_codeobj__205
#define __pyx_codeobj__207 __pyx_mstate_global->__pyx_codeobj__207
#define __pyx_codeobj__208 __pyx_mstate_global->__pyx_codeobj__208
#define __pyx_codeobj__210 __pyx_mstate_global->__pyx_codeobj__210
#define __pyx_codeobj__211 __pyx_mstate_global->__pyx_codeobj__211
#define __pyx_codeobj__212 __pyx_mstate_global->__pyx_codeobj__212
#define __pyx_codeobj__213 __pyx_mstate_global->__pyx_codeobj__213
#define __pyx_codeobj__214 __pyx_mstate_global->__pyx_codeobj__214
#define __pyx_codeobj__215 __pyx_mstate_global->__pyx_codeobj__215
#define __pyx_codeobj__220 __pyx_mstate_global->__pyx_codeobj__220
#define __pyx_codeobj__221 __pyx_mstate_global->__pyx_codeobj__221
#define __pyx_codeobj__222 __pyx_mstate_global->__pyx_codeobj__222
#define __pyx_codeobj__223 __pyx_mstate_global->__pyx_codeobj__223
#define __pyx_codeobj__224 __pyx_mstate_global->__pyx_codeobj__224
#define __pyx_codeobj__225 __pyx_mstate_global->__pyx_codeobj__225
#define __pyx_codeobj__226 __pyx_mstate_global->__pyx_codeobj__226
#define __pyx_codeobj__227 __pyx_mstate_global->__pyx_codeobj__227
#define __pyx_codeobj__228 __pyx_mstate_global->__pyx_codeobj__228
#define __pyx_codeobj__229 __pyx_mstate_global->__pyx_codeobj__229
#define __pyx_codeobj__230 __pyx_mstate_global->__pyx_codeobj__230
#define __pyx_codeobj__231 __pyx_mstate_global->__pyx_codeobj__231
#define __pyx_codeobj__232 __pyx_mstate_global->__pyx_codeobj__232
#define __pyx_codeobj__233 __pyx_mstate_global->__pyx_codeobj__233
#define __pyx_codeobj__234 __pyx_mstate_global->__pyx_codeobj__234
#define __pyx_codeobj__235 __pyx_mstate_global->__pyx_codeobj__235
#define __pyx_codeobj__236 __pyx_mstate_global->__pyx_codeobj__236
#define __pyx_codeobj__237 __pyx_mstate_global->__pyx_codeobj__237
#define __pyx_codeobj__238 __pyx_mstate_global->__pyx_codeobj__238
#define __pyx_codeobj__239 __pyx_mstate_global->__pyx_codeobj__239
#define __pyx_codeobj__240 __pyx_mstate_global->__pyx_codeobj__240
#define __pyx_codeobj__241 __pyx_mstate_global->__pyx_codeobj__241
#define __pyx_codeobj__242 __pyx_mstate_global->__pyx_codeobj__242
#define __pyx_codeobj__243 __pyx_mstate_global->__pyx_codeobj__243
#define __pyx_codeobj__244 __pyx_mstate_global->__pyx_codeobj__244
#define __pyx_codeobj__245 __pyx_mstate_global->__pyx_codeobj__245
#define __pyx_codeobj__247 __pyx_mstate_global->__pyx_codeobj__247
#define __pyx_codeobj__248 __pyx_mstate_global->__pyx_codeobj__248
#define __pyx_codeobj__249 __pyx_mstate_global->__pyx_codeobj__249
#define __pyx_codeobj__252 __pyx_mstate_global->__pyx_codeobj__252
#define __pyx_codeobj__253 __pyx_mstate_global->__pyx_codeobj__253
#define __pyx_codeobj__255 __pyx_mstate_global->__pyx_codeobj__255
#define __pyx_codeobj__257 __pyx_mstate_global->__pyx_codeobj__257
#define __pyx_codeobj__259 __pyx_mstate_global->__pyx_codeobj__259
#define __pyx_codeobj__260 __pyx_mstate_global->__pyx_codeobj__260
#define __pyx_codeobj__261 __pyx_mstate_global->__pyx_codeobj__261
#define __pyx_codeobj__262 __pyx_mstate_global->__pyx_codeobj__262
#define __pyx_codeobj__264 __pyx_mstate_global->__pyx_codeobj__264
#define __pyx_codeobj__266 __pyx_mstate_global->__pyx_codeobj__266
#define __pyx_codeobj__267 __pyx_mstate_global->__pyx_codeobj__267
#define __pyx_codeobj__268 __pyx_mstate_global->__pyx_codeobj__268
#define __pyx_codeobj__270 __pyx_mstate_global->__pyx_codeobj__270
#define __pyx_codeobj__272 __pyx_mstate_global->__pyx_codeobj__272
#define __pyx_codeobj__273 __pyx_mstate_global->__pyx_codeobj__273
#define __pyx_codeobj__274 __pyx_mstate_global->__pyx_codeobj__274
#define __pyx_codeobj__275 __pyx_mstate_global->__pyx_codeobj__275
#define __pyx_codeobj__276 __pyx_mstate_global->__pyx_codeobj__276
#define __pyx_codeobj__277 __pyx_mstate_global->__pyx_codeobj__277
#define __pyx_codeobj__278 __pyx_mstate_global->__pyx_codeobj__278
#define __pyx_codeobj__279 __pyx_mstate_global->__pyx_codeobj__279
#define __pyx_codeobj__280 __pyx_mstate_global->__pyx_codeobj__280
#define __pyx_codeobj__281 __pyx_mstate_global->__pyx_codeobj__281
#define __pyx_codeobj__282 __pyx_mstate_global->__pyx_codeobj__282
#define __pyx_codeobj__283 __pyx_mstate_global->__pyx_codeobj__283
#define __pyx_codeobj__284 __pyx_mstate_global->__pyx_codeobj__284
#define __pyx_codeobj__285 __pyx_mstate_global->__pyx_codeobj__285
#define __pyx_codeobj__286 __pyx_mstate_global->__pyx_codeobj__286
#define __pyx_codeobj__287 __pyx_mstate_global->__pyx_codeobj__287
#define __pyx_codeobj__288 __pyx_mstate_global->__pyx_codeobj__288
#define __pyx_codeobj__289 __pyx_mstate_global->__pyx_codeobj__289
#define __pyx_codeobj__290 __pyx_mstate_global->__pyx_codeobj__290
#define __pyx_codeobj__291 __pyx_mstate_global->__pyx_codeobj__291
#define __pyx_codeobj__292 __pyx_mstate_global->__pyx_codeobj__292
#define __pyx_codeobj__293 __pyx_mstate_global->__pyx_codeobj__293
#define __pyx_codeobj__294 __pyx_mstate_global->__pyx_codeobj__294
#define __pyx_codeobj__295 __pyx_mstate_global->__pyx_codeobj__295
#define __pyx_codeobj__296 __pyx_mstate_global->__pyx_codeobj__296
#define __pyx_codeobj__297 __pyx_mstate_global->__pyx_codeobj__297
#define __pyx_codeobj__298 __pyx_mstate_global->__pyx_codeobj__298
#define __pyx_codeobj__299 __pyx_mstate_global->__pyx_codeobj__299
#define __pyx_codeobj__300 __pyx_mstate_global->__pyx_codeobj__300
#define __pyx_codeobj__301 __pyx_mstate_global->__pyx_codeobj__301
#define __pyx_codeobj__303 __pyx_mstate_global->__pyx_codeobj__303
#define __pyx_codeobj__305 __pyx_mstate_global->__pyx_codeobj__305
#define __pyx_codeobj__307 __pyx_mstate_global->__pyx_codeobj__307
#define __pyx_codeobj__309 __pyx_mstate_global->__pyx_codeobj__309
#define __pyx_codeobj__310 __pyx_mstate_global->__pyx_codeobj__310
#define __pyx_codeobj__311 __pyx_mstate_global->__pyx_codeobj__311
#define __pyx_codeobj__312 __pyx_mstate_global->__pyx_codeobj__312
#define __pyx_codeobj__313 __pyx_mstate_global->__pyx_codeobj__313
#define __pyx_codeobj__315 __pyx_mstate_global->__pyx_codeobj__315
#define __pyx_codeobj__317 __pyx_mstate_global->__pyx_codeobj__317
#define __pyx_codeobj__318 __pyx_mstate_global->__pyx_codeobj__318
#define __pyx_codeobj__319 __pyx_mstate_global->__pyx_codeobj__319
#define __pyx_codeobj__321 __pyx_mstate_global->__pyx_codeobj__321
#define __pyx_codeobj__323 __pyx_mstate_global->__pyx_codeobj__323
#define __pyx_codeobj__326 __pyx_mstate_global->__pyx_codeobj__326
#define __pyx_codeobj__327 __pyx_mstate_global->__pyx_codeobj__327
#define __pyx_codeobj__329 __pyx_mstate_global->__pyx_codeobj__329
#define __pyx_codeobj__331 __pyx_mstate_global->__pyx_codeobj__331
#define __pyx_codeobj__332 __pyx_mstate_global->__pyx_codeobj__332
#define __pyx_codeobj__334 __pyx_mstate_global->__pyx_codeobj__334
#define __pyx_codeobj__336 __pyx_mstate_global->__pyx_codeobj__336
#define __pyx_codeobj__338 __pyx_mstate_global->__pyx_codeobj__338
#define __pyx_codeobj__339 __pyx_mstate_global->__pyx_codeobj__339
#define __pyx_codeobj__341 __pyx_mstate_global->__pyx_codeobj__341
#define __pyx_codeobj__343 __pyx_mstate_global->__pyx_codeobj__343
#define __pyx_codeobj__345 __pyx_mstate_global->__pyx_codeobj__345
#define __pyx_codeobj__346 __pyx_mstate_global->__pyx_codeobj__346
#define __pyx_codeobj__347 __pyx_mstate_global->__pyx_codeobj__347
#define __pyx_codeobj__348 __pyx_mstate_global->__pyx_codeobj__348
#define __pyx_codeobj__349 __pyx_mstate_global->__pyx_codeobj__349
#define __pyx_codeobj__350 __pyx_mstate_global->__pyx_codeobj__350
#define __pyx_codeobj__351 __pyx_mstate_global->__pyx_codeobj__351
#define __pyx_codeobj__352 __pyx_mstate_global->__pyx_codeobj__352
#define __pyx_codeobj__354 __pyx_mstate_global->__pyx_codeobj__354
#define __pyx_codeobj__356 __pyx_mstate_global->__pyx_codeobj__356
#define __pyx_codeobj__358 __pyx_mstate_global->__pyx_codeobj__358
#define __pyx_codeobj__360 __pyx_mstate_global->__pyx_codeobj__360
#define __pyx_codeobj__362 __pyx_mstate_global->__pyx_codeobj__362
#define __pyx_codeobj__364 __pyx_mstate_global->__pyx_codeobj__364
#define __pyx_codeobj__366 __pyx_mstate_global->__pyx_codeobj__366
#define __pyx_codeobj__368 __pyx_mstate_global->__pyx_codeobj__368
#define __pyx_codeobj__370 __pyx_mstate_global->__pyx_codeobj__370
#define __pyx_codeobj__372 __pyx_mstate_global->__pyx_codeobj__372
#define __pyx_codeobj__375 __pyx_mstate_global->__pyx_codeobj__375
#define __pyx_codeobj__377 __pyx_mstate_global->__pyx_codeobj__377
#define __pyx_codeobj__379 __pyx_mstate_global->__pyx_codeobj__379
#define __pyx_codeobj__381 __pyx_mstate_global->__pyx_codeobj__381
#define __pyx_codeobj__382 __pyx_mstate_global->__pyx_codeobj__382
#define __pyx_codeobj__384 __pyx_mstate_global->__pyx_codeobj__384
#define __pyx_codeobj__385 __pyx_mstate_global->__pyx_codeobj__385
#define __pyx_codeobj__386 __pyx_mstate_global->__pyx_codeobj__386
#define __pyx_codeobj__388 __pyx_mstate_global->__pyx_codeobj__388
#define __pyx_codeobj__389 __pyx_mstate_global->__pyx_codeobj__389
/* #### Code section: module_code ### */

/* "cpython/complex.pxd":19
 * 
 *         @property
 *         cdef inline double real(self) noexcept:             # <<<<<<<<<<<<<<
 *             return self.cval.real
 * 
 */

static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4real_real(PyComplexObject *__pyx_v_self) {
  double __pyx_r;

  /* "cpython/complex.pxd":20
 *         @property
 *         cdef inline double real(self) noexcept:
 *             return self.cval.real             # <<<<<<<<<<<<<<
 * 
 *         @property
 */
  __pyx_r = __pyx_v_self->cval.real;
  goto __pyx_L0;

  /* "cpython/complex.pxd":19
 * 
 *         @property
 *         cdef inline double real(self) noexcept:             # <<<<<<<<<<<<<<
 *             return self.cval.real
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "cpython/complex.pxd":23
 * 
 *         @property
 *         cdef inline double imag(self) noexcept:             # <<<<<<<<<<<<<<
 *             return self.cval.imag
 * 
 */

static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4imag_imag(PyComplexObject *__pyx_v_self) {
  double __pyx_r;

  /* "cpython/complex.pxd":24
 *         @property
 *         cdef inline double imag(self) noexcept:
 *             return self.cval.imag             # <<<<<<<<<<<<<<
 * 
 *     # PyTypeObject PyComplex_Type
 */
  __pyx_r = __pyx_v_self->cval.imag;
  goto __pyx_L0;

  /* "cpython/complex.pxd":23
 * 
 *         @property
 *         cdef inline double imag(self) noexcept:             # <<<<<<<<<<<<<<
 *             return self.cval.imag
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "cpython/contextvars.pxd":112
 * 
 * 
 * cdef inline object get_value(var, default_value=None):             # <<<<<<<<<<<<<<
 *     """Return a new reference to the value of the context variable,
 *     or the default value of the context variable,
 */

static CYTHON_INLINE PyObject *__pyx_f_7cpython_11contextvars_get_value(PyObject *__pyx_v_var, struct __pyx_opt_args_7cpython_11contextvars_get_value *__pyx_optional_args) {
  PyObject *__pyx_v_default_value = ((PyObject *)Py_None);
  PyObject *__pyx_v_value;
  PyObject *__pyx_v_pyvalue = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_value", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_default_value = __pyx_optional_args->default_value;
    }
  }

  /* "cpython/contextvars.pxd":117
 *     or None if no such value or default was found.
 *     """
 *     cdef PyObject *value = NULL             # <<<<<<<<<<<<<<
 *     PyContextVar_Get(var, NULL, &value)
 *     if value is NULL:
 */
  __pyx_v_value = NULL;

  /* "cpython/contextvars.pxd":118
 *     """
 *     cdef PyObject *value = NULL
 *     PyContextVar_Get(var, NULL, &value)             # <<<<<<<<<<<<<<
 *     if value is NULL:
 *         # context variable does not have a default
 */
  __pyx_t_1 = PyContextVar_Get(__pyx_v_var, NULL, (&__pyx_v_value)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(7, 118, __pyx_L1_error)

  /* "cpython/contextvars.pxd":119
 *     cdef PyObject *value = NULL
 *     PyContextVar_Get(var, NULL, &value)
 *     if value is NULL:             # <<<<<<<<<<<<<<
 *         # context variable does not have a default
 *         pyvalue = default_value
 */
  __pyx_t_2 = (__pyx_v_value == NULL);
  if (__pyx_t_2) {

    /* "cpython/contextvars.pxd":121
 *     if value is NULL:
 *         # context variable does not have a default
 *         pyvalue = default_value             # <<<<<<<<<<<<<<
 *     else:
 *         # value or default value of context variable
 */
    __Pyx_INCREF(__pyx_v_default_value);
    __pyx_v_pyvalue = __pyx_v_default_value;

    /* "cpython/contextvars.pxd":119
 *     cdef PyObject *value = NULL
 *     PyContextVar_Get(var, NULL, &value)
 *     if value is NULL:             # <<<<<<<<<<<<<<
 *         # context variable does not have a default
 *         pyvalue = default_value
 */
    goto __pyx_L3;
  }

  /* "cpython/contextvars.pxd":124
 *     else:
 *         # value or default value of context variable
 *         pyvalue = <object>value             # <<<<<<<<<<<<<<
 *         Py_XDECREF(value)  # PyContextVar_Get() returned an owned reference as 'PyObject*'
 *     return pyvalue
 */
  /*else*/ {
    __pyx_t_3 = ((PyObject *)__pyx_v_value);
    __Pyx_INCREF(__pyx_t_3);
    __pyx_v_pyvalue = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "cpython/contextvars.pxd":125
 *         # value or default value of context variable
 *         pyvalue = <object>value
 *         Py_XDECREF(value)  # PyContextVar_Get() returned an owned reference as 'PyObject*'             # <<<<<<<<<<<<<<
 *     return pyvalue
 * 
 */
    Py_XDECREF(__pyx_v_value);
  }
  __pyx_L3:;

  /* "cpython/contextvars.pxd":126
 *         pyvalue = <object>value
 *         Py_XDECREF(value)  # PyContextVar_Get() returned an owned reference as 'PyObject*'
 *     return pyvalue             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_pyvalue);
  __pyx_r = __pyx_v_pyvalue;
  goto __pyx_L0;

  /* "cpython/contextvars.pxd":112
 * 
 * 
 * cdef inline object get_value(var, default_value=None):             # <<<<<<<<<<<<<<
 *     """Return a new reference to the value of the context variable,
 *     or the default value of the context variable,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cpython.contextvars.get_value", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_pyvalue);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cpython/contextvars.pxd":129
 * 
 * 
 * cdef inline object get_value_no_default(var, default_value=None):             # <<<<<<<<<<<<<<
 *     """Return a new reference to the value of the context variable,
 *     or the provided default value if no such value was found.
 */

static CYTHON_INLINE PyObject *__pyx_f_7cpython_11contextvars_get_value_no_default(PyObject *__pyx_v_var, struct __pyx_opt_args_7cpython_11contextvars_get_value_no_default *__pyx_optional_args) {
  PyObject *__pyx_v_default_value = ((PyObject *)Py_None);
  PyObject *__pyx_v_value;
  PyObject *__pyx_v_pyvalue = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_value_no_default", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_default_value = __pyx_optional_args->default_value;
    }
  }

  /* "cpython/contextvars.pxd":135
 *     Ignores the default value of the context variable, if any.
 *     """
 *     cdef PyObject *value = NULL             # <<<<<<<<<<<<<<
 *     PyContextVar_Get(var, <PyObject*>default_value, &value)
 *     # value of context variable or 'default_value'
 */
  __pyx_v_value = NULL;

  /* "cpython/contextvars.pxd":136
 *     """
 *     cdef PyObject *value = NULL
 *     PyContextVar_Get(var, <PyObject*>default_value, &value)             # <<<<<<<<<<<<<<
 *     # value of context variable or 'default_value'
 *     pyvalue = <object>value
 */
  __pyx_t_1 = PyContextVar_Get(__pyx_v_var, ((PyObject *)__pyx_v_default_value), (&__pyx_v_value)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(7, 136, __pyx_L1_error)

  /* "cpython/contextvars.pxd":138
 *     PyContextVar_Get(var, <PyObject*>default_value, &value)
 *     # value of context variable or 'default_value'
 *     pyvalue = <object>value             # <<<<<<<<<<<<<<
 *     Py_XDECREF(value)  # PyContextVar_Get() returned an owned reference as 'PyObject*'
 *     return pyvalue
 */
  __pyx_t_2 = ((PyObject *)__pyx_v_value);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_v_pyvalue = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cpython/contextvars.pxd":139
 *     # value of context variable or 'default_value'
 *     pyvalue = <object>value
 *     Py_XDECREF(value)  # PyContextVar_Get() returned an owned reference as 'PyObject*'             # <<<<<<<<<<<<<<
 *     return pyvalue
 */
  Py_XDECREF(__pyx_v_value);

  /* "cpython/contextvars.pxd":140
 *     pyvalue = <object>value
 *     Py_XDECREF(value)  # PyContextVar_Get() returned an owned reference as 'PyObject*'
 *     return pyvalue             # <<<<<<<<<<<<<<
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_pyvalue);
  __pyx_r = __pyx_v_pyvalue;
  goto __pyx_L0;

  /* "cpython/contextvars.pxd":129
 * 
 * 
 * cdef inline object get_value_no_default(var, default_value=None):             # <<<<<<<<<<<<<<
 *     """Return a new reference to the value of the context variable,
 *     or the provided default value if no such value was found.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cpython.contextvars.get_value_no_default", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_pyvalue);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/util.pxi":10
 * from libcpp cimport bool
 * 
 * cdef PY_AMPL_CALL(campl.AMPL_ERRORINFO* errorinfo):             # <<<<<<<<<<<<<<
 *     cdef campl.AMPL_RETCODE rc
 *     cdef char* message
 */

static PyObject *__pyx_f_7_amplpy_PY_AMPL_CALL(AMPL_ERRORINFO *__pyx_v_errorinfo) {
  AMPL_RETCODE __pyx_v_rc;
  char *__pyx_v_message;
  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 = NULL;
  PyObject *__pyx_t_5 = NULL;
  unsigned int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PY_AMPL_CALL", 1);

  /* "amplpy/util.pxi":13
 *     cdef campl.AMPL_RETCODE rc
 *     cdef char* message
 *     rc = campl.AMPL_ErrorInfoGetError(errorinfo)             # <<<<<<<<<<<<<<
 *     if rc == campl.AMPL_OK:
 *         pass
 */
  __pyx_v_rc = AMPL_ErrorInfoGetError(__pyx_v_errorinfo);

  /* "amplpy/util.pxi":14
 *     cdef char* message
 *     rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *     if rc == campl.AMPL_OK:             # <<<<<<<<<<<<<<
 *         pass
 *     elif rc == campl.AMPL_INFEASIBILITY_EXCEPTION:
 */
  switch (__pyx_v_rc) {
    case AMPL_OK:
    break;
    case AMPL_INFEASIBILITY_EXCEPTION:

    /* "amplpy/util.pxi":17
 *         pass
 *     elif rc == campl.AMPL_INFEASIBILITY_EXCEPTION:
 *         message = campl.AMPL_ErrorInfoGetMessage(errorinfo)             # <<<<<<<<<<<<<<
 *         raise InfeasibilityException("InfeasibilityException: " + message.decode('utf-8'))
 *     elif rc == campl.AMPL_PRESOLVE_EXCEPTION:
 */
    __pyx_v_message = AMPL_ErrorInfoGetMessage(__pyx_v_errorinfo);

    /* "amplpy/util.pxi":18
 *     elif rc == campl.AMPL_INFEASIBILITY_EXCEPTION:
 *         message = campl.AMPL_ErrorInfoGetMessage(errorinfo)
 *         raise InfeasibilityException("InfeasibilityException: " + message.decode('utf-8'))             # <<<<<<<<<<<<<<
 *     elif rc == campl.AMPL_PRESOLVE_EXCEPTION:
 *         message = campl.AMPL_ErrorInfoGetMessage(errorinfo)
 */
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_InfeasibilityException); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 18, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_ssize_strlen(__pyx_v_message); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(4, 18, __pyx_L1_error)
    __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_message, 0, __pyx_t_3, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 18, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_kp_u_InfeasibilityException_2, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 18, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (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);
        __pyx_t_6 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 18, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(4, 18, __pyx_L1_error)

    /* "amplpy/util.pxi":16
 *     if rc == campl.AMPL_OK:
 *         pass
 *     elif rc == campl.AMPL_INFEASIBILITY_EXCEPTION:             # <<<<<<<<<<<<<<
 *         message = campl.AMPL_ErrorInfoGetMessage(errorinfo)
 *         raise InfeasibilityException("InfeasibilityException: " + message.decode('utf-8'))
 */
    break;
    case AMPL_PRESOLVE_EXCEPTION:

    /* "amplpy/util.pxi":20
 *         raise InfeasibilityException("InfeasibilityException: " + message.decode('utf-8'))
 *     elif rc == campl.AMPL_PRESOLVE_EXCEPTION:
 *         message = campl.AMPL_ErrorInfoGetMessage(errorinfo)             # <<<<<<<<<<<<<<
 *         raise PresolveException("PresolveException: " + message.decode('utf-8'))
 *     elif rc == campl.AMPL_LICENSE_EXCEPTION:
 */
    __pyx_v_message = AMPL_ErrorInfoGetMessage(__pyx_v_errorinfo);

    /* "amplpy/util.pxi":21
 *     elif rc == campl.AMPL_PRESOLVE_EXCEPTION:
 *         message = campl.AMPL_ErrorInfoGetMessage(errorinfo)
 *         raise PresolveException("PresolveException: " + message.decode('utf-8'))             # <<<<<<<<<<<<<<
 *     elif rc == campl.AMPL_LICENSE_EXCEPTION:
 *         message = campl.AMPL_ErrorInfoGetMessage(errorinfo)
 */
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_PresolveException); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 21, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_ssize_strlen(__pyx_v_message); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(4, 21, __pyx_L1_error)
    __pyx_t_5 = __Pyx_decode_c_string(__pyx_v_message, 0, __pyx_t_3, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 21, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_kp_u_PresolveException_2, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 21, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_6 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_4};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 21, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(4, 21, __pyx_L1_error)

    /* "amplpy/util.pxi":19
 *         message = campl.AMPL_ErrorInfoGetMessage(errorinfo)
 *         raise InfeasibilityException("InfeasibilityException: " + message.decode('utf-8'))
 *     elif rc == campl.AMPL_PRESOLVE_EXCEPTION:             # <<<<<<<<<<<<<<
 *         message = campl.AMPL_ErrorInfoGetMessage(errorinfo)
 *         raise PresolveException("PresolveException: " + message.decode('utf-8'))
 */
    break;
    case AMPL_LICENSE_EXCEPTION:

    /* "amplpy/util.pxi":23
 *         raise PresolveException("PresolveException: " + message.decode('utf-8'))
 *     elif rc == campl.AMPL_LICENSE_EXCEPTION:
 *         message = campl.AMPL_ErrorInfoGetMessage(errorinfo)             # <<<<<<<<<<<<<<
 *         raise SystemError(message.decode('utf-8'))
 *     elif rc == campl.AMPL_FILE_IO_EXCEPTION:
 */
    __pyx_v_message = AMPL_ErrorInfoGetMessage(__pyx_v_errorinfo);

    /* "amplpy/util.pxi":24
 *     elif rc == campl.AMPL_LICENSE_EXCEPTION:
 *         message = campl.AMPL_ErrorInfoGetMessage(errorinfo)
 *         raise SystemError(message.decode('utf-8'))             # <<<<<<<<<<<<<<
 *     elif rc == campl.AMPL_FILE_IO_EXCEPTION:
 *         message = campl.AMPL_ErrorInfoGetMessage(errorinfo)
 */
    __pyx_t_3 = __Pyx_ssize_strlen(__pyx_v_message); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(4, 24, __pyx_L1_error)
    __pyx_t_1 = __Pyx_decode_c_string(__pyx_v_message, 0, __pyx_t_3, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 24, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_SystemError, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 24, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(4, 24, __pyx_L1_error)

    /* "amplpy/util.pxi":22
 *         message = campl.AMPL_ErrorInfoGetMessage(errorinfo)
 *         raise PresolveException("PresolveException: " + message.decode('utf-8'))
 *     elif rc == campl.AMPL_LICENSE_EXCEPTION:             # <<<<<<<<<<<<<<
 *         message = campl.AMPL_ErrorInfoGetMessage(errorinfo)
 *         raise SystemError(message.decode('utf-8'))
 */
    break;
    case AMPL_FILE_IO_EXCEPTION:

    /* "amplpy/util.pxi":26
 *         raise SystemError(message.decode('utf-8'))
 *     elif rc == campl.AMPL_FILE_IO_EXCEPTION:
 *         message = campl.AMPL_ErrorInfoGetMessage(errorinfo)             # <<<<<<<<<<<<<<
 *         raise IOError(message.decode('utf-8'))
 *     elif rc == campl.AMPL_UNSUPPORTED_OPERATION_EXCEPTION:
 */
    __pyx_v_message = AMPL_ErrorInfoGetMessage(__pyx_v_errorinfo);

    /* "amplpy/util.pxi":27
 *     elif rc == campl.AMPL_FILE_IO_EXCEPTION:
 *         message = campl.AMPL_ErrorInfoGetMessage(errorinfo)
 *         raise IOError(message.decode('utf-8'))             # <<<<<<<<<<<<<<
 *     elif rc == campl.AMPL_UNSUPPORTED_OPERATION_EXCEPTION:
 *         message = campl.AMPL_ErrorInfoGetMessage(errorinfo)
 */
    __pyx_t_3 = __Pyx_ssize_strlen(__pyx_v_message); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(4, 27, __pyx_L1_error)
    __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_message, 0, __pyx_t_3, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 27, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IOError, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 27, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(4, 27, __pyx_L1_error)

    /* "amplpy/util.pxi":25
 *         message = campl.AMPL_ErrorInfoGetMessage(errorinfo)
 *         raise SystemError(message.decode('utf-8'))
 *     elif rc == campl.AMPL_FILE_IO_EXCEPTION:             # <<<<<<<<<<<<<<
 *         message = campl.AMPL_ErrorInfoGetMessage(errorinfo)
 *         raise IOError(message.decode('utf-8'))
 */
    break;
    case AMPL_UNSUPPORTED_OPERATION_EXCEPTION:

    /* "amplpy/util.pxi":29
 *         raise IOError(message.decode('utf-8'))
 *     elif rc == campl.AMPL_UNSUPPORTED_OPERATION_EXCEPTION:
 *         message = campl.AMPL_ErrorInfoGetMessage(errorinfo)             # <<<<<<<<<<<<<<
 *         raise TypeError(message.decode('utf-8'))
 *     elif rc == campl.AMPL_INVALID_SUBSCRIPT_EXCEPTION:
 */
    __pyx_v_message = AMPL_ErrorInfoGetMessage(__pyx_v_errorinfo);

    /* "amplpy/util.pxi":30
 *     elif rc == campl.AMPL_UNSUPPORTED_OPERATION_EXCEPTION:
 *         message = campl.AMPL_ErrorInfoGetMessage(errorinfo)
 *         raise TypeError(message.decode('utf-8'))             # <<<<<<<<<<<<<<
 *     elif rc == campl.AMPL_INVALID_SUBSCRIPT_EXCEPTION:
 *         print("AMPL: AMPL_INVALID_SUBSCRIPT_EXCEPTION")
 */
    __pyx_t_3 = __Pyx_ssize_strlen(__pyx_v_message); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(4, 30, __pyx_L1_error)
    __pyx_t_1 = __Pyx_decode_c_string(__pyx_v_message, 0, __pyx_t_3, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 30, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 30, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(4, 30, __pyx_L1_error)

    /* "amplpy/util.pxi":28
 *         message = campl.AMPL_ErrorInfoGetMessage(errorinfo)
 *         raise IOError(message.decode('utf-8'))
 *     elif rc == campl.AMPL_UNSUPPORTED_OPERATION_EXCEPTION:             # <<<<<<<<<<<<<<
 *         message = campl.AMPL_ErrorInfoGetMessage(errorinfo)
 *         raise TypeError(message.decode('utf-8'))
 */
    break;
    case AMPL_INVALID_SUBSCRIPT_EXCEPTION:

    /* "amplpy/util.pxi":32
 *         raise TypeError(message.decode('utf-8'))
 *     elif rc == campl.AMPL_INVALID_SUBSCRIPT_EXCEPTION:
 *         print("AMPL: AMPL_INVALID_SUBSCRIPT_EXCEPTION")             # <<<<<<<<<<<<<<
 *         #throw InvalidSubscriptException(AMPL_ErrorInfoGetSource(call), AMPL_ErrorInfoGetLine(call), AMPL_ErrorInfoGetOffset(call),
 *         #                              AMPL_ErrorInfoGetMessage(call))
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 32, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "amplpy/util.pxi":31
 *         message = campl.AMPL_ErrorInfoGetMessage(errorinfo)
 *         raise TypeError(message.decode('utf-8'))
 *     elif rc == campl.AMPL_INVALID_SUBSCRIPT_EXCEPTION:             # <<<<<<<<<<<<<<
 *         print("AMPL: AMPL_INVALID_SUBSCRIPT_EXCEPTION")
 *         #throw InvalidSubscriptException(AMPL_ErrorInfoGetSource(call), AMPL_ErrorInfoGetLine(call), AMPL_ErrorInfoGetOffset(call),
 */
    break;
    case AMPL_SYNTAX_ERROR_EXCEPTION:

    /* "amplpy/util.pxi":36
 *         #                              AMPL_ErrorInfoGetMessage(call))
 *     elif rc == campl.AMPL_SYNTAX_ERROR_EXCEPTION:
 *         print("AMPL: AMPL_SYNTAX_ERROR_EXCEPTION")             # <<<<<<<<<<<<<<
 *         #throw SyntaxErrorException(AMPL_ErrorInfoGetSource(call), AMPL_ErrorInfoGetLine(call), AMPL_ErrorInfoGetOffset(call),
 *         #                         AMPL_ErrorInfoGetMessage(call))
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 36, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "amplpy/util.pxi":35
 *         #throw InvalidSubscriptException(AMPL_ErrorInfoGetSource(call), AMPL_ErrorInfoGetLine(call), AMPL_ErrorInfoGetOffset(call),
 *         #                              AMPL_ErrorInfoGetMessage(call))
 *     elif rc == campl.AMPL_SYNTAX_ERROR_EXCEPTION:             # <<<<<<<<<<<<<<
 *         print("AMPL: AMPL_SYNTAX_ERROR_EXCEPTION")
 *         #throw SyntaxErrorException(AMPL_ErrorInfoGetSource(call), AMPL_ErrorInfoGetLine(call), AMPL_ErrorInfoGetOffset(call),
 */
    break;
    case AMPL_NO_DATA_EXCEPTION:

    /* "amplpy/util.pxi":40
 *         #                         AMPL_ErrorInfoGetMessage(call))
 *     elif rc == campl.AMPL_NO_DATA_EXCEPTION:
 *         print("AMPL: AMPL_NO_DATA_EXCEPTION")             # <<<<<<<<<<<<<<
 *         #throw NoDataException(AMPL_ErrorInfoGetMessage(call))
 *     elif rc == campl.AMPL_EXCEPTION:
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 40, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "amplpy/util.pxi":39
 *         #throw SyntaxErrorException(AMPL_ErrorInfoGetSource(call), AMPL_ErrorInfoGetLine(call), AMPL_ErrorInfoGetOffset(call),
 *         #                         AMPL_ErrorInfoGetMessage(call))
 *     elif rc == campl.AMPL_NO_DATA_EXCEPTION:             # <<<<<<<<<<<<<<
 *         print("AMPL: AMPL_NO_DATA_EXCEPTION")
 *         #throw NoDataException(AMPL_ErrorInfoGetMessage(call))
 */
    break;
    case AMPL_EXCEPTION:

    /* "amplpy/util.pxi":43
 *         #throw NoDataException(AMPL_ErrorInfoGetMessage(call))
 *     elif rc == campl.AMPL_EXCEPTION:
 *         message = campl.AMPL_ErrorInfoGetMessage(errorinfo)             # <<<<<<<<<<<<<<
 *         raise RuntimeError(message.decode('utf-8'))
 *     elif rc == campl.AMPL_RUNTIME_ERROR:
 */
    __pyx_v_message = AMPL_ErrorInfoGetMessage(__pyx_v_errorinfo);

    /* "amplpy/util.pxi":44
 *     elif rc == campl.AMPL_EXCEPTION:
 *         message = campl.AMPL_ErrorInfoGetMessage(errorinfo)
 *         raise RuntimeError(message.decode('utf-8'))             # <<<<<<<<<<<<<<
 *     elif rc == campl.AMPL_RUNTIME_ERROR:
 *         message = campl.AMPL_ErrorInfoGetMessage(errorinfo)
 */
    __pyx_t_3 = __Pyx_ssize_strlen(__pyx_v_message); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(4, 44, __pyx_L1_error)
    __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_message, 0, __pyx_t_3, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 44, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_RuntimeError, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 44, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(4, 44, __pyx_L1_error)

    /* "amplpy/util.pxi":42
 *         print("AMPL: AMPL_NO_DATA_EXCEPTION")
 *         #throw NoDataException(AMPL_ErrorInfoGetMessage(call))
 *     elif rc == campl.AMPL_EXCEPTION:             # <<<<<<<<<<<<<<
 *         message = campl.AMPL_ErrorInfoGetMessage(errorinfo)
 *         raise RuntimeError(message.decode('utf-8'))
 */
    break;
    case AMPL_RUNTIME_ERROR:

    /* "amplpy/util.pxi":46
 *         raise RuntimeError(message.decode('utf-8'))
 *     elif rc == campl.AMPL_RUNTIME_ERROR:
 *         message = campl.AMPL_ErrorInfoGetMessage(errorinfo)             # <<<<<<<<<<<<<<
 *         raise RuntimeError(message.decode('utf-8'))
 *     elif rc == campl.AMPL_LOGIC_ERROR:
 */
    __pyx_v_message = AMPL_ErrorInfoGetMessage(__pyx_v_errorinfo);

    /* "amplpy/util.pxi":47
 *     elif rc == campl.AMPL_RUNTIME_ERROR:
 *         message = campl.AMPL_ErrorInfoGetMessage(errorinfo)
 *         raise RuntimeError(message.decode('utf-8'))             # <<<<<<<<<<<<<<
 *     elif rc == campl.AMPL_LOGIC_ERROR:
 *         message = campl.AMPL_ErrorInfoGetMessage(errorinfo)
 */
    __pyx_t_3 = __Pyx_ssize_strlen(__pyx_v_message); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(4, 47, __pyx_L1_error)
    __pyx_t_1 = __Pyx_decode_c_string(__pyx_v_message, 0, __pyx_t_3, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 47, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_RuntimeError, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 47, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(4, 47, __pyx_L1_error)

    /* "amplpy/util.pxi":45
 *         message = campl.AMPL_ErrorInfoGetMessage(errorinfo)
 *         raise RuntimeError(message.decode('utf-8'))
 *     elif rc == campl.AMPL_RUNTIME_ERROR:             # <<<<<<<<<<<<<<
 *         message = campl.AMPL_ErrorInfoGetMessage(errorinfo)
 *         raise RuntimeError(message.decode('utf-8'))
 */
    break;
    case AMPL_LOGIC_ERROR:

    /* "amplpy/util.pxi":49
 *         raise RuntimeError(message.decode('utf-8'))
 *     elif rc == campl.AMPL_LOGIC_ERROR:
 *         message = campl.AMPL_ErrorInfoGetMessage(errorinfo)             # <<<<<<<<<<<<<<
 *         raise TypeError(message.decode('utf-8'))
 *     elif rc == campl.AMPL_OUT_OF_RANGE:
 */
    __pyx_v_message = AMPL_ErrorInfoGetMessage(__pyx_v_errorinfo);

    /* "amplpy/util.pxi":50
 *     elif rc == campl.AMPL_LOGIC_ERROR:
 *         message = campl.AMPL_ErrorInfoGetMessage(errorinfo)
 *         raise TypeError(message.decode('utf-8'))             # <<<<<<<<<<<<<<
 *     elif rc == campl.AMPL_OUT_OF_RANGE:
 *         message = campl.AMPL_ErrorInfoGetMessage(errorinfo)
 */
    __pyx_t_3 = __Pyx_ssize_strlen(__pyx_v_message); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(4, 50, __pyx_L1_error)
    __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_message, 0, __pyx_t_3, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 50, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 50, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(4, 50, __pyx_L1_error)

    /* "amplpy/util.pxi":48
 *         message = campl.AMPL_ErrorInfoGetMessage(errorinfo)
 *         raise RuntimeError(message.decode('utf-8'))
 *     elif rc == campl.AMPL_LOGIC_ERROR:             # <<<<<<<<<<<<<<
 *         message = campl.AMPL_ErrorInfoGetMessage(errorinfo)
 *         raise TypeError(message.decode('utf-8'))
 */
    break;
    case AMPL_OUT_OF_RANGE:

    /* "amplpy/util.pxi":52
 *         raise TypeError(message.decode('utf-8'))
 *     elif rc == campl.AMPL_OUT_OF_RANGE:
 *         message = campl.AMPL_ErrorInfoGetMessage(errorinfo)             # <<<<<<<<<<<<<<
 *         raise KeyError(message.decode('utf-8'))
 *     elif rc == campl.AMPL_INVALID_ARGUMENT:
 */
    __pyx_v_message = AMPL_ErrorInfoGetMessage(__pyx_v_errorinfo);

    /* "amplpy/util.pxi":53
 *     elif rc == campl.AMPL_OUT_OF_RANGE:
 *         message = campl.AMPL_ErrorInfoGetMessage(errorinfo)
 *         raise KeyError(message.decode('utf-8'))             # <<<<<<<<<<<<<<
 *     elif rc == campl.AMPL_INVALID_ARGUMENT:
 *         message = campl.AMPL_ErrorInfoGetMessage(errorinfo)
 */
    __pyx_t_3 = __Pyx_ssize_strlen(__pyx_v_message); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(4, 53, __pyx_L1_error)
    __pyx_t_1 = __Pyx_decode_c_string(__pyx_v_message, 0, __pyx_t_3, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 53, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 53, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(4, 53, __pyx_L1_error)

    /* "amplpy/util.pxi":51
 *         message = campl.AMPL_ErrorInfoGetMessage(errorinfo)
 *         raise TypeError(message.decode('utf-8'))
 *     elif rc == campl.AMPL_OUT_OF_RANGE:             # <<<<<<<<<<<<<<
 *         message = campl.AMPL_ErrorInfoGetMessage(errorinfo)
 *         raise KeyError(message.decode('utf-8'))
 */
    break;
    case AMPL_INVALID_ARGUMENT:

    /* "amplpy/util.pxi":55
 *         raise KeyError(message.decode('utf-8'))
 *     elif rc == campl.AMPL_INVALID_ARGUMENT:
 *         message = campl.AMPL_ErrorInfoGetMessage(errorinfo)             # <<<<<<<<<<<<<<
 *         raise ValueError(message.decode('utf-8'))
 *     elif rc == campl.AMPL_STD_EXCEPTION:
 */
    __pyx_v_message = AMPL_ErrorInfoGetMessage(__pyx_v_errorinfo);

    /* "amplpy/util.pxi":56
 *     elif rc == campl.AMPL_INVALID_ARGUMENT:
 *         message = campl.AMPL_ErrorInfoGetMessage(errorinfo)
 *         raise ValueError(message.decode('utf-8'))             # <<<<<<<<<<<<<<
 *     elif rc == campl.AMPL_STD_EXCEPTION:
 *         message = campl.AMPL_ErrorInfoGetMessage(errorinfo)
 */
    __pyx_t_3 = __Pyx_ssize_strlen(__pyx_v_message); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(4, 56, __pyx_L1_error)
    __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_message, 0, __pyx_t_3, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 56, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 56, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(4, 56, __pyx_L1_error)

    /* "amplpy/util.pxi":54
 *         message = campl.AMPL_ErrorInfoGetMessage(errorinfo)
 *         raise KeyError(message.decode('utf-8'))
 *     elif rc == campl.AMPL_INVALID_ARGUMENT:             # <<<<<<<<<<<<<<
 *         message = campl.AMPL_ErrorInfoGetMessage(errorinfo)
 *         raise ValueError(message.decode('utf-8'))
 */
    break;
    case AMPL_STD_EXCEPTION:

    /* "amplpy/util.pxi":58
 *         raise ValueError(message.decode('utf-8'))
 *     elif rc == campl.AMPL_STD_EXCEPTION:
 *         message = campl.AMPL_ErrorInfoGetMessage(errorinfo)             # <<<<<<<<<<<<<<
 *         raise Exception(message.decode('utf-8'))
 *     else:
 */
    __pyx_v_message = AMPL_ErrorInfoGetMessage(__pyx_v_errorinfo);

    /* "amplpy/util.pxi":59
 *     elif rc == campl.AMPL_STD_EXCEPTION:
 *         message = campl.AMPL_ErrorInfoGetMessage(errorinfo)
 *         raise Exception(message.decode('utf-8'))             # <<<<<<<<<<<<<<
 *     else:
 *         print("AMPL: unknown return code!")
 */
    __pyx_t_3 = __Pyx_ssize_strlen(__pyx_v_message); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(4, 59, __pyx_L1_error)
    __pyx_t_1 = __Pyx_decode_c_string(__pyx_v_message, 0, __pyx_t_3, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 59, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 59, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(4, 59, __pyx_L1_error)

    /* "amplpy/util.pxi":57
 *         message = campl.AMPL_ErrorInfoGetMessage(errorinfo)
 *         raise ValueError(message.decode('utf-8'))
 *     elif rc == campl.AMPL_STD_EXCEPTION:             # <<<<<<<<<<<<<<
 *         message = campl.AMPL_ErrorInfoGetMessage(errorinfo)
 *         raise Exception(message.decode('utf-8'))
 */
    break;
    default:

    /* "amplpy/util.pxi":61
 *         raise Exception(message.decode('utf-8'))
 *     else:
 *         print("AMPL: unknown return code!")             # <<<<<<<<<<<<<<
 *         raise Exception('AMPL: unknown return code!')
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 61, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "amplpy/util.pxi":62
 *     else:
 *         print("AMPL: unknown return code!")
 *         raise Exception('AMPL: unknown return code!')             # <<<<<<<<<<<<<<
 * 
 * cdef void setValues(campl.AMPL* ampl, char* name, campl.AMPL_TUPLE* index, values, size_t size):
 */
    __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])), __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 62, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(4, 62, __pyx_L1_error)
    break;
  }

  /* "amplpy/util.pxi":10
 * from libcpp cimport bool
 * 
 * cdef PY_AMPL_CALL(campl.AMPL_ERRORINFO* errorinfo):             # <<<<<<<<<<<<<<
 *     cdef campl.AMPL_RETCODE rc
 *     cdef char* message
 */

  /* 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_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("_amplpy.PY_AMPL_CALL", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/util.pxi":64
 *         raise Exception('AMPL: unknown return code!')
 * 
 * cdef void setValues(campl.AMPL* ampl, char* name, campl.AMPL_TUPLE* index, values, size_t size):             # <<<<<<<<<<<<<<
 *     cdef campl.AMPL_TUPLE** values_c
 *     cdef size_t i
 */

static void __pyx_f_7_amplpy_setValues(AMPL *__pyx_v_ampl, char *__pyx_v_name, AMPL_TUPLE *__pyx_v_index, PyObject *__pyx_v_values, size_t __pyx_v_size) {
  AMPL_TUPLE **__pyx_v_values_c;
  size_t __pyx_v_i;
  __Pyx_RefNannyDeclarations
  size_t __pyx_t_1;
  size_t __pyx_t_2;
  size_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  AMPL_TUPLE *__pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("setValues", 1);

  /* "amplpy/util.pxi":67
 *     cdef campl.AMPL_TUPLE** values_c
 *     cdef size_t i
 *     values_c = <campl.AMPL_TUPLE**>malloc(size * sizeof(campl.AMPL_TUPLE*))             # <<<<<<<<<<<<<<
 * 
 *     for i in range(size):
 */
  __pyx_v_values_c = ((AMPL_TUPLE **)malloc((__pyx_v_size * (sizeof(AMPL_TUPLE *)))));

  /* "amplpy/util.pxi":69
 *     values_c = <campl.AMPL_TUPLE**>malloc(size * sizeof(campl.AMPL_TUPLE*))
 * 
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         values_c[i] = to_c_tuple(values[i])
 * 
 */
  __pyx_t_1 = __pyx_v_size;
  __pyx_t_2 = __pyx_t_1;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "amplpy/util.pxi":70
 * 
 *     for i in range(size):
 *         values_c[i] = to_c_tuple(values[i])             # <<<<<<<<<<<<<<
 * 
 *     campl.AMPL_SetInstanceSetValuesTuples(ampl, name, index, values_c, size)
 */
    __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_values, __pyx_v_i, size_t, 0, __Pyx_PyInt_FromSize_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 70, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __pyx_f_7_amplpy_to_c_tuple(__pyx_t_4); if (unlikely(__pyx_t_5 == ((AMPL_TUPLE *)NULL) && PyErr_Occurred())) __PYX_ERR(4, 70, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    (__pyx_v_values_c[__pyx_v_i]) = __pyx_t_5;
  }

  /* "amplpy/util.pxi":72
 *         values_c[i] = to_c_tuple(values[i])
 * 
 *     campl.AMPL_SetInstanceSetValuesTuples(ampl, name, index, values_c, size)             # <<<<<<<<<<<<<<
 * 
 *     for i in range(size):
 */
  (void)(AMPL_SetInstanceSetValuesTuples(__pyx_v_ampl, __pyx_v_name, __pyx_v_index, __pyx_v_values_c, __pyx_v_size));

  /* "amplpy/util.pxi":74
 *     campl.AMPL_SetInstanceSetValuesTuples(ampl, name, index, values_c, size)
 * 
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         campl.AMPL_TupleFree(&values_c[i])
 *     free(values_c)
 */
  __pyx_t_1 = __pyx_v_size;
  __pyx_t_2 = __pyx_t_1;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "amplpy/util.pxi":75
 * 
 *     for i in range(size):
 *         campl.AMPL_TupleFree(&values_c[i])             # <<<<<<<<<<<<<<
 *     free(values_c)
 * 
 */
    (void)(AMPL_TupleFree((&(__pyx_v_values_c[__pyx_v_i]))));
  }

  /* "amplpy/util.pxi":76
 *     for i in range(size):
 *         campl.AMPL_TupleFree(&values_c[i])
 *     free(values_c)             # <<<<<<<<<<<<<<
 * 
 * cdef to_py_variant(campl.AMPL_VARIANT* variant):
 */
  free(__pyx_v_values_c);

  /* "amplpy/util.pxi":64
 *         raise Exception('AMPL: unknown return code!')
 * 
 * cdef void setValues(campl.AMPL* ampl, char* name, campl.AMPL_TUPLE* index, values, size_t size):             # <<<<<<<<<<<<<<
 *     cdef campl.AMPL_TUPLE** values_c
 *     cdef size_t i
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("_amplpy.setValues", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "amplpy/util.pxi":78
 *     free(values_c)
 * 
 * cdef to_py_variant(campl.AMPL_VARIANT* variant):             # <<<<<<<<<<<<<<
 *     cdef campl.AMPL_TYPE type
 *     cdef char* value_c
 */

static PyObject *__pyx_f_7_amplpy_to_py_variant(AMPL_VARIANT *__pyx_v_variant) {
  AMPL_TYPE __pyx_v_type;
  char *__pyx_v_value_c;
  double __pyx_v_real_c;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_py_variant", 1);

  /* "amplpy/util.pxi":82
 *     cdef char* value_c
 *     cdef double real_c
 *     campl.AMPL_VariantGetType(variant, &type)             # <<<<<<<<<<<<<<
 *     if type == campl.AMPL_STRING:
 *         campl.AMPL_VariantGetStringValue(variant, &value_c)
 */
  (void)(AMPL_VariantGetType(__pyx_v_variant, (&__pyx_v_type)));

  /* "amplpy/util.pxi":83
 *     cdef double real_c
 *     campl.AMPL_VariantGetType(variant, &type)
 *     if type == campl.AMPL_STRING:             # <<<<<<<<<<<<<<
 *         campl.AMPL_VariantGetStringValue(variant, &value_c)
 *         return value_c.decode('utf-8')
 */
  switch (__pyx_v_type) {
    case AMPL_STRING:

    /* "amplpy/util.pxi":84
 *     campl.AMPL_VariantGetType(variant, &type)
 *     if type == campl.AMPL_STRING:
 *         campl.AMPL_VariantGetStringValue(variant, &value_c)             # <<<<<<<<<<<<<<
 *         return value_c.decode('utf-8')
 *     elif type == campl.AMPL_NUMERIC:
 */
    (void)(AMPL_VariantGetStringValue(__pyx_v_variant, (&__pyx_v_value_c)));

    /* "amplpy/util.pxi":85
 *     if type == campl.AMPL_STRING:
 *         campl.AMPL_VariantGetStringValue(variant, &value_c)
 *         return value_c.decode('utf-8')             # <<<<<<<<<<<<<<
 *     elif type == campl.AMPL_NUMERIC:
 *         campl.AMPL_VariantGetNumericValue(variant, &real_c)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_ssize_strlen(__pyx_v_value_c); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(4, 85, __pyx_L1_error)
    __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_value_c, 0, __pyx_t_1, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 85, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "amplpy/util.pxi":83
 *     cdef double real_c
 *     campl.AMPL_VariantGetType(variant, &type)
 *     if type == campl.AMPL_STRING:             # <<<<<<<<<<<<<<
 *         campl.AMPL_VariantGetStringValue(variant, &value_c)
 *         return value_c.decode('utf-8')
 */
    break;
    case AMPL_NUMERIC:

    /* "amplpy/util.pxi":87
 *         return value_c.decode('utf-8')
 *     elif type == campl.AMPL_NUMERIC:
 *         campl.AMPL_VariantGetNumericValue(variant, &real_c)             # <<<<<<<<<<<<<<
 *         if real_c % 1 == 0:
 *             return int(real_c)
 */
    (void)(AMPL_VariantGetNumericValue(__pyx_v_variant, (&__pyx_v_real_c)));

    /* "amplpy/util.pxi":88
 *     elif type == campl.AMPL_NUMERIC:
 *         campl.AMPL_VariantGetNumericValue(variant, &real_c)
 *         if real_c % 1 == 0:             # <<<<<<<<<<<<<<
 *             return int(real_c)
 *         else:
 */
    __pyx_t_3 = (__Pyx_mod_double(__pyx_v_real_c, 1.0) == 0.0);
    if (__pyx_t_3) {

      /* "amplpy/util.pxi":89
 *         campl.AMPL_VariantGetNumericValue(variant, &real_c)
 *         if real_c % 1 == 0:
 *             return int(real_c)             # <<<<<<<<<<<<<<
 *         else:
 *             return real_c
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = __Pyx_PyInt_FromDouble(__pyx_v_real_c); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 89, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;

      /* "amplpy/util.pxi":88
 *     elif type == campl.AMPL_NUMERIC:
 *         campl.AMPL_VariantGetNumericValue(variant, &real_c)
 *         if real_c % 1 == 0:             # <<<<<<<<<<<<<<
 *             return int(real_c)
 *         else:
 */
    }

    /* "amplpy/util.pxi":91
 *             return int(real_c)
 *         else:
 *             return real_c             # <<<<<<<<<<<<<<
 *     else:
 *         return None
 */
    /*else*/ {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyFloat_FromDouble(__pyx_v_real_c); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 91, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;
    }

    /* "amplpy/util.pxi":86
 *         campl.AMPL_VariantGetStringValue(variant, &value_c)
 *         return value_c.decode('utf-8')
 *     elif type == campl.AMPL_NUMERIC:             # <<<<<<<<<<<<<<
 *         campl.AMPL_VariantGetNumericValue(variant, &real_c)
 *         if real_c % 1 == 0:
 */
    break;
    default:

    /* "amplpy/util.pxi":93
 *             return real_c
 *     else:
 *         return None             # <<<<<<<<<<<<<<
 * 
 * cdef to_py_tuple(campl.AMPL_TUPLE* tuple_c):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
    break;
  }

  /* "amplpy/util.pxi":78
 *     free(values_c)
 * 
 * cdef to_py_variant(campl.AMPL_VARIANT* variant):             # <<<<<<<<<<<<<<
 *     cdef campl.AMPL_TYPE type
 *     cdef char* value_c
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("_amplpy.to_py_variant", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/util.pxi":95
 *         return None
 * 
 * cdef to_py_tuple(campl.AMPL_TUPLE* tuple_c):             # <<<<<<<<<<<<<<
 *     cdef size_t size
 *     cdef campl.AMPL_VARIANT** variants
 */

static PyObject *__pyx_f_7_amplpy_to_py_tuple(AMPL_TUPLE *__pyx_v_tuple_c) {
  size_t __pyx_v_size;
  AMPL_VARIANT **__pyx_v_variants;
  PyObject *__pyx_v_pylist = 0;
  size_t __pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  size_t __pyx_t_2;
  size_t __pyx_t_3;
  size_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_py_tuple", 1);

  /* "amplpy/util.pxi":98
 *     cdef size_t size
 *     cdef campl.AMPL_VARIANT** variants
 *     cdef list pylist = []             # <<<<<<<<<<<<<<
 *     campl.AMPL_TupleGetSize(tuple_c, &size)
 *     campl.AMPL_TupleGetVariantPtr(tuple_c, &variants)
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 98, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_pylist = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "amplpy/util.pxi":99
 *     cdef campl.AMPL_VARIANT** variants
 *     cdef list pylist = []
 *     campl.AMPL_TupleGetSize(tuple_c, &size)             # <<<<<<<<<<<<<<
 *     campl.AMPL_TupleGetVariantPtr(tuple_c, &variants)
 *     for i in range(size):
 */
  (void)(AMPL_TupleGetSize(__pyx_v_tuple_c, (&__pyx_v_size)));

  /* "amplpy/util.pxi":100
 *     cdef list pylist = []
 *     campl.AMPL_TupleGetSize(tuple_c, &size)
 *     campl.AMPL_TupleGetVariantPtr(tuple_c, &variants)             # <<<<<<<<<<<<<<
 *     for i in range(size):
 *         pylist.append(to_py_variant(variants[i]))
 */
  (void)(AMPL_TupleGetVariantPtr(__pyx_v_tuple_c, (&__pyx_v_variants)));

  /* "amplpy/util.pxi":101
 *     campl.AMPL_TupleGetSize(tuple_c, &size)
 *     campl.AMPL_TupleGetVariantPtr(tuple_c, &variants)
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         pylist.append(to_py_variant(variants[i]))
 *     return tuple(pylist)
 */
  __pyx_t_2 = __pyx_v_size;
  __pyx_t_3 = __pyx_t_2;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
    __pyx_v_i = __pyx_t_4;

    /* "amplpy/util.pxi":102
 *     campl.AMPL_TupleGetVariantPtr(tuple_c, &variants)
 *     for i in range(size):
 *         pylist.append(to_py_variant(variants[i]))             # <<<<<<<<<<<<<<
 *     return tuple(pylist)
 * 
 */
    __pyx_t_1 = __pyx_f_7_amplpy_to_py_variant((__pyx_v_variants[__pyx_v_i])); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 102, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_pylist, __pyx_t_1); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(4, 102, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "amplpy/util.pxi":103
 *     for i in range(size):
 *         pylist.append(to_py_variant(variants[i]))
 *     return tuple(pylist)             # <<<<<<<<<<<<<<
 * 
 * cdef campl.AMPL_TUPLE* to_c_tuple(py_tuple):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyList_AsTuple(__pyx_v_pylist); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 103, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "amplpy/util.pxi":95
 *         return None
 * 
 * cdef to_py_tuple(campl.AMPL_TUPLE* tuple_c):             # <<<<<<<<<<<<<<
 *     cdef size_t size
 *     cdef campl.AMPL_VARIANT** variants
 */

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

/* "amplpy/util.pxi":105
 *     return tuple(pylist)
 * 
 * cdef campl.AMPL_TUPLE* to_c_tuple(py_tuple):             # <<<<<<<<<<<<<<
 *     cdef size_t i
 *     cdef campl.AMPL_TUPLE* tuple_c
 */

static AMPL_TUPLE *__pyx_f_7_amplpy_to_c_tuple(PyObject *__pyx_v_py_tuple) {
  size_t __pyx_v_i;
  AMPL_TUPLE *__pyx_v_tuple_c;
  size_t __pyx_v_size;
  AMPL_VARIANT **__pyx_v_variants;
  AMPL_TUPLE *__pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  size_t __pyx_t_5;
  size_t __pyx_t_6;
  size_t __pyx_t_7;
  AMPL_VARIANT *__pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_c_tuple", 0);
  __Pyx_INCREF(__pyx_v_py_tuple);

  /* "amplpy/util.pxi":109
 *     cdef campl.AMPL_TUPLE* tuple_c
 * 
 *     if not isinstance(py_tuple, (tuple, list)):             # <<<<<<<<<<<<<<
 *         py_tuple = [py_tuple]
 * 
 */
  __pyx_t_2 = PyTuple_Check(__pyx_v_py_tuple); 
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = PyList_Check(__pyx_v_py_tuple); 
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  __pyx_t_2 = (!__pyx_t_1);
  if (__pyx_t_2) {

    /* "amplpy/util.pxi":110
 * 
 *     if not isinstance(py_tuple, (tuple, list)):
 *         py_tuple = [py_tuple]             # <<<<<<<<<<<<<<
 * 
 *     cdef size_t size = len(py_tuple)
 */
    __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 110, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_py_tuple);
    __Pyx_GIVEREF(__pyx_v_py_tuple);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_v_py_tuple)) __PYX_ERR(4, 110, __pyx_L1_error);
    __Pyx_DECREF_SET(__pyx_v_py_tuple, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "amplpy/util.pxi":109
 *     cdef campl.AMPL_TUPLE* tuple_c
 * 
 *     if not isinstance(py_tuple, (tuple, list)):             # <<<<<<<<<<<<<<
 *         py_tuple = [py_tuple]
 * 
 */
  }

  /* "amplpy/util.pxi":112
 *         py_tuple = [py_tuple]
 * 
 *     cdef size_t size = len(py_tuple)             # <<<<<<<<<<<<<<
 *     cdef campl.AMPL_VARIANT** variants = <campl.AMPL_VARIANT**> malloc(size * sizeof(campl.AMPL_VARIANT*))
 * 
 */
  __pyx_t_4 = PyObject_Length(__pyx_v_py_tuple); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(4, 112, __pyx_L1_error)
  __pyx_v_size = __pyx_t_4;

  /* "amplpy/util.pxi":113
 * 
 *     cdef size_t size = len(py_tuple)
 *     cdef campl.AMPL_VARIANT** variants = <campl.AMPL_VARIANT**> malloc(size * sizeof(campl.AMPL_VARIANT*))             # <<<<<<<<<<<<<<
 * 
 *     for i in range(size):
 */
  __pyx_v_variants = ((AMPL_VARIANT **)malloc((__pyx_v_size * (sizeof(AMPL_VARIANT *)))));

  /* "amplpy/util.pxi":115
 *     cdef campl.AMPL_VARIANT** variants = <campl.AMPL_VARIANT**> malloc(size * sizeof(campl.AMPL_VARIANT*))
 * 
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         variants[i] = to_c_variant(py_tuple[i])
 * 
 */
  __pyx_t_5 = __pyx_v_size;
  __pyx_t_6 = __pyx_t_5;
  for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
    __pyx_v_i = __pyx_t_7;

    /* "amplpy/util.pxi":116
 * 
 *     for i in range(size):
 *         variants[i] = to_c_variant(py_tuple[i])             # <<<<<<<<<<<<<<
 * 
 *     campl.AMPL_TupleCreate(&tuple_c, size, variants)
 */
    __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_py_tuple, __pyx_v_i, size_t, 0, __Pyx_PyInt_FromSize_t, 0, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 116, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_8 = __pyx_f_7_amplpy_to_c_variant(__pyx_t_3); if (unlikely(__pyx_t_8 == ((AMPL_VARIANT *)NULL) && PyErr_Occurred())) __PYX_ERR(4, 116, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    (__pyx_v_variants[__pyx_v_i]) = __pyx_t_8;
  }

  /* "amplpy/util.pxi":118
 *         variants[i] = to_c_variant(py_tuple[i])
 * 
 *     campl.AMPL_TupleCreate(&tuple_c, size, variants)             # <<<<<<<<<<<<<<
 * 
 *     for i in range(size):
 */
  (void)(AMPL_TupleCreate((&__pyx_v_tuple_c), __pyx_v_size, __pyx_v_variants));

  /* "amplpy/util.pxi":120
 *     campl.AMPL_TupleCreate(&tuple_c, size, variants)
 * 
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         campl.AMPL_VariantFree(&variants[i])
 * 
 */
  __pyx_t_5 = __pyx_v_size;
  __pyx_t_6 = __pyx_t_5;
  for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
    __pyx_v_i = __pyx_t_7;

    /* "amplpy/util.pxi":121
 * 
 *     for i in range(size):
 *         campl.AMPL_VariantFree(&variants[i])             # <<<<<<<<<<<<<<
 * 
 *     free(variants)
 */
    (void)(AMPL_VariantFree((&(__pyx_v_variants[__pyx_v_i]))));
  }

  /* "amplpy/util.pxi":123
 *         campl.AMPL_VariantFree(&variants[i])
 * 
 *     free(variants)             # <<<<<<<<<<<<<<
 *     return tuple_c
 * 
 */
  free(__pyx_v_variants);

  /* "amplpy/util.pxi":124
 * 
 *     free(variants)
 *     return tuple_c             # <<<<<<<<<<<<<<
 * 
 * cdef campl.AMPL_VARIANT* to_c_variant(value):
 */
  __pyx_r = __pyx_v_tuple_c;
  goto __pyx_L0;

  /* "amplpy/util.pxi":105
 *     return tuple(pylist)
 * 
 * cdef campl.AMPL_TUPLE* to_c_tuple(py_tuple):             # <<<<<<<<<<<<<<
 *     cdef size_t i
 *     cdef campl.AMPL_TUPLE* tuple_c
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("_amplpy.to_c_tuple", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_py_tuple);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/util.pxi":126
 *     return tuple_c
 * 
 * cdef campl.AMPL_VARIANT* to_c_variant(value):             # <<<<<<<<<<<<<<
 *     cdef campl.AMPL_VARIANT* variant
 *     if isinstance(value, str):
 */

static AMPL_VARIANT *__pyx_f_7_amplpy_to_c_variant(PyObject *__pyx_v_value) {
  AMPL_VARIANT *__pyx_v_variant;
  AMPL_VARIANT *__pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  unsigned int __pyx_t_5;
  char const *__pyx_t_6;
  double __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_c_variant", 1);

  /* "amplpy/util.pxi":128
 * cdef campl.AMPL_VARIANT* to_c_variant(value):
 *     cdef campl.AMPL_VARIANT* variant
 *     if isinstance(value, str):             # <<<<<<<<<<<<<<
 *         campl.AMPL_VariantCreateString(&variant, value.encode('utf-8'))
 *     elif isinstance(value, Real):
 */
  __pyx_t_1 = PyUnicode_Check(__pyx_v_value); 
  if (__pyx_t_1) {

    /* "amplpy/util.pxi":129
 *     cdef campl.AMPL_VARIANT* variant
 *     if isinstance(value, str):
 *         campl.AMPL_VariantCreateString(&variant, value.encode('utf-8'))             # <<<<<<<<<<<<<<
 *     elif isinstance(value, Real):
 *         campl.AMPL_VariantCreateNumeric(&variant, value)
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 129, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_u_utf_8};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 129, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_t_2); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(4, 129, __pyx_L1_error)
    (void)(AMPL_VariantCreateString((&__pyx_v_variant), __pyx_t_6));
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "amplpy/util.pxi":128
 * cdef campl.AMPL_VARIANT* to_c_variant(value):
 *     cdef campl.AMPL_VARIANT* variant
 *     if isinstance(value, str):             # <<<<<<<<<<<<<<
 *         campl.AMPL_VariantCreateString(&variant, value.encode('utf-8'))
 *     elif isinstance(value, Real):
 */
    goto __pyx_L3;
  }

  /* "amplpy/util.pxi":130
 *     if isinstance(value, str):
 *         campl.AMPL_VariantCreateString(&variant, value.encode('utf-8'))
 *     elif isinstance(value, Real):             # <<<<<<<<<<<<<<
 *         campl.AMPL_VariantCreateNumeric(&variant, value)
 *     elif value is None:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Real); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 130, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_IsInstance(__pyx_v_value, __pyx_t_2); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(4, 130, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_1) {

    /* "amplpy/util.pxi":131
 *         campl.AMPL_VariantCreateString(&variant, value.encode('utf-8'))
 *     elif isinstance(value, Real):
 *         campl.AMPL_VariantCreateNumeric(&variant, value)             # <<<<<<<<<<<<<<
 *     elif value is None:
 *         campl.AMPL_VariantCreateEmpty(&variant)
 */
    __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) __PYX_ERR(4, 131, __pyx_L1_error)
    (void)(AMPL_VariantCreateNumeric((&__pyx_v_variant), __pyx_t_7));

    /* "amplpy/util.pxi":130
 *     if isinstance(value, str):
 *         campl.AMPL_VariantCreateString(&variant, value.encode('utf-8'))
 *     elif isinstance(value, Real):             # <<<<<<<<<<<<<<
 *         campl.AMPL_VariantCreateNumeric(&variant, value)
 *     elif value is None:
 */
    goto __pyx_L3;
  }

  /* "amplpy/util.pxi":132
 *     elif isinstance(value, Real):
 *         campl.AMPL_VariantCreateNumeric(&variant, value)
 *     elif value is None:             # <<<<<<<<<<<<<<
 *         campl.AMPL_VariantCreateEmpty(&variant)
 *     else:
 */
  __pyx_t_1 = (__pyx_v_value == Py_None);
  if (likely(__pyx_t_1)) {

    /* "amplpy/util.pxi":133
 *         campl.AMPL_VariantCreateNumeric(&variant, value)
 *     elif value is None:
 *         campl.AMPL_VariantCreateEmpty(&variant)             # <<<<<<<<<<<<<<
 *     else:
 *         raise ValueError(f"unsupported type {type(value)}")
 */
    (void)(AMPL_VariantCreateEmpty((&__pyx_v_variant)));

    /* "amplpy/util.pxi":132
 *     elif isinstance(value, Real):
 *         campl.AMPL_VariantCreateNumeric(&variant, value)
 *     elif value is None:             # <<<<<<<<<<<<<<
 *         campl.AMPL_VariantCreateEmpty(&variant)
 *     else:
 */
    goto __pyx_L3;
  }

  /* "amplpy/util.pxi":135
 *         campl.AMPL_VariantCreateEmpty(&variant)
 *     else:
 *         raise ValueError(f"unsupported type {type(value)}")             # <<<<<<<<<<<<<<
 *     return variant
 * 
 */
  /*else*/ {
    __pyx_t_2 = __Pyx_PyObject_FormatSimple(((PyObject *)Py_TYPE(__pyx_v_value)), __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 135, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_kp_u_unsupported_type, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 135, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 135, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(4, 135, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "amplpy/util.pxi":136
 *     else:
 *         raise ValueError(f"unsupported type {type(value)}")
 *     return variant             # <<<<<<<<<<<<<<
 * 
 * cdef create_entity(campl.AMPL_ENTITYTYPE entity_class, campl.AMPL* ampl, char* name, campl.AMPL_TUPLE* index, parent):
 */
  __pyx_r = __pyx_v_variant;
  goto __pyx_L0;

  /* "amplpy/util.pxi":126
 *     return tuple_c
 * 
 * cdef campl.AMPL_VARIANT* to_c_variant(value):             # <<<<<<<<<<<<<<
 *     cdef campl.AMPL_VARIANT* variant
 *     if isinstance(value, str):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("_amplpy.to_c_variant", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/util.pxi":138
 *     return variant
 * 
 * cdef create_entity(campl.AMPL_ENTITYTYPE entity_class, campl.AMPL* ampl, char* name, campl.AMPL_TUPLE* index, parent):             # <<<<<<<<<<<<<<
 *     if entity_class == campl.AMPL_VARIABLE:
 *         return Variable.create(ampl, name, index, parent)
 */

static PyObject *__pyx_f_7_amplpy_create_entity(AMPL_ENTITYTYPE __pyx_v_entity_class, AMPL *__pyx_v_ampl, char *__pyx_v_name, AMPL_TUPLE *__pyx_v_index, PyObject *__pyx_v_parent) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("create_entity", 1);

  /* "amplpy/util.pxi":139
 * 
 * cdef create_entity(campl.AMPL_ENTITYTYPE entity_class, campl.AMPL* ampl, char* name, campl.AMPL_TUPLE* index, parent):
 *     if entity_class == campl.AMPL_VARIABLE:             # <<<<<<<<<<<<<<
 *         return Variable.create(ampl, name, index, parent)
 *     elif entity_class == campl.AMPL_CONSTRAINT:
 */
  switch (__pyx_v_entity_class) {
    case AMPL_VARIABLE:

    /* "amplpy/util.pxi":140
 * cdef create_entity(campl.AMPL_ENTITYTYPE entity_class, campl.AMPL* ampl, char* name, campl.AMPL_TUPLE* index, parent):
 *     if entity_class == campl.AMPL_VARIABLE:
 *         return Variable.create(ampl, name, index, parent)             # <<<<<<<<<<<<<<
 *     elif entity_class == campl.AMPL_CONSTRAINT:
 *         return Constraint.create(ampl, name, index, parent)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __pyx_f_7_amplpy_8Variable_create(__pyx_v_ampl, __pyx_v_name, __pyx_v_index, __pyx_v_parent); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 140, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "amplpy/util.pxi":139
 * 
 * cdef create_entity(campl.AMPL_ENTITYTYPE entity_class, campl.AMPL* ampl, char* name, campl.AMPL_TUPLE* index, parent):
 *     if entity_class == campl.AMPL_VARIABLE:             # <<<<<<<<<<<<<<
 *         return Variable.create(ampl, name, index, parent)
 *     elif entity_class == campl.AMPL_CONSTRAINT:
 */
    break;
    case AMPL_CONSTRAINT:

    /* "amplpy/util.pxi":142
 *         return Variable.create(ampl, name, index, parent)
 *     elif entity_class == campl.AMPL_CONSTRAINT:
 *         return Constraint.create(ampl, name, index, parent)             # <<<<<<<<<<<<<<
 *     elif entity_class == campl.AMPL_OBJECTIVE:
 *         return Objective.create(ampl, name, index, parent)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __pyx_f_7_amplpy_10Constraint_create(__pyx_v_ampl, __pyx_v_name, __pyx_v_index, __pyx_v_parent); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 142, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "amplpy/util.pxi":141
 *     if entity_class == campl.AMPL_VARIABLE:
 *         return Variable.create(ampl, name, index, parent)
 *     elif entity_class == campl.AMPL_CONSTRAINT:             # <<<<<<<<<<<<<<
 *         return Constraint.create(ampl, name, index, parent)
 *     elif entity_class == campl.AMPL_OBJECTIVE:
 */
    break;
    case AMPL_OBJECTIVE:

    /* "amplpy/util.pxi":144
 *         return Constraint.create(ampl, name, index, parent)
 *     elif entity_class == campl.AMPL_OBJECTIVE:
 *         return Objective.create(ampl, name, index, parent)             # <<<<<<<<<<<<<<
 *     elif entity_class == campl.AMPL_SET:
 *         return Set.create(ampl, name, index, parent)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __pyx_f_7_amplpy_9Objective_create(__pyx_v_ampl, __pyx_v_name, __pyx_v_index, __pyx_v_parent); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 144, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "amplpy/util.pxi":143
 *     elif entity_class == campl.AMPL_CONSTRAINT:
 *         return Constraint.create(ampl, name, index, parent)
 *     elif entity_class == campl.AMPL_OBJECTIVE:             # <<<<<<<<<<<<<<
 *         return Objective.create(ampl, name, index, parent)
 *     elif entity_class == campl.AMPL_SET:
 */
    break;
    case AMPL_SET:

    /* "amplpy/util.pxi":146
 *         return Objective.create(ampl, name, index, parent)
 *     elif entity_class == campl.AMPL_SET:
 *         return Set.create(ampl, name, index, parent)             # <<<<<<<<<<<<<<
 *     elif entity_class == campl.AMPL_PARAMETER:
 *         return Parameter.create(ampl, name, index, parent)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __pyx_f_7_amplpy_3Set_create(__pyx_v_ampl, __pyx_v_name, __pyx_v_index, __pyx_v_parent); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 146, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "amplpy/util.pxi":145
 *     elif entity_class == campl.AMPL_OBJECTIVE:
 *         return Objective.create(ampl, name, index, parent)
 *     elif entity_class == campl.AMPL_SET:             # <<<<<<<<<<<<<<
 *         return Set.create(ampl, name, index, parent)
 *     elif entity_class == campl.AMPL_PARAMETER:
 */
    break;
    case AMPL_PARAMETER:

    /* "amplpy/util.pxi":148
 *         return Set.create(ampl, name, index, parent)
 *     elif entity_class == campl.AMPL_PARAMETER:
 *         return Parameter.create(ampl, name, index, parent)             # <<<<<<<<<<<<<<
 *     else:
 *         return Entity.create(ampl, name, index, parent)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __pyx_f_7_amplpy_9Parameter_create(__pyx_v_ampl, __pyx_v_name, __pyx_v_index, __pyx_v_parent); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 148, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "amplpy/util.pxi":147
 *     elif entity_class == campl.AMPL_SET:
 *         return Set.create(ampl, name, index, parent)
 *     elif entity_class == campl.AMPL_PARAMETER:             # <<<<<<<<<<<<<<
 *         return Parameter.create(ampl, name, index, parent)
 *     else:
 */
    break;
    default:

    /* "amplpy/util.pxi":150
 *         return Parameter.create(ampl, name, index, parent)
 *     else:
 *         return Entity.create(ampl, name, index, parent)             # <<<<<<<<<<<<<<
 * 
 * cdef void setValuesParamNum(campl.AMPL* ampl, char* name, values):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __pyx_f_7_amplpy_6Entity_create(__pyx_v_ampl, __pyx_v_name, __pyx_v_index, __pyx_v_parent); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 150, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
    break;
  }

  /* "amplpy/util.pxi":138
 *     return variant
 * 
 * cdef create_entity(campl.AMPL_ENTITYTYPE entity_class, campl.AMPL* ampl, char* name, campl.AMPL_TUPLE* index, parent):             # <<<<<<<<<<<<<<
 *     if entity_class == campl.AMPL_VARIABLE:
 *         return Variable.create(ampl, name, index, parent)
 */

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

/* "amplpy/util.pxi":152
 *         return Entity.create(ampl, name, index, parent)
 * 
 * cdef void setValuesParamNum(campl.AMPL* ampl, char* name, values):             # <<<<<<<<<<<<<<
 *     cdef size_t size = len(values)
 *     cdef double* values_c = <double*> malloc(size * sizeof(double))
 */

static void __pyx_f_7_amplpy_setValuesParamNum(AMPL *__pyx_v_ampl, char *__pyx_v_name, PyObject *__pyx_v_values) {
  size_t __pyx_v_size;
  double *__pyx_v_values_c;
  size_t __pyx_v_i;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  size_t __pyx_t_2;
  size_t __pyx_t_3;
  size_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  double __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("setValuesParamNum", 1);

  /* "amplpy/util.pxi":153
 * 
 * cdef void setValuesParamNum(campl.AMPL* ampl, char* name, values):
 *     cdef size_t size = len(values)             # <<<<<<<<<<<<<<
 *     cdef double* values_c = <double*> malloc(size * sizeof(double))
 *     for i in range(size):
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(4, 153, __pyx_L1_error)
  __pyx_v_size = __pyx_t_1;

  /* "amplpy/util.pxi":154
 * cdef void setValuesParamNum(campl.AMPL* ampl, char* name, values):
 *     cdef size_t size = len(values)
 *     cdef double* values_c = <double*> malloc(size * sizeof(double))             # <<<<<<<<<<<<<<
 *     for i in range(size):
 *         values_c[i] = values[i]
 */
  __pyx_v_values_c = ((double *)malloc((__pyx_v_size * (sizeof(double)))));

  /* "amplpy/util.pxi":155
 *     cdef size_t size = len(values)
 *     cdef double* values_c = <double*> malloc(size * sizeof(double))
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         values_c[i] = values[i]
 *     campl.AMPL_ParameterSetArgsDoubleValues(ampl, name, size, values_c)
 */
  __pyx_t_2 = __pyx_v_size;
  __pyx_t_3 = __pyx_t_2;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
    __pyx_v_i = __pyx_t_4;

    /* "amplpy/util.pxi":156
 *     cdef double* values_c = <double*> malloc(size * sizeof(double))
 *     for i in range(size):
 *         values_c[i] = values[i]             # <<<<<<<<<<<<<<
 *     campl.AMPL_ParameterSetArgsDoubleValues(ampl, name, size, values_c)
 *     free(values_c)
 */
    __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_values, __pyx_v_i, size_t, 0, __Pyx_PyInt_FromSize_t, 0, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 156, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(4, 156, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    (__pyx_v_values_c[__pyx_v_i]) = __pyx_t_6;
  }

  /* "amplpy/util.pxi":157
 *     for i in range(size):
 *         values_c[i] = values[i]
 *     campl.AMPL_ParameterSetArgsDoubleValues(ampl, name, size, values_c)             # <<<<<<<<<<<<<<
 *     free(values_c)
 * 
 */
  (void)(AMPL_ParameterSetArgsDoubleValues(__pyx_v_ampl, __pyx_v_name, __pyx_v_size, __pyx_v_values_c));

  /* "amplpy/util.pxi":158
 *         values_c[i] = values[i]
 *     campl.AMPL_ParameterSetArgsDoubleValues(ampl, name, size, values_c)
 *     free(values_c)             # <<<<<<<<<<<<<<
 * 
 * cdef void setValuesParamStr(campl.AMPL* ampl, char* name, values):
 */
  free(__pyx_v_values_c);

  /* "amplpy/util.pxi":152
 *         return Entity.create(ampl, name, index, parent)
 * 
 * cdef void setValuesParamNum(campl.AMPL* ampl, char* name, values):             # <<<<<<<<<<<<<<
 *     cdef size_t size = len(values)
 *     cdef double* values_c = <double*> malloc(size * sizeof(double))
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("_amplpy.setValuesParamNum", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "amplpy/util.pxi":160
 *     free(values_c)
 * 
 * cdef void setValuesParamStr(campl.AMPL* ampl, char* name, values):             # <<<<<<<<<<<<<<
 *     cdef size_t size = len(values)
 *     cdef char** values_c = <char**> malloc(size * sizeof(char*))
 */

static void __pyx_f_7_amplpy_setValuesParamStr(AMPL *__pyx_v_ampl, char *__pyx_v_name, PyObject *__pyx_v_values) {
  size_t __pyx_v_size;
  char **__pyx_v_values_c;
  size_t __pyx_v_i;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  size_t __pyx_t_2;
  size_t __pyx_t_3;
  size_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  unsigned int __pyx_t_8;
  char const *__pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("setValuesParamStr", 1);

  /* "amplpy/util.pxi":161
 * 
 * cdef void setValuesParamStr(campl.AMPL* ampl, char* name, values):
 *     cdef size_t size = len(values)             # <<<<<<<<<<<<<<
 *     cdef char** values_c = <char**> malloc(size * sizeof(char*))
 *     for i in range(size):
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(4, 161, __pyx_L1_error)
  __pyx_v_size = __pyx_t_1;

  /* "amplpy/util.pxi":162
 * cdef void setValuesParamStr(campl.AMPL* ampl, char* name, values):
 *     cdef size_t size = len(values)
 *     cdef char** values_c = <char**> malloc(size * sizeof(char*))             # <<<<<<<<<<<<<<
 *     for i in range(size):
 *         values_c[i] = strdup(values[i].encode('utf-8'))
 */
  __pyx_v_values_c = ((char **)malloc((__pyx_v_size * (sizeof(char *)))));

  /* "amplpy/util.pxi":163
 *     cdef size_t size = len(values)
 *     cdef char** values_c = <char**> malloc(size * sizeof(char*))
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         values_c[i] = strdup(values[i].encode('utf-8'))
 * 
 */
  __pyx_t_2 = __pyx_v_size;
  __pyx_t_3 = __pyx_t_2;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
    __pyx_v_i = __pyx_t_4;

    /* "amplpy/util.pxi":164
 *     cdef char** values_c = <char**> malloc(size * sizeof(char*))
 *     for i in range(size):
 *         values_c[i] = strdup(values[i].encode('utf-8'))             # <<<<<<<<<<<<<<
 * 
 *     campl.AMPL_ParameterSetArgsStringValues(ampl, name, size, values_c)
 */
    __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_values, __pyx_v_i, size_t, 0, __Pyx_PyInt_FromSize_t, 0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 164, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_encode); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 164, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    __pyx_t_8 = 0;
    #if CYTHON_UNPACK_METHODS
    if (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);
        __pyx_t_8 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_kp_u_utf_8};
      __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 164, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __pyx_t_9 = __Pyx_PyObject_AsString(__pyx_t_5); if (unlikely((!__pyx_t_9) && PyErr_Occurred())) __PYX_ERR(4, 164, __pyx_L1_error)
    (__pyx_v_values_c[__pyx_v_i]) = strdup(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }

  /* "amplpy/util.pxi":166
 *         values_c[i] = strdup(values[i].encode('utf-8'))
 * 
 *     campl.AMPL_ParameterSetArgsStringValues(ampl, name, size, values_c)             # <<<<<<<<<<<<<<
 * 
 *     for i in range(size):
 */
  (void)(AMPL_ParameterSetArgsStringValues(__pyx_v_ampl, __pyx_v_name, __pyx_v_size, __pyx_v_values_c));

  /* "amplpy/util.pxi":168
 *     campl.AMPL_ParameterSetArgsStringValues(ampl, name, size, values_c)
 * 
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         free(values_c[i])
 *     free(values_c)
 */
  __pyx_t_2 = __pyx_v_size;
  __pyx_t_3 = __pyx_t_2;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
    __pyx_v_i = __pyx_t_4;

    /* "amplpy/util.pxi":169
 * 
 *     for i in range(size):
 *         free(values_c[i])             # <<<<<<<<<<<<<<
 *     free(values_c)
 * 
 */
    free((__pyx_v_values_c[__pyx_v_i]));
  }

  /* "amplpy/util.pxi":170
 *     for i in range(size):
 *         free(values_c[i])
 *     free(values_c)             # <<<<<<<<<<<<<<
 * 
 * cdef void setValuesPyDict(campl.AMPL* ampl, char* name, dict dicts):
 */
  free(__pyx_v_values_c);

  /* "amplpy/util.pxi":160
 *     free(values_c)
 * 
 * cdef void setValuesParamStr(campl.AMPL* ampl, char* name, values):             # <<<<<<<<<<<<<<
 *     cdef size_t size = len(values)
 *     cdef char** values_c = <char**> malloc(size * sizeof(char*))
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("_amplpy.setValuesParamStr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "amplpy/util.pxi":172
 *     free(values_c)
 * 
 * cdef void setValuesPyDict(campl.AMPL* ampl, char* name, dict dicts):             # <<<<<<<<<<<<<<
 *     cdef size_t i
 *     cdef campl.AMPL_TUPLE** indices_c
 */

static void __pyx_f_7_amplpy_setValuesPyDict(AMPL *__pyx_v_ampl, char *__pyx_v_name, PyObject *__pyx_v_dicts) {
  size_t __pyx_v_i;
  AMPL_TUPLE **__pyx_v_indices_c;
  char **__pyx_v_values_str_c;
  double *__pyx_v_values_num_c;
  PyObject *__pyx_v_item;
  PyObject *__pyx_v_d_keys = 0;
  PyObject *__pyx_v_d_values = 0;
  size_t __pyx_v_size;
  bool __pyx_v_has_numbers;
  bool __pyx_v_has_strings;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  size_t __pyx_t_4;
  size_t __pyx_t_5;
  size_t __pyx_t_6;
  PyObject *__pyx_t_7;
  int __pyx_t_8;
  AMPL_TUPLE *__pyx_t_9;
  char const *__pyx_t_10;
  long __pyx_t_11;
  double __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("setValuesPyDict", 1);

  /* "amplpy/util.pxi":179
 *     cdef PyObject* item
 * 
 *     if not PyDict_Check(dicts):             # <<<<<<<<<<<<<<
 *         raise ValueError("Expected a dictionary")
 * 
 */
  __pyx_t_1 = (!PyDict_Check(__pyx_v_dicts));
  if (unlikely(__pyx_t_1)) {

    /* "amplpy/util.pxi":180
 * 
 *     if not PyDict_Check(dicts):
 *         raise ValueError("Expected a dictionary")             # <<<<<<<<<<<<<<
 * 
 *     cdef object d_keys = PyDict_Keys(dicts)
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 180, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(4, 180, __pyx_L1_error)

    /* "amplpy/util.pxi":179
 *     cdef PyObject* item
 * 
 *     if not PyDict_Check(dicts):             # <<<<<<<<<<<<<<
 *         raise ValueError("Expected a dictionary")
 * 
 */
  }

  /* "amplpy/util.pxi":182
 *         raise ValueError("Expected a dictionary")
 * 
 *     cdef object d_keys = PyDict_Keys(dicts)             # <<<<<<<<<<<<<<
 *     cdef object d_values = PyDict_Values(dicts)
 *     cdef size_t size = len(dicts)
 */
  __pyx_t_2 = PyDict_Keys(__pyx_v_dicts); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 182, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_d_keys = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "amplpy/util.pxi":183
 * 
 *     cdef object d_keys = PyDict_Keys(dicts)
 *     cdef object d_values = PyDict_Values(dicts)             # <<<<<<<<<<<<<<
 *     cdef size_t size = len(dicts)
 * 
 */
  __pyx_t_2 = PyDict_Values(__pyx_v_dicts); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 183, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_d_values = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "amplpy/util.pxi":184
 *     cdef object d_keys = PyDict_Keys(dicts)
 *     cdef object d_values = PyDict_Values(dicts)
 *     cdef size_t size = len(dicts)             # <<<<<<<<<<<<<<
 * 
 *     cdef bool has_numbers = False
 */
  if (unlikely(__pyx_v_dicts == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(4, 184, __pyx_L1_error)
  }
  __pyx_t_3 = PyDict_Size(__pyx_v_dicts); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(4, 184, __pyx_L1_error)
  __pyx_v_size = __pyx_t_3;

  /* "amplpy/util.pxi":186
 *     cdef size_t size = len(dicts)
 * 
 *     cdef bool has_numbers = False             # <<<<<<<<<<<<<<
 *     cdef bool has_strings = False
 * 
 */
  __pyx_v_has_numbers = 0;

  /* "amplpy/util.pxi":187
 * 
 *     cdef bool has_numbers = False
 *     cdef bool has_strings = False             # <<<<<<<<<<<<<<
 * 
 *     for i in range(size):
 */
  __pyx_v_has_strings = 0;

  /* "amplpy/util.pxi":189
 *     cdef bool has_strings = False
 * 
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         item = PyList_GetItem(d_values, i)
 *         if item == NULL:
 */
  __pyx_t_4 = __pyx_v_size;
  __pyx_t_5 = __pyx_t_4;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "amplpy/util.pxi":190
 * 
 *     for i in range(size):
 *         item = PyList_GetItem(d_values, i)             # <<<<<<<<<<<<<<
 *         if item == NULL:
 *             raise ValueError("Failed to access value")
 */
    __pyx_t_7 = PyList_GetItem(__pyx_v_d_values, __pyx_v_i); if (unlikely(__pyx_t_7 == ((PyObject *)NULL))) __PYX_ERR(4, 190, __pyx_L1_error)
    __pyx_v_item = __pyx_t_7;

    /* "amplpy/util.pxi":191
 *     for i in range(size):
 *         item = PyList_GetItem(d_values, i)
 *         if item == NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError("Failed to access value")
 * 
 */
    __pyx_t_1 = (__pyx_v_item == NULL);
    if (unlikely(__pyx_t_1)) {

      /* "amplpy/util.pxi":192
 *         item = PyList_GetItem(d_values, i)
 *         if item == NULL:
 *             raise ValueError("Failed to access value")             # <<<<<<<<<<<<<<
 * 
 *         if PyUnicode_Check(<object>item):
 */
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 192, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __PYX_ERR(4, 192, __pyx_L1_error)

      /* "amplpy/util.pxi":191
 *     for i in range(size):
 *         item = PyList_GetItem(d_values, i)
 *         if item == NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError("Failed to access value")
 * 
 */
    }

    /* "amplpy/util.pxi":194
 *             raise ValueError("Failed to access value")
 * 
 *         if PyUnicode_Check(<object>item):             # <<<<<<<<<<<<<<
 *             has_strings = True
 *         else:
 */
    __pyx_t_1 = PyUnicode_Check(((PyObject *)__pyx_v_item));
    if (__pyx_t_1) {

      /* "amplpy/util.pxi":195
 * 
 *         if PyUnicode_Check(<object>item):
 *             has_strings = True             # <<<<<<<<<<<<<<
 *         else:
 *             has_numbers = True
 */
      __pyx_v_has_strings = 1;

      /* "amplpy/util.pxi":194
 *             raise ValueError("Failed to access value")
 * 
 *         if PyUnicode_Check(<object>item):             # <<<<<<<<<<<<<<
 *             has_strings = True
 *         else:
 */
      goto __pyx_L7;
    }

    /* "amplpy/util.pxi":197
 *             has_strings = True
 *         else:
 *             has_numbers = True             # <<<<<<<<<<<<<<
 * 
 *         if has_numbers and has_strings:
 */
    /*else*/ {
      __pyx_v_has_numbers = 1;
    }
    __pyx_L7:;

    /* "amplpy/util.pxi":199
 *             has_numbers = True
 * 
 *         if has_numbers and has_strings:             # <<<<<<<<<<<<<<
 *             raise ValueError("All values must be either numbers or strings")
 * 
 */
    __pyx_t_8 = (__pyx_v_has_numbers != 0);
    if (__pyx_t_8) {
    } else {
      __pyx_t_1 = __pyx_t_8;
      goto __pyx_L9_bool_binop_done;
    }
    __pyx_t_8 = (__pyx_v_has_strings != 0);
    __pyx_t_1 = __pyx_t_8;
    __pyx_L9_bool_binop_done:;
    if (unlikely(__pyx_t_1)) {

      /* "amplpy/util.pxi":200
 * 
 *         if has_numbers and has_strings:
 *             raise ValueError("All values must be either numbers or strings")             # <<<<<<<<<<<<<<
 * 
 *     if has_strings and not has_numbers:
 */
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 200, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __PYX_ERR(4, 200, __pyx_L1_error)

      /* "amplpy/util.pxi":199
 *             has_numbers = True
 * 
 *         if has_numbers and has_strings:             # <<<<<<<<<<<<<<
 *             raise ValueError("All values must be either numbers or strings")
 * 
 */
    }
  }

  /* "amplpy/util.pxi":202
 *             raise ValueError("All values must be either numbers or strings")
 * 
 *     if has_strings and not has_numbers:             # <<<<<<<<<<<<<<
 *         indices_c = <campl.AMPL_TUPLE**> malloc(size * sizeof(campl.AMPL_TUPLE*))
 *         values_str_c = <char **> malloc(size * sizeof(char*))
 */
  __pyx_t_8 = (__pyx_v_has_strings != 0);
  if (__pyx_t_8) {
  } else {
    __pyx_t_1 = __pyx_t_8;
    goto __pyx_L12_bool_binop_done;
  }
  __pyx_t_8 = (!(__pyx_v_has_numbers != 0));
  __pyx_t_1 = __pyx_t_8;
  __pyx_L12_bool_binop_done:;
  if (__pyx_t_1) {

    /* "amplpy/util.pxi":203
 * 
 *     if has_strings and not has_numbers:
 *         indices_c = <campl.AMPL_TUPLE**> malloc(size * sizeof(campl.AMPL_TUPLE*))             # <<<<<<<<<<<<<<
 *         values_str_c = <char **> malloc(size * sizeof(char*))
 *         for i in range(size):
 */
    __pyx_v_indices_c = ((AMPL_TUPLE **)malloc((__pyx_v_size * (sizeof(AMPL_TUPLE *)))));

    /* "amplpy/util.pxi":204
 *     if has_strings and not has_numbers:
 *         indices_c = <campl.AMPL_TUPLE**> malloc(size * sizeof(campl.AMPL_TUPLE*))
 *         values_str_c = <char **> malloc(size * sizeof(char*))             # <<<<<<<<<<<<<<
 *         for i in range(size):
 *             indices_c[i] = to_c_tuple(<object>PyList_GetItem(d_keys, i))
 */
    __pyx_v_values_str_c = ((char **)malloc((__pyx_v_size * (sizeof(char *)))));

    /* "amplpy/util.pxi":205
 *         indices_c = <campl.AMPL_TUPLE**> malloc(size * sizeof(campl.AMPL_TUPLE*))
 *         values_str_c = <char **> malloc(size * sizeof(char*))
 *         for i in range(size):             # <<<<<<<<<<<<<<
 *             indices_c[i] = to_c_tuple(<object>PyList_GetItem(d_keys, i))
 *             values_str_c[i] = PyUnicode_AsUTF8(<object>PyList_GetItem(d_values, i))
 */
    __pyx_t_4 = __pyx_v_size;
    __pyx_t_5 = __pyx_t_4;
    for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
      __pyx_v_i = __pyx_t_6;

      /* "amplpy/util.pxi":206
 *         values_str_c = <char **> malloc(size * sizeof(char*))
 *         for i in range(size):
 *             indices_c[i] = to_c_tuple(<object>PyList_GetItem(d_keys, i))             # <<<<<<<<<<<<<<
 *             values_str_c[i] = PyUnicode_AsUTF8(<object>PyList_GetItem(d_values, i))
 *         campl.AMPL_ParameterSetSomeStringValues(ampl, name, size, indices_c, values_str_c)
 */
      __pyx_t_7 = PyList_GetItem(__pyx_v_d_keys, __pyx_v_i); if (unlikely(__pyx_t_7 == ((PyObject *)NULL))) __PYX_ERR(4, 206, __pyx_L1_error)
      __pyx_t_9 = __pyx_f_7_amplpy_to_c_tuple(((PyObject *)__pyx_t_7)); if (unlikely(__pyx_t_9 == ((AMPL_TUPLE *)NULL) && PyErr_Occurred())) __PYX_ERR(4, 206, __pyx_L1_error)
      (__pyx_v_indices_c[__pyx_v_i]) = __pyx_t_9;

      /* "amplpy/util.pxi":207
 *         for i in range(size):
 *             indices_c[i] = to_c_tuple(<object>PyList_GetItem(d_keys, i))
 *             values_str_c[i] = PyUnicode_AsUTF8(<object>PyList_GetItem(d_values, i))             # <<<<<<<<<<<<<<
 *         campl.AMPL_ParameterSetSomeStringValues(ampl, name, size, indices_c, values_str_c)
 *         for i in range(size):
 */
      __pyx_t_7 = PyList_GetItem(__pyx_v_d_values, __pyx_v_i); if (unlikely(__pyx_t_7 == ((PyObject *)NULL))) __PYX_ERR(4, 207, __pyx_L1_error)
      __pyx_t_10 = PyUnicode_AsUTF8(((PyObject *)__pyx_t_7)); if (unlikely(__pyx_t_10 == ((char const *)NULL))) __PYX_ERR(4, 207, __pyx_L1_error)
      (__pyx_v_values_str_c[__pyx_v_i]) = __pyx_t_10;
    }

    /* "amplpy/util.pxi":208
 *             indices_c[i] = to_c_tuple(<object>PyList_GetItem(d_keys, i))
 *             values_str_c[i] = PyUnicode_AsUTF8(<object>PyList_GetItem(d_values, i))
 *         campl.AMPL_ParameterSetSomeStringValues(ampl, name, size, indices_c, values_str_c)             # <<<<<<<<<<<<<<
 *         for i in range(size):
 *             campl.AMPL_TupleFree(&indices_c[i])
 */
    (void)(AMPL_ParameterSetSomeStringValues(__pyx_v_ampl, __pyx_v_name, __pyx_v_size, __pyx_v_indices_c, __pyx_v_values_str_c));

    /* "amplpy/util.pxi":209
 *             values_str_c[i] = PyUnicode_AsUTF8(<object>PyList_GetItem(d_values, i))
 *         campl.AMPL_ParameterSetSomeStringValues(ampl, name, size, indices_c, values_str_c)
 *         for i in range(size):             # <<<<<<<<<<<<<<
 *             campl.AMPL_TupleFree(&indices_c[i])
 *         free(indices_c)
 */
    __pyx_t_4 = __pyx_v_size;
    __pyx_t_5 = __pyx_t_4;
    for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
      __pyx_v_i = __pyx_t_6;

      /* "amplpy/util.pxi":210
 *         campl.AMPL_ParameterSetSomeStringValues(ampl, name, size, indices_c, values_str_c)
 *         for i in range(size):
 *             campl.AMPL_TupleFree(&indices_c[i])             # <<<<<<<<<<<<<<
 *         free(indices_c)
 *         free(values_str_c)
 */
      (void)(AMPL_TupleFree((&(__pyx_v_indices_c[__pyx_v_i]))));
    }

    /* "amplpy/util.pxi":211
 *         for i in range(size):
 *             campl.AMPL_TupleFree(&indices_c[i])
 *         free(indices_c)             # <<<<<<<<<<<<<<
 *         free(values_str_c)
 *     elif has_numbers and not has_strings:
 */
    free(__pyx_v_indices_c);

    /* "amplpy/util.pxi":212
 *             campl.AMPL_TupleFree(&indices_c[i])
 *         free(indices_c)
 *         free(values_str_c)             # <<<<<<<<<<<<<<
 *     elif has_numbers and not has_strings:
 *         indices_c = <campl.AMPL_TUPLE**> malloc(size * sizeof(campl.AMPL_TUPLE*))
 */
    free(__pyx_v_values_str_c);

    /* "amplpy/util.pxi":202
 *             raise ValueError("All values must be either numbers or strings")
 * 
 *     if has_strings and not has_numbers:             # <<<<<<<<<<<<<<
 *         indices_c = <campl.AMPL_TUPLE**> malloc(size * sizeof(campl.AMPL_TUPLE*))
 *         values_str_c = <char **> malloc(size * sizeof(char*))
 */
    goto __pyx_L11;
  }

  /* "amplpy/util.pxi":213
 *         free(indices_c)
 *         free(values_str_c)
 *     elif has_numbers and not has_strings:             # <<<<<<<<<<<<<<
 *         indices_c = <campl.AMPL_TUPLE**> malloc(size * sizeof(campl.AMPL_TUPLE*))
 *         values_num_c = <double *> malloc(size * sizeof(double))
 */
  __pyx_t_8 = (__pyx_v_has_numbers != 0);
  if (__pyx_t_8) {
  } else {
    __pyx_t_1 = __pyx_t_8;
    goto __pyx_L18_bool_binop_done;
  }
  __pyx_t_8 = (!(__pyx_v_has_strings != 0));
  __pyx_t_1 = __pyx_t_8;
  __pyx_L18_bool_binop_done:;
  if (likely(__pyx_t_1)) {

    /* "amplpy/util.pxi":214
 *         free(values_str_c)
 *     elif has_numbers and not has_strings:
 *         indices_c = <campl.AMPL_TUPLE**> malloc(size * sizeof(campl.AMPL_TUPLE*))             # <<<<<<<<<<<<<<
 *         values_num_c = <double *> malloc(size * sizeof(double))
 *         for i in range(size):
 */
    __pyx_v_indices_c = ((AMPL_TUPLE **)malloc((__pyx_v_size * (sizeof(AMPL_TUPLE *)))));

    /* "amplpy/util.pxi":215
 *     elif has_numbers and not has_strings:
 *         indices_c = <campl.AMPL_TUPLE**> malloc(size * sizeof(campl.AMPL_TUPLE*))
 *         values_num_c = <double *> malloc(size * sizeof(double))             # <<<<<<<<<<<<<<
 *         for i in range(size):
 *             indices_c[i] = to_c_tuple(<object>PyList_GetItem(d_keys, i))
 */
    __pyx_v_values_num_c = ((double *)malloc((__pyx_v_size * (sizeof(double)))));

    /* "amplpy/util.pxi":216
 *         indices_c = <campl.AMPL_TUPLE**> malloc(size * sizeof(campl.AMPL_TUPLE*))
 *         values_num_c = <double *> malloc(size * sizeof(double))
 *         for i in range(size):             # <<<<<<<<<<<<<<
 *             indices_c[i] = to_c_tuple(<object>PyList_GetItem(d_keys, i))
 *             item = PyList_GetItem(d_values, i)
 */
    __pyx_t_4 = __pyx_v_size;
    __pyx_t_5 = __pyx_t_4;
    for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
      __pyx_v_i = __pyx_t_6;

      /* "amplpy/util.pxi":217
 *         values_num_c = <double *> malloc(size * sizeof(double))
 *         for i in range(size):
 *             indices_c[i] = to_c_tuple(<object>PyList_GetItem(d_keys, i))             # <<<<<<<<<<<<<<
 *             item = PyList_GetItem(d_values, i)
 *             if PyLong_Check(<object>item):
 */
      __pyx_t_7 = PyList_GetItem(__pyx_v_d_keys, __pyx_v_i); if (unlikely(__pyx_t_7 == ((PyObject *)NULL))) __PYX_ERR(4, 217, __pyx_L1_error)
      __pyx_t_9 = __pyx_f_7_amplpy_to_c_tuple(((PyObject *)__pyx_t_7)); if (unlikely(__pyx_t_9 == ((AMPL_TUPLE *)NULL) && PyErr_Occurred())) __PYX_ERR(4, 217, __pyx_L1_error)
      (__pyx_v_indices_c[__pyx_v_i]) = __pyx_t_9;

      /* "amplpy/util.pxi":218
 *         for i in range(size):
 *             indices_c[i] = to_c_tuple(<object>PyList_GetItem(d_keys, i))
 *             item = PyList_GetItem(d_values, i)             # <<<<<<<<<<<<<<
 *             if PyLong_Check(<object>item):
 *                 values_num_c[i] = PyLong_AsLong(<object>item)
 */
      __pyx_t_7 = PyList_GetItem(__pyx_v_d_values, __pyx_v_i); if (unlikely(__pyx_t_7 == ((PyObject *)NULL))) __PYX_ERR(4, 218, __pyx_L1_error)
      __pyx_v_item = __pyx_t_7;

      /* "amplpy/util.pxi":219
 *             indices_c[i] = to_c_tuple(<object>PyList_GetItem(d_keys, i))
 *             item = PyList_GetItem(d_values, i)
 *             if PyLong_Check(<object>item):             # <<<<<<<<<<<<<<
 *                 values_num_c[i] = PyLong_AsLong(<object>item)
 *             else:
 */
      __pyx_t_1 = PyLong_Check(((PyObject *)__pyx_v_item));
      if (__pyx_t_1) {

        /* "amplpy/util.pxi":220
 *             item = PyList_GetItem(d_values, i)
 *             if PyLong_Check(<object>item):
 *                 values_num_c[i] = PyLong_AsLong(<object>item)             # <<<<<<<<<<<<<<
 *             else:
 *                 values_num_c[i] = PyFloat_AsDouble(<object>item)
 */
        __pyx_t_11 = PyLong_AsLong(((PyObject *)__pyx_v_item)); if (unlikely(__pyx_t_11 == ((long)-1L) && PyErr_Occurred())) __PYX_ERR(4, 220, __pyx_L1_error)
        (__pyx_v_values_num_c[__pyx_v_i]) = __pyx_t_11;

        /* "amplpy/util.pxi":219
 *             indices_c[i] = to_c_tuple(<object>PyList_GetItem(d_keys, i))
 *             item = PyList_GetItem(d_values, i)
 *             if PyLong_Check(<object>item):             # <<<<<<<<<<<<<<
 *                 values_num_c[i] = PyLong_AsLong(<object>item)
 *             else:
 */
        goto __pyx_L22;
      }

      /* "amplpy/util.pxi":222
 *                 values_num_c[i] = PyLong_AsLong(<object>item)
 *             else:
 *                 values_num_c[i] = PyFloat_AsDouble(<object>item)             # <<<<<<<<<<<<<<
 *         campl.AMPL_ParameterSetSomeDoubleValues(ampl, name, size, indices_c, values_num_c)
 *         for i in range(size):
 */
      /*else*/ {
        __pyx_t_12 = PyFloat_AsDouble(((PyObject *)__pyx_v_item)); if (unlikely(__pyx_t_12 == ((double)-1.0) && PyErr_Occurred())) __PYX_ERR(4, 222, __pyx_L1_error)
        (__pyx_v_values_num_c[__pyx_v_i]) = __pyx_t_12;
      }
      __pyx_L22:;
    }

    /* "amplpy/util.pxi":223
 *             else:
 *                 values_num_c[i] = PyFloat_AsDouble(<object>item)
 *         campl.AMPL_ParameterSetSomeDoubleValues(ampl, name, size, indices_c, values_num_c)             # <<<<<<<<<<<<<<
 *         for i in range(size):
 *             campl.AMPL_TupleFree(&indices_c[i])
 */
    (void)(AMPL_ParameterSetSomeDoubleValues(__pyx_v_ampl, __pyx_v_name, __pyx_v_size, __pyx_v_indices_c, __pyx_v_values_num_c));

    /* "amplpy/util.pxi":224
 *                 values_num_c[i] = PyFloat_AsDouble(<object>item)
 *         campl.AMPL_ParameterSetSomeDoubleValues(ampl, name, size, indices_c, values_num_c)
 *         for i in range(size):             # <<<<<<<<<<<<<<
 *             campl.AMPL_TupleFree(&indices_c[i])
 *         free(indices_c)
 */
    __pyx_t_4 = __pyx_v_size;
    __pyx_t_5 = __pyx_t_4;
    for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
      __pyx_v_i = __pyx_t_6;

      /* "amplpy/util.pxi":225
 *         campl.AMPL_ParameterSetSomeDoubleValues(ampl, name, size, indices_c, values_num_c)
 *         for i in range(size):
 *             campl.AMPL_TupleFree(&indices_c[i])             # <<<<<<<<<<<<<<
 *         free(indices_c)
 *         free(values_num_c)
 */
      (void)(AMPL_TupleFree((&(__pyx_v_indices_c[__pyx_v_i]))));
    }

    /* "amplpy/util.pxi":226
 *         for i in range(size):
 *             campl.AMPL_TupleFree(&indices_c[i])
 *         free(indices_c)             # <<<<<<<<<<<<<<
 *         free(values_num_c)
 *     else:
 */
    free(__pyx_v_indices_c);

    /* "amplpy/util.pxi":227
 *             campl.AMPL_TupleFree(&indices_c[i])
 *         free(indices_c)
 *         free(values_num_c)             # <<<<<<<<<<<<<<
 *     else:
 *         raise ValueError("Dictionary must contain either all strings or all numbers")
 */
    free(__pyx_v_values_num_c);

    /* "amplpy/util.pxi":213
 *         free(indices_c)
 *         free(values_str_c)
 *     elif has_numbers and not has_strings:             # <<<<<<<<<<<<<<
 *         indices_c = <campl.AMPL_TUPLE**> malloc(size * sizeof(campl.AMPL_TUPLE*))
 *         values_num_c = <double *> malloc(size * sizeof(double))
 */
    goto __pyx_L11;
  }

  /* "amplpy/util.pxi":229
 *         free(values_num_c)
 *     else:
 *         raise ValueError("Dictionary must contain either all strings or all numbers")             # <<<<<<<<<<<<<<
 * 
 * cdef raiseKeyError(campl.AMPL_ENTITYTYPE entity_class, char* name):
 */
  /*else*/ {
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 229, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(4, 229, __pyx_L1_error)
  }
  __pyx_L11:;

  /* "amplpy/util.pxi":172
 *     free(values_c)
 * 
 * cdef void setValuesPyDict(campl.AMPL* ampl, char* name, dict dicts):             # <<<<<<<<<<<<<<
 *     cdef size_t i
 *     cdef campl.AMPL_TUPLE** indices_c
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("_amplpy.setValuesPyDict", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_d_keys);
  __Pyx_XDECREF(__pyx_v_d_values);
  __Pyx_RefNannyFinishContext();
}

/* "amplpy/util.pxi":231
 *         raise ValueError("Dictionary must contain either all strings or all numbers")
 * 
 * cdef raiseKeyError(campl.AMPL_ENTITYTYPE entity_class, char* name):             # <<<<<<<<<<<<<<
 *     if entity_class == campl.AMPL_VARIABLE:
 *         raise KeyError("A variable called {name} cannot be found.")
 */

static PyObject *__pyx_f_7_amplpy_raiseKeyError(AMPL_ENTITYTYPE __pyx_v_entity_class, CYTHON_UNUSED char *__pyx_v_name) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("raiseKeyError", 1);

  /* "amplpy/util.pxi":232
 * 
 * cdef raiseKeyError(campl.AMPL_ENTITYTYPE entity_class, char* name):
 *     if entity_class == campl.AMPL_VARIABLE:             # <<<<<<<<<<<<<<
 *         raise KeyError("A variable called {name} cannot be found.")
 *     elif entity_class == campl.AMPL_CONSTRAINT:
 */
  switch (__pyx_v_entity_class) {
    case AMPL_VARIABLE:

    /* "amplpy/util.pxi":233
 * cdef raiseKeyError(campl.AMPL_ENTITYTYPE entity_class, char* name):
 *     if entity_class == campl.AMPL_VARIABLE:
 *         raise KeyError("A variable called {name} cannot be found.")             # <<<<<<<<<<<<<<
 *     elif entity_class == campl.AMPL_CONSTRAINT:
 *         raise KeyError("A constraint called {name} cannot be found.")
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_KeyError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 233, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(4, 233, __pyx_L1_error)

    /* "amplpy/util.pxi":232
 * 
 * cdef raiseKeyError(campl.AMPL_ENTITYTYPE entity_class, char* name):
 *     if entity_class == campl.AMPL_VARIABLE:             # <<<<<<<<<<<<<<
 *         raise KeyError("A variable called {name} cannot be found.")
 *     elif entity_class == campl.AMPL_CONSTRAINT:
 */
    break;
    case AMPL_CONSTRAINT:

    /* "amplpy/util.pxi":235
 *         raise KeyError("A variable called {name} cannot be found.")
 *     elif entity_class == campl.AMPL_CONSTRAINT:
 *         raise KeyError("A constraint called {name} cannot be found.")             # <<<<<<<<<<<<<<
 *     elif entity_class == campl.AMPL_OBJECTIVE:
 *         raise KeyError("An objective called {name} cannot be found.")
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_KeyError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 235, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(4, 235, __pyx_L1_error)

    /* "amplpy/util.pxi":234
 *     if entity_class == campl.AMPL_VARIABLE:
 *         raise KeyError("A variable called {name} cannot be found.")
 *     elif entity_class == campl.AMPL_CONSTRAINT:             # <<<<<<<<<<<<<<
 *         raise KeyError("A constraint called {name} cannot be found.")
 *     elif entity_class == campl.AMPL_OBJECTIVE:
 */
    break;
    case AMPL_OBJECTIVE:

    /* "amplpy/util.pxi":237
 *         raise KeyError("A constraint called {name} cannot be found.")
 *     elif entity_class == campl.AMPL_OBJECTIVE:
 *         raise KeyError("An objective called {name} cannot be found.")             # <<<<<<<<<<<<<<
 *     elif entity_class == campl.AMPL_SET:
 *         raise KeyError("A set called {name} cannot be found.")
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_KeyError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 237, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(4, 237, __pyx_L1_error)

    /* "amplpy/util.pxi":236
 *     elif entity_class == campl.AMPL_CONSTRAINT:
 *         raise KeyError("A constraint called {name} cannot be found.")
 *     elif entity_class == campl.AMPL_OBJECTIVE:             # <<<<<<<<<<<<<<
 *         raise KeyError("An objective called {name} cannot be found.")
 *     elif entity_class == campl.AMPL_SET:
 */
    break;
    case AMPL_SET:

    /* "amplpy/util.pxi":239
 *         raise KeyError("An objective called {name} cannot be found.")
 *     elif entity_class == campl.AMPL_SET:
 *         raise KeyError("A set called {name} cannot be found.")             # <<<<<<<<<<<<<<
 *     elif entity_class == campl.AMPL_PARAMETER:
 *         raise KeyError("A parameter called {name} cannot be found.")
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_KeyError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 239, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(4, 239, __pyx_L1_error)

    /* "amplpy/util.pxi":238
 *     elif entity_class == campl.AMPL_OBJECTIVE:
 *         raise KeyError("An objective called {name} cannot be found.")
 *     elif entity_class == campl.AMPL_SET:             # <<<<<<<<<<<<<<
 *         raise KeyError("A set called {name} cannot be found.")
 *     elif entity_class == campl.AMPL_PARAMETER:
 */
    break;
    case AMPL_PARAMETER:

    /* "amplpy/util.pxi":241
 *         raise KeyError("A set called {name} cannot be found.")
 *     elif entity_class == campl.AMPL_PARAMETER:
 *         raise KeyError("A parameter called {name} cannot be found.")             # <<<<<<<<<<<<<<
 *     else:
 *         pass
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_KeyError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 241, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(4, 241, __pyx_L1_error)

    /* "amplpy/util.pxi":240
 *     elif entity_class == campl.AMPL_SET:
 *         raise KeyError("A set called {name} cannot be found.")
 *     elif entity_class == campl.AMPL_PARAMETER:             # <<<<<<<<<<<<<<
 *         raise KeyError("A parameter called {name} cannot be found.")
 *     else:
 */
    break;
    default:
    break;
  }

  /* "amplpy/util.pxi":231
 *         raise ValueError("Dictionary must contain either all strings or all numbers")
 * 
 * cdef raiseKeyError(campl.AMPL_ENTITYTYPE entity_class, char* name):             # <<<<<<<<<<<<<<
 *     if entity_class == campl.AMPL_VARIABLE:
 *         raise KeyError("A variable called {name} cannot be found.")
 */

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

/* "amplpy/constraint.pxi":33
 *     """
 *     @staticmethod
 *     cdef create(campl.AMPL* ampl_c, char* name, campl.AMPL_TUPLE* index, parent):             # <<<<<<<<<<<<<<
 *         entity = Constraint()
 *         entity._c_ampl = ampl_c
 */

static PyObject *__pyx_f_7_amplpy_10Constraint_create(AMPL *__pyx_v_ampl_c, char *__pyx_v_name, AMPL_TUPLE *__pyx_v_index, PyObject *__pyx_v_parent) {
  struct __pyx_obj_7_amplpy_Constraint *__pyx_v_entity = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("create", 1);

  /* "amplpy/constraint.pxi":34
 *     @staticmethod
 *     cdef create(campl.AMPL* ampl_c, char* name, campl.AMPL_TUPLE* index, parent):
 *         entity = Constraint()             # <<<<<<<<<<<<<<
 *         entity._c_ampl = ampl_c
 *         entity._name = name
 */
  __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_7_amplpy_Constraint)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_entity = ((struct __pyx_obj_7_amplpy_Constraint *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "amplpy/constraint.pxi":35
 *     cdef create(campl.AMPL* ampl_c, char* name, campl.AMPL_TUPLE* index, parent):
 *         entity = Constraint()
 *         entity._c_ampl = ampl_c             # <<<<<<<<<<<<<<
 *         entity._name = name
 *         entity._index = index
 */
  __pyx_v_entity->__pyx_base._c_ampl = __pyx_v_ampl_c;

  /* "amplpy/constraint.pxi":36
 *         entity = Constraint()
 *         entity._c_ampl = ampl_c
 *         entity._name = name             # <<<<<<<<<<<<<<
 *         entity._index = index
 *         entity.wrap_function = campl.AMPL_CONSTRAINT
 */
  __pyx_v_entity->__pyx_base._name = __pyx_v_name;

  /* "amplpy/constraint.pxi":37
 *         entity._c_ampl = ampl_c
 *         entity._name = name
 *         entity._index = index             # <<<<<<<<<<<<<<
 *         entity.wrap_function = campl.AMPL_CONSTRAINT
 *         entity._entity = parent
 */
  __pyx_v_entity->__pyx_base._index = __pyx_v_index;

  /* "amplpy/constraint.pxi":38
 *         entity._name = name
 *         entity._index = index
 *         entity.wrap_function = campl.AMPL_CONSTRAINT             # <<<<<<<<<<<<<<
 *         entity._entity = parent
 *         if entity._entity is not None:
 */
  __pyx_v_entity->__pyx_base.wrap_function = AMPL_CONSTRAINT;

  /* "amplpy/constraint.pxi":39
 *         entity._index = index
 *         entity.wrap_function = campl.AMPL_CONSTRAINT
 *         entity._entity = parent             # <<<<<<<<<<<<<<
 *         if entity._entity is not None:
 *             Py_INCREF(entity._entity)
 */
  __Pyx_INCREF(__pyx_v_parent);
  __Pyx_GIVEREF(__pyx_v_parent);
  __Pyx_GOTREF(__pyx_v_entity->__pyx_base._entity);
  __Pyx_DECREF(__pyx_v_entity->__pyx_base._entity);
  __pyx_v_entity->__pyx_base._entity = __pyx_v_parent;

  /* "amplpy/constraint.pxi":40
 *         entity.wrap_function = campl.AMPL_CONSTRAINT
 *         entity._entity = parent
 *         if entity._entity is not None:             # <<<<<<<<<<<<<<
 *             Py_INCREF(entity._entity)
 *         return entity
 */
  __pyx_t_2 = (__pyx_v_entity->__pyx_base._entity != Py_None);
  if (__pyx_t_2) {

    /* "amplpy/constraint.pxi":41
 *         entity._entity = parent
 *         if entity._entity is not None:
 *             Py_INCREF(entity._entity)             # <<<<<<<<<<<<<<
 *         return entity
 * 
 */
    __pyx_t_1 = __pyx_v_entity->__pyx_base._entity;
    __Pyx_INCREF(__pyx_t_1);
    Py_INCREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "amplpy/constraint.pxi":40
 *         entity.wrap_function = campl.AMPL_CONSTRAINT
 *         entity._entity = parent
 *         if entity._entity is not None:             # <<<<<<<<<<<<<<
 *             Py_INCREF(entity._entity)
 *         return entity
 */
  }

  /* "amplpy/constraint.pxi":42
 *         if entity._entity is not None:
 *             Py_INCREF(entity._entity)
 *         return entity             # <<<<<<<<<<<<<<
 * 
 *     def __setitem__(self, index, value):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_entity);
  __pyx_r = ((PyObject *)__pyx_v_entity);
  goto __pyx_L0;

  /* "amplpy/constraint.pxi":33
 *     """
 *     @staticmethod
 *     cdef create(campl.AMPL* ampl_c, char* name, campl.AMPL_TUPLE* index, parent):             # <<<<<<<<<<<<<<
 *         entity = Constraint()
 *         entity._c_ampl = ampl_c
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("_amplpy.Constraint.create", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_entity);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/constraint.pxi":44
 *         return entity
 * 
 *     def __setitem__(self, index, value):             # <<<<<<<<<<<<<<
 *         self.__getitem__(index).set_dual(value)
 * 
 */

/* Python wrapper */
static int __pyx_pw_7_amplpy_10Constraint_1__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_7_amplpy_10Constraint_1__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7_amplpy_10Constraint___setitem__(((struct __pyx_obj_7_amplpy_Constraint *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_7_amplpy_10Constraint___setitem__(struct __pyx_obj_7_amplpy_Constraint *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  unsigned int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setitem__", 1);

  /* "amplpy/constraint.pxi":45
 * 
 *     def __setitem__(self, index, value):
 *         self.__getitem__(index).set_dual(value)             # <<<<<<<<<<<<<<
 * 
 *     def is_logical(self):
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getitem); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 45, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_index};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 45, __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_set_dual); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 45, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_value};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 45, __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;

  /* "amplpy/constraint.pxi":44
 *         return entity
 * 
 *     def __setitem__(self, index, value):             # <<<<<<<<<<<<<<
 *         self.__getitem__(index).set_dual(value)
 * 
 */

  /* function exit code */
  __pyx_r = 0;
  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("_amplpy.Constraint.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/constraint.pxi":47
 *         self.__getitem__(index).set_dual(value)
 * 
 *     def is_logical(self):             # <<<<<<<<<<<<<<
 *         """
 *         Check if the constraint is a logical constraint. Returns True if
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_10Constraint_3is_logical(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_10Constraint_2is_logical, "Constraint.is_logical(self)\n\n        Check if the constraint is a logical constraint. Returns True if\n        logical. The available suffixes differ between logical and non logical\n        constraints. See http://www.ampl.com/NEW/suffbuiltin.html for a list of\n        the available suffixes for algebraic constraints. The suffixes\n        available for logical constraints are marked on the method description\n        by \"Valid only for logical constraints\".\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_10Constraint_3is_logical = {"is_logical", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_10Constraint_3is_logical, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_10Constraint_2is_logical};
static PyObject *__pyx_pw_7_amplpy_10Constraint_3is_logical(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_logical (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("is_logical", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "is_logical", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_10Constraint_2is_logical(((struct __pyx_obj_7_amplpy_Constraint *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_10Constraint_2is_logical(struct __pyx_obj_7_amplpy_Constraint *__pyx_v_self) {
  bool __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;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("is_logical", 1);

  /* "amplpy/constraint.pxi":57
 *         """
 *         cdef bool_c value
 *         try:             # <<<<<<<<<<<<<<
 *             PY_AMPL_CALL(campl.AMPL_ConstraintIsLogical(self._c_ampl, self._name, &value))
 *             return value
 */
  {
    __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:*/ {

      /* "amplpy/constraint.pxi":58
 *         cdef bool_c value
 *         try:
 *             PY_AMPL_CALL(campl.AMPL_ConstraintIsLogical(self._c_ampl, self._name, &value))             # <<<<<<<<<<<<<<
 *             return value
 *         except AttributeError:
 */
      __pyx_t_4 = __pyx_f_7_amplpy_PY_AMPL_CALL(AMPL_ConstraintIsLogical(__pyx_v_self->__pyx_base._c_ampl, __pyx_v_self->__pyx_base._name, (&__pyx_v_value))); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 58, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "amplpy/constraint.pxi":59
 *         try:
 *             PY_AMPL_CALL(campl.AMPL_ConstraintIsLogical(self._c_ampl, self._name, &value))
 *             return value             # <<<<<<<<<<<<<<
 *         except AttributeError:
 *             return False
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 59, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_r = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L7_try_return;

      /* "amplpy/constraint.pxi":57
 *         """
 *         cdef bool_c value
 *         try:             # <<<<<<<<<<<<<<
 *             PY_AMPL_CALL(campl.AMPL_ConstraintIsLogical(self._c_ampl, self._name, &value))
 *             return value
 */
    }
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "amplpy/constraint.pxi":60
 *             PY_AMPL_CALL(campl.AMPL_ConstraintIsLogical(self._c_ampl, self._name, &value))
 *             return value
 *         except AttributeError:             # <<<<<<<<<<<<<<
 *             return False
 * 
 */
    __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
    if (__pyx_t_5) {
      __Pyx_AddTraceback("_amplpy.Constraint.is_logical", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(5, 60, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_7);

      /* "amplpy/constraint.pxi":61
 *             return value
 *         except AttributeError:
 *             return False             # <<<<<<<<<<<<<<
 * 
 *     def drop(self):
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_False);
      __pyx_r = Py_False;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L6_except_return;
    }
    goto __pyx_L5_except_error;

    /* "amplpy/constraint.pxi":57
 *         """
 *         cdef bool_c value
 *         try:             # <<<<<<<<<<<<<<
 *             PY_AMPL_CALL(campl.AMPL_ConstraintIsLogical(self._c_ampl, self._name, &value))
 *             return value
 */
    __pyx_L5_except_error:;
    __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;
  }

  /* "amplpy/constraint.pxi":47
 *         self.__getitem__(index).set_dual(value)
 * 
 *     def is_logical(self):             # <<<<<<<<<<<<<<
 *         """
 *         Check if the constraint is a logical constraint. Returns True if
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("_amplpy.Constraint.is_logical", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/constraint.pxi":63
 *             return False
 * 
 *     def drop(self):             # <<<<<<<<<<<<<<
 *         """
 *         Drop all instances in this constraint entity, corresponding to the AMPL
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_10Constraint_5drop(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_10Constraint_4drop, "Constraint.drop(self)\n\n        Drop all instances in this constraint entity, corresponding to the AMPL\n        code: `drop constraintname;`.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_10Constraint_5drop = {"drop", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_10Constraint_5drop, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_10Constraint_4drop};
static PyObject *__pyx_pw_7_amplpy_10Constraint_5drop(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("drop (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("drop", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "drop", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_10Constraint_4drop(((struct __pyx_obj_7_amplpy_Constraint *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_10Constraint_4drop(struct __pyx_obj_7_amplpy_Constraint *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("drop", 1);

  /* "amplpy/constraint.pxi":68
 *         code: `drop constraintname;`.
 *         """
 *         PY_AMPL_CALL(campl.AMPL_EntityDrop(self._c_ampl, self._name))             # <<<<<<<<<<<<<<
 * 
 *     def restore(self):
 */
  __pyx_t_1 = __pyx_f_7_amplpy_PY_AMPL_CALL(AMPL_EntityDrop(__pyx_v_self->__pyx_base._c_ampl, __pyx_v_self->__pyx_base._name)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 68, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "amplpy/constraint.pxi":63
 *             return False
 * 
 *     def drop(self):             # <<<<<<<<<<<<<<
 *         """
 *         Drop all instances in this constraint entity, corresponding to the AMPL
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("_amplpy.Constraint.drop", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/constraint.pxi":70
 *         PY_AMPL_CALL(campl.AMPL_EntityDrop(self._c_ampl, self._name))
 * 
 *     def restore(self):             # <<<<<<<<<<<<<<
 *         """
 *         Restore all instances in this constraint entity, corresponding to the
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_10Constraint_7restore(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_10Constraint_6restore, "Constraint.restore(self)\n\n        Restore all instances in this constraint entity, corresponding to the\n        AMPL code: `restore constraintname;`.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_10Constraint_7restore = {"restore", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_10Constraint_7restore, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_10Constraint_6restore};
static PyObject *__pyx_pw_7_amplpy_10Constraint_7restore(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("restore (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("restore", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "restore", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_10Constraint_6restore(((struct __pyx_obj_7_amplpy_Constraint *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_10Constraint_6restore(struct __pyx_obj_7_amplpy_Constraint *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("restore", 1);

  /* "amplpy/constraint.pxi":75
 *         AMPL code: `restore constraintname;`.
 *         """
 *         PY_AMPL_CALL(campl.AMPL_EntityRestore(self._c_ampl, self._name))             # <<<<<<<<<<<<<<
 * 
 *     def body(self):
 */
  __pyx_t_1 = __pyx_f_7_amplpy_PY_AMPL_CALL(AMPL_EntityRestore(__pyx_v_self->__pyx_base._c_ampl, __pyx_v_self->__pyx_base._name)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 75, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "amplpy/constraint.pxi":70
 *         PY_AMPL_CALL(campl.AMPL_EntityDrop(self._c_ampl, self._name))
 * 
 *     def restore(self):             # <<<<<<<<<<<<<<
 *         """
 *         Restore all instances in this constraint entity, corresponding to the
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("_amplpy.Constraint.restore", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/constraint.pxi":77
 *         PY_AMPL_CALL(campl.AMPL_EntityRestore(self._c_ampl, self._name))
 * 
 *     def body(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the current value of the constraint's body.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_10Constraint_9body(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_10Constraint_8body, "Constraint.body(self)\n\n        Get the current value of the constraint's body.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_10Constraint_9body = {"body", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_10Constraint_9body, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_10Constraint_8body};
static PyObject *__pyx_pw_7_amplpy_10Constraint_9body(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("body (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("body", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "body", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_10Constraint_8body(((struct __pyx_obj_7_amplpy_Constraint *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_10Constraint_8body(struct __pyx_obj_7_amplpy_Constraint *__pyx_v_self) {
  double __pyx_v_value;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("body", 1);

  /* "amplpy/constraint.pxi":82
 *         """
 *         cdef double value
 *         PY_AMPL_CALL(campl.AMPL_InstanceGetDoubleSuffix(self._c_ampl, self._name, self._index, campl.AMPL_NUMERICSUFFIX.AMPL_BODY, &value))             # <<<<<<<<<<<<<<
 *         return value
 * 
 */
  __pyx_t_1 = __pyx_f_7_amplpy_PY_AMPL_CALL(AMPL_InstanceGetDoubleSuffix(__pyx_v_self->__pyx_base._c_ampl, __pyx_v_self->__pyx_base._name, __pyx_v_self->__pyx_base._index, AMPL_BODY, (&__pyx_v_value))); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 82, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "amplpy/constraint.pxi":83
 *         cdef double value
 *         PY_AMPL_CALL(campl.AMPL_InstanceGetDoubleSuffix(self._c_ampl, self._name, self._index, campl.AMPL_NUMERICSUFFIX.AMPL_BODY, &value))
 *         return value             # <<<<<<<<<<<<<<
 * 
 *     def astatus(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 83, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "amplpy/constraint.pxi":77
 *         PY_AMPL_CALL(campl.AMPL_EntityRestore(self._c_ampl, self._name))
 * 
 *     def body(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the current value of the constraint's body.
 */

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

/* "amplpy/constraint.pxi":85
 *         return value
 * 
 *     def astatus(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the current AMPL status (dropped, presolved, or substituted out).
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_10Constraint_11astatus(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_10Constraint_10astatus, "Constraint.astatus(self)\n\n        Get the current AMPL status (dropped, presolved, or substituted out).\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_10Constraint_11astatus = {"astatus", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_10Constraint_11astatus, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_10Constraint_10astatus};
static PyObject *__pyx_pw_7_amplpy_10Constraint_11astatus(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("astatus (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("astatus", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "astatus", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_10Constraint_10astatus(((struct __pyx_obj_7_amplpy_Constraint *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_10Constraint_10astatus(struct __pyx_obj_7_amplpy_Constraint *__pyx_v_self) {
  AMPL_ERRORINFO *__pyx_v_errorinfo;
  AMPL_RETCODE __pyx_v_rc;
  char *__pyx_v_value_c;
  PyObject *__pyx_v_value = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("astatus", 1);

  /* "amplpy/constraint.pxi":92
 *         cdef campl.AMPL_RETCODE rc
 *         cdef char* value_c
 *         errorinfo = campl.AMPL_InstanceGetStringSuffix(self._c_ampl, self._name, self._index, campl.AMPL_STRINGSUFFIX.AMPL_ASTATUS, &value_c)             # <<<<<<<<<<<<<<
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:
 */
  __pyx_v_errorinfo = AMPL_InstanceGetStringSuffix(__pyx_v_self->__pyx_base._c_ampl, __pyx_v_self->__pyx_base._name, __pyx_v_self->__pyx_base._index, AMPL_ASTATUS, (&__pyx_v_value_c));

  /* "amplpy/constraint.pxi":93
 *         cdef char* value_c
 *         errorinfo = campl.AMPL_InstanceGetStringSuffix(self._c_ampl, self._name, self._index, campl.AMPL_STRINGSUFFIX.AMPL_ASTATUS, &value_c)
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)             # <<<<<<<<<<<<<<
 *         if rc != campl.AMPL_OK:
 *             campl.AMPL_StringFree(&value_c)
 */
  __pyx_v_rc = AMPL_ErrorInfoGetError(__pyx_v_errorinfo);

  /* "amplpy/constraint.pxi":94
 *         errorinfo = campl.AMPL_InstanceGetStringSuffix(self._c_ampl, self._name, self._index, campl.AMPL_STRINGSUFFIX.AMPL_ASTATUS, &value_c)
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:             # <<<<<<<<<<<<<<
 *             campl.AMPL_StringFree(&value_c)
 *             PY_AMPL_CALL(errorinfo)
 */
  __pyx_t_1 = (__pyx_v_rc != AMPL_OK);
  if (__pyx_t_1) {

    /* "amplpy/constraint.pxi":95
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:
 *             campl.AMPL_StringFree(&value_c)             # <<<<<<<<<<<<<<
 *             PY_AMPL_CALL(errorinfo)
 *         value = str(value_c.decode('utf-8'))
 */
    (void)(AMPL_StringFree((&__pyx_v_value_c)));

    /* "amplpy/constraint.pxi":96
 *         if rc != campl.AMPL_OK:
 *             campl.AMPL_StringFree(&value_c)
 *             PY_AMPL_CALL(errorinfo)             # <<<<<<<<<<<<<<
 *         value = str(value_c.decode('utf-8'))
 *         campl.AMPL_StringFree(&value_c)
 */
    __pyx_t_2 = __pyx_f_7_amplpy_PY_AMPL_CALL(__pyx_v_errorinfo); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 96, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "amplpy/constraint.pxi":94
 *         errorinfo = campl.AMPL_InstanceGetStringSuffix(self._c_ampl, self._name, self._index, campl.AMPL_STRINGSUFFIX.AMPL_ASTATUS, &value_c)
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:             # <<<<<<<<<<<<<<
 *             campl.AMPL_StringFree(&value_c)
 *             PY_AMPL_CALL(errorinfo)
 */
  }

  /* "amplpy/constraint.pxi":97
 *             campl.AMPL_StringFree(&value_c)
 *             PY_AMPL_CALL(errorinfo)
 *         value = str(value_c.decode('utf-8'))             # <<<<<<<<<<<<<<
 *         campl.AMPL_StringFree(&value_c)
 * 
 */
  __pyx_t_3 = __Pyx_ssize_strlen(__pyx_v_value_c); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(5, 97, __pyx_L1_error)
  __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_value_c, 0, __pyx_t_3, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 97, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_value = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "amplpy/constraint.pxi":98
 *             PY_AMPL_CALL(errorinfo)
 *         value = str(value_c.decode('utf-8'))
 *         campl.AMPL_StringFree(&value_c)             # <<<<<<<<<<<<<<
 * 
 *         return value
 */
  (void)(AMPL_StringFree((&__pyx_v_value_c)));

  /* "amplpy/constraint.pxi":100
 *         campl.AMPL_StringFree(&value_c)
 * 
 *         return value             # <<<<<<<<<<<<<<
 * 
 *     def defvar(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_value);
  __pyx_r = __pyx_v_value;
  goto __pyx_L0;

  /* "amplpy/constraint.pxi":85
 *         return value
 * 
 *     def astatus(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the current AMPL status (dropped, presolved, or substituted out).
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("_amplpy.Constraint.astatus", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/constraint.pxi":102
 *         return value
 * 
 *     def defvar(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the index in `_var` of "defined variable" substituted out by the
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_10Constraint_13defvar(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_10Constraint_12defvar, "Constraint.defvar(self)\n\n        Get the index in `_var` of \"defined variable\" substituted out by the\n        constraint.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_10Constraint_13defvar = {"defvar", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_10Constraint_13defvar, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_10Constraint_12defvar};
static PyObject *__pyx_pw_7_amplpy_10Constraint_13defvar(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("defvar (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("defvar", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "defvar", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_10Constraint_12defvar(((struct __pyx_obj_7_amplpy_Constraint *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_10Constraint_12defvar(struct __pyx_obj_7_amplpy_Constraint *__pyx_v_self) {
  int __pyx_v_value;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("defvar", 1);

  /* "amplpy/constraint.pxi":108
 *         """
 *         cdef int value
 *         PY_AMPL_CALL(campl.AMPL_InstanceGetIntSuffix(self._c_ampl, self._name, self._index, campl.AMPL_NUMERICSUFFIX.AMPL_DEFVAR, &value))             # <<<<<<<<<<<<<<
 *         return value
 * 
 */
  __pyx_t_1 = __pyx_f_7_amplpy_PY_AMPL_CALL(AMPL_InstanceGetIntSuffix(__pyx_v_self->__pyx_base._c_ampl, __pyx_v_self->__pyx_base._name, __pyx_v_self->__pyx_base._index, AMPL_DEFVAR, (&__pyx_v_value))); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 108, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "amplpy/constraint.pxi":109
 *         cdef int value
 *         PY_AMPL_CALL(campl.AMPL_InstanceGetIntSuffix(self._c_ampl, self._name, self._index, campl.AMPL_NUMERICSUFFIX.AMPL_DEFVAR, &value))
 *         return value             # <<<<<<<<<<<<<<
 * 
 *     def dinit(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 109, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "amplpy/constraint.pxi":102
 *         return value
 * 
 *     def defvar(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the index in `_var` of "defined variable" substituted out by the
 */

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

/* "amplpy/constraint.pxi":111
 *         return value
 * 
 *     def dinit(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the current initial guess for the constraint's dual variable.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_10Constraint_15dinit(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_10Constraint_14dinit, "Constraint.dinit(self)\n\n        Get the current initial guess for the constraint's dual variable.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_10Constraint_15dinit = {"dinit", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_10Constraint_15dinit, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_10Constraint_14dinit};
static PyObject *__pyx_pw_7_amplpy_10Constraint_15dinit(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dinit (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("dinit", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "dinit", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_10Constraint_14dinit(((struct __pyx_obj_7_amplpy_Constraint *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_10Constraint_14dinit(struct __pyx_obj_7_amplpy_Constraint *__pyx_v_self) {
  double __pyx_v_value;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dinit", 1);

  /* "amplpy/constraint.pxi":116
 *         """
 *         cdef double value
 *         PY_AMPL_CALL(campl.AMPL_InstanceGetDoubleSuffix(self._c_ampl, self._name, self._index, campl.AMPL_NUMERICSUFFIX.AMPL_DINIT, &value))             # <<<<<<<<<<<<<<
 *         return value
 * 
 */
  __pyx_t_1 = __pyx_f_7_amplpy_PY_AMPL_CALL(AMPL_InstanceGetDoubleSuffix(__pyx_v_self->__pyx_base._c_ampl, __pyx_v_self->__pyx_base._name, __pyx_v_self->__pyx_base._index, AMPL_DINIT, (&__pyx_v_value))); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 116, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "amplpy/constraint.pxi":117
 *         cdef double value
 *         PY_AMPL_CALL(campl.AMPL_InstanceGetDoubleSuffix(self._c_ampl, self._name, self._index, campl.AMPL_NUMERICSUFFIX.AMPL_DINIT, &value))
 *         return value             # <<<<<<<<<<<<<<
 * 
 *     def dinit0(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "amplpy/constraint.pxi":111
 *         return value
 * 
 *     def dinit(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the current initial guess for the constraint's dual variable.
 */

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

/* "amplpy/constraint.pxi":119
 *         return value
 * 
 *     def dinit0(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the original initial guess for the constraint's dual variable.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_10Constraint_17dinit0(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_10Constraint_16dinit0, "Constraint.dinit0(self)\n\n        Get the original initial guess for the constraint's dual variable.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_10Constraint_17dinit0 = {"dinit0", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_10Constraint_17dinit0, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_10Constraint_16dinit0};
static PyObject *__pyx_pw_7_amplpy_10Constraint_17dinit0(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dinit0 (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("dinit0", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "dinit0", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_10Constraint_16dinit0(((struct __pyx_obj_7_amplpy_Constraint *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_10Constraint_16dinit0(struct __pyx_obj_7_amplpy_Constraint *__pyx_v_self) {
  double __pyx_v_value;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dinit0", 1);

  /* "amplpy/constraint.pxi":124
 *         """
 *         cdef double value
 *         PY_AMPL_CALL(campl.AMPL_InstanceGetDoubleSuffix(self._c_ampl, self._name, self._index, campl.AMPL_NUMERICSUFFIX.AMPL_DINIT0, &value))             # <<<<<<<<<<<<<<
 *         return value
 * 
 */
  __pyx_t_1 = __pyx_f_7_amplpy_PY_AMPL_CALL(AMPL_InstanceGetDoubleSuffix(__pyx_v_self->__pyx_base._c_ampl, __pyx_v_self->__pyx_base._name, __pyx_v_self->__pyx_base._index, AMPL_DINIT0, (&__pyx_v_value))); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 124, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "amplpy/constraint.pxi":125
 *         cdef double value
 *         PY_AMPL_CALL(campl.AMPL_InstanceGetDoubleSuffix(self._c_ampl, self._name, self._index, campl.AMPL_NUMERICSUFFIX.AMPL_DINIT0, &value))
 *         return value             # <<<<<<<<<<<<<<
 * 
 *     def dual(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 125, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "amplpy/constraint.pxi":119
 *         return value
 * 
 *     def dinit0(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the original initial guess for the constraint's dual variable.
 */

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

/* "amplpy/constraint.pxi":127
 *         return value
 * 
 *     def dual(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the current value of the constraint's dual variable.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_10Constraint_19dual(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_10Constraint_18dual, "Constraint.dual(self)\n\n        Get the current value of the constraint's dual variable.\n\n        Note that dual values are often reset by the underlying AMPL\n        interpreter by the presolve functionalities triggered by some methods.\n        A possible workaround is to set the option `presolve` to `false`\n        (see :func:`~amplpy.AMPL.setOption`).\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_10Constraint_19dual = {"dual", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_10Constraint_19dual, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_10Constraint_18dual};
static PyObject *__pyx_pw_7_amplpy_10Constraint_19dual(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dual (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("dual", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "dual", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_10Constraint_18dual(((struct __pyx_obj_7_amplpy_Constraint *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_10Constraint_18dual(struct __pyx_obj_7_amplpy_Constraint *__pyx_v_self) {
  double __pyx_v_value;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dual", 1);

  /* "amplpy/constraint.pxi":137
 *         """
 *         cdef double value
 *         PY_AMPL_CALL(campl.AMPL_InstanceGetDoubleSuffix(self._c_ampl, self._name, self._index, campl.AMPL_NUMERICSUFFIX.AMPL_DUAL, &value))             # <<<<<<<<<<<<<<
 *         return value
 * 
 */
  __pyx_t_1 = __pyx_f_7_amplpy_PY_AMPL_CALL(AMPL_InstanceGetDoubleSuffix(__pyx_v_self->__pyx_base._c_ampl, __pyx_v_self->__pyx_base._name, __pyx_v_self->__pyx_base._index, AMPL_DUAL, (&__pyx_v_value))); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 137, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "amplpy/constraint.pxi":138
 *         cdef double value
 *         PY_AMPL_CALL(campl.AMPL_InstanceGetDoubleSuffix(self._c_ampl, self._name, self._index, campl.AMPL_NUMERICSUFFIX.AMPL_DUAL, &value))
 *         return value             # <<<<<<<<<<<<<<
 * 
 *     def lb(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "amplpy/constraint.pxi":127
 *         return value
 * 
 *     def dual(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the current value of the constraint's dual variable.
 */

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

/* "amplpy/constraint.pxi":140
 *         return value
 * 
 *     def lb(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the current value of the constraint's lower bound.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_10Constraint_21lb(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_10Constraint_20lb, "Constraint.lb(self)\n\n        Get the current value of the constraint's lower bound.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_10Constraint_21lb = {"lb", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_10Constraint_21lb, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_10Constraint_20lb};
static PyObject *__pyx_pw_7_amplpy_10Constraint_21lb(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lb (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("lb", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "lb", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_10Constraint_20lb(((struct __pyx_obj_7_amplpy_Constraint *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_10Constraint_20lb(struct __pyx_obj_7_amplpy_Constraint *__pyx_v_self) {
  double __pyx_v_value;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("lb", 1);

  /* "amplpy/constraint.pxi":145
 *         """
 *         cdef double value
 *         PY_AMPL_CALL(campl.AMPL_InstanceGetDoubleSuffix(self._c_ampl, self._name, self._index, campl.AMPL_NUMERICSUFFIX.AMPL_LB, &value))             # <<<<<<<<<<<<<<
 *         return value
 * 
 */
  __pyx_t_1 = __pyx_f_7_amplpy_PY_AMPL_CALL(AMPL_InstanceGetDoubleSuffix(__pyx_v_self->__pyx_base._c_ampl, __pyx_v_self->__pyx_base._name, __pyx_v_self->__pyx_base._index, AMPL_LB, (&__pyx_v_value))); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 145, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "amplpy/constraint.pxi":146
 *         cdef double value
 *         PY_AMPL_CALL(campl.AMPL_InstanceGetDoubleSuffix(self._c_ampl, self._name, self._index, campl.AMPL_NUMERICSUFFIX.AMPL_LB, &value))
 *         return value             # <<<<<<<<<<<<<<
 * 
 *     def ub(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 146, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "amplpy/constraint.pxi":140
 *         return value
 * 
 *     def lb(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the current value of the constraint's lower bound.
 */

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

/* "amplpy/constraint.pxi":148
 *         return value
 * 
 *     def ub(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the current value of the constraint's upper bound.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_10Constraint_23ub(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_10Constraint_22ub, "Constraint.ub(self)\n\n        Get the current value of the constraint's upper bound.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_10Constraint_23ub = {"ub", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_10Constraint_23ub, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_10Constraint_22ub};
static PyObject *__pyx_pw_7_amplpy_10Constraint_23ub(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ub (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("ub", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "ub", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_10Constraint_22ub(((struct __pyx_obj_7_amplpy_Constraint *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_10Constraint_22ub(struct __pyx_obj_7_amplpy_Constraint *__pyx_v_self) {
  double __pyx_v_value;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ub", 1);

  /* "amplpy/constraint.pxi":153
 *         """
 *         cdef double value
 *         PY_AMPL_CALL(campl.AMPL_InstanceGetDoubleSuffix(self._c_ampl, self._name, self._index, campl.AMPL_NUMERICSUFFIX.AMPL_UB, &value))             # <<<<<<<<<<<<<<
 *         return value
 * 
 */
  __pyx_t_1 = __pyx_f_7_amplpy_PY_AMPL_CALL(AMPL_InstanceGetDoubleSuffix(__pyx_v_self->__pyx_base._c_ampl, __pyx_v_self->__pyx_base._name, __pyx_v_self->__pyx_base._index, AMPL_UB, (&__pyx_v_value))); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 153, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "amplpy/constraint.pxi":154
 *         cdef double value
 *         PY_AMPL_CALL(campl.AMPL_InstanceGetDoubleSuffix(self._c_ampl, self._name, self._index, campl.AMPL_NUMERICSUFFIX.AMPL_UB, &value))
 *         return value             # <<<<<<<<<<<<<<
 * 
 *     def lbs(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 154, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "amplpy/constraint.pxi":148
 *         return value
 * 
 *     def ub(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the current value of the constraint's upper bound.
 */

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

/* "amplpy/constraint.pxi":156
 *         return value
 * 
 *     def lbs(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the constraint lower bound sent to the solver (reflecting
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_10Constraint_25lbs(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_10Constraint_24lbs, "Constraint.lbs(self)\n\n        Get the constraint lower bound sent to the solver (reflecting\n        adjustment for fixed variables).\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_10Constraint_25lbs = {"lbs", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_10Constraint_25lbs, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_10Constraint_24lbs};
static PyObject *__pyx_pw_7_amplpy_10Constraint_25lbs(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lbs (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("lbs", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "lbs", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_10Constraint_24lbs(((struct __pyx_obj_7_amplpy_Constraint *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_10Constraint_24lbs(struct __pyx_obj_7_amplpy_Constraint *__pyx_v_self) {
  double __pyx_v_value;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("lbs", 1);

  /* "amplpy/constraint.pxi":162
 *         """
 *         cdef double value
 *         PY_AMPL_CALL(campl.AMPL_InstanceGetDoubleSuffix(self._c_ampl, self._name, self._index, campl.AMPL_NUMERICSUFFIX.AMPL_LBS, &value))             # <<<<<<<<<<<<<<
 *         return value
 * 
 */
  __pyx_t_1 = __pyx_f_7_amplpy_PY_AMPL_CALL(AMPL_InstanceGetDoubleSuffix(__pyx_v_self->__pyx_base._c_ampl, __pyx_v_self->__pyx_base._name, __pyx_v_self->__pyx_base._index, AMPL_LBS, (&__pyx_v_value))); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 162, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "amplpy/constraint.pxi":163
 *         cdef double value
 *         PY_AMPL_CALL(campl.AMPL_InstanceGetDoubleSuffix(self._c_ampl, self._name, self._index, campl.AMPL_NUMERICSUFFIX.AMPL_LBS, &value))
 *         return value             # <<<<<<<<<<<<<<
 * 
 *     def ubs(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 163, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "amplpy/constraint.pxi":156
 *         return value
 * 
 *     def lbs(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the constraint lower bound sent to the solver (reflecting
 */

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

/* "amplpy/constraint.pxi":165
 *         return value
 * 
 *     def ubs(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the constraint upper bound sent to the solver (reflecting
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_10Constraint_27ubs(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_10Constraint_26ubs, "Constraint.ubs(self)\n\n        Get the constraint upper bound sent to the solver (reflecting\n        adjustment for fixed variables).\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_10Constraint_27ubs = {"ubs", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_10Constraint_27ubs, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_10Constraint_26ubs};
static PyObject *__pyx_pw_7_amplpy_10Constraint_27ubs(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ubs (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("ubs", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "ubs", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_10Constraint_26ubs(((struct __pyx_obj_7_amplpy_Constraint *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_10Constraint_26ubs(struct __pyx_obj_7_amplpy_Constraint *__pyx_v_self) {
  double __pyx_v_value;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ubs", 1);

  /* "amplpy/constraint.pxi":171
 *         """
 *         cdef double value
 *         PY_AMPL_CALL(campl.AMPL_InstanceGetDoubleSuffix(self._c_ampl, self._name, self._index, campl.AMPL_NUMERICSUFFIX.AMPL_UBS, &value))             # <<<<<<<<<<<<<<
 *         return value
 * 
 */
  __pyx_t_1 = __pyx_f_7_amplpy_PY_AMPL_CALL(AMPL_InstanceGetDoubleSuffix(__pyx_v_self->__pyx_base._c_ampl, __pyx_v_self->__pyx_base._name, __pyx_v_self->__pyx_base._index, AMPL_UBS, (&__pyx_v_value))); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 171, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "amplpy/constraint.pxi":172
 *         cdef double value
 *         PY_AMPL_CALL(campl.AMPL_InstanceGetDoubleSuffix(self._c_ampl, self._name, self._index, campl.AMPL_NUMERICSUFFIX.AMPL_UBS, &value))
 *         return value             # <<<<<<<<<<<<<<
 * 
 *     def ldual(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 172, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "amplpy/constraint.pxi":165
 *         return value
 * 
 *     def ubs(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the constraint upper bound sent to the solver (reflecting
 */

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

/* "amplpy/constraint.pxi":174
 *         return value
 * 
 *     def ldual(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the current dual value associated with the lower bound.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_10Constraint_29ldual(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_10Constraint_28ldual, "Constraint.ldual(self)\n\n        Get the current dual value associated with the lower bound.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_10Constraint_29ldual = {"ldual", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_10Constraint_29ldual, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_10Constraint_28ldual};
static PyObject *__pyx_pw_7_amplpy_10Constraint_29ldual(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ldual (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("ldual", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "ldual", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_10Constraint_28ldual(((struct __pyx_obj_7_amplpy_Constraint *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_10Constraint_28ldual(struct __pyx_obj_7_amplpy_Constraint *__pyx_v_self) {
  double __pyx_v_value;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ldual", 1);

  /* "amplpy/constraint.pxi":179
 *         """
 *         cdef double value
 *         PY_AMPL_CALL(campl.AMPL_InstanceGetDoubleSuffix(self._c_ampl, self._name, self._index, campl.AMPL_NUMERICSUFFIX.AMPL_LDUAL, &value))             # <<<<<<<<<<<<<<
 *         return value
 * 
 */
  __pyx_t_1 = __pyx_f_7_amplpy_PY_AMPL_CALL(AMPL_InstanceGetDoubleSuffix(__pyx_v_self->__pyx_base._c_ampl, __pyx_v_self->__pyx_base._name, __pyx_v_self->__pyx_base._index, AMPL_LDUAL, (&__pyx_v_value))); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 179, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "amplpy/constraint.pxi":180
 *         cdef double value
 *         PY_AMPL_CALL(campl.AMPL_InstanceGetDoubleSuffix(self._c_ampl, self._name, self._index, campl.AMPL_NUMERICSUFFIX.AMPL_LDUAL, &value))
 *         return value             # <<<<<<<<<<<<<<
 * 
 *     def udual(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 180, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "amplpy/constraint.pxi":174
 *         return value
 * 
 *     def ldual(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the current dual value associated with the lower bound.
 */

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

/* "amplpy/constraint.pxi":182
 *         return value
 * 
 *     def udual(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the current dual value associated with the upper bounds.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_10Constraint_31udual(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_10Constraint_30udual, "Constraint.udual(self)\n\n        Get the current dual value associated with the upper bounds.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_10Constraint_31udual = {"udual", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_10Constraint_31udual, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_10Constraint_30udual};
static PyObject *__pyx_pw_7_amplpy_10Constraint_31udual(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("udual (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("udual", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "udual", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_10Constraint_30udual(((struct __pyx_obj_7_amplpy_Constraint *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_10Constraint_30udual(struct __pyx_obj_7_amplpy_Constraint *__pyx_v_self) {
  double __pyx_v_value;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("udual", 1);

  /* "amplpy/constraint.pxi":187
 *         """
 *         cdef double value
 *         PY_AMPL_CALL(campl.AMPL_InstanceGetDoubleSuffix(self._c_ampl, self._name, self._index, campl.AMPL_NUMERICSUFFIX.AMPL_UDUAL, &value))             # <<<<<<<<<<<<<<
 *         return value
 * 
 */
  __pyx_t_1 = __pyx_f_7_amplpy_PY_AMPL_CALL(AMPL_InstanceGetDoubleSuffix(__pyx_v_self->__pyx_base._c_ampl, __pyx_v_self->__pyx_base._name, __pyx_v_self->__pyx_base._index, AMPL_UDUAL, (&__pyx_v_value))); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 187, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "amplpy/constraint.pxi":188
 *         cdef double value
 *         PY_AMPL_CALL(campl.AMPL_InstanceGetDoubleSuffix(self._c_ampl, self._name, self._index, campl.AMPL_NUMERICSUFFIX.AMPL_UDUAL, &value))
 *         return value             # <<<<<<<<<<<<<<
 * 
 *     def lslack(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 188, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "amplpy/constraint.pxi":182
 *         return value
 * 
 *     def udual(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the current dual value associated with the upper bounds.
 */

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

/* "amplpy/constraint.pxi":190
 *         return value
 * 
 *     def lslack(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the slack at lower bound `body - lb`.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_10Constraint_33lslack(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_10Constraint_32lslack, "Constraint.lslack(self)\n\n        Get the slack at lower bound `body - lb`.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_10Constraint_33lslack = {"lslack", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_10Constraint_33lslack, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_10Constraint_32lslack};
static PyObject *__pyx_pw_7_amplpy_10Constraint_33lslack(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lslack (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("lslack", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "lslack", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_10Constraint_32lslack(((struct __pyx_obj_7_amplpy_Constraint *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_10Constraint_32lslack(struct __pyx_obj_7_amplpy_Constraint *__pyx_v_self) {
  double __pyx_v_value;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("lslack", 1);

  /* "amplpy/constraint.pxi":195
 *         """
 *         cdef double value
 *         PY_AMPL_CALL(campl.AMPL_InstanceGetDoubleSuffix(self._c_ampl, self._name, self._index, campl.AMPL_NUMERICSUFFIX.AMPL_LSLACK, &value))             # <<<<<<<<<<<<<<
 *         return value
 * 
 */
  __pyx_t_1 = __pyx_f_7_amplpy_PY_AMPL_CALL(AMPL_InstanceGetDoubleSuffix(__pyx_v_self->__pyx_base._c_ampl, __pyx_v_self->__pyx_base._name, __pyx_v_self->__pyx_base._index, AMPL_LSLACK, (&__pyx_v_value))); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 195, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "amplpy/constraint.pxi":196
 *         cdef double value
 *         PY_AMPL_CALL(campl.AMPL_InstanceGetDoubleSuffix(self._c_ampl, self._name, self._index, campl.AMPL_NUMERICSUFFIX.AMPL_LSLACK, &value))
 *         return value             # <<<<<<<<<<<<<<
 * 
 *     def uslack(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 196, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "amplpy/constraint.pxi":190
 *         return value
 * 
 *     def lslack(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the slack at lower bound `body - lb`.
 */

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

/* "amplpy/constraint.pxi":198
 *         return value
 * 
 *     def uslack(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the slack at upper bound `ub - body`.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_10Constraint_35uslack(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_10Constraint_34uslack, "Constraint.uslack(self)\n\n        Get the slack at upper bound `ub - body`.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_10Constraint_35uslack = {"uslack", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_10Constraint_35uslack, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_10Constraint_34uslack};
static PyObject *__pyx_pw_7_amplpy_10Constraint_35uslack(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("uslack (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("uslack", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "uslack", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_10Constraint_34uslack(((struct __pyx_obj_7_amplpy_Constraint *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_10Constraint_34uslack(struct __pyx_obj_7_amplpy_Constraint *__pyx_v_self) {
  double __pyx_v_value;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("uslack", 1);

  /* "amplpy/constraint.pxi":203
 *         """
 *         cdef double value
 *         PY_AMPL_CALL(campl.AMPL_InstanceGetDoubleSuffix(self._c_ampl, self._name, self._index, campl.AMPL_NUMERICSUFFIX.AMPL_USLACK, &value))             # <<<<<<<<<<<<<<
 *         return value
 * 
 */
  __pyx_t_1 = __pyx_f_7_amplpy_PY_AMPL_CALL(AMPL_InstanceGetDoubleSuffix(__pyx_v_self->__pyx_base._c_ampl, __pyx_v_self->__pyx_base._name, __pyx_v_self->__pyx_base._index, AMPL_USLACK, (&__pyx_v_value))); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 203, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "amplpy/constraint.pxi":204
 *         cdef double value
 *         PY_AMPL_CALL(campl.AMPL_InstanceGetDoubleSuffix(self._c_ampl, self._name, self._index, campl.AMPL_NUMERICSUFFIX.AMPL_USLACK, &value))
 *         return value             # <<<<<<<<<<<<<<
 * 
 *     def slack(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 204, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "amplpy/constraint.pxi":198
 *         return value
 * 
 *     def uslack(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the slack at upper bound `ub - body`.
 */

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

/* "amplpy/constraint.pxi":206
 *         return value
 * 
 *     def slack(self):             # <<<<<<<<<<<<<<
 *         """
 *         Constraint slack (the lesser of lslack and uslack).
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_10Constraint_37slack(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_10Constraint_36slack, "Constraint.slack(self)\n\n        Constraint slack (the lesser of lslack and uslack).\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_10Constraint_37slack = {"slack", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_10Constraint_37slack, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_10Constraint_36slack};
static PyObject *__pyx_pw_7_amplpy_10Constraint_37slack(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("slack (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("slack", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "slack", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_10Constraint_36slack(((struct __pyx_obj_7_amplpy_Constraint *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_10Constraint_36slack(struct __pyx_obj_7_amplpy_Constraint *__pyx_v_self) {
  double __pyx_v_value;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("slack", 1);

  /* "amplpy/constraint.pxi":211
 *         """
 *         cdef double value
 *         PY_AMPL_CALL(campl.AMPL_InstanceGetDoubleSuffix(self._c_ampl, self._name, self._index, campl.AMPL_NUMERICSUFFIX.AMPL_SLACK, &value))             # <<<<<<<<<<<<<<
 *         return value
 * 
 */
  __pyx_t_1 = __pyx_f_7_amplpy_PY_AMPL_CALL(AMPL_InstanceGetDoubleSuffix(__pyx_v_self->__pyx_base._c_ampl, __pyx_v_self->__pyx_base._name, __pyx_v_self->__pyx_base._index, AMPL_SLACK, (&__pyx_v_value))); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 211, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "amplpy/constraint.pxi":212
 *         cdef double value
 *         PY_AMPL_CALL(campl.AMPL_InstanceGetDoubleSuffix(self._c_ampl, self._name, self._index, campl.AMPL_NUMERICSUFFIX.AMPL_SLACK, &value))
 *         return value             # <<<<<<<<<<<<<<
 * 
 *     def sstatus(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 212, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "amplpy/constraint.pxi":206
 *         return value
 * 
 *     def slack(self):             # <<<<<<<<<<<<<<
 *         """
 *         Constraint slack (the lesser of lslack and uslack).
 */

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

/* "amplpy/constraint.pxi":214
 *         return value
 * 
 *     def sstatus(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the solver status (basis status of constraint's slack or artificial
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_10Constraint_39sstatus(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_10Constraint_38sstatus, "Constraint.sstatus(self)\n\n        Get the solver status (basis status of constraint's slack or artificial\n        variable).\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_10Constraint_39sstatus = {"sstatus", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_10Constraint_39sstatus, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_10Constraint_38sstatus};
static PyObject *__pyx_pw_7_amplpy_10Constraint_39sstatus(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sstatus (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("sstatus", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "sstatus", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_10Constraint_38sstatus(((struct __pyx_obj_7_amplpy_Constraint *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_10Constraint_38sstatus(struct __pyx_obj_7_amplpy_Constraint *__pyx_v_self) {
  AMPL_ERRORINFO *__pyx_v_errorinfo;
  AMPL_RETCODE __pyx_v_rc;
  char *__pyx_v_value_c;
  PyObject *__pyx_v_value = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("sstatus", 1);

  /* "amplpy/constraint.pxi":222
 *         cdef campl.AMPL_RETCODE rc
 *         cdef char* value_c
 *         errorinfo = campl.AMPL_InstanceGetStringSuffix(self._c_ampl, self._name, self._index, campl.AMPL_STRINGSUFFIX.AMPL_SSTATUS, &value_c)             # <<<<<<<<<<<<<<
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:
 */
  __pyx_v_errorinfo = AMPL_InstanceGetStringSuffix(__pyx_v_self->__pyx_base._c_ampl, __pyx_v_self->__pyx_base._name, __pyx_v_self->__pyx_base._index, AMPL_SSTATUS, (&__pyx_v_value_c));

  /* "amplpy/constraint.pxi":223
 *         cdef char* value_c
 *         errorinfo = campl.AMPL_InstanceGetStringSuffix(self._c_ampl, self._name, self._index, campl.AMPL_STRINGSUFFIX.AMPL_SSTATUS, &value_c)
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)             # <<<<<<<<<<<<<<
 *         if rc != campl.AMPL_OK:
 *             campl.AMPL_StringFree(&value_c)
 */
  __pyx_v_rc = AMPL_ErrorInfoGetError(__pyx_v_errorinfo);

  /* "amplpy/constraint.pxi":224
 *         errorinfo = campl.AMPL_InstanceGetStringSuffix(self._c_ampl, self._name, self._index, campl.AMPL_STRINGSUFFIX.AMPL_SSTATUS, &value_c)
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:             # <<<<<<<<<<<<<<
 *             campl.AMPL_StringFree(&value_c)
 *             PY_AMPL_CALL(errorinfo)
 */
  __pyx_t_1 = (__pyx_v_rc != AMPL_OK);
  if (__pyx_t_1) {

    /* "amplpy/constraint.pxi":225
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:
 *             campl.AMPL_StringFree(&value_c)             # <<<<<<<<<<<<<<
 *             PY_AMPL_CALL(errorinfo)
 *         value = str(value_c.decode('utf-8'))
 */
    (void)(AMPL_StringFree((&__pyx_v_value_c)));

    /* "amplpy/constraint.pxi":226
 *         if rc != campl.AMPL_OK:
 *             campl.AMPL_StringFree(&value_c)
 *             PY_AMPL_CALL(errorinfo)             # <<<<<<<<<<<<<<
 *         value = str(value_c.decode('utf-8'))
 *         campl.AMPL_StringFree(&value_c)
 */
    __pyx_t_2 = __pyx_f_7_amplpy_PY_AMPL_CALL(__pyx_v_errorinfo); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 226, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "amplpy/constraint.pxi":224
 *         errorinfo = campl.AMPL_InstanceGetStringSuffix(self._c_ampl, self._name, self._index, campl.AMPL_STRINGSUFFIX.AMPL_SSTATUS, &value_c)
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:             # <<<<<<<<<<<<<<
 *             campl.AMPL_StringFree(&value_c)
 *             PY_AMPL_CALL(errorinfo)
 */
  }

  /* "amplpy/constraint.pxi":227
 *             campl.AMPL_StringFree(&value_c)
 *             PY_AMPL_CALL(errorinfo)
 *         value = str(value_c.decode('utf-8'))             # <<<<<<<<<<<<<<
 *         campl.AMPL_StringFree(&value_c)
 * 
 */
  __pyx_t_3 = __Pyx_ssize_strlen(__pyx_v_value_c); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(5, 227, __pyx_L1_error)
  __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_value_c, 0, __pyx_t_3, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 227, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_value = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "amplpy/constraint.pxi":228
 *             PY_AMPL_CALL(errorinfo)
 *         value = str(value_c.decode('utf-8'))
 *         campl.AMPL_StringFree(&value_c)             # <<<<<<<<<<<<<<
 * 
 *         return value
 */
  (void)(AMPL_StringFree((&__pyx_v_value_c)));

  /* "amplpy/constraint.pxi":230
 *         campl.AMPL_StringFree(&value_c)
 * 
 *         return value             # <<<<<<<<<<<<<<
 * 
 *     def status(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_value);
  __pyx_r = __pyx_v_value;
  goto __pyx_L0;

  /* "amplpy/constraint.pxi":214
 *         return value
 * 
 *     def sstatus(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the solver status (basis status of constraint's slack or artificial
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("_amplpy.Constraint.sstatus", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/constraint.pxi":232
 *         return value
 * 
 *     def status(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the AMPL status if not `in`, otherwise solver status.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_10Constraint_41status(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_10Constraint_40status, "Constraint.status(self)\n\n        Get the AMPL status if not `in`, otherwise solver status.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_10Constraint_41status = {"status", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_10Constraint_41status, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_10Constraint_40status};
static PyObject *__pyx_pw_7_amplpy_10Constraint_41status(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("status (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("status", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "status", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_10Constraint_40status(((struct __pyx_obj_7_amplpy_Constraint *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_10Constraint_40status(struct __pyx_obj_7_amplpy_Constraint *__pyx_v_self) {
  AMPL_ERRORINFO *__pyx_v_errorinfo;
  AMPL_RETCODE __pyx_v_rc;
  char *__pyx_v_value_c;
  PyObject *__pyx_v_value = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("status", 1);

  /* "amplpy/constraint.pxi":239
 *         cdef campl.AMPL_RETCODE rc
 *         cdef char* value_c
 *         errorinfo = campl.AMPL_InstanceGetStringSuffix(self._c_ampl, self._name, self._index, campl.AMPL_STRINGSUFFIX.AMPL_STATUS, &value_c)             # <<<<<<<<<<<<<<
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:
 */
  __pyx_v_errorinfo = AMPL_InstanceGetStringSuffix(__pyx_v_self->__pyx_base._c_ampl, __pyx_v_self->__pyx_base._name, __pyx_v_self->__pyx_base._index, AMPL_STATUS, (&__pyx_v_value_c));

  /* "amplpy/constraint.pxi":240
 *         cdef char* value_c
 *         errorinfo = campl.AMPL_InstanceGetStringSuffix(self._c_ampl, self._name, self._index, campl.AMPL_STRINGSUFFIX.AMPL_STATUS, &value_c)
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)             # <<<<<<<<<<<<<<
 *         if rc != campl.AMPL_OK:
 *             campl.AMPL_StringFree(&value_c)
 */
  __pyx_v_rc = AMPL_ErrorInfoGetError(__pyx_v_errorinfo);

  /* "amplpy/constraint.pxi":241
 *         errorinfo = campl.AMPL_InstanceGetStringSuffix(self._c_ampl, self._name, self._index, campl.AMPL_STRINGSUFFIX.AMPL_STATUS, &value_c)
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:             # <<<<<<<<<<<<<<
 *             campl.AMPL_StringFree(&value_c)
 *             PY_AMPL_CALL(errorinfo)
 */
  __pyx_t_1 = (__pyx_v_rc != AMPL_OK);
  if (__pyx_t_1) {

    /* "amplpy/constraint.pxi":242
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:
 *             campl.AMPL_StringFree(&value_c)             # <<<<<<<<<<<<<<
 *             PY_AMPL_CALL(errorinfo)
 *         value = str(value_c.decode('utf-8'))
 */
    (void)(AMPL_StringFree((&__pyx_v_value_c)));

    /* "amplpy/constraint.pxi":243
 *         if rc != campl.AMPL_OK:
 *             campl.AMPL_StringFree(&value_c)
 *             PY_AMPL_CALL(errorinfo)             # <<<<<<<<<<<<<<
 *         value = str(value_c.decode('utf-8'))
 *         campl.AMPL_StringFree(&value_c)
 */
    __pyx_t_2 = __pyx_f_7_amplpy_PY_AMPL_CALL(__pyx_v_errorinfo); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 243, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "amplpy/constraint.pxi":241
 *         errorinfo = campl.AMPL_InstanceGetStringSuffix(self._c_ampl, self._name, self._index, campl.AMPL_STRINGSUFFIX.AMPL_STATUS, &value_c)
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:             # <<<<<<<<<<<<<<
 *             campl.AMPL_StringFree(&value_c)
 *             PY_AMPL_CALL(errorinfo)
 */
  }

  /* "amplpy/constraint.pxi":244
 *             campl.AMPL_StringFree(&value_c)
 *             PY_AMPL_CALL(errorinfo)
 *         value = str(value_c.decode('utf-8'))             # <<<<<<<<<<<<<<
 *         campl.AMPL_StringFree(&value_c)
 * 
 */
  __pyx_t_3 = __Pyx_ssize_strlen(__pyx_v_value_c); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(5, 244, __pyx_L1_error)
  __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_value_c, 0, __pyx_t_3, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 244, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_value = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "amplpy/constraint.pxi":245
 *             PY_AMPL_CALL(errorinfo)
 *         value = str(value_c.decode('utf-8'))
 *         campl.AMPL_StringFree(&value_c)             # <<<<<<<<<<<<<<
 * 
 *         return value
 */
  (void)(AMPL_StringFree((&__pyx_v_value_c)));

  /* "amplpy/constraint.pxi":247
 *         campl.AMPL_StringFree(&value_c)
 * 
 *         return value             # <<<<<<<<<<<<<<
 * 
 *     def set_dual(self, dual):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_value);
  __pyx_r = __pyx_v_value;
  goto __pyx_L0;

  /* "amplpy/constraint.pxi":232
 *         return value
 * 
 *     def status(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the AMPL status if not `in`, otherwise solver status.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("_amplpy.Constraint.status", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/constraint.pxi":249
 *         return value
 * 
 *     def set_dual(self, dual):             # <<<<<<<<<<<<<<
 *         """
 *         Set the value of the dual variable associated to this constraint (valid
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_10Constraint_43set_dual(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_10Constraint_42set_dual, "Constraint.set_dual(self, dual)\n\n        Set the value of the dual variable associated to this constraint (valid\n        only if the constraint is scalar). Equivalent to the AMPL statement:\n\n        `let c := dual;`\n\n        Note that dual values are often reset by the underlying AMPL\n        interpreter by the presolve functionalities triggered by some methods.\n        A possible workaround is to set the option `presolve` to `False`\n        (see :func:`~amplpy.AMPL.setOption`).\n\n        Args:\n            dual: The value to be assigned to the dual variable.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_10Constraint_43set_dual = {"set_dual", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_10Constraint_43set_dual, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_10Constraint_42set_dual};
static PyObject *__pyx_pw_7_amplpy_10Constraint_43set_dual(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_dual = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_dual (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dual,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dual)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 249, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_dual") < 0)) __PYX_ERR(5, 249, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_dual = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_dual", 1, 1, 1, __pyx_nargs); __PYX_ERR(5, 249, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.Constraint.set_dual", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_10Constraint_42set_dual(((struct __pyx_obj_7_amplpy_Constraint *)__pyx_v_self), __pyx_v_dual);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_10Constraint_42set_dual(struct __pyx_obj_7_amplpy_Constraint *__pyx_v_self, PyObject *__pyx_v_dual) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  double __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_dual", 1);

  /* "amplpy/constraint.pxi":264
 *             dual: The value to be assigned to the dual variable.
 *         """
 *         PY_AMPL_CALL(campl.AMPL_ConstraintSetDual(self._c_ampl, self._name, float(dual)))             # <<<<<<<<<<<<<<
 * 
 *     def val(self):
 */
  __pyx_t_1 = __Pyx_PyObject_AsDouble(__pyx_v_dual); if (unlikely(__pyx_t_1 == ((double)((double)-1)) && PyErr_Occurred())) __PYX_ERR(5, 264, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_7_amplpy_PY_AMPL_CALL(AMPL_ConstraintSetDual(__pyx_v_self->__pyx_base._c_ampl, __pyx_v_self->__pyx_base._name, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 264, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "amplpy/constraint.pxi":249
 *         return value
 * 
 *     def set_dual(self, dual):             # <<<<<<<<<<<<<<
 *         """
 *         Set the value of the dual variable associated to this constraint (valid
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("_amplpy.Constraint.set_dual", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/constraint.pxi":266
 *         PY_AMPL_CALL(campl.AMPL_ConstraintSetDual(self._c_ampl, self._name, float(dual)))
 * 
 *     def val(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the AMPL val suffix. Valid only for logical constraints.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_10Constraint_45val(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_10Constraint_44val, "Constraint.val(self)\n\n        Get the AMPL val suffix. Valid only for logical constraints.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_10Constraint_45val = {"val", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_10Constraint_45val, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_10Constraint_44val};
static PyObject *__pyx_pw_7_amplpy_10Constraint_45val(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("val (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("val", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "val", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_10Constraint_44val(((struct __pyx_obj_7_amplpy_Constraint *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_10Constraint_44val(struct __pyx_obj_7_amplpy_Constraint *__pyx_v_self) {
  double __pyx_v_value;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("val", 1);

  /* "amplpy/constraint.pxi":271
 *         """
 *         cdef double value
 *         if self.is_logical():             # <<<<<<<<<<<<<<
 *             PY_AMPL_CALL(campl.AMPL_InstanceGetDoubleSuffix(self._c_ampl, self._name, self._index, campl.AMPL_NUMERICSUFFIX.AMPL_VAL, &value))
 *             return value
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_is_logical); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 271, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 271, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(5, 271, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_5) {

    /* "amplpy/constraint.pxi":272
 *         cdef double value
 *         if self.is_logical():
 *             PY_AMPL_CALL(campl.AMPL_InstanceGetDoubleSuffix(self._c_ampl, self._name, self._index, campl.AMPL_NUMERICSUFFIX.AMPL_VAL, &value))             # <<<<<<<<<<<<<<
 *             return value
 *         else:
 */
    __pyx_t_1 = __pyx_f_7_amplpy_PY_AMPL_CALL(AMPL_InstanceGetDoubleSuffix(__pyx_v_self->__pyx_base._c_ampl, __pyx_v_self->__pyx_base._name, __pyx_v_self->__pyx_base._index, AMPL_VAL, (&__pyx_v_value))); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 272, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "amplpy/constraint.pxi":273
 *         if self.is_logical():
 *             PY_AMPL_CALL(campl.AMPL_InstanceGetDoubleSuffix(self._c_ampl, self._name, self._index, campl.AMPL_NUMERICSUFFIX.AMPL_VAL, &value))
 *             return value             # <<<<<<<<<<<<<<
 *         else:
 *             return None
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = PyFloat_FromDouble(__pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 273, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "amplpy/constraint.pxi":271
 *         """
 *         cdef double value
 *         if self.is_logical():             # <<<<<<<<<<<<<<
 *             PY_AMPL_CALL(campl.AMPL_InstanceGetDoubleSuffix(self._c_ampl, self._name, self._index, campl.AMPL_NUMERICSUFFIX.AMPL_VAL, &value))
 *             return value
 */
  }

  /* "amplpy/constraint.pxi":275
 *             return value
 *         else:
 *             return None             # <<<<<<<<<<<<<<
 * 
 *     # Aliases
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "amplpy/constraint.pxi":266
 *         PY_AMPL_CALL(campl.AMPL_ConstraintSetDual(self._c_ampl, self._name, float(dual)))
 * 
 *     def val(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the AMPL val suffix. Valid only for logical constraints.
 */

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

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._c_ampl,self._index cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_10Constraint_47__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_10Constraint_46__reduce_cython__, "Constraint.__reduce_cython__(self)");
static PyMethodDef __pyx_mdef_7_amplpy_10Constraint_47__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_10Constraint_47__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_10Constraint_46__reduce_cython__};
static PyObject *__pyx_pw_7_amplpy_10Constraint_47__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_10Constraint_46__reduce_cython__(((struct __pyx_obj_7_amplpy_Constraint *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_10Constraint_46__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7_amplpy_Constraint *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 1);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "self._c_ampl,self._index cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self._c_ampl,self._index cannot be converted to a Python object for pickling"
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_self__c_ampl_self__index_cannot, 0, 0);
  __PYX_ERR(8, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._c_ampl,self._index cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 */

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

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._c_ampl,self._index cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._c_ampl,self._index cannot be converted to a Python object for pickling"
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_10Constraint_49__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_10Constraint_48__setstate_cython__, "Constraint.__setstate_cython__(self, __pyx_state)");
static PyMethodDef __pyx_mdef_7_amplpy_10Constraint_49__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_10Constraint_49__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_10Constraint_48__setstate_cython__};
static PyObject *__pyx_pw_7_amplpy_10Constraint_49__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 3, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(8, 3, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(8, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.Constraint.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_10Constraint_48__setstate_cython__(((struct __pyx_obj_7_amplpy_Constraint *)__pyx_v_self), __pyx_v___pyx_state);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_10Constraint_48__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7_amplpy_Constraint *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 1);

  /* "(tree fragment)":4
 *     raise TypeError, "self._c_ampl,self._index cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self._c_ampl,self._index cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_self__c_ampl_self__index_cannot, 0, 0);
  __PYX_ERR(8, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._c_ampl,self._index cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._c_ampl,self._index cannot be converted to a Python object for pickling"
 */

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

/* "amplpy/dataframe.pxi":25
 * 
 *     @staticmethod
 *     cdef create(campl.AMPL_DATAFRAME* df, size_t index):             # <<<<<<<<<<<<<<
 *         row = Row()
 *         row._df = df
 */

static PyObject *__pyx_f_7_amplpy_3Row_create(AMPL_DATAFRAME *__pyx_v_df, size_t __pyx_v_index) {
  struct __pyx_obj_7_amplpy_Row *__pyx_v_row = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("create", 1);

  /* "amplpy/dataframe.pxi":26
 *     @staticmethod
 *     cdef create(campl.AMPL_DATAFRAME* df, size_t index):
 *         row = Row()             # <<<<<<<<<<<<<<
 *         row._df = df
 *         row._index = index
 */
  __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_7_amplpy_Row)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 26, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_row = ((struct __pyx_obj_7_amplpy_Row *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "amplpy/dataframe.pxi":27
 *     cdef create(campl.AMPL_DATAFRAME* df, size_t index):
 *         row = Row()
 *         row._df = df             # <<<<<<<<<<<<<<
 *         row._index = index
 *         return row
 */
  __pyx_v_row->_df = __pyx_v_df;

  /* "amplpy/dataframe.pxi":28
 *         row = Row()
 *         row._df = df
 *         row._index = index             # <<<<<<<<<<<<<<
 *         return row
 * 
 */
  __pyx_v_row->_index = __pyx_v_index;

  /* "amplpy/dataframe.pxi":29
 *         row._df = df
 *         row._index = index
 *         return row             # <<<<<<<<<<<<<<
 * 
 *     def __str__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_row);
  __pyx_r = ((PyObject *)__pyx_v_row);
  goto __pyx_L0;

  /* "amplpy/dataframe.pxi":25
 * 
 *     @staticmethod
 *     cdef create(campl.AMPL_DATAFRAME* df, size_t index):             # <<<<<<<<<<<<<<
 *         row = Row()
 *         row._df = df
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("_amplpy.Row.create", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_row);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/dataframe.pxi":31
 *         return row
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return self.to_string()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_3Row_1__str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7_amplpy_3Row_1__str__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7_amplpy_3Row___str__(((struct __pyx_obj_7_amplpy_Row *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_3Row___str__(struct __pyx_obj_7_amplpy_Row *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__str__", 1);

  /* "amplpy/dataframe.pxi":32
 * 
 *     def __str__(self):
 *         return self.to_string()             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_to_string); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 32, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "amplpy/dataframe.pxi":31
 *         return row
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return self.to_string()
 * 
 */

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

/* "amplpy/dataframe.pxi":34
 *         return self.to_string()
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return RowIterator.create(self._df, self._index)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_3Row_3__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7_amplpy_3Row_3__iter__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7_amplpy_3Row_2__iter__(((struct __pyx_obj_7_amplpy_Row *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_3Row_2__iter__(struct __pyx_obj_7_amplpy_Row *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__iter__", 1);

  /* "amplpy/dataframe.pxi":35
 * 
 *     def __iter__(self):
 *         return RowIterator.create(self._df, self._index)             # <<<<<<<<<<<<<<
 * 
 *     def __getitem__(self, key):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7_amplpy_11RowIterator_create(__pyx_v_self->_df, __pyx_v_self->_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "amplpy/dataframe.pxi":34
 *         return self.to_string()
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return RowIterator.create(self._df, self._index)
 * 
 */

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

/* "amplpy/dataframe.pxi":37
 *         return RowIterator.create(self._df, self._index)
 * 
 *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
 *         cdef campl.AMPL_VARIANT* v
 *         PY_AMPL_CALL(campl.AMPL_DataFrameElement(self._df, self._index, key, &v))
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_3Row_5__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_7_amplpy_3Row_5__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7_amplpy_3Row_4__getitem__(((struct __pyx_obj_7_amplpy_Row *)__pyx_v_self), ((PyObject *)__pyx_v_key));

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

static PyObject *__pyx_pf_7_amplpy_3Row_4__getitem__(struct __pyx_obj_7_amplpy_Row *__pyx_v_self, PyObject *__pyx_v_key) {
  AMPL_VARIANT *__pyx_v_v;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  size_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getitem__", 1);

  /* "amplpy/dataframe.pxi":39
 *     def __getitem__(self, key):
 *         cdef campl.AMPL_VARIANT* v
 *         PY_AMPL_CALL(campl.AMPL_DataFrameElement(self._df, self._index, key, &v))             # <<<<<<<<<<<<<<
 *         return to_py_variant(v)
 * 
 */
  __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_key); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 39, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_7_amplpy_PY_AMPL_CALL(AMPL_DataFrameElement(__pyx_v_self->_df, __pyx_v_self->_index, __pyx_t_1, (&__pyx_v_v))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 39, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "amplpy/dataframe.pxi":40
 *         cdef campl.AMPL_VARIANT* v
 *         PY_AMPL_CALL(campl.AMPL_DataFrameElement(self._df, self._index, key, &v))
 *         return to_py_variant(v)             # <<<<<<<<<<<<<<
 * 
 *     def to_string(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_7_amplpy_to_py_variant(__pyx_v_v); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 40, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "amplpy/dataframe.pxi":37
 *         return RowIterator.create(self._df, self._index)
 * 
 *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
 *         cdef campl.AMPL_VARIANT* v
 *         PY_AMPL_CALL(campl.AMPL_DataFrameElement(self._df, self._index, key, &v))
 */

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

/* "amplpy/dataframe.pxi":42
 *         return to_py_variant(v)
 * 
 *     def to_string(self):             # <<<<<<<<<<<<<<
 *         return str(list(self))
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_3Row_7to_string(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_3Row_6to_string, "Row.to_string(self)");
static PyMethodDef __pyx_mdef_7_amplpy_3Row_7to_string = {"to_string", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_3Row_7to_string, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_3Row_6to_string};
static PyObject *__pyx_pw_7_amplpy_3Row_7to_string(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_string (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("to_string", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "to_string", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_3Row_6to_string(((struct __pyx_obj_7_amplpy_Row *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_3Row_6to_string(struct __pyx_obj_7_amplpy_Row *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_string", 1);

  /* "amplpy/dataframe.pxi":43
 * 
 *     def to_string(self):
 *         return str(list(self))             # <<<<<<<<<<<<<<
 * 
 *     # Aliases
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PySequence_List(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Unicode(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 43, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "amplpy/dataframe.pxi":42
 *         return to_py_variant(v)
 * 
 *     def to_string(self):             # <<<<<<<<<<<<<<
 *         return str(list(self))
 * 
 */

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

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._df cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_3Row_9__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_3Row_8__reduce_cython__, "Row.__reduce_cython__(self)");
static PyMethodDef __pyx_mdef_7_amplpy_3Row_9__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_3Row_9__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_3Row_8__reduce_cython__};
static PyObject *__pyx_pw_7_amplpy_3Row_9__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_3Row_8__reduce_cython__(((struct __pyx_obj_7_amplpy_Row *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_3Row_8__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7_amplpy_Row *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 1);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "self._df cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self._df cannot be converted to a Python object for pickling"
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_self__df_cannot_be_converted_to, 0, 0);
  __PYX_ERR(8, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._df cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 */

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

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._df cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._df cannot be converted to a Python object for pickling"
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_3Row_11__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_3Row_10__setstate_cython__, "Row.__setstate_cython__(self, __pyx_state)");
static PyMethodDef __pyx_mdef_7_amplpy_3Row_11__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_3Row_11__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_3Row_10__setstate_cython__};
static PyObject *__pyx_pw_7_amplpy_3Row_11__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 3, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(8, 3, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(8, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.Row.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_3Row_10__setstate_cython__(((struct __pyx_obj_7_amplpy_Row *)__pyx_v_self), __pyx_v___pyx_state);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_3Row_10__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7_amplpy_Row *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 1);

  /* "(tree fragment)":4
 *     raise TypeError, "self._df cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self._df cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_self__df_cannot_be_converted_to, 0, 0);
  __PYX_ERR(8, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._df cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._df cannot be converted to a Python object for pickling"
 */

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

/* "amplpy/dataframe.pxi":57
 * 
 *     @staticmethod
 *     cdef create(campl.AMPL_DATAFRAME* df, size_t index):             # <<<<<<<<<<<<<<
 *         col = Column()
 *         col._df = df
 */

static PyObject *__pyx_f_7_amplpy_6Column_create(AMPL_DATAFRAME *__pyx_v_df, size_t __pyx_v_index) {
  struct __pyx_obj_7_amplpy_Column *__pyx_v_col = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("create", 1);

  /* "amplpy/dataframe.pxi":58
 *     @staticmethod
 *     cdef create(campl.AMPL_DATAFRAME* df, size_t index):
 *         col = Column()             # <<<<<<<<<<<<<<
 *         col._df = df
 *         col._index = index
 */
  __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_7_amplpy_Column)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 58, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_col = ((struct __pyx_obj_7_amplpy_Column *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "amplpy/dataframe.pxi":59
 *     cdef create(campl.AMPL_DATAFRAME* df, size_t index):
 *         col = Column()
 *         col._df = df             # <<<<<<<<<<<<<<
 *         col._index = index
 *         return col
 */
  __pyx_v_col->_df = __pyx_v_df;

  /* "amplpy/dataframe.pxi":60
 *         col = Column()
 *         col._df = df
 *         col._index = index             # <<<<<<<<<<<<<<
 *         return col
 * 
 */
  __pyx_v_col->_index = __pyx_v_index;

  /* "amplpy/dataframe.pxi":61
 *         col._df = df
 *         col._index = index
 *         return col             # <<<<<<<<<<<<<<
 * 
 *     def __str__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_col);
  __pyx_r = ((PyObject *)__pyx_v_col);
  goto __pyx_L0;

  /* "amplpy/dataframe.pxi":57
 * 
 *     @staticmethod
 *     cdef create(campl.AMPL_DATAFRAME* df, size_t index):             # <<<<<<<<<<<<<<
 *         col = Column()
 *         col._df = df
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("_amplpy.Column.create", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_col);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/dataframe.pxi":63
 *         return col
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return self.to_string()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_6Column_1__str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7_amplpy_6Column_1__str__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7_amplpy_6Column___str__(((struct __pyx_obj_7_amplpy_Column *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_6Column___str__(struct __pyx_obj_7_amplpy_Column *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__str__", 1);

  /* "amplpy/dataframe.pxi":64
 * 
 *     def __str__(self):
 *         return self.to_string()             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_to_string); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 64, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 64, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "amplpy/dataframe.pxi":63
 *         return col
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return self.to_string()
 * 
 */

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

/* "amplpy/dataframe.pxi":66
 *         return self.to_string()
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return ColIterator.create(self._df, self._index)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_6Column_3__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7_amplpy_6Column_3__iter__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7_amplpy_6Column_2__iter__(((struct __pyx_obj_7_amplpy_Column *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_6Column_2__iter__(struct __pyx_obj_7_amplpy_Column *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__iter__", 1);

  /* "amplpy/dataframe.pxi":67
 * 
 *     def __iter__(self):
 *         return ColIterator.create(self._df, self._index)             # <<<<<<<<<<<<<<
 * 
 *     def to_string(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7_amplpy_11ColIterator_create(__pyx_v_self->_df, __pyx_v_self->_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 67, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "amplpy/dataframe.pxi":66
 *         return self.to_string()
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return ColIterator.create(self._df, self._index)
 * 
 */

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

/* "amplpy/dataframe.pxi":69
 *         return ColIterator.create(self._df, self._index)
 * 
 *     def to_string(self):             # <<<<<<<<<<<<<<
 *         return str(self.to_list())
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_6Column_5to_string(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_6Column_4to_string, "Column.to_string(self)");
static PyMethodDef __pyx_mdef_7_amplpy_6Column_5to_string = {"to_string", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_6Column_5to_string, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_6Column_4to_string};
static PyObject *__pyx_pw_7_amplpy_6Column_5to_string(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_string (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("to_string", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "to_string", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_6Column_4to_string(((struct __pyx_obj_7_amplpy_Column *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_6Column_4to_string(struct __pyx_obj_7_amplpy_Column *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_string", 1);

  /* "amplpy/dataframe.pxi":70
 * 
 *     def to_string(self):
 *         return str(self.to_list())             # <<<<<<<<<<<<<<
 * 
 *     def to_list(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_to_list); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 70, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 70, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_t_2 = __Pyx_PyObject_Unicode(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 70, __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;

  /* "amplpy/dataframe.pxi":69
 *         return ColIterator.create(self._df, self._index)
 * 
 *     def to_string(self):             # <<<<<<<<<<<<<<
 *         return str(self.to_list())
 * 
 */

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

/* "amplpy/dataframe.pxi":72
 *         return str(self.to_list())
 * 
 *     def to_list(self):             # <<<<<<<<<<<<<<
 *         py_list = []
 *         cdef campl.AMPL_VARIANT* v
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_6Column_7to_list(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_6Column_6to_list, "Column.to_list(self)");
static PyMethodDef __pyx_mdef_7_amplpy_6Column_7to_list = {"to_list", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_6Column_7to_list, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_6Column_6to_list};
static PyObject *__pyx_pw_7_amplpy_6Column_7to_list(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_list (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("to_list", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "to_list", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_6Column_6to_list(((struct __pyx_obj_7_amplpy_Column *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_6Column_6to_list(struct __pyx_obj_7_amplpy_Column *__pyx_v_self) {
  PyObject *__pyx_v_py_list = NULL;
  AMPL_VARIANT *__pyx_v_v;
  size_t __pyx_v_rowindex;
  size_t __pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  size_t __pyx_t_2;
  size_t __pyx_t_3;
  size_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_list", 1);

  /* "amplpy/dataframe.pxi":73
 * 
 *     def to_list(self):
 *         py_list = []             # <<<<<<<<<<<<<<
 *         cdef campl.AMPL_VARIANT* v
 *         cdef size_t rowindex
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 73, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_py_list = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "amplpy/dataframe.pxi":77
 *         cdef size_t rowindex
 *         cdef size_t i
 *         PY_AMPL_CALL(campl.AMPL_DataFrameGetNumRows(self._df, &rowindex))             # <<<<<<<<<<<<<<
 *         for i in range(rowindex):
 *             PY_AMPL_CALL(campl.AMPL_DataFrameElement(self._df, i, self._index, &v))
 */
  __pyx_t_1 = __pyx_f_7_amplpy_PY_AMPL_CALL(AMPL_DataFrameGetNumRows(__pyx_v_self->_df, (&__pyx_v_rowindex))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 77, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "amplpy/dataframe.pxi":78
 *         cdef size_t i
 *         PY_AMPL_CALL(campl.AMPL_DataFrameGetNumRows(self._df, &rowindex))
 *         for i in range(rowindex):             # <<<<<<<<<<<<<<
 *             PY_AMPL_CALL(campl.AMPL_DataFrameElement(self._df, i, self._index, &v))
 *             py_list.append(to_py_variant(v))
 */
  __pyx_t_2 = __pyx_v_rowindex;
  __pyx_t_3 = __pyx_t_2;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
    __pyx_v_i = __pyx_t_4;

    /* "amplpy/dataframe.pxi":79
 *         PY_AMPL_CALL(campl.AMPL_DataFrameGetNumRows(self._df, &rowindex))
 *         for i in range(rowindex):
 *             PY_AMPL_CALL(campl.AMPL_DataFrameElement(self._df, i, self._index, &v))             # <<<<<<<<<<<<<<
 *             py_list.append(to_py_variant(v))
 *         return py_list
 */
    __pyx_t_1 = __pyx_f_7_amplpy_PY_AMPL_CALL(AMPL_DataFrameElement(__pyx_v_self->_df, __pyx_v_i, __pyx_v_self->_index, (&__pyx_v_v))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 79, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "amplpy/dataframe.pxi":80
 *         for i in range(rowindex):
 *             PY_AMPL_CALL(campl.AMPL_DataFrameElement(self._df, i, self._index, &v))
 *             py_list.append(to_py_variant(v))             # <<<<<<<<<<<<<<
 *         return py_list
 * 
 */
    __pyx_t_1 = __pyx_f_7_amplpy_to_py_variant(__pyx_v_v); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 80, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_py_list, __pyx_t_1); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 80, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "amplpy/dataframe.pxi":81
 *             PY_AMPL_CALL(campl.AMPL_DataFrameElement(self._df, i, self._index, &v))
 *             py_list.append(to_py_variant(v))
 *         return py_list             # <<<<<<<<<<<<<<
 * 
 *     # Aliases
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_py_list);
  __pyx_r = __pyx_v_py_list;
  goto __pyx_L0;

  /* "amplpy/dataframe.pxi":72
 *         return str(self.to_list())
 * 
 *     def to_list(self):             # <<<<<<<<<<<<<<
 *         py_list = []
 *         cdef campl.AMPL_VARIANT* v
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("_amplpy.Column.to_list", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_py_list);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._df cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_6Column_9__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_6Column_8__reduce_cython__, "Column.__reduce_cython__(self)");
static PyMethodDef __pyx_mdef_7_amplpy_6Column_9__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_6Column_9__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_6Column_8__reduce_cython__};
static PyObject *__pyx_pw_7_amplpy_6Column_9__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_6Column_8__reduce_cython__(((struct __pyx_obj_7_amplpy_Column *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_6Column_8__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7_amplpy_Column *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 1);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "self._df cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self._df cannot be converted to a Python object for pickling"
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_self__df_cannot_be_converted_to, 0, 0);
  __PYX_ERR(8, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._df cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 */

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

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._df cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._df cannot be converted to a Python object for pickling"
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_6Column_11__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_6Column_10__setstate_cython__, "Column.__setstate_cython__(self, __pyx_state)");
static PyMethodDef __pyx_mdef_7_amplpy_6Column_11__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_6Column_11__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_6Column_10__setstate_cython__};
static PyObject *__pyx_pw_7_amplpy_6Column_11__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 3, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(8, 3, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(8, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.Column.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_6Column_10__setstate_cython__(((struct __pyx_obj_7_amplpy_Column *)__pyx_v_self), __pyx_v___pyx_state);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_6Column_10__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7_amplpy_Column *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 1);

  /* "(tree fragment)":4
 *     raise TypeError, "self._df cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self._df cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_self__df_cannot_be_converted_to, 0, 0);
  __PYX_ERR(8, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._df cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._df cannot be converted to a Python object for pickling"
 */

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

/* "amplpy/dataframe.pxi":122
 *     cdef campl.AMPL_DATAFRAME* _c_df
 * 
 *     def __cinit__(self, index, columns=tuple(), **kwargs):             # <<<<<<<<<<<<<<
 *         """
 *         Create a new DataFrame with specifed index and column headers.
 */

/* Python wrapper */
static int __pyx_pw_7_amplpy_9DataFrame_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7_amplpy_9DataFrame_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_index = 0;
  PyObject *__pyx_v_columns = 0;
  CYTHON_UNUSED PyObject *__pyx_v_kwargs = 0;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1;
  __Pyx_GOTREF(__pyx_v_kwargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,&__pyx_n_s_columns,0};
    values[1] = __Pyx_Arg_NewRef_VARARGS(__pyx_k__14);
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_index)) != 0)) {
          (void)__Pyx_Arg_NewRef_VARARGS(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 122, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_columns);
          if (value) { values[1] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 122, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, __pyx_v_kwargs, values + 0, kwd_pos_args, "__cinit__") < 0)) __PYX_ERR(0, 122, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_index = values[0];
    __pyx_v_columns = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 122, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]);
    }
  }
  __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
  __Pyx_AddTraceback("_amplpy.DataFrame.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_9DataFrame___cinit__(((struct __pyx_obj_7_amplpy_DataFrame *)__pyx_v_self), __pyx_v_index, __pyx_v_columns, __pyx_v_kwargs);

  /* function exit code */
  __Pyx_DECREF(__pyx_v_kwargs);
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7_amplpy_9DataFrame___cinit__(struct __pyx_obj_7_amplpy_DataFrame *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_columns, CYTHON_UNUSED PyObject *__pyx_v_kwargs) {
  char **__pyx_v_headers;
  size_t __pyx_v_index_size;
  size_t __pyx_v_column_size;
  PyObject *__pyx_v_index_names = NULL;
  PyObject *__pyx_v_column_names = NULL;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_temp = NULL;
  PyObject *__pyx_v_col = NULL;
  PyObject *__pyx_7genexpr__pyx_v_col = NULL;
  PyObject *__pyx_8genexpr1__pyx_v_col = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  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;
  unsigned int __pyx_t_8;
  char const *__pyx_t_9;
  Py_ssize_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__cinit__", 0);
  __Pyx_INCREF(__pyx_v_index);
  __Pyx_INCREF(__pyx_v_columns);

  /* "amplpy/dataframe.pxi":133
 *         cdef char** headers
 *         cdef size_t index_size, column_size
 *         if index is not None:             # <<<<<<<<<<<<<<
 *             if isinstance(index, str):
 *                 index = (index,)
 */
  __pyx_t_1 = (__pyx_v_index != Py_None);
  if (__pyx_t_1) {

    /* "amplpy/dataframe.pxi":134
 *         cdef size_t index_size, column_size
 *         if index is not None:
 *             if isinstance(index, str):             # <<<<<<<<<<<<<<
 *                 index = (index,)
 *             if isinstance(columns, str):
 */
    __pyx_t_1 = PyUnicode_Check(__pyx_v_index); 
    if (__pyx_t_1) {

      /* "amplpy/dataframe.pxi":135
 *         if index is not None:
 *             if isinstance(index, str):
 *                 index = (index,)             # <<<<<<<<<<<<<<
 *             if isinstance(columns, str):
 *                 columns = (columns,)
 */
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 135, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_index);
      __Pyx_GIVEREF(__pyx_v_index);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_index)) __PYX_ERR(0, 135, __pyx_L1_error);
      __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "amplpy/dataframe.pxi":134
 *         cdef size_t index_size, column_size
 *         if index is not None:
 *             if isinstance(index, str):             # <<<<<<<<<<<<<<
 *                 index = (index,)
 *             if isinstance(columns, str):
 */
    }

    /* "amplpy/dataframe.pxi":136
 *             if isinstance(index, str):
 *                 index = (index,)
 *             if isinstance(columns, str):             # <<<<<<<<<<<<<<
 *                 columns = (columns,)
 *             index_names = [col[0] if isinstance(col, tuple) else col for col in index]
 */
    __pyx_t_1 = PyUnicode_Check(__pyx_v_columns); 
    if (__pyx_t_1) {

      /* "amplpy/dataframe.pxi":137
 *                 index = (index,)
 *             if isinstance(columns, str):
 *                 columns = (columns,)             # <<<<<<<<<<<<<<
 *             index_names = [col[0] if isinstance(col, tuple) else col for col in index]
 *             column_names = [
 */
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 137, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_columns);
      __Pyx_GIVEREF(__pyx_v_columns);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_columns)) __PYX_ERR(0, 137, __pyx_L1_error);
      __Pyx_DECREF_SET(__pyx_v_columns, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "amplpy/dataframe.pxi":136
 *             if isinstance(index, str):
 *                 index = (index,)
 *             if isinstance(columns, str):             # <<<<<<<<<<<<<<
 *                 columns = (columns,)
 *             index_names = [col[0] if isinstance(col, tuple) else col for col in index]
 */
    }

    /* "amplpy/dataframe.pxi":138
 *             if isinstance(columns, str):
 *                 columns = (columns,)
 *             index_names = [col[0] if isinstance(col, tuple) else col for col in index]             # <<<<<<<<<<<<<<
 *             column_names = [
 *                 col[0] if isinstance(col, tuple) else col for col in columns
 */
    { /* enter inner scope */
      __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 138, __pyx_L8_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
        __pyx_t_3 = __pyx_v_index; __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_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 138, __pyx_L8_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 138, __pyx_L8_error)
      }
      for (;;) {
        if (likely(!__pyx_t_5)) {
          if (likely(PyList_CheckExact(__pyx_t_3))) {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3);
              #if !CYTHON_ASSUME_SAFE_MACROS
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 138, __pyx_L8_error)
              #endif
              if (__pyx_t_4 >= __pyx_temp) break;
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_6 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 138, __pyx_L8_error)
            #else
            __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 138, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_6);
            #endif
          } else {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3);
              #if !CYTHON_ASSUME_SAFE_MACROS
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 138, __pyx_L8_error)
              #endif
              if (__pyx_t_4 >= __pyx_temp) break;
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 138, __pyx_L8_error)
            #else
            __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 138, __pyx_L8_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, 138, __pyx_L8_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_6);
        }
        __Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_col, __pyx_t_6);
        __pyx_t_6 = 0;
        __pyx_t_1 = PyTuple_Check(__pyx_7genexpr__pyx_v_col); 
        if (__pyx_t_1) {
          __pyx_t_7 = __Pyx_GetItemInt(__pyx_7genexpr__pyx_v_col, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 138, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_6 = __pyx_t_7;
          __pyx_t_7 = 0;
        } else {
          __Pyx_INCREF(__pyx_7genexpr__pyx_v_col);
          __pyx_t_6 = __pyx_7genexpr__pyx_v_col;
        }
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 138, __pyx_L8_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_7genexpr__pyx_v_col); __pyx_7genexpr__pyx_v_col = 0;
      goto __pyx_L12_exit_scope;
      __pyx_L8_error:;
      __Pyx_XDECREF(__pyx_7genexpr__pyx_v_col); __pyx_7genexpr__pyx_v_col = 0;
      goto __pyx_L1_error;
      __pyx_L12_exit_scope:;
    } /* exit inner scope */
    __pyx_v_index_names = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "amplpy/dataframe.pxi":139
 *                 columns = (columns,)
 *             index_names = [col[0] if isinstance(col, tuple) else col for col in index]
 *             column_names = [             # <<<<<<<<<<<<<<
 *                 col[0] if isinstance(col, tuple) else col for col in columns
 *             ]
 */
    { /* enter inner scope */
      __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 139, __pyx_L15_error)
      __Pyx_GOTREF(__pyx_t_2);

      /* "amplpy/dataframe.pxi":140
 *             index_names = [col[0] if isinstance(col, tuple) else col for col in index]
 *             column_names = [
 *                 col[0] if isinstance(col, tuple) else col for col in columns             # <<<<<<<<<<<<<<
 *             ]
 *             index_size = len(index_names)
 */
      if (likely(PyList_CheckExact(__pyx_v_columns)) || PyTuple_CheckExact(__pyx_v_columns)) {
        __pyx_t_3 = __pyx_v_columns; __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_columns); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 140, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 140, __pyx_L15_error)
      }
      for (;;) {
        if (likely(!__pyx_t_5)) {
          if (likely(PyList_CheckExact(__pyx_t_3))) {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3);
              #if !CYTHON_ASSUME_SAFE_MACROS
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 140, __pyx_L15_error)
              #endif
              if (__pyx_t_4 >= __pyx_temp) break;
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_6 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 140, __pyx_L15_error)
            #else
            __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 140, __pyx_L15_error)
            __Pyx_GOTREF(__pyx_t_6);
            #endif
          } else {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3);
              #if !CYTHON_ASSUME_SAFE_MACROS
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 140, __pyx_L15_error)
              #endif
              if (__pyx_t_4 >= __pyx_temp) break;
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 140, __pyx_L15_error)
            #else
            __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 140, __pyx_L15_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, 140, __pyx_L15_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_6);
        }
        __Pyx_XDECREF_SET(__pyx_8genexpr1__pyx_v_col, __pyx_t_6);
        __pyx_t_6 = 0;
        __pyx_t_1 = PyTuple_Check(__pyx_8genexpr1__pyx_v_col); 
        if (__pyx_t_1) {
          __pyx_t_7 = __Pyx_GetItemInt(__pyx_8genexpr1__pyx_v_col, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 140, __pyx_L15_error)
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_6 = __pyx_t_7;
          __pyx_t_7 = 0;
        } else {
          __Pyx_INCREF(__pyx_8genexpr1__pyx_v_col);
          __pyx_t_6 = __pyx_8genexpr1__pyx_v_col;
        }
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 139, __pyx_L15_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_col); __pyx_8genexpr1__pyx_v_col = 0;
      goto __pyx_L19_exit_scope;
      __pyx_L15_error:;
      __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_col); __pyx_8genexpr1__pyx_v_col = 0;
      goto __pyx_L1_error;
      __pyx_L19_exit_scope:;
    } /* exit inner scope */
    __pyx_v_column_names = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "amplpy/dataframe.pxi":142
 *                 col[0] if isinstance(col, tuple) else col for col in columns
 *             ]
 *             index_size = len(index_names)             # <<<<<<<<<<<<<<
 *             column_size = len(column_names)
 *             headers = <char**> malloc((index_size+column_size) * sizeof(char*))
 */
    __pyx_t_4 = __Pyx_PyList_GET_SIZE(__pyx_v_index_names); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 142, __pyx_L1_error)
    __pyx_v_index_size = __pyx_t_4;

    /* "amplpy/dataframe.pxi":143
 *             ]
 *             index_size = len(index_names)
 *             column_size = len(column_names)             # <<<<<<<<<<<<<<
 *             headers = <char**> malloc((index_size+column_size) * sizeof(char*))
 * 
 */
    __pyx_t_4 = __Pyx_PyList_GET_SIZE(__pyx_v_column_names); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 143, __pyx_L1_error)
    __pyx_v_column_size = __pyx_t_4;

    /* "amplpy/dataframe.pxi":144
 *             index_size = len(index_names)
 *             column_size = len(column_names)
 *             headers = <char**> malloc((index_size+column_size) * sizeof(char*))             # <<<<<<<<<<<<<<
 * 
 *             for i in range(index_size + column_size):
 */
    __pyx_v_headers = ((char **)malloc(((__pyx_v_index_size + __pyx_v_column_size) * (sizeof(char *)))));

    /* "amplpy/dataframe.pxi":146
 *             headers = <char**> malloc((index_size+column_size) * sizeof(char*))
 * 
 *             for i in range(index_size + column_size):             # <<<<<<<<<<<<<<
 *                 if i < index_size:
 *                     temp = index_names[i].encode('utf-8')
 */
    __pyx_t_2 = __Pyx_PyInt_FromSize_t((__pyx_v_index_size + __pyx_v_column_size)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 146, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 146, __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, 146, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 146, __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))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 146, __pyx_L1_error)
            #endif
            if (__pyx_t_4 >= __pyx_temp) 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, 146, __pyx_L1_error)
          #else
          __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 146, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          #endif
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 146, __pyx_L1_error)
            #endif
            if (__pyx_t_4 >= __pyx_temp) 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, 146, __pyx_L1_error)
          #else
          __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 146, __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, 146, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_3);
      }
      __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "amplpy/dataframe.pxi":147
 * 
 *             for i in range(index_size + column_size):
 *                 if i < index_size:             # <<<<<<<<<<<<<<
 *                     temp = index_names[i].encode('utf-8')
 *                 else:
 */
      __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_v_index_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 147, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 = PyObject_RichCompare(__pyx_v_i, __pyx_t_3, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 147, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 147, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (__pyx_t_1) {

        /* "amplpy/dataframe.pxi":148
 *             for i in range(index_size + column_size):
 *                 if i < index_size:
 *                     temp = index_names[i].encode('utf-8')             # <<<<<<<<<<<<<<
 *                 else:
 *                     temp = column_names[i - index_size].encode('utf-8')
 */
        __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_index_names, __pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 148, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_encode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 148, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = NULL;
        __pyx_t_8 = 0;
        #if CYTHON_UNPACK_METHODS
        if (likely(PyMethod_Check(__pyx_t_7))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7);
          if (likely(__pyx_t_3)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
            __Pyx_INCREF(__pyx_t_3);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_7, function);
            __pyx_t_8 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_u_utf_8};
          __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 148, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        }
        __Pyx_XDECREF_SET(__pyx_v_temp, __pyx_t_6);
        __pyx_t_6 = 0;

        /* "amplpy/dataframe.pxi":147
 * 
 *             for i in range(index_size + column_size):
 *                 if i < index_size:             # <<<<<<<<<<<<<<
 *                     temp = index_names[i].encode('utf-8')
 *                 else:
 */
        goto __pyx_L22;
      }

      /* "amplpy/dataframe.pxi":150
 *                     temp = index_names[i].encode('utf-8')
 *                 else:
 *                     temp = column_names[i - index_size].encode('utf-8')             # <<<<<<<<<<<<<<
 *                 headers[i] = strdup(temp)
 * 
 */
      /*else*/ {
        __pyx_t_7 = __Pyx_PyInt_FromSize_t(__pyx_v_index_size); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 150, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_3 = PyNumber_Subtract(__pyx_v_i, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 150, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_column_names, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 150, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 150, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        __pyx_t_8 = 0;
        #if CYTHON_UNPACK_METHODS
        if (likely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
            __pyx_t_8 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_kp_u_utf_8};
          __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 150, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        }
        __Pyx_XDECREF_SET(__pyx_v_temp, __pyx_t_6);
        __pyx_t_6 = 0;
      }
      __pyx_L22:;

      /* "amplpy/dataframe.pxi":151
 *                 else:
 *                     temp = column_names[i - index_size].encode('utf-8')
 *                 headers[i] = strdup(temp)             # <<<<<<<<<<<<<<
 * 
 *             PY_AMPL_CALL(campl.AMPL_DataFrameCreate(&self._c_df, index_size, column_size, headers))
 */
      __pyx_t_9 = __Pyx_PyObject_AsString(__pyx_v_temp); if (unlikely((!__pyx_t_9) && PyErr_Occurred())) __PYX_ERR(0, 151, __pyx_L1_error)
      __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 151, __pyx_L1_error)
      (__pyx_v_headers[__pyx_t_10]) = strdup(__pyx_t_9);

      /* "amplpy/dataframe.pxi":146
 *             headers = <char**> malloc((index_size+column_size) * sizeof(char*))
 * 
 *             for i in range(index_size + column_size):             # <<<<<<<<<<<<<<
 *                 if i < index_size:
 *                     temp = index_names[i].encode('utf-8')
 */
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "amplpy/dataframe.pxi":153
 *                 headers[i] = strdup(temp)
 * 
 *             PY_AMPL_CALL(campl.AMPL_DataFrameCreate(&self._c_df, index_size, column_size, headers))             # <<<<<<<<<<<<<<
 * 
 *             for i in range(index_size+column_size):
 */
    __pyx_t_2 = __pyx_f_7_amplpy_PY_AMPL_CALL(AMPL_DataFrameCreate((&__pyx_v_self->_c_df), __pyx_v_index_size, __pyx_v_column_size, __pyx_v_headers)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 153, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "amplpy/dataframe.pxi":155
 *             PY_AMPL_CALL(campl.AMPL_DataFrameCreate(&self._c_df, index_size, column_size, headers))
 * 
 *             for i in range(index_size+column_size):             # <<<<<<<<<<<<<<
 *                 if headers[i] != NULL:
 *                     free(headers[i])
 */
    __pyx_t_2 = __Pyx_PyInt_FromSize_t((__pyx_v_index_size + __pyx_v_column_size)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 155, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 155, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (likely(PyList_CheckExact(__pyx_t_6)) || PyTuple_CheckExact(__pyx_t_6)) {
      __pyx_t_2 = __pyx_t_6; __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_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 155, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 155, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    for (;;) {
      if (likely(!__pyx_t_5)) {
        if (likely(PyList_CheckExact(__pyx_t_2))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 155, __pyx_L1_error)
            #endif
            if (__pyx_t_4 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_6 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 155, __pyx_L1_error)
          #else
          __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 155, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          #endif
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 155, __pyx_L1_error)
            #endif
            if (__pyx_t_4 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 155, __pyx_L1_error)
          #else
          __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 155, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          #endif
        }
      } else {
        __pyx_t_6 = __pyx_t_5(__pyx_t_2);
        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, 155, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_6);
      }
      __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "amplpy/dataframe.pxi":156
 * 
 *             for i in range(index_size+column_size):
 *                 if headers[i] != NULL:             # <<<<<<<<<<<<<<
 *                     free(headers[i])
 *             free(headers)
 */
      __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 156, __pyx_L1_error)
      __pyx_t_1 = ((__pyx_v_headers[__pyx_t_10]) != NULL);
      if (__pyx_t_1) {

        /* "amplpy/dataframe.pxi":157
 *             for i in range(index_size+column_size):
 *                 if headers[i] != NULL:
 *                     free(headers[i])             # <<<<<<<<<<<<<<
 *             free(headers)
 * 
 */
        __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 157, __pyx_L1_error)
        free((__pyx_v_headers[__pyx_t_10]));

        /* "amplpy/dataframe.pxi":156
 * 
 *             for i in range(index_size+column_size):
 *                 if headers[i] != NULL:             # <<<<<<<<<<<<<<
 *                     free(headers[i])
 *             free(headers)
 */
      }

      /* "amplpy/dataframe.pxi":155
 *             PY_AMPL_CALL(campl.AMPL_DataFrameCreate(&self._c_df, index_size, column_size, headers))
 * 
 *             for i in range(index_size+column_size):             # <<<<<<<<<<<<<<
 *                 if headers[i] != NULL:
 *                     free(headers[i])
 */
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "amplpy/dataframe.pxi":158
 *                 if headers[i] != NULL:
 *                     free(headers[i])
 *             free(headers)             # <<<<<<<<<<<<<<
 * 
 *             for col in index:
 */
    free(__pyx_v_headers);

    /* "amplpy/dataframe.pxi":160
 *             free(headers)
 * 
 *             for col in index:             # <<<<<<<<<<<<<<
 *                 if isinstance(col, tuple):
 *                     self._set_column(col[0], col[1])
 */
    if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
      __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2);
      __pyx_t_4 = 0;
      __pyx_t_5 = NULL;
    } else {
      __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 160, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 160, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_5)) {
        if (likely(PyList_CheckExact(__pyx_t_2))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 160, __pyx_L1_error)
            #endif
            if (__pyx_t_4 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_6 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 160, __pyx_L1_error)
          #else
          __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 160, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          #endif
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 160, __pyx_L1_error)
            #endif
            if (__pyx_t_4 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 160, __pyx_L1_error)
          #else
          __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 160, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          #endif
        }
      } else {
        __pyx_t_6 = __pyx_t_5(__pyx_t_2);
        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, 160, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_6);
      }
      __Pyx_XDECREF_SET(__pyx_v_col, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "amplpy/dataframe.pxi":161
 * 
 *             for col in index:
 *                 if isinstance(col, tuple):             # <<<<<<<<<<<<<<
 *                     self._set_column(col[0], col[1])
 *             for col in columns:
 */
      __pyx_t_1 = PyTuple_Check(__pyx_v_col); 
      if (__pyx_t_1) {

        /* "amplpy/dataframe.pxi":162
 *             for col in index:
 *                 if isinstance(col, tuple):
 *                     self._set_column(col[0], col[1])             # <<<<<<<<<<<<<<
 *             for col in columns:
 *                 if isinstance(col, tuple):
 */
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_column); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 162, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_col, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 162, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_col, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 162, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_12 = NULL;
        __pyx_t_8 = 0;
        #if CYTHON_UNPACK_METHODS
        if (likely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_12)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_12);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
            __pyx_t_8 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[3] = {__pyx_t_12, __pyx_t_7, __pyx_t_11};
          __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8);
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 162, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

        /* "amplpy/dataframe.pxi":161
 * 
 *             for col in index:
 *                 if isinstance(col, tuple):             # <<<<<<<<<<<<<<
 *                     self._set_column(col[0], col[1])
 *             for col in columns:
 */
      }

      /* "amplpy/dataframe.pxi":160
 *             free(headers)
 * 
 *             for col in index:             # <<<<<<<<<<<<<<
 *                 if isinstance(col, tuple):
 *                     self._set_column(col[0], col[1])
 */
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "amplpy/dataframe.pxi":163
 *                 if isinstance(col, tuple):
 *                     self._set_column(col[0], col[1])
 *             for col in columns:             # <<<<<<<<<<<<<<
 *                 if isinstance(col, tuple):
 *                     self._set_column(col[0], col[1])
 */
    if (likely(PyList_CheckExact(__pyx_v_columns)) || PyTuple_CheckExact(__pyx_v_columns)) {
      __pyx_t_2 = __pyx_v_columns; __Pyx_INCREF(__pyx_t_2);
      __pyx_t_4 = 0;
      __pyx_t_5 = NULL;
    } else {
      __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_columns); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 163, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 163, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_5)) {
        if (likely(PyList_CheckExact(__pyx_t_2))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 163, __pyx_L1_error)
            #endif
            if (__pyx_t_4 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_6 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 163, __pyx_L1_error)
          #else
          __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 163, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          #endif
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 163, __pyx_L1_error)
            #endif
            if (__pyx_t_4 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 163, __pyx_L1_error)
          #else
          __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 163, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          #endif
        }
      } else {
        __pyx_t_6 = __pyx_t_5(__pyx_t_2);
        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, 163, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_6);
      }
      __Pyx_XDECREF_SET(__pyx_v_col, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "amplpy/dataframe.pxi":164
 *                     self._set_column(col[0], col[1])
 *             for col in columns:
 *                 if isinstance(col, tuple):             # <<<<<<<<<<<<<<
 *                     self._set_column(col[0], col[1])
 * 
 */
      __pyx_t_1 = PyTuple_Check(__pyx_v_col); 
      if (__pyx_t_1) {

        /* "amplpy/dataframe.pxi":165
 *             for col in columns:
 *                 if isinstance(col, tuple):
 *                     self._set_column(col[0], col[1])             # <<<<<<<<<<<<<<
 * 
 *     cdef campl.AMPL_DATAFRAME* get_ptr(self):
 */
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_column); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 165, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_col, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 165, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_col, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 165, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_12 = NULL;
        __pyx_t_8 = 0;
        #if CYTHON_UNPACK_METHODS
        if (likely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_12)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_12);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
            __pyx_t_8 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[3] = {__pyx_t_12, __pyx_t_11, __pyx_t_7};
          __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8);
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 165, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

        /* "amplpy/dataframe.pxi":164
 *                     self._set_column(col[0], col[1])
 *             for col in columns:
 *                 if isinstance(col, tuple):             # <<<<<<<<<<<<<<
 *                     self._set_column(col[0], col[1])
 * 
 */
      }

      /* "amplpy/dataframe.pxi":163
 *                 if isinstance(col, tuple):
 *                     self._set_column(col[0], col[1])
 *             for col in columns:             # <<<<<<<<<<<<<<
 *                 if isinstance(col, tuple):
 *                     self._set_column(col[0], col[1])
 */
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "amplpy/dataframe.pxi":133
 *         cdef char** headers
 *         cdef size_t index_size, column_size
 *         if index is not None:             # <<<<<<<<<<<<<<
 *             if isinstance(index, str):
 *                 index = (index,)
 */
  }

  /* "amplpy/dataframe.pxi":122
 *     cdef campl.AMPL_DATAFRAME* _c_df
 * 
 *     def __cinit__(self, index, columns=tuple(), **kwargs):             # <<<<<<<<<<<<<<
 *         """
 *         Create a new DataFrame with specifed index and column headers.
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("_amplpy.DataFrame.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_index_names);
  __Pyx_XDECREF(__pyx_v_column_names);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_temp);
  __Pyx_XDECREF(__pyx_v_col);
  __Pyx_XDECREF(__pyx_7genexpr__pyx_v_col);
  __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_col);
  __Pyx_XDECREF(__pyx_v_index);
  __Pyx_XDECREF(__pyx_v_columns);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/dataframe.pxi":167
 *                     self._set_column(col[0], col[1])
 * 
 *     cdef campl.AMPL_DATAFRAME* get_ptr(self):             # <<<<<<<<<<<<<<
 *         return self._c_df
 * 
 */

static AMPL_DATAFRAME *__pyx_f_7_amplpy_9DataFrame_get_ptr(struct __pyx_obj_7_amplpy_DataFrame *__pyx_v_self) {
  AMPL_DATAFRAME *__pyx_r;

  /* "amplpy/dataframe.pxi":168
 * 
 *     cdef campl.AMPL_DATAFRAME* get_ptr(self):
 *         return self._c_df             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
  __pyx_r = __pyx_v_self->_c_df;
  goto __pyx_L0;

  /* "amplpy/dataframe.pxi":167
 *                     self._set_column(col[0], col[1])
 * 
 *     cdef campl.AMPL_DATAFRAME* get_ptr(self):             # <<<<<<<<<<<<<<
 *         return self._c_df
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "amplpy/dataframe.pxi":171
 * 
 *     @staticmethod
 *     cdef create(campl.AMPL_DATAFRAME* df_c):             # <<<<<<<<<<<<<<
 *         df = DataFrame(index=None)
 *         df._c_df = df_c
 */

static PyObject *__pyx_f_7_amplpy_9DataFrame_create(AMPL_DATAFRAME *__pyx_v_df_c) {
  struct __pyx_obj_7_amplpy_DataFrame *__pyx_v_df = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("create", 1);

  /* "amplpy/dataframe.pxi":172
 *     @staticmethod
 *     cdef create(campl.AMPL_DATAFRAME* df_c):
 *         df = DataFrame(index=None)             # <<<<<<<<<<<<<<
 *         df._c_df = df_c
 *         return df
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 172, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_index, Py_None) < 0) __PYX_ERR(0, 172, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7_amplpy_DataFrame), __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 172, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_df = ((struct __pyx_obj_7_amplpy_DataFrame *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "amplpy/dataframe.pxi":173
 *     cdef create(campl.AMPL_DATAFRAME* df_c):
 *         df = DataFrame(index=None)
 *         df._c_df = df_c             # <<<<<<<<<<<<<<
 *         return df
 * 
 */
  __pyx_v_df->_c_df = __pyx_v_df_c;

  /* "amplpy/dataframe.pxi":174
 *         df = DataFrame(index=None)
 *         df._c_df = df_c
 *         return df             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_df);
  __pyx_r = ((PyObject *)__pyx_v_df);
  goto __pyx_L0;

  /* "amplpy/dataframe.pxi":171
 * 
 *     @staticmethod
 *     cdef create(campl.AMPL_DATAFRAME* df_c):             # <<<<<<<<<<<<<<
 *         df = DataFrame(index=None)
 *         df._c_df = df_c
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("_amplpy.DataFrame.create", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_df);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/dataframe.pxi":176
 *         return df
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Default destructor:
 */

/* Python wrapper */
static void __pyx_pw_7_amplpy_9DataFrame_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_7_amplpy_9DataFrame_3__dealloc__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_pf_7_amplpy_9DataFrame_2__dealloc__(((struct __pyx_obj_7_amplpy_DataFrame *)__pyx_v_self));

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

static void __pyx_pf_7_amplpy_9DataFrame_2__dealloc__(struct __pyx_obj_7_amplpy_DataFrame *__pyx_v_self) {

  /* "amplpy/dataframe.pxi":181
 *         releases all the resources related to the Dataframe instance.
 *         """
 *         campl.AMPL_DataFrameFree(&self._c_df)             # <<<<<<<<<<<<<<
 * 
 *     def to_string(self):
 */
  AMPL_DataFrameFree((&__pyx_v_self->_c_df));

  /* "amplpy/dataframe.pxi":176
 *         return df
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Default destructor:
 */

  /* function exit code */
}

/* "amplpy/dataframe.pxi":183
 *         campl.AMPL_DataFrameFree(&self._c_df)
 * 
 *     def to_string(self):             # <<<<<<<<<<<<<<
 *         cdef char* value_c
 *         PY_AMPL_CALL(campl.AMPL_DataFrameToString(self._c_df, &value_c))
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_9DataFrame_5to_string(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_9DataFrame_4to_string, "DataFrame.to_string(self)");
static PyMethodDef __pyx_mdef_7_amplpy_9DataFrame_5to_string = {"to_string", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_9DataFrame_5to_string, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_9DataFrame_4to_string};
static PyObject *__pyx_pw_7_amplpy_9DataFrame_5to_string(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_string (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("to_string", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "to_string", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_9DataFrame_4to_string(((struct __pyx_obj_7_amplpy_DataFrame *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_9DataFrame_4to_string(struct __pyx_obj_7_amplpy_DataFrame *__pyx_v_self) {
  char *__pyx_v_value_c;
  PyObject *__pyx_v_value = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_string", 1);

  /* "amplpy/dataframe.pxi":185
 *     def to_string(self):
 *         cdef char* value_c
 *         PY_AMPL_CALL(campl.AMPL_DataFrameToString(self._c_df, &value_c))             # <<<<<<<<<<<<<<
 *         value = str(value_c.decode('utf-8'))
 *         campl.AMPL_StringFree(&value_c)
 */
  __pyx_t_1 = __pyx_f_7_amplpy_PY_AMPL_CALL(AMPL_DataFrameToString(__pyx_v_self->_c_df, (&__pyx_v_value_c))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 185, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "amplpy/dataframe.pxi":186
 *         cdef char* value_c
 *         PY_AMPL_CALL(campl.AMPL_DataFrameToString(self._c_df, &value_c))
 *         value = str(value_c.decode('utf-8'))             # <<<<<<<<<<<<<<
 *         campl.AMPL_StringFree(&value_c)
 *         return value
 */
  __pyx_t_2 = __Pyx_ssize_strlen(__pyx_v_value_c); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 186, __pyx_L1_error)
  __pyx_t_1 = __Pyx_decode_c_string(__pyx_v_value_c, 0, __pyx_t_2, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 186, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_value = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "amplpy/dataframe.pxi":187
 *         PY_AMPL_CALL(campl.AMPL_DataFrameToString(self._c_df, &value_c))
 *         value = str(value_c.decode('utf-8'))
 *         campl.AMPL_StringFree(&value_c)             # <<<<<<<<<<<<<<
 *         return value
 * 
 */
  (void)(AMPL_StringFree((&__pyx_v_value_c)));

  /* "amplpy/dataframe.pxi":188
 *         value = str(value_c.decode('utf-8'))
 *         campl.AMPL_StringFree(&value_c)
 *         return value             # <<<<<<<<<<<<<<
 * 
 *     def __str__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_value);
  __pyx_r = __pyx_v_value;
  goto __pyx_L0;

  /* "amplpy/dataframe.pxi":183
 *         campl.AMPL_DataFrameFree(&self._c_df)
 * 
 *     def to_string(self):             # <<<<<<<<<<<<<<
 *         cdef char* value_c
 *         PY_AMPL_CALL(campl.AMPL_DataFrameToString(self._c_df, &value_c))
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("_amplpy.DataFrame.to_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/dataframe.pxi":190
 *         return value
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return self.to_string()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_9DataFrame_7__str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7_amplpy_9DataFrame_7__str__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7_amplpy_9DataFrame_6__str__(((struct __pyx_obj_7_amplpy_DataFrame *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_9DataFrame_6__str__(struct __pyx_obj_7_amplpy_DataFrame *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__str__", 1);

  /* "amplpy/dataframe.pxi":191
 * 
 *     def __str__(self):
 *         return self.to_string()             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_to_string); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 191, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 191, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "amplpy/dataframe.pxi":190
 *         return value
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return self.to_string()
 * 
 */

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

/* "amplpy/dataframe.pxi":193
 *         return self.to_string()
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         # FIXME: C++ iterators for dataframes not working with SWIG.
 *         return (self._get_row_by_index(i) for i in range(self._get_num_rows()))
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_9DataFrame_9__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7_amplpy_9DataFrame_9__iter__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7_amplpy_9DataFrame_8__iter__(((struct __pyx_obj_7_amplpy_DataFrame *)__pyx_v_self));

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

/* "amplpy/dataframe.pxi":195
 *     def __iter__(self):
 *         # FIXME: C++ iterators for dataframes not working with SWIG.
 *         return (self._get_row_by_index(i) for i in range(self._get_num_rows()))             # <<<<<<<<<<<<<<
 * 
 *     def _get_num_cols(self):
 */

static PyObject *__pyx_pf_7_amplpy_9DataFrame_8__iter___genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) {
  struct __pyx_obj_7_amplpy___pyx_scope_struct_1_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_7_amplpy___pyx_scope_struct_1_genexpr *)__pyx_tp_new_7_amplpy___pyx_scope_struct_1_genexpr(__pyx_ptype_7_amplpy___pyx_scope_struct_1_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7_amplpy___pyx_scope_struct_1_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 195, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7_amplpy___pyx_scope_struct____iter__ *) __pyx_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope);
  __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7_amplpy_9DataFrame_8__iter___2generator, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_iter___locals_genexpr, __pyx_n_s_amplpy); if (unlikely(!gen)) __PYX_ERR(0, 195, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("_amplpy.DataFrame.__iter__.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_7_amplpy_9DataFrame_8__iter___2generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7_amplpy___pyx_scope_struct_1_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7_amplpy___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;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  unsigned int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __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, 195, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 195, __pyx_L1_error) }
  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) {
    __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __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_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 195, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 195, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 195, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) 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, 195, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 195, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 195, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) 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, 195, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 195, __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, 195, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_i);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_i, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 195, __pyx_L1_error) }
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self), __pyx_n_s_get_row_by_index); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 195, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (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_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_cur_scope->__pyx_v_i};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 195, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    __Pyx_XGIVEREF(__pyx_t_1);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_3;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __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, 195, __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_Generator_Replace_StopIteration(0);
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/dataframe.pxi":193
 *         return self.to_string()
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         # FIXME: C++ iterators for dataframes not working with SWIG.
 *         return (self._get_row_by_index(i) for i in range(self._get_num_rows()))
 */

static PyObject *__pyx_pf_7_amplpy_9DataFrame_8__iter__(struct __pyx_obj_7_amplpy_DataFrame *__pyx_v_self) {
  struct __pyx_obj_7_amplpy___pyx_scope_struct____iter__ *__pyx_cur_scope;
  PyObject *__pyx_gb_7_amplpy_9DataFrame_8__iter___2generator = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__iter__", 0);
  __pyx_cur_scope = (struct __pyx_obj_7_amplpy___pyx_scope_struct____iter__ *)__pyx_tp_new_7_amplpy___pyx_scope_struct____iter__(__pyx_ptype_7_amplpy___pyx_scope_struct____iter__, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7_amplpy___pyx_scope_struct____iter__ *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 193, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);

  /* "amplpy/dataframe.pxi":195
 *     def __iter__(self):
 *         # FIXME: C++ iterators for dataframes not working with SWIG.
 *         return (self._get_row_by_index(i) for i in range(self._get_num_rows()))             # <<<<<<<<<<<<<<
 * 
 *     def _get_num_cols(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_get_num_rows); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 195, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 195, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 195, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __pyx_pf_7_amplpy_9DataFrame_8__iter___genexpr(((PyObject*)__pyx_cur_scope), __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 195, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "amplpy/dataframe.pxi":193
 *         return self.to_string()
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         # FIXME: C++ iterators for dataframes not working with SWIG.
 *         return (self._get_row_by_index(i) for i in range(self._get_num_rows()))
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("_amplpy.DataFrame.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_gb_7_amplpy_9DataFrame_8__iter___2generator);
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/dataframe.pxi":197
 *         return (self._get_row_by_index(i) for i in range(self._get_num_rows()))
 * 
 *     def _get_num_cols(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the total number of columns in this dataframe (indexarity + number
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_9DataFrame_11_get_num_cols(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_9DataFrame_10_get_num_cols, "DataFrame._get_num_cols(self)\n\n        Get the total number of columns in this dataframe (indexarity + number\n        of values).\n\n        Returns:\n            The number of columns.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_9DataFrame_11_get_num_cols = {"_get_num_cols", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_9DataFrame_11_get_num_cols, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_9DataFrame_10_get_num_cols};
static PyObject *__pyx_pw_7_amplpy_9DataFrame_11_get_num_cols(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get_num_cols (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("_get_num_cols", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "_get_num_cols", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_9DataFrame_10_get_num_cols(((struct __pyx_obj_7_amplpy_DataFrame *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_9DataFrame_10_get_num_cols(struct __pyx_obj_7_amplpy_DataFrame *__pyx_v_self) {
  size_t __pyx_v_num;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_num_cols", 1);

  /* "amplpy/dataframe.pxi":206
 *         """
 *         cdef size_t num
 *         PY_AMPL_CALL(campl.AMPL_DataFrameGetNumCols(self._c_df, &num))             # <<<<<<<<<<<<<<
 *         return int(num)
 * 
 */
  __pyx_t_1 = __pyx_f_7_amplpy_PY_AMPL_CALL(AMPL_DataFrameGetNumCols(__pyx_v_self->_c_df, (&__pyx_v_num))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 206, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "amplpy/dataframe.pxi":207
 *         cdef size_t num
 *         PY_AMPL_CALL(campl.AMPL_DataFrameGetNumCols(self._c_df, &num))
 *         return int(num)             # <<<<<<<<<<<<<<
 * 
 *     def _get_num_rows(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_num); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyInt_Type)), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 207, __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;

  /* "amplpy/dataframe.pxi":197
 *         return (self._get_row_by_index(i) for i in range(self._get_num_rows()))
 * 
 *     def _get_num_cols(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the total number of columns in this dataframe (indexarity + number
 */

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

/* "amplpy/dataframe.pxi":209
 *         return int(num)
 * 
 *     def _get_num_rows(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the number of data rows in this dataframe.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_9DataFrame_13_get_num_rows(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_9DataFrame_12_get_num_rows, "DataFrame._get_num_rows(self)\n\n        Get the number of data rows in this dataframe.\n\n        Returns:\n            The number of rows.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_9DataFrame_13_get_num_rows = {"_get_num_rows", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_9DataFrame_13_get_num_rows, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_9DataFrame_12_get_num_rows};
static PyObject *__pyx_pw_7_amplpy_9DataFrame_13_get_num_rows(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get_num_rows (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("_get_num_rows", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "_get_num_rows", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_9DataFrame_12_get_num_rows(((struct __pyx_obj_7_amplpy_DataFrame *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_9DataFrame_12_get_num_rows(struct __pyx_obj_7_amplpy_DataFrame *__pyx_v_self) {
  size_t __pyx_v_num;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_num_rows", 1);

  /* "amplpy/dataframe.pxi":217
 *         """
 *         cdef size_t num
 *         PY_AMPL_CALL(campl.AMPL_DataFrameGetNumRows(self._c_df, &num))             # <<<<<<<<<<<<<<
 *         return int(num)
 * 
 */
  __pyx_t_1 = __pyx_f_7_amplpy_PY_AMPL_CALL(AMPL_DataFrameGetNumRows(__pyx_v_self->_c_df, (&__pyx_v_num))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 217, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "amplpy/dataframe.pxi":218
 *         cdef size_t num
 *         PY_AMPL_CALL(campl.AMPL_DataFrameGetNumRows(self._c_df, &num))
 *         return int(num)             # <<<<<<<<<<<<<<
 * 
 *     def _get_num_indices(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_num); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 218, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyInt_Type)), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 218, __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;

  /* "amplpy/dataframe.pxi":209
 *         return int(num)
 * 
 *     def _get_num_rows(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the number of data rows in this dataframe.
 */

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

/* "amplpy/dataframe.pxi":220
 *         return int(num)
 * 
 *     def _get_num_indices(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the number of indices (the indexarity) of this dataframe.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_9DataFrame_15_get_num_indices(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_9DataFrame_14_get_num_indices, "DataFrame._get_num_indices(self)\n\n        Get the number of indices (the indexarity) of this dataframe.\n\n        Returns:\n            The number of indices needed to access one row of this dataframe.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_9DataFrame_15_get_num_indices = {"_get_num_indices", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_9DataFrame_15_get_num_indices, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_9DataFrame_14_get_num_indices};
static PyObject *__pyx_pw_7_amplpy_9DataFrame_15_get_num_indices(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get_num_indices (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("_get_num_indices", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "_get_num_indices", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_9DataFrame_14_get_num_indices(((struct __pyx_obj_7_amplpy_DataFrame *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_9DataFrame_14_get_num_indices(struct __pyx_obj_7_amplpy_DataFrame *__pyx_v_self) {
  size_t __pyx_v_num;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_num_indices", 1);

  /* "amplpy/dataframe.pxi":228
 *         """
 *         cdef size_t num
 *         PY_AMPL_CALL(campl.AMPL_DataFrameGetNumIndices(self._c_df, &num))             # <<<<<<<<<<<<<<
 *         return int(num)
 * 
 */
  __pyx_t_1 = __pyx_f_7_amplpy_PY_AMPL_CALL(AMPL_DataFrameGetNumIndices(__pyx_v_self->_c_df, (&__pyx_v_num))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 228, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "amplpy/dataframe.pxi":229
 *         cdef size_t num
 *         PY_AMPL_CALL(campl.AMPL_DataFrameGetNumIndices(self._c_df, &num))
 *         return int(num)             # <<<<<<<<<<<<<<
 * 
 *     def _add_row(self, *value):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_num); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyInt_Type)), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 229, __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;

  /* "amplpy/dataframe.pxi":220
 *         return int(num)
 * 
 *     def _get_num_indices(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the number of indices (the indexarity) of this dataframe.
 */

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

/* "amplpy/dataframe.pxi":231
 *         return int(num)
 * 
 *     def _add_row(self, *value):             # <<<<<<<<<<<<<<
 *         """
 *         Add a row to the DataFrame. The size of the tuple must be equal to the
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_9DataFrame_17_add_row(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_9DataFrame_16_add_row, "DataFrame._add_row(self, *value)\n\n        Add a row to the DataFrame. The size of the tuple must be equal to the\n        total number of columns in the dataframe.\n\n        Args:\n           value: A single argument with a tuple containing all the values\n           for the row to be added, or multiple arguments with the values for\n           each column.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_9DataFrame_17_add_row = {"_add_row", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7_amplpy_9DataFrame_17_add_row, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7_amplpy_9DataFrame_16_add_row};
static PyObject *__pyx_pw_7_amplpy_9DataFrame_17_add_row(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_value = 0;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_add_row (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "_add_row", 0))) return NULL;
  __Pyx_INCREF(__pyx_args);
  __pyx_v_value = __pyx_args;
  __pyx_r = __pyx_pf_7_amplpy_9DataFrame_16_add_row(((struct __pyx_obj_7_amplpy_DataFrame *)__pyx_v_self), __pyx_v_value);

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

static PyObject *__pyx_pf_7_amplpy_9DataFrame_16_add_row(struct __pyx_obj_7_amplpy_DataFrame *__pyx_v_self, PyObject *__pyx_v_value) {
  AMPL_TUPLE *__pyx_v_tuple_c;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  unsigned int __pyx_t_9;
  AMPL_TUPLE *__pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_add_row", 0);
  __Pyx_INCREF(__pyx_v_value);

  /* "amplpy/dataframe.pxi":241
 *            each column.
 *         """
 *         if len(value) == 1 and isinstance(value[0], (tuple, list)):             # <<<<<<<<<<<<<<
 *             value = value[0]
 *         assert len(value) == self._get_num_cols()
 */
  __pyx_t_2 = PyObject_Length(__pyx_v_value); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 241, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_2 == 1);
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_value, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 241, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyTuple_Check(__pyx_t_4); 
  if (!__pyx_t_5) {
  } else {
    __pyx_t_3 = __pyx_t_5;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_5 = PyList_Check(__pyx_t_4); 
  __pyx_t_3 = __pyx_t_5;
  __pyx_L6_bool_binop_done:;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "amplpy/dataframe.pxi":242
 *         """
 *         if len(value) == 1 and isinstance(value[0], (tuple, list)):
 *             value = value[0]             # <<<<<<<<<<<<<<
 *         assert len(value) == self._get_num_cols()
 *         cdef campl.AMPL_TUPLE* tuple_c = to_c_tuple(tuple(value))
 */
    __pyx_t_4 = PyTuple_GET_ITEM(__pyx_v_value, 0);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "amplpy/dataframe.pxi":241
 *            each column.
 *         """
 *         if len(value) == 1 and isinstance(value[0], (tuple, list)):             # <<<<<<<<<<<<<<
 *             value = value[0]
 *         assert len(value) == self._get_num_cols()
 */
  }

  /* "amplpy/dataframe.pxi":243
 *         if len(value) == 1 and isinstance(value[0], (tuple, list)):
 *             value = value[0]
 *         assert len(value) == self._get_num_cols()             # <<<<<<<<<<<<<<
 *         cdef campl.AMPL_TUPLE* tuple_c = to_c_tuple(tuple(value))
 *         campl.AMPL_DataFrameAddRow(self._c_df, tuple_c)
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_2 = PyObject_Length(__pyx_v_value); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 243, __pyx_L1_error)
    __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 243, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_num_cols); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 243, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = NULL;
    __pyx_t_9 = 0;
    #if CYTHON_UNPACK_METHODS
    if (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_9 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_8, NULL};
      __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_9, 0+__pyx_t_9);
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 243, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __pyx_t_7 = PyObject_RichCompare(__pyx_t_4, __pyx_t_6, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 243, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 243, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 243, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 243, __pyx_L1_error)
  #endif

  /* "amplpy/dataframe.pxi":244
 *             value = value[0]
 *         assert len(value) == self._get_num_cols()
 *         cdef campl.AMPL_TUPLE* tuple_c = to_c_tuple(tuple(value))             # <<<<<<<<<<<<<<
 *         campl.AMPL_DataFrameAddRow(self._c_df, tuple_c)
 *         campl.AMPL_TupleFree(&tuple_c)
 */
  __pyx_t_7 = __Pyx_PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 244, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_10 = __pyx_f_7_amplpy_to_c_tuple(__pyx_t_7); if (unlikely(__pyx_t_10 == ((AMPL_TUPLE *)NULL) && PyErr_Occurred())) __PYX_ERR(0, 244, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_v_tuple_c = __pyx_t_10;

  /* "amplpy/dataframe.pxi":245
 *         assert len(value) == self._get_num_cols()
 *         cdef campl.AMPL_TUPLE* tuple_c = to_c_tuple(tuple(value))
 *         campl.AMPL_DataFrameAddRow(self._c_df, tuple_c)             # <<<<<<<<<<<<<<
 *         campl.AMPL_TupleFree(&tuple_c)
 * 
 */
  (void)(AMPL_DataFrameAddRow(__pyx_v_self->_c_df, __pyx_v_tuple_c));

  /* "amplpy/dataframe.pxi":246
 *         cdef campl.AMPL_TUPLE* tuple_c = to_c_tuple(tuple(value))
 *         campl.AMPL_DataFrameAddRow(self._c_df, tuple_c)
 *         campl.AMPL_TupleFree(&tuple_c)             # <<<<<<<<<<<<<<
 * 
 *     def _add_column(self, header, values=None):
 */
  (void)(AMPL_TupleFree((&__pyx_v_tuple_c)));

  /* "amplpy/dataframe.pxi":231
 *         return int(num)
 * 
 *     def _add_row(self, *value):             # <<<<<<<<<<<<<<
 *         """
 *         Add a row to the DataFrame. The size of the tuple must be equal to the
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("_amplpy.DataFrame._add_row", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/dataframe.pxi":248
 *         campl.AMPL_TupleFree(&tuple_c)
 * 
 *     def _add_column(self, header, values=None):             # <<<<<<<<<<<<<<
 *         """
 *         Add a new column with the corresponding header and values to the
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_9DataFrame_19_add_column(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_9DataFrame_18_add_column, "DataFrame._add_column(self, header, values=None)\n\n        Add a new column with the corresponding header and values to the\n        dataframe.\n\n        Args:\n            header: The name of the new column.\n\n            values: A list of size :func:`~amplpy.DataFrame.getNumRows` with\n            all the values of the new column.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_9DataFrame_19_add_column = {"_add_column", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_9DataFrame_19_add_column, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_9DataFrame_18_add_column};
static PyObject *__pyx_pw_7_amplpy_9DataFrame_19_add_column(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_header = 0;
  PyObject *__pyx_v_values = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_add_column (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_header,&__pyx_n_s_values,0};
    values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_header)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 248, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_values);
          if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 248, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_add_column") < 0)) __PYX_ERR(0, 248, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_header = values[0];
    __pyx_v_values = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_add_column", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 248, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.DataFrame._add_column", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_9DataFrame_18_add_column(((struct __pyx_obj_7_amplpy_DataFrame *)__pyx_v_self), __pyx_v_header, __pyx_v_values);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7_amplpy_9DataFrame_11_add_column_2generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "amplpy/dataframe.pxi":268
 *         else:
 *             assert len(values) == self._get_num_rows()
 *             if any(isinstance(value, str) for value in values):             # <<<<<<<<<<<<<<
 *                 c_string_array = <const char**> malloc(size * sizeof(const char*))
 *                 if not isinstance(values, (list, tuple)):
 */

static PyObject *__pyx_pf_7_amplpy_9DataFrame_11_add_column_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) {
  struct __pyx_obj_7_amplpy___pyx_scope_struct_2_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_7_amplpy___pyx_scope_struct_2_genexpr *)__pyx_tp_new_7_amplpy___pyx_scope_struct_2_genexpr(__pyx_ptype_7_amplpy___pyx_scope_struct_2_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7_amplpy___pyx_scope_struct_2_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 268, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7_amplpy_9DataFrame_11_add_column_2generator1, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_add_column_locals_genexpr, __pyx_n_s_amplpy); if (unlikely(!gen)) __PYX_ERR(0, 268, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("_amplpy.DataFrame._add_column.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_7_amplpy_9DataFrame_11_add_column_2generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7_amplpy___pyx_scope_struct_2_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7_amplpy___pyx_scope_struct_2_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_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __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, 268, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 268, __pyx_L1_error) }
  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) {
    __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __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_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 268, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 268, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 268, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) 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, 268, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 268, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 268, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) 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, 268, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 268, __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, 268, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_value);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_value, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_5 = PyUnicode_Check(__pyx_cur_scope->__pyx_v_value); 
    if (__pyx_t_5) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_True);
      __pyx_r = Py_True;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    goto __pyx_L0;
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_Generator_Replace_StopIteration(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);
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7_amplpy_9DataFrame_11_add_column_5generator2(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "amplpy/dataframe.pxi":279
 *                         free(c_string_array[i])
 *                 free(c_string_array)
 *             elif all(isinstance(value, Real) for value in values):             # <<<<<<<<<<<<<<
 *                 values = list(map(float, values))
 *                 c_double_array = <double*> malloc(size * sizeof(double))
 */

static PyObject *__pyx_pf_7_amplpy_9DataFrame_11_add_column_3genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) {
  struct __pyx_obj_7_amplpy___pyx_scope_struct_3_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_7_amplpy___pyx_scope_struct_3_genexpr *)__pyx_tp_new_7_amplpy___pyx_scope_struct_3_genexpr(__pyx_ptype_7_amplpy___pyx_scope_struct_3_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7_amplpy___pyx_scope_struct_3_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 279, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7_amplpy_9DataFrame_11_add_column_5generator2, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_add_column_locals_genexpr, __pyx_n_s_amplpy); if (unlikely(!gen)) __PYX_ERR(0, 279, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("_amplpy.DataFrame._add_column.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_7_amplpy_9DataFrame_11_add_column_5generator2(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7_amplpy___pyx_scope_struct_3_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7_amplpy___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;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __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, 279, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 279, __pyx_L1_error) }
  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) {
    __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __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_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 279, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 279, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 279, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) 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, 279, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 279, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 279, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) 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, 279, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 279, __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, 279, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_value);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_value, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Real); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 279, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyObject_IsInstance(__pyx_cur_scope->__pyx_v_value, __pyx_t_4); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 279, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_6 = (!__pyx_t_5);
    if (__pyx_t_6) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_False);
      __pyx_r = Py_False;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_True);
    __pyx_r = Py_True;
    goto __pyx_L0;
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_Generator_Replace_StopIteration(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);
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/dataframe.pxi":248
 *         campl.AMPL_TupleFree(&tuple_c)
 * 
 *     def _add_column(self, header, values=None):             # <<<<<<<<<<<<<<
 *         """
 *         Add a new column with the corresponding header and values to the
 */

static PyObject *__pyx_pf_7_amplpy_9DataFrame_18_add_column(struct __pyx_obj_7_amplpy_DataFrame *__pyx_v_self, PyObject *__pyx_v_header, PyObject *__pyx_v_values) {
  size_t __pyx_v_size;
  char const **__pyx_v_c_string_array;
  double *__pyx_v_c_double_array;
  size_t __pyx_v_i;
  PyObject *__pyx_gb_7_amplpy_9DataFrame_11_add_column_2generator1 = 0;
  PyObject *__pyx_gb_7_amplpy_9DataFrame_11_add_column_5generator2 = 0;
  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;
  unsigned int __pyx_t_6;
  char const *__pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  size_t __pyx_t_10;
  size_t __pyx_t_11;
  size_t __pyx_t_12;
  char const *__pyx_t_13;
  char const *__pyx_t_14;
  double __pyx_t_15;
  char const *__pyx_t_16;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_add_column", 0);
  __Pyx_INCREF(__pyx_v_values);

  /* "amplpy/dataframe.pxi":259
 *             all the values of the new column.
 *         """
 *         cdef size_t size = len(values)             # <<<<<<<<<<<<<<
 *         cdef const char** c_string_array = NULL
 *         cdef double* c_double_array = NULL
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 259, __pyx_L1_error)
  __pyx_v_size = __pyx_t_1;

  /* "amplpy/dataframe.pxi":260
 *         """
 *         cdef size_t size = len(values)
 *         cdef const char** c_string_array = NULL             # <<<<<<<<<<<<<<
 *         cdef double* c_double_array = NULL
 *         if values is None:
 */
  __pyx_v_c_string_array = NULL;

  /* "amplpy/dataframe.pxi":261
 *         cdef size_t size = len(values)
 *         cdef const char** c_string_array = NULL
 *         cdef double* c_double_array = NULL             # <<<<<<<<<<<<<<
 *         if values is None:
 *             values = []
 */
  __pyx_v_c_double_array = NULL;

  /* "amplpy/dataframe.pxi":262
 *         cdef const char** c_string_array = NULL
 *         cdef double* c_double_array = NULL
 *         if values is None:             # <<<<<<<<<<<<<<
 *             values = []
 *         if size == 0:
 */
  __pyx_t_2 = (__pyx_v_values == Py_None);
  if (__pyx_t_2) {

    /* "amplpy/dataframe.pxi":263
 *         cdef double* c_double_array = NULL
 *         if values is None:
 *             values = []             # <<<<<<<<<<<<<<
 *         if size == 0:
 *             PY_AMPL_CALL(campl.AMPL_DataFrameAddEmptyColumn(self._c_df, header.encode('utf-8')))
 */
    __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 263, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_values, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "amplpy/dataframe.pxi":262
 *         cdef const char** c_string_array = NULL
 *         cdef double* c_double_array = NULL
 *         if values is None:             # <<<<<<<<<<<<<<
 *             values = []
 *         if size == 0:
 */
  }

  /* "amplpy/dataframe.pxi":264
 *         if values is None:
 *             values = []
 *         if size == 0:             # <<<<<<<<<<<<<<
 *             PY_AMPL_CALL(campl.AMPL_DataFrameAddEmptyColumn(self._c_df, header.encode('utf-8')))
 *         else:
 */
  __pyx_t_2 = (__pyx_v_size == 0);
  if (__pyx_t_2) {

    /* "amplpy/dataframe.pxi":265
 *             values = []
 *         if size == 0:
 *             PY_AMPL_CALL(campl.AMPL_DataFrameAddEmptyColumn(self._c_df, header.encode('utf-8')))             # <<<<<<<<<<<<<<
 *         else:
 *             assert len(values) == self._get_num_rows()
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_header, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 265, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_6 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_kp_u_utf_8};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 265, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __pyx_t_7 = __Pyx_PyObject_AsString(__pyx_t_3); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(0, 265, __pyx_L1_error)
    __pyx_t_4 = __pyx_f_7_amplpy_PY_AMPL_CALL(AMPL_DataFrameAddEmptyColumn(__pyx_v_self->_c_df, __pyx_t_7)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 265, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "amplpy/dataframe.pxi":264
 *         if values is None:
 *             values = []
 *         if size == 0:             # <<<<<<<<<<<<<<
 *             PY_AMPL_CALL(campl.AMPL_DataFrameAddEmptyColumn(self._c_df, header.encode('utf-8')))
 *         else:
 */
    goto __pyx_L4;
  }

  /* "amplpy/dataframe.pxi":267
 *             PY_AMPL_CALL(campl.AMPL_DataFrameAddEmptyColumn(self._c_df, header.encode('utf-8')))
 *         else:
 *             assert len(values) == self._get_num_rows()             # <<<<<<<<<<<<<<
 *             if any(isinstance(value, str) for value in values):
 *                 c_string_array = <const char**> malloc(size * sizeof(const char*))
 */
  /*else*/ {
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(__pyx_assertions_enabled())) {
      __pyx_t_1 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 267, __pyx_L1_error)
      __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 267, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_num_rows); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 267, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_8 = NULL;
      __pyx_t_6 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_8)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
          __pyx_t_6 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_8, NULL};
        __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6);
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 267, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      }
      __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 267, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 267, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) {
        __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
        __PYX_ERR(0, 267, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(0, 267, __pyx_L1_error)
    #endif

    /* "amplpy/dataframe.pxi":268
 *         else:
 *             assert len(values) == self._get_num_rows()
 *             if any(isinstance(value, str) for value in values):             # <<<<<<<<<<<<<<
 *                 c_string_array = <const char**> malloc(size * sizeof(const char*))
 *                 if not isinstance(values, (list, tuple)):
 */
    __pyx_t_5 = __pyx_pf_7_amplpy_9DataFrame_11_add_column_genexpr(NULL, __pyx_v_values); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 268, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = __Pyx_Generator_Next(__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 268, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __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, 268, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_2) {

      /* "amplpy/dataframe.pxi":269
 *             assert len(values) == self._get_num_rows()
 *             if any(isinstance(value, str) for value in values):
 *                 c_string_array = <const char**> malloc(size * sizeof(const char*))             # <<<<<<<<<<<<<<
 *                 if not isinstance(values, (list, tuple)):
 *                     values = list(values)
 */
      __pyx_v_c_string_array = ((char const **)malloc((__pyx_v_size * (sizeof(char const *)))));

      /* "amplpy/dataframe.pxi":270
 *             if any(isinstance(value, str) for value in values):
 *                 c_string_array = <const char**> malloc(size * sizeof(const char*))
 *                 if not isinstance(values, (list, tuple)):             # <<<<<<<<<<<<<<
 *                     values = list(values)
 *                 for i in range(size):
 */
      __pyx_t_9 = PyList_Check(__pyx_v_values); 
      if (!__pyx_t_9) {
      } else {
        __pyx_t_2 = __pyx_t_9;
        goto __pyx_L7_bool_binop_done;
      }
      __pyx_t_9 = PyTuple_Check(__pyx_v_values); 
      __pyx_t_2 = __pyx_t_9;
      __pyx_L7_bool_binop_done:;
      __pyx_t_9 = (!__pyx_t_2);
      if (__pyx_t_9) {

        /* "amplpy/dataframe.pxi":271
 *                 c_string_array = <const char**> malloc(size * sizeof(const char*))
 *                 if not isinstance(values, (list, tuple)):
 *                     values = list(values)             # <<<<<<<<<<<<<<
 *                 for i in range(size):
 *                     c_string_array[i] = strdup(values[i].encode('utf-8'))
 */
        __pyx_t_3 = PySequence_List(__pyx_v_values); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 271, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF_SET(__pyx_v_values, __pyx_t_3);
        __pyx_t_3 = 0;

        /* "amplpy/dataframe.pxi":270
 *             if any(isinstance(value, str) for value in values):
 *                 c_string_array = <const char**> malloc(size * sizeof(const char*))
 *                 if not isinstance(values, (list, tuple)):             # <<<<<<<<<<<<<<
 *                     values = list(values)
 *                 for i in range(size):
 */
      }

      /* "amplpy/dataframe.pxi":272
 *                 if not isinstance(values, (list, tuple)):
 *                     values = list(values)
 *                 for i in range(size):             # <<<<<<<<<<<<<<
 *                     c_string_array[i] = strdup(values[i].encode('utf-8'))
 *                 campl.AMPL_DataFrameAddColumnString(self._c_df, header.encode('utf-8'), c_string_array)
 */
      __pyx_t_10 = __pyx_v_size;
      __pyx_t_11 = __pyx_t_10;
      for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {
        __pyx_v_i = __pyx_t_12;

        /* "amplpy/dataframe.pxi":273
 *                     values = list(values)
 *                 for i in range(size):
 *                     c_string_array[i] = strdup(values[i].encode('utf-8'))             # <<<<<<<<<<<<<<
 *                 campl.AMPL_DataFrameAddColumnString(self._c_df, header.encode('utf-8'), c_string_array)
 *                 for i in range(size):
 */
        __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_values, __pyx_v_i, size_t, 0, __Pyx_PyInt_FromSize_t, 0, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 273, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 273, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = NULL;
        __pyx_t_6 = 0;
        #if CYTHON_UNPACK_METHODS
        if (likely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
          if (likely(__pyx_t_5)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
            __Pyx_INCREF(__pyx_t_5);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_4, function);
            __pyx_t_6 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_kp_u_utf_8};
          __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 273, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        }
        __pyx_t_13 = __Pyx_PyObject_AsString(__pyx_t_3); if (unlikely((!__pyx_t_13) && PyErr_Occurred())) __PYX_ERR(0, 273, __pyx_L1_error)
        (__pyx_v_c_string_array[__pyx_v_i]) = strdup(__pyx_t_13);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      }

      /* "amplpy/dataframe.pxi":274
 *                 for i in range(size):
 *                     c_string_array[i] = strdup(values[i].encode('utf-8'))
 *                 campl.AMPL_DataFrameAddColumnString(self._c_df, header.encode('utf-8'), c_string_array)             # <<<<<<<<<<<<<<
 *                 for i in range(size):
 *                     if c_string_array[i] != NULL:
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_header, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 274, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = NULL;
      __pyx_t_6 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
          __pyx_t_6 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_kp_u_utf_8};
        __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 274, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }
      __pyx_t_14 = __Pyx_PyObject_AsString(__pyx_t_3); if (unlikely((!__pyx_t_14) && PyErr_Occurred())) __PYX_ERR(0, 274, __pyx_L1_error)
      (void)(AMPL_DataFrameAddColumnString(__pyx_v_self->_c_df, __pyx_t_14, __pyx_v_c_string_array));
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "amplpy/dataframe.pxi":275
 *                     c_string_array[i] = strdup(values[i].encode('utf-8'))
 *                 campl.AMPL_DataFrameAddColumnString(self._c_df, header.encode('utf-8'), c_string_array)
 *                 for i in range(size):             # <<<<<<<<<<<<<<
 *                     if c_string_array[i] != NULL:
 *                         free(c_string_array[i])
 */
      __pyx_t_10 = __pyx_v_size;
      __pyx_t_11 = __pyx_t_10;
      for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {
        __pyx_v_i = __pyx_t_12;

        /* "amplpy/dataframe.pxi":276
 *                 campl.AMPL_DataFrameAddColumnString(self._c_df, header.encode('utf-8'), c_string_array)
 *                 for i in range(size):
 *                     if c_string_array[i] != NULL:             # <<<<<<<<<<<<<<
 *                         free(c_string_array[i])
 *                 free(c_string_array)
 */
        __pyx_t_9 = ((__pyx_v_c_string_array[__pyx_v_i]) != NULL);
        if (__pyx_t_9) {

          /* "amplpy/dataframe.pxi":277
 *                 for i in range(size):
 *                     if c_string_array[i] != NULL:
 *                         free(c_string_array[i])             # <<<<<<<<<<<<<<
 *                 free(c_string_array)
 *             elif all(isinstance(value, Real) for value in values):
 */
          free((__pyx_v_c_string_array[__pyx_v_i]));

          /* "amplpy/dataframe.pxi":276
 *                 campl.AMPL_DataFrameAddColumnString(self._c_df, header.encode('utf-8'), c_string_array)
 *                 for i in range(size):
 *                     if c_string_array[i] != NULL:             # <<<<<<<<<<<<<<
 *                         free(c_string_array[i])
 *                 free(c_string_array)
 */
        }
      }

      /* "amplpy/dataframe.pxi":278
 *                     if c_string_array[i] != NULL:
 *                         free(c_string_array[i])
 *                 free(c_string_array)             # <<<<<<<<<<<<<<
 *             elif all(isinstance(value, Real) for value in values):
 *                 values = list(map(float, values))
 */
      free(__pyx_v_c_string_array);

      /* "amplpy/dataframe.pxi":268
 *         else:
 *             assert len(values) == self._get_num_rows()
 *             if any(isinstance(value, str) for value in values):             # <<<<<<<<<<<<<<
 *                 c_string_array = <const char**> malloc(size * sizeof(const char*))
 *                 if not isinstance(values, (list, tuple)):
 */
      goto __pyx_L5;
    }

    /* "amplpy/dataframe.pxi":279
 *                         free(c_string_array[i])
 *                 free(c_string_array)
 *             elif all(isinstance(value, Real) for value in values):             # <<<<<<<<<<<<<<
 *                 values = list(map(float, values))
 *                 c_double_array = <double*> malloc(size * sizeof(double))
 */
    __pyx_t_3 = __pyx_pf_7_amplpy_9DataFrame_11_add_column_3genexpr(NULL, __pyx_v_values); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 279, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_Generator_Next(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 279, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 279, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (likely(__pyx_t_9)) {

      /* "amplpy/dataframe.pxi":280
 *                 free(c_string_array)
 *             elif all(isinstance(value, Real) for value in values):
 *                 values = list(map(float, values))             # <<<<<<<<<<<<<<
 *                 c_double_array = <double*> malloc(size * sizeof(double))
 *                 for i in range(size):
 */
      __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 280, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_INCREF((PyObject *)(&PyFloat_Type));
      __Pyx_GIVEREF((PyObject *)(&PyFloat_Type));
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)(&PyFloat_Type)))) __PYX_ERR(0, 280, __pyx_L1_error);
      __Pyx_INCREF(__pyx_v_values);
      __Pyx_GIVEREF(__pyx_v_values);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_values)) __PYX_ERR(0, 280, __pyx_L1_error);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 280, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PySequence_ListKeepNew(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 280, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF_SET(__pyx_v_values, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "amplpy/dataframe.pxi":281
 *             elif all(isinstance(value, Real) for value in values):
 *                 values = list(map(float, values))
 *                 c_double_array = <double*> malloc(size * sizeof(double))             # <<<<<<<<<<<<<<
 *                 for i in range(size):
 *                     c_double_array[i] = values[i]
 */
      __pyx_v_c_double_array = ((double *)malloc((__pyx_v_size * (sizeof(double)))));

      /* "amplpy/dataframe.pxi":282
 *                 values = list(map(float, values))
 *                 c_double_array = <double*> malloc(size * sizeof(double))
 *                 for i in range(size):             # <<<<<<<<<<<<<<
 *                     c_double_array[i] = values[i]
 *                 campl.AMPL_DataFrameAddColumnDouble(self._c_df, header.encode('utf-8'), c_double_array)
 */
      __pyx_t_10 = __pyx_v_size;
      __pyx_t_11 = __pyx_t_10;
      for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {
        __pyx_v_i = __pyx_t_12;

        /* "amplpy/dataframe.pxi":283
 *                 c_double_array = <double*> malloc(size * sizeof(double))
 *                 for i in range(size):
 *                     c_double_array[i] = values[i]             # <<<<<<<<<<<<<<
 *                 campl.AMPL_DataFrameAddColumnDouble(self._c_df, header.encode('utf-8'), c_double_array)
 *                 free(c_double_array)
 */
        __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_values, __pyx_v_i, size_t, 0, __Pyx_PyInt_FromSize_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 283, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_15 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_15 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 283, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        (__pyx_v_c_double_array[__pyx_v_i]) = __pyx_t_15;
      }

      /* "amplpy/dataframe.pxi":284
 *                 for i in range(size):
 *                     c_double_array[i] = values[i]
 *                 campl.AMPL_DataFrameAddColumnDouble(self._c_df, header.encode('utf-8'), c_double_array)             # <<<<<<<<<<<<<<
 *                 free(c_double_array)
 *             else:
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_header, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 284, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = NULL;
      __pyx_t_6 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_6 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_kp_u_utf_8};
        __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 284, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      }
      __pyx_t_16 = __Pyx_PyObject_AsString(__pyx_t_4); if (unlikely((!__pyx_t_16) && PyErr_Occurred())) __PYX_ERR(0, 284, __pyx_L1_error)
      (void)(AMPL_DataFrameAddColumnDouble(__pyx_v_self->_c_df, __pyx_t_16, __pyx_v_c_double_array));
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "amplpy/dataframe.pxi":285
 *                     c_double_array[i] = values[i]
 *                 campl.AMPL_DataFrameAddColumnDouble(self._c_df, header.encode('utf-8'), c_double_array)
 *                 free(c_double_array)             # <<<<<<<<<<<<<<
 *             else:
 *                 raise NotImplementedError
 */
      free(__pyx_v_c_double_array);

      /* "amplpy/dataframe.pxi":279
 *                         free(c_string_array[i])
 *                 free(c_string_array)
 *             elif all(isinstance(value, Real) for value in values):             # <<<<<<<<<<<<<<
 *                 values = list(map(float, values))
 *                 c_double_array = <double*> malloc(size * sizeof(double))
 */
      goto __pyx_L5;
    }

    /* "amplpy/dataframe.pxi":287
 *                 free(c_double_array)
 *             else:
 *                 raise NotImplementedError             # <<<<<<<<<<<<<<
 * 
 *     def _get_column(self, header):
 */
    /*else*/ {
      __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0);
      __PYX_ERR(0, 287, __pyx_L1_error)
    }
    __pyx_L5:;
  }
  __pyx_L4:;

  /* "amplpy/dataframe.pxi":248
 *         campl.AMPL_TupleFree(&tuple_c)
 * 
 *     def _add_column(self, header, values=None):             # <<<<<<<<<<<<<<
 *         """
 *         Add a new column with the corresponding header and values to the
 */

  /* 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_8);
  __Pyx_AddTraceback("_amplpy.DataFrame._add_column", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_gb_7_amplpy_9DataFrame_11_add_column_2generator1);
  __Pyx_XDECREF(__pyx_gb_7_amplpy_9DataFrame_11_add_column_5generator2);
  __Pyx_XDECREF(__pyx_v_values);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/dataframe.pxi":289
 *                 raise NotImplementedError
 * 
 *     def _get_column(self, header):             # <<<<<<<<<<<<<<
 *         """
 *         Get the specified column as a view object.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_9DataFrame_21_get_column(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_9DataFrame_20_get_column, "DataFrame._get_column(self, header)\n\n        Get the specified column as a view object.\n\n        Args:\n            header: The header of the column.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_9DataFrame_21_get_column = {"_get_column", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_9DataFrame_21_get_column, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_9DataFrame_20_get_column};
static PyObject *__pyx_pw_7_amplpy_9DataFrame_21_get_column(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_header = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get_column (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_header,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_header)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 289, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_get_column") < 0)) __PYX_ERR(0, 289, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_header = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_get_column", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 289, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.DataFrame._get_column", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_9DataFrame_20_get_column(((struct __pyx_obj_7_amplpy_DataFrame *)__pyx_v_self), __pyx_v_header);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_9DataFrame_20_get_column(struct __pyx_obj_7_amplpy_DataFrame *__pyx_v_self, PyObject *__pyx_v_header) {
  size_t __pyx_v_index;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  char const *__pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_column", 1);

  /* "amplpy/dataframe.pxi":297
 *         """
 *         cdef size_t index
 *         PY_AMPL_CALL(campl.AMPL_DataFrameGetColumnIndex(self._c_df, header.encode('utf-8'), &index))             # <<<<<<<<<<<<<<
 *         return Column.create(self._c_df, index)
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_header, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 297, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_u_utf_8};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 297, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_t_5 = __Pyx_PyObject_AsString(__pyx_t_1); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) __PYX_ERR(0, 297, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_7_amplpy_PY_AMPL_CALL(AMPL_DataFrameGetColumnIndex(__pyx_v_self->_c_df, __pyx_t_5, (&__pyx_v_index))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 297, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "amplpy/dataframe.pxi":298
 *         cdef size_t index
 *         PY_AMPL_CALL(campl.AMPL_DataFrameGetColumnIndex(self._c_df, header.encode('utf-8'), &index))
 *         return Column.create(self._c_df, index)             # <<<<<<<<<<<<<<
 * 
 *     def _set_column(self, header, values):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_7_amplpy_6Column_create(__pyx_v_self->_c_df, __pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 298, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "amplpy/dataframe.pxi":289
 *                 raise NotImplementedError
 * 
 *     def _get_column(self, header):             # <<<<<<<<<<<<<<
 *         """
 *         Get the specified column as a view object.
 */

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

/* "amplpy/dataframe.pxi":300
 *         return Column.create(self._c_df, index)
 * 
 *     def _set_column(self, header, values):             # <<<<<<<<<<<<<<
 *         """
 *         Set the values of a column.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_9DataFrame_23_set_column(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_9DataFrame_22_set_column, "DataFrame._set_column(self, header, values)\n\n        Set the values of a column.\n\n        Args:\n            header: The header of the column to be set.\n\n            values: The values to set.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_9DataFrame_23_set_column = {"_set_column", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_9DataFrame_23_set_column, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_9DataFrame_22_set_column};
static PyObject *__pyx_pw_7_amplpy_9DataFrame_23_set_column(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_header = 0;
  PyObject *__pyx_v_values = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_set_column (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_header,&__pyx_n_s_values,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_header)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 300, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_values)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 300, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("_set_column", 1, 2, 2, 1); __PYX_ERR(0, 300, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_set_column") < 0)) __PYX_ERR(0, 300, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_header = values[0];
    __pyx_v_values = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_set_column", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 300, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.DataFrame._set_column", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_9DataFrame_22_set_column(((struct __pyx_obj_7_amplpy_DataFrame *)__pyx_v_self), __pyx_v_header, __pyx_v_values);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_9DataFrame_22_set_column(struct __pyx_obj_7_amplpy_DataFrame *__pyx_v_self, PyObject *__pyx_v_header, PyObject *__pyx_v_values) {
  AMPL_ERRORINFO *__pyx_v_errorinfo;
  AMPL_RETCODE __pyx_v_rc;
  double *__pyx_v_c_double_array;
  char **__pyx_v_c_string_array;
  size_t __pyx_v_size;
  size_t __pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  size_t __pyx_t_5;
  size_t __pyx_t_6;
  size_t __pyx_t_7;
  double __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  unsigned int __pyx_t_10;
  char const *__pyx_t_11;
  char const *__pyx_t_12;
  char const *__pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_set_column", 1);

  /* "amplpy/dataframe.pxi":311
 *         cdef campl.AMPL_ERRORINFO* errorinfo
 *         cdef campl.AMPL_RETCODE rc
 *         cdef double* c_double_array = NULL             # <<<<<<<<<<<<<<
 *         cdef char** c_string_array = NULL
 *         cdef size_t size = len(values)
 */
  __pyx_v_c_double_array = NULL;

  /* "amplpy/dataframe.pxi":312
 *         cdef campl.AMPL_RETCODE rc
 *         cdef double* c_double_array = NULL
 *         cdef char** c_string_array = NULL             # <<<<<<<<<<<<<<
 *         cdef size_t size = len(values)
 *         if isinstance(values[0], Real):
 */
  __pyx_v_c_string_array = NULL;

  /* "amplpy/dataframe.pxi":313
 *         cdef double* c_double_array = NULL
 *         cdef char** c_string_array = NULL
 *         cdef size_t size = len(values)             # <<<<<<<<<<<<<<
 *         if isinstance(values[0], Real):
 *             c_double_array = <double*> malloc(size * sizeof(double))
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 313, __pyx_L1_error)
  __pyx_v_size = __pyx_t_1;

  /* "amplpy/dataframe.pxi":314
 *         cdef char** c_string_array = NULL
 *         cdef size_t size = len(values)
 *         if isinstance(values[0], Real):             # <<<<<<<<<<<<<<
 *             c_double_array = <double*> malloc(size * sizeof(double))
 *             for i in range(size):
 */
  __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_values, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 314, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Real); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 314, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyObject_IsInstance(__pyx_t_2, __pyx_t_3); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 314, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_4) {

    /* "amplpy/dataframe.pxi":315
 *         cdef size_t size = len(values)
 *         if isinstance(values[0], Real):
 *             c_double_array = <double*> malloc(size * sizeof(double))             # <<<<<<<<<<<<<<
 *             for i in range(size):
 *                 c_double_array[i] = values[i]
 */
    __pyx_v_c_double_array = ((double *)malloc((__pyx_v_size * (sizeof(double)))));

    /* "amplpy/dataframe.pxi":316
 *         if isinstance(values[0], Real):
 *             c_double_array = <double*> malloc(size * sizeof(double))
 *             for i in range(size):             # <<<<<<<<<<<<<<
 *                 c_double_array[i] = values[i]
 *             errorinfo = campl.AMPL_DataFrameSetColumnArgDouble(self._c_df, header.encode('utf-8'), c_double_array, size)
 */
    __pyx_t_5 = __pyx_v_size;
    __pyx_t_6 = __pyx_t_5;
    for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
      __pyx_v_i = __pyx_t_7;

      /* "amplpy/dataframe.pxi":317
 *             c_double_array = <double*> malloc(size * sizeof(double))
 *             for i in range(size):
 *                 c_double_array[i] = values[i]             # <<<<<<<<<<<<<<
 *             errorinfo = campl.AMPL_DataFrameSetColumnArgDouble(self._c_df, header.encode('utf-8'), c_double_array, size)
 *             rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 */
      __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_values, __pyx_v_i, size_t, 0, __Pyx_PyInt_FromSize_t, 0, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 317, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 317, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      (__pyx_v_c_double_array[__pyx_v_i]) = __pyx_t_8;
    }

    /* "amplpy/dataframe.pxi":318
 *             for i in range(size):
 *                 c_double_array[i] = values[i]
 *             errorinfo = campl.AMPL_DataFrameSetColumnArgDouble(self._c_df, header.encode('utf-8'), c_double_array, size)             # <<<<<<<<<<<<<<
 *             rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *             free(c_double_array)
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_header, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 318, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_9 = NULL;
    __pyx_t_10 = 0;
    #if CYTHON_UNPACK_METHODS
    if (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);
        __pyx_t_10 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_kp_u_utf_8};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10);
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 318, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __pyx_t_11 = __Pyx_PyObject_AsString(__pyx_t_3); if (unlikely((!__pyx_t_11) && PyErr_Occurred())) __PYX_ERR(0, 318, __pyx_L1_error)
    __pyx_v_errorinfo = AMPL_DataFrameSetColumnArgDouble(__pyx_v_self->_c_df, __pyx_t_11, __pyx_v_c_double_array, __pyx_v_size);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "amplpy/dataframe.pxi":319
 *                 c_double_array[i] = values[i]
 *             errorinfo = campl.AMPL_DataFrameSetColumnArgDouble(self._c_df, header.encode('utf-8'), c_double_array, size)
 *             rc = campl.AMPL_ErrorInfoGetError(errorinfo)             # <<<<<<<<<<<<<<
 *             free(c_double_array)
 *             if rc != campl.AMPL_OK:
 */
    __pyx_v_rc = AMPL_ErrorInfoGetError(__pyx_v_errorinfo);

    /* "amplpy/dataframe.pxi":320
 *             errorinfo = campl.AMPL_DataFrameSetColumnArgDouble(self._c_df, header.encode('utf-8'), c_double_array, size)
 *             rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *             free(c_double_array)             # <<<<<<<<<<<<<<
 *             if rc != campl.AMPL_OK:
 *                 PY_AMPL_CALL(errorinfo)
 */
    free(__pyx_v_c_double_array);

    /* "amplpy/dataframe.pxi":321
 *             rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *             free(c_double_array)
 *             if rc != campl.AMPL_OK:             # <<<<<<<<<<<<<<
 *                 PY_AMPL_CALL(errorinfo)
 *         elif isinstance(values[0], str):
 */
    __pyx_t_4 = (__pyx_v_rc != AMPL_OK);
    if (__pyx_t_4) {

      /* "amplpy/dataframe.pxi":322
 *             free(c_double_array)
 *             if rc != campl.AMPL_OK:
 *                 PY_AMPL_CALL(errorinfo)             # <<<<<<<<<<<<<<
 *         elif isinstance(values[0], str):
 *             c_string_array = <char**> malloc(size * sizeof(char*))
 */
      __pyx_t_3 = __pyx_f_7_amplpy_PY_AMPL_CALL(__pyx_v_errorinfo); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 322, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "amplpy/dataframe.pxi":321
 *             rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *             free(c_double_array)
 *             if rc != campl.AMPL_OK:             # <<<<<<<<<<<<<<
 *                 PY_AMPL_CALL(errorinfo)
 *         elif isinstance(values[0], str):
 */
    }

    /* "amplpy/dataframe.pxi":314
 *         cdef char** c_string_array = NULL
 *         cdef size_t size = len(values)
 *         if isinstance(values[0], Real):             # <<<<<<<<<<<<<<
 *             c_double_array = <double*> malloc(size * sizeof(double))
 *             for i in range(size):
 */
    goto __pyx_L3;
  }

  /* "amplpy/dataframe.pxi":323
 *             if rc != campl.AMPL_OK:
 *                 PY_AMPL_CALL(errorinfo)
 *         elif isinstance(values[0], str):             # <<<<<<<<<<<<<<
 *             c_string_array = <char**> malloc(size * sizeof(char*))
 *             for i in range(size):
 */
  __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_values, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 323, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyUnicode_Check(__pyx_t_3); 
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_4) {

    /* "amplpy/dataframe.pxi":324
 *                 PY_AMPL_CALL(errorinfo)
 *         elif isinstance(values[0], str):
 *             c_string_array = <char**> malloc(size * sizeof(char*))             # <<<<<<<<<<<<<<
 *             for i in range(size):
 *                 c_string_array[i] = strdup(values[i].encode('utf-8'))
 */
    __pyx_v_c_string_array = ((char **)malloc((__pyx_v_size * (sizeof(char *)))));

    /* "amplpy/dataframe.pxi":325
 *         elif isinstance(values[0], str):
 *             c_string_array = <char**> malloc(size * sizeof(char*))
 *             for i in range(size):             # <<<<<<<<<<<<<<
 *                 c_string_array[i] = strdup(values[i].encode('utf-8'))
 *             errorinfo = campl.AMPL_DataFrameSetColumnArgString(self._c_df, header.encode('utf-8'), c_string_array, size)
 */
    __pyx_t_5 = __pyx_v_size;
    __pyx_t_6 = __pyx_t_5;
    for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
      __pyx_v_i = __pyx_t_7;

      /* "amplpy/dataframe.pxi":326
 *             c_string_array = <char**> malloc(size * sizeof(char*))
 *             for i in range(size):
 *                 c_string_array[i] = strdup(values[i].encode('utf-8'))             # <<<<<<<<<<<<<<
 *             errorinfo = campl.AMPL_DataFrameSetColumnArgString(self._c_df, header.encode('utf-8'), c_string_array, size)
 *             rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 */
      __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_values, __pyx_v_i, size_t, 0, __Pyx_PyInt_FromSize_t, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 326, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_encode); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 326, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = NULL;
      __pyx_t_10 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_9))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_9);
        if (likely(__pyx_t_2)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_9, function);
          __pyx_t_10 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_kp_u_utf_8};
        __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10);
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 326, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }
      __pyx_t_12 = __Pyx_PyObject_AsString(__pyx_t_3); if (unlikely((!__pyx_t_12) && PyErr_Occurred())) __PYX_ERR(0, 326, __pyx_L1_error)
      (__pyx_v_c_string_array[__pyx_v_i]) = strdup(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }

    /* "amplpy/dataframe.pxi":327
 *             for i in range(size):
 *                 c_string_array[i] = strdup(values[i].encode('utf-8'))
 *             errorinfo = campl.AMPL_DataFrameSetColumnArgString(self._c_df, header.encode('utf-8'), c_string_array, size)             # <<<<<<<<<<<<<<
 *             rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *             for i in range(size):
 */
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_header, __pyx_n_s_encode); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 327, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_2 = NULL;
    __pyx_t_10 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_9))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_9);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_9, function);
        __pyx_t_10 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_kp_u_utf_8};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10);
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 327, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    }
    __pyx_t_13 = __Pyx_PyObject_AsString(__pyx_t_3); if (unlikely((!__pyx_t_13) && PyErr_Occurred())) __PYX_ERR(0, 327, __pyx_L1_error)
    __pyx_v_errorinfo = AMPL_DataFrameSetColumnArgString(__pyx_v_self->_c_df, __pyx_t_13, __pyx_v_c_string_array, __pyx_v_size);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "amplpy/dataframe.pxi":328
 *                 c_string_array[i] = strdup(values[i].encode('utf-8'))
 *             errorinfo = campl.AMPL_DataFrameSetColumnArgString(self._c_df, header.encode('utf-8'), c_string_array, size)
 *             rc = campl.AMPL_ErrorInfoGetError(errorinfo)             # <<<<<<<<<<<<<<
 *             for i in range(size):
 *                 if c_string_array[i] != NULL:
 */
    __pyx_v_rc = AMPL_ErrorInfoGetError(__pyx_v_errorinfo);

    /* "amplpy/dataframe.pxi":329
 *             errorinfo = campl.AMPL_DataFrameSetColumnArgString(self._c_df, header.encode('utf-8'), c_string_array, size)
 *             rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *             for i in range(size):             # <<<<<<<<<<<<<<
 *                 if c_string_array[i] != NULL:
 *                     free(c_string_array[i])
 */
    __pyx_t_5 = __pyx_v_size;
    __pyx_t_6 = __pyx_t_5;
    for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
      __pyx_v_i = __pyx_t_7;

      /* "amplpy/dataframe.pxi":330
 *             rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *             for i in range(size):
 *                 if c_string_array[i] != NULL:             # <<<<<<<<<<<<<<
 *                     free(c_string_array[i])
 *             free(c_string_array)
 */
      __pyx_t_4 = ((__pyx_v_c_string_array[__pyx_v_i]) != NULL);
      if (__pyx_t_4) {

        /* "amplpy/dataframe.pxi":331
 *             for i in range(size):
 *                 if c_string_array[i] != NULL:
 *                     free(c_string_array[i])             # <<<<<<<<<<<<<<
 *             free(c_string_array)
 *             if rc != campl.AMPL_OK:
 */
        free((__pyx_v_c_string_array[__pyx_v_i]));

        /* "amplpy/dataframe.pxi":330
 *             rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *             for i in range(size):
 *                 if c_string_array[i] != NULL:             # <<<<<<<<<<<<<<
 *                     free(c_string_array[i])
 *             free(c_string_array)
 */
      }
    }

    /* "amplpy/dataframe.pxi":332
 *                 if c_string_array[i] != NULL:
 *                     free(c_string_array[i])
 *             free(c_string_array)             # <<<<<<<<<<<<<<
 *             if rc != campl.AMPL_OK:
 *                 PY_AMPL_CALL(errorinfo)
 */
    free(__pyx_v_c_string_array);

    /* "amplpy/dataframe.pxi":333
 *                     free(c_string_array[i])
 *             free(c_string_array)
 *             if rc != campl.AMPL_OK:             # <<<<<<<<<<<<<<
 *                 PY_AMPL_CALL(errorinfo)
 * 
 */
    __pyx_t_4 = (__pyx_v_rc != AMPL_OK);
    if (__pyx_t_4) {

      /* "amplpy/dataframe.pxi":334
 *             free(c_string_array)
 *             if rc != campl.AMPL_OK:
 *                 PY_AMPL_CALL(errorinfo)             # <<<<<<<<<<<<<<
 * 
 *     def _get_row(self, key):
 */
      __pyx_t_3 = __pyx_f_7_amplpy_PY_AMPL_CALL(__pyx_v_errorinfo); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 334, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "amplpy/dataframe.pxi":333
 *                     free(c_string_array[i])
 *             free(c_string_array)
 *             if rc != campl.AMPL_OK:             # <<<<<<<<<<<<<<
 *                 PY_AMPL_CALL(errorinfo)
 * 
 */
    }

    /* "amplpy/dataframe.pxi":323
 *             if rc != campl.AMPL_OK:
 *                 PY_AMPL_CALL(errorinfo)
 *         elif isinstance(values[0], str):             # <<<<<<<<<<<<<<
 *             c_string_array = <char**> malloc(size * sizeof(char*))
 *             for i in range(size):
 */
  }
  __pyx_L3:;

  /* "amplpy/dataframe.pxi":300
 *         return Column.create(self._c_df, index)
 * 
 *     def _set_column(self, header, values):             # <<<<<<<<<<<<<<
 *         """
 *         Set the values of a column.
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("_amplpy.DataFrame._set_column", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/dataframe.pxi":336
 *                 PY_AMPL_CALL(errorinfo)
 * 
 *     def _get_row(self, key):             # <<<<<<<<<<<<<<
 *         """
 *         Get a row by value of the indexing columns. If the index is not
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_9DataFrame_25_get_row(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_9DataFrame_24_get_row, "DataFrame._get_row(self, key)\n\n        Get a row by value of the indexing columns. If the index is not\n        specified, gets the only row of a dataframe with no indexing columns.\n\n        Args:\n            key: Tuple representing the index of the desired row.\n\n        Returns:\n            The row.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_9DataFrame_25_get_row = {"_get_row", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_9DataFrame_25_get_row, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_9DataFrame_24_get_row};
static PyObject *__pyx_pw_7_amplpy_9DataFrame_25_get_row(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_key = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get_row (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_key,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_key)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 336, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_get_row") < 0)) __PYX_ERR(0, 336, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_key = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_get_row", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 336, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.DataFrame._get_row", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_9DataFrame_24_get_row(((struct __pyx_obj_7_amplpy_DataFrame *)__pyx_v_self), __pyx_v_key);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_9DataFrame_24_get_row(struct __pyx_obj_7_amplpy_DataFrame *__pyx_v_self, PyObject *__pyx_v_key) {
  size_t __pyx_v_index;
  AMPL_TUPLE *__pyx_v_tuple;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  AMPL_TUPLE *__pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_row", 1);

  /* "amplpy/dataframe.pxi":348
 *         """
 *         cdef size_t index
 *         cdef campl.AMPL_TUPLE* tuple = to_c_tuple(key)             # <<<<<<<<<<<<<<
 *         campl.AMPL_DataFrameGetRowIndex(self._c_df, tuple, &index)
 *         campl.AMPL_TupleFree(&tuple)
 */
  __pyx_t_1 = __pyx_f_7_amplpy_to_c_tuple(__pyx_v_key); if (unlikely(__pyx_t_1 == ((AMPL_TUPLE *)NULL) && PyErr_Occurred())) __PYX_ERR(0, 348, __pyx_L1_error)
  __pyx_v_tuple = __pyx_t_1;

  /* "amplpy/dataframe.pxi":349
 *         cdef size_t index
 *         cdef campl.AMPL_TUPLE* tuple = to_c_tuple(key)
 *         campl.AMPL_DataFrameGetRowIndex(self._c_df, tuple, &index)             # <<<<<<<<<<<<<<
 *         campl.AMPL_TupleFree(&tuple)
 *         return Row.create(self._c_df, index)
 */
  (void)(AMPL_DataFrameGetRowIndex(__pyx_v_self->_c_df, __pyx_v_tuple, (&__pyx_v_index)));

  /* "amplpy/dataframe.pxi":350
 *         cdef campl.AMPL_TUPLE* tuple = to_c_tuple(key)
 *         campl.AMPL_DataFrameGetRowIndex(self._c_df, tuple, &index)
 *         campl.AMPL_TupleFree(&tuple)             # <<<<<<<<<<<<<<
 *         return Row.create(self._c_df, index)
 * 
 */
  (void)(AMPL_TupleFree((&__pyx_v_tuple)));

  /* "amplpy/dataframe.pxi":351
 *         campl.AMPL_DataFrameGetRowIndex(self._c_df, tuple, &index)
 *         campl.AMPL_TupleFree(&tuple)
 *         return Row.create(self._c_df, index)             # <<<<<<<<<<<<<<
 * 
 *     def _get_row_by_index(self, index):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_7_amplpy_3Row_create(__pyx_v_self->_c_df, __pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 351, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "amplpy/dataframe.pxi":336
 *                 PY_AMPL_CALL(errorinfo)
 * 
 *     def _get_row(self, key):             # <<<<<<<<<<<<<<
 *         """
 *         Get a row by value of the indexing columns. If the index is not
 */

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

/* "amplpy/dataframe.pxi":353
 *         return Row.create(self._c_df, index)
 * 
 *     def _get_row_by_index(self, index):             # <<<<<<<<<<<<<<
 *         """
 *         Get row by numeric index.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_9DataFrame_27_get_row_by_index(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_9DataFrame_26_get_row_by_index, "DataFrame._get_row_by_index(self, index)\n\n        Get row by numeric index.\n\n        Args:\n            index: Zero-based index of the row to get.\n\n        Returns:\n            The corresponding row.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_9DataFrame_27_get_row_by_index = {"_get_row_by_index", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_9DataFrame_27_get_row_by_index, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_9DataFrame_26_get_row_by_index};
static PyObject *__pyx_pw_7_amplpy_9DataFrame_27_get_row_by_index(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_index = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get_row_by_index (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_index)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 353, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_get_row_by_index") < 0)) __PYX_ERR(0, 353, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_index = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_get_row_by_index", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 353, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.DataFrame._get_row_by_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_9DataFrame_26_get_row_by_index(((struct __pyx_obj_7_amplpy_DataFrame *)__pyx_v_self), __pyx_v_index);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_9DataFrame_26_get_row_by_index(struct __pyx_obj_7_amplpy_DataFrame *__pyx_v_self, PyObject *__pyx_v_index) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  size_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_row_by_index", 1);

  /* "amplpy/dataframe.pxi":363
 *             The corresponding row.
 *         """
 *         return Row.create(self._c_df, index)             # <<<<<<<<<<<<<<
 * 
 *     def _get_headers(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_index); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 363, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_7_amplpy_3Row_create(__pyx_v_self->_c_df, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 363, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "amplpy/dataframe.pxi":353
 *         return Row.create(self._c_df, index)
 * 
 *     def _get_row_by_index(self, index):             # <<<<<<<<<<<<<<
 *         """
 *         Get row by numeric index.
 */

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

/* "amplpy/dataframe.pxi":365
 *         return Row.create(self._c_df, index)
 * 
 *     def _get_headers(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the headers of this DataFrame.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_9DataFrame_29_get_headers(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_9DataFrame_28_get_headers, "DataFrame._get_headers(self)\n\n        Get the headers of this DataFrame.\n\n        Returns:\n           The headers of this DataFrame.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_9DataFrame_29_get_headers = {"_get_headers", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_9DataFrame_29_get_headers, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_9DataFrame_28_get_headers};
static PyObject *__pyx_pw_7_amplpy_9DataFrame_29_get_headers(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get_headers (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("_get_headers", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "_get_headers", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_9DataFrame_28_get_headers(((struct __pyx_obj_7_amplpy_DataFrame *)__pyx_v_self));

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

/* "amplpy/dataframe.pxi":375
 *         cdef char** headers
 *         campl.AMPL_DataFrameGetHeaders(self._c_df, &size, &headers)
 *         headers_py = tuple(str(headers[i].decode('utf-8')) for i in range(size))             # <<<<<<<<<<<<<<
 *         for i in range(size):
 *             campl.AMPL_StringFree(&headers[i])
 */

static PyObject *__pyx_pf_7_amplpy_9DataFrame_12_get_headers_genexpr(PyObject *__pyx_self, size_t __pyx_genexpr_arg_0) {
  struct __pyx_obj_7_amplpy___pyx_scope_struct_5_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_7_amplpy___pyx_scope_struct_5_genexpr *)__pyx_tp_new_7_amplpy___pyx_scope_struct_5_genexpr(__pyx_ptype_7_amplpy___pyx_scope_struct_5_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7_amplpy___pyx_scope_struct_5_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 375, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7_amplpy___pyx_scope_struct_4__get_headers *) __pyx_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope);
  __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0;
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7_amplpy_9DataFrame_12_get_headers_2generator3, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_get_headers_locals_genexpr, __pyx_n_s_amplpy); if (unlikely(!gen)) __PYX_ERR(0, 375, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("_amplpy.DataFrame._get_headers.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_7_amplpy_9DataFrame_12_get_headers_2generator3(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7_amplpy___pyx_scope_struct_5_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7_amplpy___pyx_scope_struct_5_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  size_t __pyx_t_1;
  size_t __pyx_t_2;
  size_t __pyx_t_3;
  char *__pyx_t_4;
  Py_ssize_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __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, 375, __pyx_L1_error)
  __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0;
  __pyx_t_2 = __pyx_t_1;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_cur_scope->__pyx_v_i = __pyx_t_3;
    __pyx_t_4 = (__pyx_cur_scope->__pyx_outer_scope->__pyx_v_headers[__pyx_cur_scope->__pyx_v_i]);
    __pyx_t_5 = __Pyx_ssize_strlen(__pyx_t_4); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 375, __pyx_L1_error)
    __pyx_t_6 = __Pyx_decode_c_string(__pyx_t_4, 0, __pyx_t_5, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 375, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_t_6);
    __pyx_r = __pyx_t_6;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __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_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, 375, __pyx_L1_error)
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

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

/* "amplpy/dataframe.pxi":365
 *         return Row.create(self._c_df, index)
 * 
 *     def _get_headers(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the headers of this DataFrame.
 */

static PyObject *__pyx_pf_7_amplpy_9DataFrame_28_get_headers(struct __pyx_obj_7_amplpy_DataFrame *__pyx_v_self) {
  struct __pyx_obj_7_amplpy___pyx_scope_struct_4__get_headers *__pyx_cur_scope;
  size_t __pyx_v_size;
  PyObject *__pyx_v_headers_py = NULL;
  size_t __pyx_v_i;
  PyObject *__pyx_gb_7_amplpy_9DataFrame_12_get_headers_2generator3 = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  size_t __pyx_t_4;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_headers", 0);
  __pyx_cur_scope = (struct __pyx_obj_7_amplpy___pyx_scope_struct_4__get_headers *)__pyx_tp_new_7_amplpy___pyx_scope_struct_4__get_headers(__pyx_ptype_7_amplpy___pyx_scope_struct_4__get_headers, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7_amplpy___pyx_scope_struct_4__get_headers *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 365, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }

  /* "amplpy/dataframe.pxi":374
 *         cdef size_t size
 *         cdef char** headers
 *         campl.AMPL_DataFrameGetHeaders(self._c_df, &size, &headers)             # <<<<<<<<<<<<<<
 *         headers_py = tuple(str(headers[i].decode('utf-8')) for i in range(size))
 *         for i in range(size):
 */
  (void)(AMPL_DataFrameGetHeaders(__pyx_v_self->_c_df, (&__pyx_v_size), (&__pyx_cur_scope->__pyx_v_headers)));

  /* "amplpy/dataframe.pxi":375
 *         cdef char** headers
 *         campl.AMPL_DataFrameGetHeaders(self._c_df, &size, &headers)
 *         headers_py = tuple(str(headers[i].decode('utf-8')) for i in range(size))             # <<<<<<<<<<<<<<
 *         for i in range(size):
 *             campl.AMPL_StringFree(&headers[i])
 */
  __pyx_t_1 = __pyx_pf_7_amplpy_9DataFrame_12_get_headers_genexpr(((PyObject*)__pyx_cur_scope), __pyx_v_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 375, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 375, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_headers_py = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "amplpy/dataframe.pxi":376
 *         campl.AMPL_DataFrameGetHeaders(self._c_df, &size, &headers)
 *         headers_py = tuple(str(headers[i].decode('utf-8')) for i in range(size))
 *         for i in range(size):             # <<<<<<<<<<<<<<
 *             campl.AMPL_StringFree(&headers[i])
 *         free(headers)
 */
  __pyx_t_3 = __pyx_v_size;
  __pyx_t_4 = __pyx_t_3;
  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
    __pyx_v_i = __pyx_t_5;

    /* "amplpy/dataframe.pxi":377
 *         headers_py = tuple(str(headers[i].decode('utf-8')) for i in range(size))
 *         for i in range(size):
 *             campl.AMPL_StringFree(&headers[i])             # <<<<<<<<<<<<<<
 *         free(headers)
 *         return headers_py
 */
    (void)(AMPL_StringFree((&(__pyx_cur_scope->__pyx_v_headers[__pyx_v_i]))));
  }

  /* "amplpy/dataframe.pxi":378
 *         for i in range(size):
 *             campl.AMPL_StringFree(&headers[i])
 *         free(headers)             # <<<<<<<<<<<<<<
 *         return headers_py
 * 
 */
  free(__pyx_cur_scope->__pyx_v_headers);

  /* "amplpy/dataframe.pxi":379
 *             campl.AMPL_StringFree(&headers[i])
 *         free(headers)
 *         return headers_py             # <<<<<<<<<<<<<<
 * 
 *     def _set_values(self, values):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_headers_py);
  __pyx_r = __pyx_v_headers_py;
  goto __pyx_L0;

  /* "amplpy/dataframe.pxi":365
 *         return Row.create(self._c_df, index)
 * 
 *     def _get_headers(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the headers of this DataFrame.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("_amplpy.DataFrame._get_headers", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_headers_py);
  __Pyx_XDECREF(__pyx_gb_7_amplpy_9DataFrame_12_get_headers_2generator3);
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/dataframe.pxi":381
 *         return headers_py
 * 
 *     def _set_values(self, values):             # <<<<<<<<<<<<<<
 *         """
 *         Set the values of a DataFrame from a dictionary.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_9DataFrame_31_set_values(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_9DataFrame_30_set_values, "DataFrame._set_values(self, values)\n\n        Set the values of a DataFrame from a dictionary.\n\n        Args:\n            values: Dictionary with the values to set.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_9DataFrame_31_set_values = {"_set_values", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_9DataFrame_31_set_values, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_9DataFrame_30_set_values};
static PyObject *__pyx_pw_7_amplpy_9DataFrame_31_set_values(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_values = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_set_values (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_values)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 381, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_set_values") < 0)) __PYX_ERR(0, 381, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_values = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_set_values", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 381, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.DataFrame._set_values", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_9DataFrame_30_set_values(((struct __pyx_obj_7_amplpy_DataFrame *)__pyx_v_self), __pyx_v_values);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/dataframe.pxi":391
 *         nindices = self._get_num_indices()
 * 
 *         def conv_to_list(value):             # <<<<<<<<<<<<<<
 *             if isinstance(value, list):
 *                 return value
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_9DataFrame_11_set_values_1conv_to_list(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7_amplpy_9DataFrame_11_set_values_1conv_to_list = {"conv_to_list", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_9DataFrame_11_set_values_1conv_to_list, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7_amplpy_9DataFrame_11_set_values_1conv_to_list(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_value = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("conv_to_list (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_value,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_value)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 391, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "conv_to_list") < 0)) __PYX_ERR(0, 391, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_value = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("conv_to_list", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 391, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.DataFrame._set_values.conv_to_list", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_9DataFrame_11_set_values_conv_to_list(__pyx_self, __pyx_v_value);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_9DataFrame_11_set_values_conv_to_list(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_value) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("conv_to_list", 1);

  /* "amplpy/dataframe.pxi":392
 * 
 *         def conv_to_list(value):
 *             if isinstance(value, list):             # <<<<<<<<<<<<<<
 *                 return value
 *             elif isinstance(value, tuple):
 */
  __pyx_t_1 = PyList_Check(__pyx_v_value); 
  if (__pyx_t_1) {

    /* "amplpy/dataframe.pxi":393
 *         def conv_to_list(value):
 *             if isinstance(value, list):
 *                 return value             # <<<<<<<<<<<<<<
 *             elif isinstance(value, tuple):
 *                 return list(value)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_value);
    __pyx_r = __pyx_v_value;
    goto __pyx_L0;

    /* "amplpy/dataframe.pxi":392
 * 
 *         def conv_to_list(value):
 *             if isinstance(value, list):             # <<<<<<<<<<<<<<
 *                 return value
 *             elif isinstance(value, tuple):
 */
  }

  /* "amplpy/dataframe.pxi":394
 *             if isinstance(value, list):
 *                 return value
 *             elif isinstance(value, tuple):             # <<<<<<<<<<<<<<
 *                 return list(value)
 *             else:
 */
  __pyx_t_1 = PyTuple_Check(__pyx_v_value); 
  if (__pyx_t_1) {

    /* "amplpy/dataframe.pxi":395
 *                 return value
 *             elif isinstance(value, tuple):
 *                 return list(value)             # <<<<<<<<<<<<<<
 *             else:
 *                 return [value]
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PySequence_List(__pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 395, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "amplpy/dataframe.pxi":394
 *             if isinstance(value, list):
 *                 return value
 *             elif isinstance(value, tuple):             # <<<<<<<<<<<<<<
 *                 return list(value)
 *             else:
 */
  }

  /* "amplpy/dataframe.pxi":397
 *                 return list(value)
 *             else:
 *                 return [value]             # <<<<<<<<<<<<<<
 * 
 *         for key, value in values.items():
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 397, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v_value);
    __Pyx_GIVEREF(__pyx_v_value);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_v_value)) __PYX_ERR(0, 397, __pyx_L1_error);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }

  /* "amplpy/dataframe.pxi":391
 *         nindices = self._get_num_indices()
 * 
 *         def conv_to_list(value):             # <<<<<<<<<<<<<<
 *             if isinstance(value, list):
 *                 return value
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("_amplpy.DataFrame._set_values.conv_to_list", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/dataframe.pxi":381
 *         return headers_py
 * 
 *     def _set_values(self, values):             # <<<<<<<<<<<<<<
 *         """
 *         Set the values of a DataFrame from a dictionary.
 */

static PyObject *__pyx_pf_7_amplpy_9DataFrame_30_set_values(struct __pyx_obj_7_amplpy_DataFrame *__pyx_v_self, PyObject *__pyx_v_values) {
  PyObject *__pyx_v_ncols = NULL;
  PyObject *__pyx_v_nindices = NULL;
  PyObject *__pyx_v_conv_to_list = 0;
  PyObject *__pyx_v_key = NULL;
  PyObject *__pyx_v_value = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_set_values", 1);

  /* "amplpy/dataframe.pxi":388
 *             values: Dictionary with the values to set.
 *         """
 *         ncols = self._get_num_cols()             # <<<<<<<<<<<<<<
 *         nindices = self._get_num_indices()
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_num_cols); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 388, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 388, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_v_ncols = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "amplpy/dataframe.pxi":389
 *         """
 *         ncols = self._get_num_cols()
 *         nindices = self._get_num_indices()             # <<<<<<<<<<<<<<
 * 
 *         def conv_to_list(value):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_num_indices); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 389, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 389, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_v_nindices = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "amplpy/dataframe.pxi":391
 *         nindices = self._get_num_indices()
 * 
 *         def conv_to_list(value):             # <<<<<<<<<<<<<<
 *             if isinstance(value, list):
 *                 return value
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_9DataFrame_11_set_values_1conv_to_list, 0, __pyx_n_s_set_values_locals_conv_to_list, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__16)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 391, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_conv_to_list = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "amplpy/dataframe.pxi":399
 *                 return [value]
 * 
 *         for key, value in values.items():             # <<<<<<<<<<<<<<
 *             key = conv_to_list(key)
 *             assert len(key) == nindices
 */
  __pyx_t_5 = 0;
  if (unlikely(__pyx_v_values == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items");
    __PYX_ERR(0, 399, __pyx_L1_error)
  }
  __pyx_t_2 = __Pyx_dict_iterator(__pyx_v_values, 0, __pyx_n_s_items, (&__pyx_t_6), (&__pyx_t_7)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 399, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_1);
  __pyx_t_1 = __pyx_t_2;
  __pyx_t_2 = 0;
  while (1) {
    __pyx_t_8 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_6, &__pyx_t_5, &__pyx_t_2, &__pyx_t_3, NULL, __pyx_t_7);
    if (unlikely(__pyx_t_8 == 0)) break;
    if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 399, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_2);
    __pyx_t_2 = 0;
    __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "amplpy/dataframe.pxi":400
 * 
 *         for key, value in values.items():
 *             key = conv_to_list(key)             # <<<<<<<<<<<<<<
 *             assert len(key) == nindices
 *             value = conv_to_list(value)
 */
    __pyx_t_3 = __pyx_pf_7_amplpy_9DataFrame_11_set_values_conv_to_list(__pyx_v_conv_to_list, __pyx_v_key); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 400, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_key, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "amplpy/dataframe.pxi":401
 *         for key, value in values.items():
 *             key = conv_to_list(key)
 *             assert len(key) == nindices             # <<<<<<<<<<<<<<
 *             value = conv_to_list(value)
 *             assert len(value) == ncols - nindices
 */
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(__pyx_assertions_enabled())) {
      __pyx_t_9 = PyObject_Length(__pyx_v_key); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 401, __pyx_L1_error)
      __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 401, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_v_nindices, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 401, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 401, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_10)) {
        __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
        __PYX_ERR(0, 401, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(0, 401, __pyx_L1_error)
    #endif

    /* "amplpy/dataframe.pxi":402
 *             key = conv_to_list(key)
 *             assert len(key) == nindices
 *             value = conv_to_list(value)             # <<<<<<<<<<<<<<
 *             assert len(value) == ncols - nindices
 *             self._add_row(key + value)
 */
    __pyx_t_2 = __pyx_pf_7_amplpy_9DataFrame_11_set_values_conv_to_list(__pyx_v_conv_to_list, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 402, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "amplpy/dataframe.pxi":403
 *             assert len(key) == nindices
 *             value = conv_to_list(value)
 *             assert len(value) == ncols - nindices             # <<<<<<<<<<<<<<
 *             self._add_row(key + value)
 * 
 */
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(__pyx_assertions_enabled())) {
      __pyx_t_9 = PyObject_Length(__pyx_v_value); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 403, __pyx_L1_error)
      __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 403, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyNumber_Subtract(__pyx_v_ncols, __pyx_v_nindices); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 403, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_11 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 403, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 403, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      if (unlikely(!__pyx_t_10)) {
        __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
        __PYX_ERR(0, 403, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(0, 403, __pyx_L1_error)
    #endif

    /* "amplpy/dataframe.pxi":404
 *             value = conv_to_list(value)
 *             assert len(value) == ncols - nindices
 *             self._add_row(key + value)             # <<<<<<<<<<<<<<
 * 
 *     def to_dict(self):
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_row); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 404, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyNumber_Add(__pyx_v_key, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 404, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_12 = NULL;
    __pyx_t_4 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_12)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_12);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_4 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_t_2};
      __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 404, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "amplpy/dataframe.pxi":381
 *         return headers_py
 * 
 *     def _set_values(self, values):             # <<<<<<<<<<<<<<
 *         """
 *         Set the values of a DataFrame from a dictionary.
 */

  /* 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_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("_amplpy.DataFrame._set_values", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_ncols);
  __Pyx_XDECREF(__pyx_v_nindices);
  __Pyx_XDECREF(__pyx_v_conv_to_list);
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/dataframe.pxi":406
 *             self._add_row(key + value)
 * 
 *     def to_dict(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return a dictionary with the DataFrame data.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_9DataFrame_33to_dict(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_9DataFrame_32to_dict, "DataFrame.to_dict(self)\n\n        Return a dictionary with the DataFrame data.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_9DataFrame_33to_dict = {"to_dict", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_9DataFrame_33to_dict, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_9DataFrame_32to_dict};
static PyObject *__pyx_pw_7_amplpy_9DataFrame_33to_dict(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_dict (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("to_dict", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "to_dict", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_9DataFrame_32to_dict(((struct __pyx_obj_7_amplpy_DataFrame *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_9DataFrame_32to_dict(struct __pyx_obj_7_amplpy_DataFrame *__pyx_v_self) {
  PyObject *__pyx_v_d = NULL;
  PyObject *__pyx_v_nindices = NULL;
  PyObject *__pyx_v_data = NULL;
  PyObject *__pyx_v_row = NULL;
  PyObject *__pyx_v_key = NULL;
  PyObject *__pyx_8genexpr6__pyx_v_header = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  PyObject *(*__pyx_t_8)(PyObject *);
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  Py_ssize_t __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_dict", 1);

  /* "amplpy/dataframe.pxi":410
 *         Return a dictionary with the DataFrame data.
 *         """
 *         d = {}             # <<<<<<<<<<<<<<
 *         nindices = self._get_num_indices()
 *         if nindices == 0:
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 410, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_d = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "amplpy/dataframe.pxi":411
 *         """
 *         d = {}
 *         nindices = self._get_num_indices()             # <<<<<<<<<<<<<<
 *         if nindices == 0:
 *             raise ValueError("cannot convert to dictionary without an index")
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_num_indices); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 411, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 411, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_v_nindices = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "amplpy/dataframe.pxi":412
 *         d = {}
 *         nindices = self._get_num_indices()
 *         if nindices == 0:             # <<<<<<<<<<<<<<
 *             raise ValueError("cannot convert to dictionary without an index")
 *         data = zip(
 */
  __pyx_t_5 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_nindices, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 412, __pyx_L1_error)
  if (unlikely(__pyx_t_5)) {

    /* "amplpy/dataframe.pxi":413
 *         nindices = self._get_num_indices()
 *         if nindices == 0:
 *             raise ValueError("cannot convert to dictionary without an index")             # <<<<<<<<<<<<<<
 *         data = zip(
 *             *[self._get_column(header).to_list() for header in self._get_headers()]
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 413, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 413, __pyx_L1_error)

    /* "amplpy/dataframe.pxi":412
 *         d = {}
 *         nindices = self._get_num_indices()
 *         if nindices == 0:             # <<<<<<<<<<<<<<
 *             raise ValueError("cannot convert to dictionary without an index")
 *         data = zip(
 */
  }

  /* "amplpy/dataframe.pxi":414
 *         if nindices == 0:
 *             raise ValueError("cannot convert to dictionary without an index")
 *         data = zip(             # <<<<<<<<<<<<<<
 *             *[self._get_column(header).to_list() for header in self._get_headers()]
 *         )
 */
  { /* enter inner scope */

    /* "amplpy/dataframe.pxi":415
 *             raise ValueError("cannot convert to dictionary without an index")
 *         data = zip(
 *             *[self._get_column(header).to_list() for header in self._get_headers()]             # <<<<<<<<<<<<<<
 *         )
 *         for row in data:
 */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 415, __pyx_L6_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_headers); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 415, __pyx_L6_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = NULL;
    __pyx_t_4 = 0;
    #if CYTHON_UNPACK_METHODS
    if (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);
        __pyx_t_4 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 415, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
      __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3);
      __pyx_t_7 = 0;
      __pyx_t_8 = NULL;
    } else {
      __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 415, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 415, __pyx_L6_error)
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    for (;;) {
      if (likely(!__pyx_t_8)) {
        if (likely(PyList_CheckExact(__pyx_t_3))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 415, __pyx_L6_error)
            #endif
            if (__pyx_t_7 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 415, __pyx_L6_error)
          #else
          __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 415, __pyx_L6_error)
          __Pyx_GOTREF(__pyx_t_2);
          #endif
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 415, __pyx_L6_error)
            #endif
            if (__pyx_t_7 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 415, __pyx_L6_error)
          #else
          __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 415, __pyx_L6_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, 415, __pyx_L6_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_XDECREF_SET(__pyx_8genexpr6__pyx_v_header, __pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_column); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 415, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_10 = NULL;
      __pyx_t_4 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_9))) {
        __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
        if (likely(__pyx_t_10)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
          __Pyx_INCREF(__pyx_t_10);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_9, function);
          __pyx_t_4 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_8genexpr6__pyx_v_header};
        __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 415, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_to_list); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 415, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      __pyx_t_4 = 0;
      #if CYTHON_UNPACK_METHODS
      if (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);
          __pyx_t_4 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
        __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 415, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 415, __pyx_L6_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_8genexpr6__pyx_v_header); __pyx_8genexpr6__pyx_v_header = 0;
    goto __pyx_L10_exit_scope;
    __pyx_L6_error:;
    __Pyx_XDECREF(__pyx_8genexpr6__pyx_v_header); __pyx_8genexpr6__pyx_v_header = 0;
    goto __pyx_L1_error;
    __pyx_L10_exit_scope:;
  } /* exit inner scope */

  /* "amplpy/dataframe.pxi":414
 *         if nindices == 0:
 *             raise ValueError("cannot convert to dictionary without an index")
 *         data = zip(             # <<<<<<<<<<<<<<
 *             *[self._get_column(header).to_list() for header in self._get_headers()]
 *         )
 */
  __pyx_t_3 = PySequence_Tuple(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 414, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 414, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_data = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "amplpy/dataframe.pxi":417
 *             *[self._get_column(header).to_list() for header in self._get_headers()]
 *         )
 *         for row in data:             # <<<<<<<<<<<<<<
 *             if nindices == 1:
 *                 key = row[0]
 */
  if (likely(PyList_CheckExact(__pyx_v_data)) || PyTuple_CheckExact(__pyx_v_data)) {
    __pyx_t_1 = __pyx_v_data; __Pyx_INCREF(__pyx_t_1);
    __pyx_t_7 = 0;
    __pyx_t_8 = NULL;
  } else {
    __pyx_t_7 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 417, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 417, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_8)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 417, __pyx_L1_error)
          #endif
          if (__pyx_t_7 >= __pyx_temp) 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, 417, __pyx_L1_error)
        #else
        __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 417, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 417, __pyx_L1_error)
          #endif
          if (__pyx_t_7 >= __pyx_temp) 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, 417, __pyx_L1_error)
        #else
        __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 417, __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, 417, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_XDECREF_SET(__pyx_v_row, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "amplpy/dataframe.pxi":418
 *         )
 *         for row in data:
 *             if nindices == 1:             # <<<<<<<<<<<<<<
 *                 key = row[0]
 *             else:
 */
    __pyx_t_5 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_nindices, __pyx_int_1, 1, 0)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 418, __pyx_L1_error)
    if (__pyx_t_5) {

      /* "amplpy/dataframe.pxi":419
 *         for row in data:
 *             if nindices == 1:
 *                 key = row[0]             # <<<<<<<<<<<<<<
 *             else:
 *                 key = tuple(row[:nindices])
 */
      __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_row, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 419, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "amplpy/dataframe.pxi":418
 *         )
 *         for row in data:
 *             if nindices == 1:             # <<<<<<<<<<<<<<
 *                 key = row[0]
 *             else:
 */
      goto __pyx_L13;
    }

    /* "amplpy/dataframe.pxi":421
 *                 key = row[0]
 *             else:
 *                 key = tuple(row[:nindices])             # <<<<<<<<<<<<<<
 *             if len(row) - nindices == 0:
 *                 d[key] = None
 */
    /*else*/ {
      __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_row, 0, 0, NULL, &__pyx_v_nindices, NULL, 0, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 421, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 421, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_2);
      __pyx_t_2 = 0;
    }
    __pyx_L13:;

    /* "amplpy/dataframe.pxi":422
 *             else:
 *                 key = tuple(row[:nindices])
 *             if len(row) - nindices == 0:             # <<<<<<<<<<<<<<
 *                 d[key] = None
 *             elif len(row) - nindices == 1:
 */
    __pyx_t_11 = PyObject_Length(__pyx_v_row); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(0, 422, __pyx_L1_error)
    __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_11); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 422, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyNumber_Subtract(__pyx_t_2, __pyx_v_nindices); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 422, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = (__Pyx_PyInt_BoolEqObjC(__pyx_t_3, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 422, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_5) {

      /* "amplpy/dataframe.pxi":423
 *                 key = tuple(row[:nindices])
 *             if len(row) - nindices == 0:
 *                 d[key] = None             # <<<<<<<<<<<<<<
 *             elif len(row) - nindices == 1:
 *                 d[key] = row[nindices]
 */
      if (unlikely((PyDict_SetItem(__pyx_v_d, __pyx_v_key, Py_None) < 0))) __PYX_ERR(0, 423, __pyx_L1_error)

      /* "amplpy/dataframe.pxi":422
 *             else:
 *                 key = tuple(row[:nindices])
 *             if len(row) - nindices == 0:             # <<<<<<<<<<<<<<
 *                 d[key] = None
 *             elif len(row) - nindices == 1:
 */
      goto __pyx_L14;
    }

    /* "amplpy/dataframe.pxi":424
 *             if len(row) - nindices == 0:
 *                 d[key] = None
 *             elif len(row) - nindices == 1:             # <<<<<<<<<<<<<<
 *                 d[key] = row[nindices]
 *             else:
 */
    __pyx_t_11 = PyObject_Length(__pyx_v_row); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(0, 424, __pyx_L1_error)
    __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_11); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 424, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyNumber_Subtract(__pyx_t_3, __pyx_v_nindices); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 424, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_5 = (__Pyx_PyInt_BoolEqObjC(__pyx_t_2, __pyx_int_1, 1, 0)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 424, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_5) {

      /* "amplpy/dataframe.pxi":425
 *                 d[key] = None
 *             elif len(row) - nindices == 1:
 *                 d[key] = row[nindices]             # <<<<<<<<<<<<<<
 *             else:
 *                 d[key] = tuple(row[nindices:])
 */
      __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_row, __pyx_v_nindices); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 425, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (unlikely((PyDict_SetItem(__pyx_v_d, __pyx_v_key, __pyx_t_2) < 0))) __PYX_ERR(0, 425, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "amplpy/dataframe.pxi":424
 *             if len(row) - nindices == 0:
 *                 d[key] = None
 *             elif len(row) - nindices == 1:             # <<<<<<<<<<<<<<
 *                 d[key] = row[nindices]
 *             else:
 */
      goto __pyx_L14;
    }

    /* "amplpy/dataframe.pxi":427
 *                 d[key] = row[nindices]
 *             else:
 *                 d[key] = tuple(row[nindices:])             # <<<<<<<<<<<<<<
 *         return d
 * 
 */
    /*else*/ {
      __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_row, 0, 0, &__pyx_v_nindices, NULL, NULL, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 427, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PySequence_Tuple(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 427, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely((PyDict_SetItem(__pyx_v_d, __pyx_v_key, __pyx_t_3) < 0))) __PYX_ERR(0, 427, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __pyx_L14:;

    /* "amplpy/dataframe.pxi":417
 *             *[self._get_column(header).to_list() for header in self._get_headers()]
 *         )
 *         for row in data:             # <<<<<<<<<<<<<<
 *             if nindices == 1:
 *                 key = row[0]
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "amplpy/dataframe.pxi":428
 *             else:
 *                 d[key] = tuple(row[nindices:])
 *         return d             # <<<<<<<<<<<<<<
 * 
 *     def to_list(self, skip_index=False):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_d);
  __pyx_r = __pyx_v_d;
  goto __pyx_L0;

  /* "amplpy/dataframe.pxi":406
 *             self._add_row(key + value)
 * 
 *     def to_dict(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return a dictionary with the DataFrame data.
 */

  /* 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_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("_amplpy.DataFrame.to_dict", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_d);
  __Pyx_XDECREF(__pyx_v_nindices);
  __Pyx_XDECREF(__pyx_v_data);
  __Pyx_XDECREF(__pyx_v_row);
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XDECREF(__pyx_8genexpr6__pyx_v_header);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/dataframe.pxi":430
 *         return d
 * 
 *     def to_list(self, skip_index=False):             # <<<<<<<<<<<<<<
 *         """
 *         Return a list with the DataFrame data.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_9DataFrame_35to_list(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_9DataFrame_34to_list, "DataFrame.to_list(self, skip_index=False)\n\n        Return a list with the DataFrame data.\n\n        Args:\n            skip_index: set to True to retrieve only values.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_9DataFrame_35to_list = {"to_list", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_9DataFrame_35to_list, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_9DataFrame_34to_list};
static PyObject *__pyx_pw_7_amplpy_9DataFrame_35to_list(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_skip_index = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_list (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_skip_index,0};
    values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_False));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_skip_index);
          if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 430, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "to_list") < 0)) __PYX_ERR(0, 430, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_skip_index = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("to_list", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 430, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.DataFrame.to_list", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_9DataFrame_34to_list(((struct __pyx_obj_7_amplpy_DataFrame *)__pyx_v_self), __pyx_v_skip_index);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_9DataFrame_34to_list(struct __pyx_obj_7_amplpy_DataFrame *__pyx_v_self, PyObject *__pyx_v_skip_index) {
  PyObject *__pyx_v_lst = NULL;
  PyObject *__pyx_v_ncols = NULL;
  PyObject *__pyx_v_nindices = NULL;
  PyObject *__pyx_8genexpr7__pyx_v_i = NULL;
  PyObject *__pyx_8genexpr8__pyx_v_i = NULL;
  PyObject *__pyx_8genexpr9__pyx_v_row = NULL;
  PyObject *__pyx_9genexpr10__pyx_v_row = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  PyObject *(*__pyx_t_8)(PyObject *);
  PyObject *__pyx_t_9 = NULL;
  Py_ssize_t __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_list", 1);

  /* "amplpy/dataframe.pxi":437
 *             skip_index: set to True to retrieve only values.
 *         """
 *         if self._get_num_cols() > 1:             # <<<<<<<<<<<<<<
 *             lst = [
 *                 tuple(self._get_row_by_index(i)) for i in range(self._get_num_rows())
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_num_cols); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 437, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 437, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_int_1, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 437, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 437, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_5) {

    /* "amplpy/dataframe.pxi":438
 *         """
 *         if self._get_num_cols() > 1:
 *             lst = [             # <<<<<<<<<<<<<<
 *                 tuple(self._get_row_by_index(i)) for i in range(self._get_num_rows())
 *             ]
 */
    { /* enter inner scope */
      __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 438, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_2);

      /* "amplpy/dataframe.pxi":439
 *         if self._get_num_cols() > 1:
 *             lst = [
 *                 tuple(self._get_row_by_index(i)) for i in range(self._get_num_rows())             # <<<<<<<<<<<<<<
 *             ]
 *         else:
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_num_rows); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 439, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 = NULL;
      __pyx_t_4 = 0;
      #if CYTHON_UNPACK_METHODS
      if (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);
          __pyx_t_4 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
        __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 439, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      }
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 439, __pyx_L6_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, 439, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 439, __pyx_L6_error)
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      for (;;) {
        if (likely(!__pyx_t_8)) {
          if (likely(PyList_CheckExact(__pyx_t_1))) {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
              #if !CYTHON_ASSUME_SAFE_MACROS
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 439, __pyx_L6_error)
              #endif
              if (__pyx_t_7 >= __pyx_temp) 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, 439, __pyx_L6_error)
            #else
            __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 439, __pyx_L6_error)
            __Pyx_GOTREF(__pyx_t_3);
            #endif
          } else {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
              #if !CYTHON_ASSUME_SAFE_MACROS
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 439, __pyx_L6_error)
              #endif
              if (__pyx_t_7 >= __pyx_temp) 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, 439, __pyx_L6_error)
            #else
            __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 439, __pyx_L6_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, 439, __pyx_L6_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_3);
        }
        __Pyx_XDECREF_SET(__pyx_8genexpr7__pyx_v_i, __pyx_t_3);
        __pyx_t_3 = 0;
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_row_by_index); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 439, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_9 = NULL;
        __pyx_t_4 = 0;
        #if CYTHON_UNPACK_METHODS
        if (likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_9)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_9);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_4 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_8genexpr7__pyx_v_i};
          __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 439, __pyx_L6_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, 439, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 438, __pyx_L6_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_i); __pyx_8genexpr7__pyx_v_i = 0;
      goto __pyx_L10_exit_scope;
      __pyx_L6_error:;
      __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_i); __pyx_8genexpr7__pyx_v_i = 0;
      goto __pyx_L1_error;
      __pyx_L10_exit_scope:;
    } /* exit inner scope */
    __pyx_v_lst = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "amplpy/dataframe.pxi":437
 *             skip_index: set to True to retrieve only values.
 *         """
 *         if self._get_num_cols() > 1:             # <<<<<<<<<<<<<<
 *             lst = [
 *                 tuple(self._get_row_by_index(i)) for i in range(self._get_num_rows())
 */
    goto __pyx_L3;
  }

  /* "amplpy/dataframe.pxi":442
 *             ]
 *         else:
 *             lst = [self._get_row_by_index(i)[0] for i in range(self._get_num_rows())]             # <<<<<<<<<<<<<<
 *         if skip_index:
 *             ncols = self._get_num_cols()
 */
  /*else*/ {
    { /* enter inner scope */
      __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 442, __pyx_L13_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_num_rows); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 442, __pyx_L13_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_3 = NULL;
      __pyx_t_4 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_4 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
        __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 442, __pyx_L13_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 442, __pyx_L13_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (likely(PyList_CheckExact(__pyx_t_6)) || PyTuple_CheckExact(__pyx_t_6)) {
        __pyx_t_1 = __pyx_t_6; __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_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 442, __pyx_L13_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 442, __pyx_L13_error)
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      for (;;) {
        if (likely(!__pyx_t_8)) {
          if (likely(PyList_CheckExact(__pyx_t_1))) {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
              #if !CYTHON_ASSUME_SAFE_MACROS
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 442, __pyx_L13_error)
              #endif
              if (__pyx_t_7 >= __pyx_temp) break;
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_6 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_6); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 442, __pyx_L13_error)
            #else
            __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 442, __pyx_L13_error)
            __Pyx_GOTREF(__pyx_t_6);
            #endif
          } else {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
              #if !CYTHON_ASSUME_SAFE_MACROS
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 442, __pyx_L13_error)
              #endif
              if (__pyx_t_7 >= __pyx_temp) break;
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_6); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 442, __pyx_L13_error)
            #else
            __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 442, __pyx_L13_error)
            __Pyx_GOTREF(__pyx_t_6);
            #endif
          }
        } else {
          __pyx_t_6 = __pyx_t_8(__pyx_t_1);
          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, 442, __pyx_L13_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_6);
        }
        __Pyx_XDECREF_SET(__pyx_8genexpr8__pyx_v_i, __pyx_t_6);
        __pyx_t_6 = 0;
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_row_by_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 442, __pyx_L13_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_9 = NULL;
        __pyx_t_4 = 0;
        #if CYTHON_UNPACK_METHODS
        if (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);
            __pyx_t_4 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_8genexpr8__pyx_v_i};
          __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 442, __pyx_L13_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        }
        __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_6, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 442, __pyx_L13_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 442, __pyx_L13_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_8genexpr8__pyx_v_i); __pyx_8genexpr8__pyx_v_i = 0;
      goto __pyx_L17_exit_scope;
      __pyx_L13_error:;
      __Pyx_XDECREF(__pyx_8genexpr8__pyx_v_i); __pyx_8genexpr8__pyx_v_i = 0;
      goto __pyx_L1_error;
      __pyx_L17_exit_scope:;
    } /* exit inner scope */
    __pyx_v_lst = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;
  }
  __pyx_L3:;

  /* "amplpy/dataframe.pxi":443
 *         else:
 *             lst = [self._get_row_by_index(i)[0] for i in range(self._get_num_rows())]
 *         if skip_index:             # <<<<<<<<<<<<<<
 *             ncols = self._get_num_cols()
 *             nindices = self._get_num_indices()
 */
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_skip_index); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 443, __pyx_L1_error)
  if (__pyx_t_5) {

    /* "amplpy/dataframe.pxi":444
 *             lst = [self._get_row_by_index(i)[0] for i in range(self._get_num_rows())]
 *         if skip_index:
 *             ncols = self._get_num_cols()             # <<<<<<<<<<<<<<
 *             nindices = self._get_num_indices()
 *             if ncols - nindices == 1:
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_num_cols); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 444, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = NULL;
    __pyx_t_4 = 0;
    #if CYTHON_UNPACK_METHODS
    if (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);
        __pyx_t_4 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 444, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __pyx_v_ncols = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "amplpy/dataframe.pxi":445
 *         if skip_index:
 *             ncols = self._get_num_cols()
 *             nindices = self._get_num_indices()             # <<<<<<<<<<<<<<
 *             if ncols - nindices == 1:
 *                 return [row[len(row)-1] for row in lst]
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_num_indices); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 445, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = NULL;
    __pyx_t_4 = 0;
    #if CYTHON_UNPACK_METHODS
    if (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);
        __pyx_t_4 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 445, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __pyx_v_nindices = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "amplpy/dataframe.pxi":446
 *             ncols = self._get_num_cols()
 *             nindices = self._get_num_indices()
 *             if ncols - nindices == 1:             # <<<<<<<<<<<<<<
 *                 return [row[len(row)-1] for row in lst]
 *             else:
 */
    __pyx_t_2 = PyNumber_Subtract(__pyx_v_ncols, __pyx_v_nindices); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 446, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = (__Pyx_PyInt_BoolEqObjC(__pyx_t_2, __pyx_int_1, 1, 0)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 446, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_5) {

      /* "amplpy/dataframe.pxi":447
 *             nindices = self._get_num_indices()
 *             if ncols - nindices == 1:
 *                 return [row[len(row)-1] for row in lst]             # <<<<<<<<<<<<<<
 *             else:
 *                 return [row[nindices:] for row in lst]
 */
      __Pyx_XDECREF(__pyx_r);
      { /* enter inner scope */
        __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 447, __pyx_L22_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_1 = __pyx_v_lst; __Pyx_INCREF(__pyx_t_1);
        __pyx_t_7 = 0;
        for (;;) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 447, __pyx_L22_error)
            #endif
            if (__pyx_t_7 >= __pyx_temp) 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, 447, __pyx_L22_error)
          #else
          __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 447, __pyx_L22_error)
          __Pyx_GOTREF(__pyx_t_3);
          #endif
          __Pyx_XDECREF_SET(__pyx_8genexpr9__pyx_v_row, __pyx_t_3);
          __pyx_t_3 = 0;
          __pyx_t_10 = PyObject_Length(__pyx_8genexpr9__pyx_v_row); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(0, 447, __pyx_L22_error)
          __pyx_t_11 = (__pyx_t_10 - 1);
          __pyx_t_3 = __Pyx_GetItemInt(__pyx_8genexpr9__pyx_v_row, __pyx_t_11, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 447, __pyx_L22_error)
          __Pyx_GOTREF(__pyx_t_3);
          if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 447, __pyx_L22_error)
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        }
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_row); __pyx_8genexpr9__pyx_v_row = 0;
        goto __pyx_L26_exit_scope;
        __pyx_L22_error:;
        __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_row); __pyx_8genexpr9__pyx_v_row = 0;
        goto __pyx_L1_error;
        __pyx_L26_exit_scope:;
      } /* exit inner scope */
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;

      /* "amplpy/dataframe.pxi":446
 *             ncols = self._get_num_cols()
 *             nindices = self._get_num_indices()
 *             if ncols - nindices == 1:             # <<<<<<<<<<<<<<
 *                 return [row[len(row)-1] for row in lst]
 *             else:
 */
    }

    /* "amplpy/dataframe.pxi":449
 *                 return [row[len(row)-1] for row in lst]
 *             else:
 *                 return [row[nindices:] for row in lst]             # <<<<<<<<<<<<<<
 *         else:
 *             return lst
 */
    /*else*/ {
      __Pyx_XDECREF(__pyx_r);
      { /* enter inner scope */
        __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 449, __pyx_L29_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_1 = __pyx_v_lst; __Pyx_INCREF(__pyx_t_1);
        __pyx_t_7 = 0;
        for (;;) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 449, __pyx_L29_error)
            #endif
            if (__pyx_t_7 >= __pyx_temp) 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, 449, __pyx_L29_error)
          #else
          __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 449, __pyx_L29_error)
          __Pyx_GOTREF(__pyx_t_3);
          #endif
          __Pyx_XDECREF_SET(__pyx_9genexpr10__pyx_v_row, __pyx_t_3);
          __pyx_t_3 = 0;
          __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_9genexpr10__pyx_v_row, 0, 0, &__pyx_v_nindices, NULL, NULL, 0, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 449, __pyx_L29_error)
          __Pyx_GOTREF(__pyx_t_3);
          if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 449, __pyx_L29_error)
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        }
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_9genexpr10__pyx_v_row); __pyx_9genexpr10__pyx_v_row = 0;
        goto __pyx_L33_exit_scope;
        __pyx_L29_error:;
        __Pyx_XDECREF(__pyx_9genexpr10__pyx_v_row); __pyx_9genexpr10__pyx_v_row = 0;
        goto __pyx_L1_error;
        __pyx_L33_exit_scope:;
      } /* exit inner scope */
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;
    }

    /* "amplpy/dataframe.pxi":443
 *         else:
 *             lst = [self._get_row_by_index(i)[0] for i in range(self._get_num_rows())]
 *         if skip_index:             # <<<<<<<<<<<<<<
 *             ncols = self._get_num_cols()
 *             nindices = self._get_num_indices()
 */
  }

  /* "amplpy/dataframe.pxi":451
 *                 return [row[nindices:] for row in lst]
 *         else:
 *             return lst             # <<<<<<<<<<<<<<
 * 
 *     def to_pandas(self, multi_index=True):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_lst);
    __pyx_r = __pyx_v_lst;
    goto __pyx_L0;
  }

  /* "amplpy/dataframe.pxi":430
 *         return d
 * 
 *     def to_list(self, skip_index=False):             # <<<<<<<<<<<<<<
 *         """
 *         Return a list with the DataFrame data.
 */

  /* 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_9);
  __Pyx_AddTraceback("_amplpy.DataFrame.to_list", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_lst);
  __Pyx_XDECREF(__pyx_v_ncols);
  __Pyx_XDECREF(__pyx_v_nindices);
  __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_i);
  __Pyx_XDECREF(__pyx_8genexpr8__pyx_v_i);
  __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_row);
  __Pyx_XDECREF(__pyx_9genexpr10__pyx_v_row);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/dataframe.pxi":453
 *             return lst
 * 
 *     def to_pandas(self, multi_index=True):             # <<<<<<<<<<<<<<
 *         """
 *         Return a pandas.DataFrame with the DataFrame data.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_9DataFrame_37to_pandas(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_9DataFrame_36to_pandas, "DataFrame.to_pandas(self, multi_index=True)\n\n        Return a pandas.DataFrame with the DataFrame data.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_9DataFrame_37to_pandas = {"to_pandas", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_9DataFrame_37to_pandas, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_9DataFrame_36to_pandas};
static PyObject *__pyx_pw_7_amplpy_9DataFrame_37to_pandas(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_multi_index = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_pandas (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_multi_index,0};
    values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_True));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_multi_index);
          if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 453, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "to_pandas") < 0)) __PYX_ERR(0, 453, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_multi_index = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("to_pandas", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 453, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.DataFrame.to_pandas", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_9DataFrame_36to_pandas(((struct __pyx_obj_7_amplpy_DataFrame *)__pyx_v_self), __pyx_v_multi_index);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_9DataFrame_36to_pandas(struct __pyx_obj_7_amplpy_DataFrame *__pyx_v_self, PyObject *__pyx_v_multi_index) {
  PyObject *__pyx_v_nindices = NULL;
  PyObject *__pyx_v_headers = NULL;
  PyObject *__pyx_v_columns = NULL;
  PyObject *__pyx_v_index_names = NULL;
  PyObject *__pyx_v_index = NULL;
  PyObject *__pyx_9genexpr11__pyx_v_header = NULL;
  PyObject *__pyx_9genexpr12__pyx_v_header = NULL;
  PyObject *__pyx_9genexpr13__pyx_v_header = NULL;
  PyObject *__pyx_9genexpr14__pyx_v_key = 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;
  unsigned int __pyx_t_5;
  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;
  int __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  Py_ssize_t __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_pandas", 1);

  /* "amplpy/dataframe.pxi":457
 *         Return a pandas.DataFrame with the DataFrame data.
 *         """
 *         assert pd is not None             # <<<<<<<<<<<<<<
 *         nindices = self._get_num_indices()
 *         headers = self._get_headers()
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_pd); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 457, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = (__pyx_t_1 != Py_None);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_2)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 457, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 457, __pyx_L1_error)
  #endif

  /* "amplpy/dataframe.pxi":458
 *         """
 *         assert pd is not None
 *         nindices = self._get_num_indices()             # <<<<<<<<<<<<<<
 *         headers = self._get_headers()
 *         columns = {
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_num_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 458, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_v_nindices = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "amplpy/dataframe.pxi":459
 *         assert pd is not None
 *         nindices = self._get_num_indices()
 *         headers = self._get_headers()             # <<<<<<<<<<<<<<
 *         columns = {
 *             header: self._get_column(header).to_list() for header in headers[nindices:]
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_headers); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 459, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 459, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_v_headers = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "amplpy/dataframe.pxi":460
 *         nindices = self._get_num_indices()
 *         headers = self._get_headers()
 *         columns = {             # <<<<<<<<<<<<<<
 *             header: self._get_column(header).to_list() for header in headers[nindices:]
 *         }
 */
  { /* enter inner scope */
    __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "amplpy/dataframe.pxi":461
 *         headers = self._get_headers()
 *         columns = {
 *             header: self._get_column(header).to_list() for header in headers[nindices:]             # <<<<<<<<<<<<<<
 *         }
 *         index_names = headers[:nindices]
 */
    __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_headers, 0, 0, &__pyx_v_nindices, NULL, NULL, 0, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 461, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
      __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4);
      __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
    } else {
      __pyx_t_6 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 461, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 461, __pyx_L5_error)
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    for (;;) {
      if (likely(!__pyx_t_7)) {
        if (likely(PyList_CheckExact(__pyx_t_4))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 461, __pyx_L5_error)
            #endif
            if (__pyx_t_6 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 461, __pyx_L5_error)
          #else
          __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 461, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_3);
          #endif
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 461, __pyx_L5_error)
            #endif
            if (__pyx_t_6 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 461, __pyx_L5_error)
          #else
          __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 461, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_3);
          #endif
        }
      } else {
        __pyx_t_3 = __pyx_t_7(__pyx_t_4);
        if (unlikely(!__pyx_t_3)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 461, __pyx_L5_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_3);
      }
      __Pyx_XDECREF_SET(__pyx_9genexpr11__pyx_v_header, __pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_column); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 461, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_10 = NULL;
      __pyx_t_5 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_9))) {
        __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
        if (likely(__pyx_t_10)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
          __Pyx_INCREF(__pyx_t_10);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_9, function);
          __pyx_t_5 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_9genexpr11__pyx_v_header};
        __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 461, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_to_list); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 461, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = NULL;
      __pyx_t_5 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_9))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_9);
        if (likely(__pyx_t_8)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_9, function);
          __pyx_t_5 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_8, NULL};
        __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 461, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }
      if (unlikely(PyDict_SetItem(__pyx_t_1, (PyObject*)__pyx_9genexpr11__pyx_v_header, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 461, __pyx_L5_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_9genexpr11__pyx_v_header); __pyx_9genexpr11__pyx_v_header = 0;
    goto __pyx_L9_exit_scope;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_9genexpr11__pyx_v_header); __pyx_9genexpr11__pyx_v_header = 0;
    goto __pyx_L1_error;
    __pyx_L9_exit_scope:;
  } /* exit inner scope */
  __pyx_v_columns = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "amplpy/dataframe.pxi":463
 *             header: self._get_column(header).to_list() for header in headers[nindices:]
 *         }
 *         index_names = headers[:nindices]             # <<<<<<<<<<<<<<
 *         if len(index_names) >= 2 and multi_index is True:
 *             index = pd.MultiIndex.from_arrays(
 */
  __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_headers, 0, 0, NULL, &__pyx_v_nindices, NULL, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 463, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_index_names = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "amplpy/dataframe.pxi":464
 *         }
 *         index_names = headers[:nindices]
 *         if len(index_names) >= 2 and multi_index is True:             # <<<<<<<<<<<<<<
 *             index = pd.MultiIndex.from_arrays(
 *                 [self._get_column(header).to_list() for header in index_names],
 */
  __pyx_t_6 = PyObject_Length(__pyx_v_index_names); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 464, __pyx_L1_error)
  __pyx_t_11 = (__pyx_t_6 >= 2);
  if (__pyx_t_11) {
  } else {
    __pyx_t_2 = __pyx_t_11;
    goto __pyx_L11_bool_binop_done;
  }
  __pyx_t_11 = (__pyx_v_multi_index == Py_True);
  __pyx_t_2 = __pyx_t_11;
  __pyx_L11_bool_binop_done:;
  if (__pyx_t_2) {

    /* "amplpy/dataframe.pxi":465
 *         index_names = headers[:nindices]
 *         if len(index_names) >= 2 and multi_index is True:
 *             index = pd.MultiIndex.from_arrays(             # <<<<<<<<<<<<<<
 *                 [self._get_column(header).to_list() for header in index_names],
 *                 names=index_names,
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_pd); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 465, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_MultiIndex); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 465, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_from_arrays); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 465, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    { /* enter inner scope */

      /* "amplpy/dataframe.pxi":466
 *         if len(index_names) >= 2 and multi_index is True:
 *             index = pd.MultiIndex.from_arrays(
 *                 [self._get_column(header).to_list() for header in index_names],             # <<<<<<<<<<<<<<
 *                 names=index_names,
 *             )
 */
      __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 466, __pyx_L15_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (likely(PyList_CheckExact(__pyx_v_index_names)) || PyTuple_CheckExact(__pyx_v_index_names)) {
        __pyx_t_3 = __pyx_v_index_names; __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_index_names); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 466, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 466, __pyx_L15_error)
      }
      for (;;) {
        if (likely(!__pyx_t_7)) {
          if (likely(PyList_CheckExact(__pyx_t_3))) {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3);
              #if !CYTHON_ASSUME_SAFE_MACROS
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 466, __pyx_L15_error)
              #endif
              if (__pyx_t_6 >= __pyx_temp) break;
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_9); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 466, __pyx_L15_error)
            #else
            __pyx_t_9 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 466, __pyx_L15_error)
            __Pyx_GOTREF(__pyx_t_9);
            #endif
          } else {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3);
              #if !CYTHON_ASSUME_SAFE_MACROS
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 466, __pyx_L15_error)
              #endif
              if (__pyx_t_6 >= __pyx_temp) break;
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_9); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 466, __pyx_L15_error)
            #else
            __pyx_t_9 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 466, __pyx_L15_error)
            __Pyx_GOTREF(__pyx_t_9);
            #endif
          }
        } else {
          __pyx_t_9 = __pyx_t_7(__pyx_t_3);
          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, 466, __pyx_L15_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_9);
        }
        __Pyx_XDECREF_SET(__pyx_9genexpr12__pyx_v_header, __pyx_t_9);
        __pyx_t_9 = 0;
        __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_column); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 466, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_12 = NULL;
        __pyx_t_5 = 0;
        #if CYTHON_UNPACK_METHODS
        if (likely(PyMethod_Check(__pyx_t_10))) {
          __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_10);
          if (likely(__pyx_t_12)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
            __Pyx_INCREF(__pyx_t_12);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_10, function);
            __pyx_t_5 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_9genexpr12__pyx_v_header};
          __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 466, __pyx_L15_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_to_list); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 466, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = NULL;
        __pyx_t_5 = 0;
        #if CYTHON_UNPACK_METHODS
        if (likely(PyMethod_Check(__pyx_t_10))) {
          __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_10);
          if (likely(__pyx_t_8)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
            __Pyx_INCREF(__pyx_t_8);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_10, function);
            __pyx_t_5 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_8, NULL};
          __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 466, __pyx_L15_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_9))) __PYX_ERR(0, 466, __pyx_L15_error)
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_9genexpr12__pyx_v_header); __pyx_9genexpr12__pyx_v_header = 0;
      goto __pyx_L19_exit_scope;
      __pyx_L15_error:;
      __Pyx_XDECREF(__pyx_9genexpr12__pyx_v_header); __pyx_9genexpr12__pyx_v_header = 0;
      goto __pyx_L1_error;
      __pyx_L19_exit_scope:;
    } /* exit inner scope */

    /* "amplpy/dataframe.pxi":465
 *         index_names = headers[:nindices]
 *         if len(index_names) >= 2 and multi_index is True:
 *             index = pd.MultiIndex.from_arrays(             # <<<<<<<<<<<<<<
 *                 [self._get_column(header).to_list() for header in index_names],
 *                 names=index_names,
 */
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 465, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_4);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4)) __PYX_ERR(0, 465, __pyx_L1_error);
    __pyx_t_4 = 0;

    /* "amplpy/dataframe.pxi":467
 *             index = pd.MultiIndex.from_arrays(
 *                 [self._get_column(header).to_list() for header in index_names],
 *                 names=index_names,             # <<<<<<<<<<<<<<
 *             )
 *             return pd.DataFrame(columns, index=index)
 */
    __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 467, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_names, __pyx_v_index_names) < 0) __PYX_ERR(0, 467, __pyx_L1_error)

    /* "amplpy/dataframe.pxi":465
 *         index_names = headers[:nindices]
 *         if len(index_names) >= 2 and multi_index is True:
 *             index = pd.MultiIndex.from_arrays(             # <<<<<<<<<<<<<<
 *                 [self._get_column(header).to_list() for header in index_names],
 *                 names=index_names,
 */
    __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 465, __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_4); __pyx_t_4 = 0;
    __pyx_v_index = __pyx_t_9;
    __pyx_t_9 = 0;

    /* "amplpy/dataframe.pxi":469
 *                 names=index_names,
 *             )
 *             return pd.DataFrame(columns, index=index)             # <<<<<<<<<<<<<<
 *         else:
 *             index = zip(*[self._get_column(header).to_list() for header in index_names])
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_pd); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 469, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_DataFrame); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 469, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 469, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_INCREF(__pyx_v_columns);
    __Pyx_GIVEREF(__pyx_v_columns);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_columns)) __PYX_ERR(0, 469, __pyx_L1_error);
    __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 469, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_index, __pyx_v_index) < 0) __PYX_ERR(0, 469, __pyx_L1_error)
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_9, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 469, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __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;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "amplpy/dataframe.pxi":464
 *         }
 *         index_names = headers[:nindices]
 *         if len(index_names) >= 2 and multi_index is True:             # <<<<<<<<<<<<<<
 *             index = pd.MultiIndex.from_arrays(
 *                 [self._get_column(header).to_list() for header in index_names],
 */
  }

  /* "amplpy/dataframe.pxi":471
 *             return pd.DataFrame(columns, index=index)
 *         else:
 *             index = zip(*[self._get_column(header).to_list() for header in index_names])             # <<<<<<<<<<<<<<
 *             index = [key if len(key) > 1 else key[0] for key in index]
 *             if index == []:
 */
  /*else*/ {
    { /* enter inner scope */
      __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 471, __pyx_L22_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (likely(PyList_CheckExact(__pyx_v_index_names)) || PyTuple_CheckExact(__pyx_v_index_names)) {
        __pyx_t_3 = __pyx_v_index_names; __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_index_names); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 471, __pyx_L22_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 471, __pyx_L22_error)
      }
      for (;;) {
        if (likely(!__pyx_t_7)) {
          if (likely(PyList_CheckExact(__pyx_t_3))) {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3);
              #if !CYTHON_ASSUME_SAFE_MACROS
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 471, __pyx_L22_error)
              #endif
              if (__pyx_t_6 >= __pyx_temp) break;
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_9); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 471, __pyx_L22_error)
            #else
            __pyx_t_9 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 471, __pyx_L22_error)
            __Pyx_GOTREF(__pyx_t_9);
            #endif
          } else {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3);
              #if !CYTHON_ASSUME_SAFE_MACROS
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 471, __pyx_L22_error)
              #endif
              if (__pyx_t_6 >= __pyx_temp) break;
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_9); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 471, __pyx_L22_error)
            #else
            __pyx_t_9 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 471, __pyx_L22_error)
            __Pyx_GOTREF(__pyx_t_9);
            #endif
          }
        } else {
          __pyx_t_9 = __pyx_t_7(__pyx_t_3);
          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, 471, __pyx_L22_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_9);
        }
        __Pyx_XDECREF_SET(__pyx_9genexpr13__pyx_v_header, __pyx_t_9);
        __pyx_t_9 = 0;
        __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_column); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 471, __pyx_L22_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_8 = NULL;
        __pyx_t_5 = 0;
        #if CYTHON_UNPACK_METHODS
        if (likely(PyMethod_Check(__pyx_t_10))) {
          __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_10);
          if (likely(__pyx_t_8)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
            __Pyx_INCREF(__pyx_t_8);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_10, function);
            __pyx_t_5 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_9genexpr13__pyx_v_header};
          __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 471, __pyx_L22_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_to_list); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 471, __pyx_L22_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = NULL;
        __pyx_t_5 = 0;
        #if CYTHON_UNPACK_METHODS
        if (likely(PyMethod_Check(__pyx_t_10))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_10);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_10, function);
            __pyx_t_5 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
          __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 471, __pyx_L22_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_9))) __PYX_ERR(0, 471, __pyx_L22_error)
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_9genexpr13__pyx_v_header); __pyx_9genexpr13__pyx_v_header = 0;
      goto __pyx_L26_exit_scope;
      __pyx_L22_error:;
      __Pyx_XDECREF(__pyx_9genexpr13__pyx_v_header); __pyx_9genexpr13__pyx_v_header = 0;
      goto __pyx_L1_error;
      __pyx_L26_exit_scope:;
    } /* exit inner scope */
    __pyx_t_3 = PySequence_Tuple(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 471, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 471, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_index = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "amplpy/dataframe.pxi":472
 *         else:
 *             index = zip(*[self._get_column(header).to_list() for header in index_names])
 *             index = [key if len(key) > 1 else key[0] for key in index]             # <<<<<<<<<<<<<<
 *             if index == []:
 *                 return pd.DataFrame(columns, index=None)
 */
    { /* enter inner scope */
      __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 472, __pyx_L29_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
        __pyx_t_3 = __pyx_v_index; __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_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 472, __pyx_L29_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 472, __pyx_L29_error)
      }
      for (;;) {
        if (likely(!__pyx_t_7)) {
          if (likely(PyList_CheckExact(__pyx_t_3))) {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3);
              #if !CYTHON_ASSUME_SAFE_MACROS
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 472, __pyx_L29_error)
              #endif
              if (__pyx_t_6 >= __pyx_temp) break;
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_9); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 472, __pyx_L29_error)
            #else
            __pyx_t_9 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 472, __pyx_L29_error)
            __Pyx_GOTREF(__pyx_t_9);
            #endif
          } else {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3);
              #if !CYTHON_ASSUME_SAFE_MACROS
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 472, __pyx_L29_error)
              #endif
              if (__pyx_t_6 >= __pyx_temp) break;
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_9); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 472, __pyx_L29_error)
            #else
            __pyx_t_9 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 472, __pyx_L29_error)
            __Pyx_GOTREF(__pyx_t_9);
            #endif
          }
        } else {
          __pyx_t_9 = __pyx_t_7(__pyx_t_3);
          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, 472, __pyx_L29_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_9);
        }
        __Pyx_XDECREF_SET(__pyx_9genexpr14__pyx_v_key, __pyx_t_9);
        __pyx_t_9 = 0;
        __pyx_t_13 = PyObject_Length(__pyx_9genexpr14__pyx_v_key); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(0, 472, __pyx_L29_error)
        __pyx_t_2 = (__pyx_t_13 > 1);
        if (__pyx_t_2) {
          __Pyx_INCREF(__pyx_9genexpr14__pyx_v_key);
          __pyx_t_9 = __pyx_9genexpr14__pyx_v_key;
        } else {
          __pyx_t_10 = __Pyx_GetItemInt(__pyx_9genexpr14__pyx_v_key, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 472, __pyx_L29_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_9 = __pyx_t_10;
          __pyx_t_10 = 0;
        }
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_9))) __PYX_ERR(0, 472, __pyx_L29_error)
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_9genexpr14__pyx_v_key); __pyx_9genexpr14__pyx_v_key = 0;
      goto __pyx_L33_exit_scope;
      __pyx_L29_error:;
      __Pyx_XDECREF(__pyx_9genexpr14__pyx_v_key); __pyx_9genexpr14__pyx_v_key = 0;
      goto __pyx_L1_error;
      __pyx_L33_exit_scope:;
    } /* exit inner scope */
    __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "amplpy/dataframe.pxi":473
 *             index = zip(*[self._get_column(header).to_list() for header in index_names])
 *             index = [key if len(key) > 1 else key[0] for key in index]
 *             if index == []:             # <<<<<<<<<<<<<<
 *                 return pd.DataFrame(columns, index=None)
 *             else:
 */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 473, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyObject_RichCompare(__pyx_v_index, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 473, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 473, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_2) {

      /* "amplpy/dataframe.pxi":474
 *             index = [key if len(key) > 1 else key[0] for key in index]
 *             if index == []:
 *                 return pd.DataFrame(columns, index=None)             # <<<<<<<<<<<<<<
 *             else:
 *                 return pd.DataFrame(columns, index=index)
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pd); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 474, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_DataFrame); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 474, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_v_columns);
      __Pyx_GIVEREF(__pyx_v_columns);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_columns)) __PYX_ERR(0, 474, __pyx_L1_error);
      __pyx_t_9 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 474, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_index, Py_None) < 0) __PYX_ERR(0, 474, __pyx_L1_error)
      __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 474, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_r = __pyx_t_10;
      __pyx_t_10 = 0;
      goto __pyx_L0;

      /* "amplpy/dataframe.pxi":473
 *             index = zip(*[self._get_column(header).to_list() for header in index_names])
 *             index = [key if len(key) > 1 else key[0] for key in index]
 *             if index == []:             # <<<<<<<<<<<<<<
 *                 return pd.DataFrame(columns, index=None)
 *             else:
 */
    }

    /* "amplpy/dataframe.pxi":476
 *                 return pd.DataFrame(columns, index=None)
 *             else:
 *                 return pd.DataFrame(columns, index=index)             # <<<<<<<<<<<<<<
 * 
 *     @classmethod
 */
    /*else*/ {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_pd); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 476, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_DataFrame); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 476, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 476, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_v_columns);
      __Pyx_GIVEREF(__pyx_v_columns);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_columns)) __PYX_ERR(0, 476, __pyx_L1_error);
      __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 476, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_index, __pyx_v_index) < 0) __PYX_ERR(0, 476, __pyx_L1_error)
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_10, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 476, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;
    }
  }

  /* "amplpy/dataframe.pxi":453
 *             return lst
 * 
 *     def to_pandas(self, multi_index=True):             # <<<<<<<<<<<<<<
 *         """
 *         Return a pandas.DataFrame with the DataFrame data.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("_amplpy.DataFrame.to_pandas", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_nindices);
  __Pyx_XDECREF(__pyx_v_headers);
  __Pyx_XDECREF(__pyx_v_columns);
  __Pyx_XDECREF(__pyx_v_index_names);
  __Pyx_XDECREF(__pyx_v_index);
  __Pyx_XDECREF(__pyx_9genexpr11__pyx_v_header);
  __Pyx_XDECREF(__pyx_9genexpr12__pyx_v_header);
  __Pyx_XDECREF(__pyx_9genexpr13__pyx_v_header);
  __Pyx_XDECREF(__pyx_9genexpr14__pyx_v_key);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/dataframe.pxi":478
 *                 return pd.DataFrame(columns, index=index)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def from_dict(cls, dic, index_names=None, column_names=None):
 *         """
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_9DataFrame_39from_dict(PyObject *__pyx_v_cls, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_9DataFrame_38from_dict, "DataFrame.from_dict(cls, dic, index_names=None, column_names=None)\n\n        Create a :class:`~amplpy.DataFrame` from a dictionary.\n\n        Args:\n            dic: dictionary to load.\n            index_names: index names to use.\n            column_names: column names to use.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_9DataFrame_39from_dict = {"from_dict", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_9DataFrame_39from_dict, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_9DataFrame_38from_dict};
static PyObject *__pyx_pw_7_amplpy_9DataFrame_39from_dict(PyObject *__pyx_v_cls, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_dic = 0;
  PyObject *__pyx_v_index_names = 0;
  PyObject *__pyx_v_column_names = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("from_dict (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dic,&__pyx_n_s_index_names,&__pyx_n_s_column_names,0};

    /* "amplpy/dataframe.pxi":479
 * 
 *     @classmethod
 *     def from_dict(cls, dic, index_names=None, column_names=None):             # <<<<<<<<<<<<<<
 *         """
 *         Create a :class:`~amplpy.DataFrame` from a dictionary.
 */
    values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dic)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 478, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_index_names);
          if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 478, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_column_names);
          if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 478, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "from_dict") < 0)) __PYX_ERR(0, 478, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_dic = values[0];
    __pyx_v_index_names = values[1];
    __pyx_v_column_names = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("from_dict", 0, 1, 3, __pyx_nargs); __PYX_ERR(0, 478, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.DataFrame.from_dict", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_9DataFrame_38from_dict(((PyTypeObject*)__pyx_v_cls), __pyx_v_dic, __pyx_v_index_names, __pyx_v_column_names);

  /* "amplpy/dataframe.pxi":478
 *                 return pd.DataFrame(columns, index=index)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def from_dict(cls, dic, index_names=None, column_names=None):
 *         """
 */

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/dataframe.pxi":491
 *         assert len(dic) != 0
 * 
 *         def to_tuple(e):             # <<<<<<<<<<<<<<
 *             if isinstance(e, (tuple, list)):
 *                 return tuple(e)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_9DataFrame_9from_dict_1to_tuple(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7_amplpy_9DataFrame_9from_dict_1to_tuple = {"to_tuple", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_9DataFrame_9from_dict_1to_tuple, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7_amplpy_9DataFrame_9from_dict_1to_tuple(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_e = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_tuple (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_e,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_e)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 491, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "to_tuple") < 0)) __PYX_ERR(0, 491, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_e = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("to_tuple", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 491, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.DataFrame.from_dict.to_tuple", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_9DataFrame_9from_dict_to_tuple(__pyx_self, __pyx_v_e);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_9DataFrame_9from_dict_to_tuple(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_e) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_tuple", 1);

  /* "amplpy/dataframe.pxi":492
 * 
 *         def to_tuple(e):
 *             if isinstance(e, (tuple, list)):             # <<<<<<<<<<<<<<
 *                 return tuple(e)
 *             else:
 */
  __pyx_t_2 = PyTuple_Check(__pyx_v_e); 
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = PyList_Check(__pyx_v_e); 
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "amplpy/dataframe.pxi":493
 *         def to_tuple(e):
 *             if isinstance(e, (tuple, list)):
 *                 return tuple(e)             # <<<<<<<<<<<<<<
 *             else:
 *                 return (e,)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_PySequence_Tuple(__pyx_v_e); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 493, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "amplpy/dataframe.pxi":492
 * 
 *         def to_tuple(e):
 *             if isinstance(e, (tuple, list)):             # <<<<<<<<<<<<<<
 *                 return tuple(e)
 *             else:
 */
  }

  /* "amplpy/dataframe.pxi":495
 *                 return tuple(e)
 *             else:
 *                 return (e,)             # <<<<<<<<<<<<<<
 * 
 *         lst_index = list(map(to_tuple, dic.keys()))
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 495, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_e);
    __Pyx_GIVEREF(__pyx_v_e);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_e)) __PYX_ERR(0, 495, __pyx_L1_error);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
  }

  /* "amplpy/dataframe.pxi":491
 *         assert len(dic) != 0
 * 
 *         def to_tuple(e):             # <<<<<<<<<<<<<<
 *             if isinstance(e, (tuple, list)):
 *                 return tuple(e)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("_amplpy.DataFrame.from_dict.to_tuple", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7_amplpy_9DataFrame_9from_dict_4generator4(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "amplpy/dataframe.pxi":502
 *         assert index_names is None or nindices == len(index_names)
 *         assert column_names is None or ncolumns == len(column_names)
 *         assert all(len(k) == nindices for k in lst_index)             # <<<<<<<<<<<<<<
 *         assert all(len(v) == ncolumns for v in lst_columns)
 * 
 */

static PyObject *__pyx_pf_7_amplpy_9DataFrame_9from_dict_2genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) {
  struct __pyx_obj_7_amplpy___pyx_scope_struct_7_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_7_amplpy___pyx_scope_struct_7_genexpr *)__pyx_tp_new_7_amplpy___pyx_scope_struct_7_genexpr(__pyx_ptype_7_amplpy___pyx_scope_struct_7_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7_amplpy___pyx_scope_struct_7_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 502, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7_amplpy___pyx_scope_struct_6_from_dict *) __pyx_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope);
  __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7_amplpy_9DataFrame_9from_dict_4generator4, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_from_dict_locals_genexpr, __pyx_n_s_amplpy); if (unlikely(!gen)) __PYX_ERR(0, 502, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("_amplpy.DataFrame.from_dict.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_7_amplpy_9DataFrame_9from_dict_4generator4(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7_amplpy___pyx_scope_struct_7_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7_amplpy___pyx_scope_struct_7_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __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, 502, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 502, __pyx_L1_error) }
  __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = 0;
  for (;;) {
    {
      Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
      #if !CYTHON_ASSUME_SAFE_MACROS
      if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 502, __pyx_L1_error)
      #endif
      if (__pyx_t_2 >= __pyx_temp) break;
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 502, __pyx_L1_error)
    #else
    __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 502, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_k);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_k, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_4 = PyObject_Length(__pyx_cur_scope->__pyx_v_k); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 502, __pyx_L1_error)
    __pyx_t_5 = (!(__pyx_t_4 == __pyx_cur_scope->__pyx_outer_scope->__pyx_v_nindices));
    if (__pyx_t_5) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_False);
      __pyx_r = Py_False;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_True);
    __pyx_r = Py_True;
    goto __pyx_L0;
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

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

/* "amplpy/dataframe.pxi":503
 *         assert column_names is None or ncolumns == len(column_names)
 *         assert all(len(k) == nindices for k in lst_index)
 *         assert all(len(v) == ncolumns for v in lst_columns)             # <<<<<<<<<<<<<<
 * 
 *         index = zip(*lst_index)
 */

static PyObject *__pyx_pf_7_amplpy_9DataFrame_9from_dict_5genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) {
  struct __pyx_obj_7_amplpy___pyx_scope_struct_8_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_7_amplpy___pyx_scope_struct_8_genexpr *)__pyx_tp_new_7_amplpy___pyx_scope_struct_8_genexpr(__pyx_ptype_7_amplpy___pyx_scope_struct_8_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7_amplpy___pyx_scope_struct_8_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 503, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7_amplpy___pyx_scope_struct_6_from_dict *) __pyx_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope);
  __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7_amplpy_9DataFrame_9from_dict_7generator5, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_from_dict_locals_genexpr, __pyx_n_s_amplpy); if (unlikely(!gen)) __PYX_ERR(0, 503, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("_amplpy.DataFrame.from_dict.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_7_amplpy_9DataFrame_9from_dict_7generator5(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7_amplpy___pyx_scope_struct_8_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7_amplpy___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 = NULL;
  Py_ssize_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __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, 503, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 503, __pyx_L1_error) }
  __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = 0;
  for (;;) {
    {
      Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
      #if !CYTHON_ASSUME_SAFE_MACROS
      if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 503, __pyx_L1_error)
      #endif
      if (__pyx_t_2 >= __pyx_temp) break;
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 503, __pyx_L1_error)
    #else
    __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 503, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_v);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_v, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_4 = PyObject_Length(__pyx_cur_scope->__pyx_v_v); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 503, __pyx_L1_error)
    __pyx_t_5 = (!(__pyx_t_4 == __pyx_cur_scope->__pyx_outer_scope->__pyx_v_ncolumns));
    if (__pyx_t_5) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_False);
      __pyx_r = Py_False;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_True);
    __pyx_r = Py_True;
    goto __pyx_L0;
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

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

/* "amplpy/dataframe.pxi":478
 *                 return pd.DataFrame(columns, index=index)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def from_dict(cls, dic, index_names=None, column_names=None):
 *         """
 */

static PyObject *__pyx_pf_7_amplpy_9DataFrame_38from_dict(PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_dic, PyObject *__pyx_v_index_names, PyObject *__pyx_v_column_names) {
  struct __pyx_obj_7_amplpy___pyx_scope_struct_6_from_dict *__pyx_cur_scope;
  PyObject *__pyx_v_to_tuple = 0;
  PyObject *__pyx_v_lst_index = NULL;
  PyObject *__pyx_v_lst_columns = NULL;
  PyObject *__pyx_v_index = NULL;
  PyObject *__pyx_v_columns = NULL;
  PyObject *__pyx_gb_7_amplpy_9DataFrame_9from_dict_4generator4 = 0;
  PyObject *__pyx_gb_7_amplpy_9DataFrame_9from_dict_7generator5 = 0;
  Py_ssize_t __pyx_9genexpr17__pyx_v_i;
  Py_ssize_t __pyx_9genexpr18__pyx_v_i;
  PyObject *__pyx_9genexpr19__pyx_v_i = NULL;
  PyObject *__pyx_9genexpr19__pyx_v_cindex = NULL;
  PyObject *__pyx_9genexpr20__pyx_v_i = NULL;
  PyObject *__pyx_9genexpr20__pyx_v_column = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  unsigned int __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  int __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *(*__pyx_t_11)(PyObject *);
  PyObject *__pyx_t_12 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("from_dict", 0);
  __pyx_cur_scope = (struct __pyx_obj_7_amplpy___pyx_scope_struct_6_from_dict *)__pyx_tp_new_7_amplpy___pyx_scope_struct_6_from_dict(__pyx_ptype_7_amplpy___pyx_scope_struct_6_from_dict, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7_amplpy___pyx_scope_struct_6_from_dict *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 478, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __Pyx_INCREF(__pyx_v_index_names);
  __Pyx_INCREF(__pyx_v_column_names);

  /* "amplpy/dataframe.pxi":488
 *             column_names: column names to use.
 *         """
 *         assert isinstance(dic, dict)             # <<<<<<<<<<<<<<
 *         assert len(dic) != 0
 * 
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = PyDict_Check(__pyx_v_dic); 
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 488, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 488, __pyx_L1_error)
  #endif

  /* "amplpy/dataframe.pxi":489
 *         """
 *         assert isinstance(dic, dict)
 *         assert len(dic) != 0             # <<<<<<<<<<<<<<
 * 
 *         def to_tuple(e):
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_2 = PyObject_Length(__pyx_v_dic); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 489, __pyx_L1_error)
    __pyx_t_1 = (__pyx_t_2 != 0);
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 489, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 489, __pyx_L1_error)
  #endif

  /* "amplpy/dataframe.pxi":491
 *         assert len(dic) != 0
 * 
 *         def to_tuple(e):             # <<<<<<<<<<<<<<
 *             if isinstance(e, (tuple, list)):
 *                 return tuple(e)
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_9DataFrame_9from_dict_1to_tuple, 0, __pyx_n_s_from_dict_locals_to_tuple, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__19)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 491, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_to_tuple = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "amplpy/dataframe.pxi":497
 *                 return (e,)
 * 
 *         lst_index = list(map(to_tuple, dic.keys()))             # <<<<<<<<<<<<<<
 *         lst_columns = list(map(to_tuple, dic.values()))
 *         nindices, ncolumns = len(lst_index[0]), len(lst_columns[0])
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_dic, __pyx_n_s_keys); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 497, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  __pyx_t_6 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_6 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 497, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 497, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_to_tuple);
  __Pyx_GIVEREF(__pyx_v_to_tuple);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_to_tuple)) __PYX_ERR(0, 497, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3)) __PYX_ERR(0, 497, __pyx_L1_error);
  __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 497, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PySequence_ListKeepNew(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 497, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_lst_index = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "amplpy/dataframe.pxi":498
 * 
 *         lst_index = list(map(to_tuple, dic.keys()))
 *         lst_columns = list(map(to_tuple, dic.values()))             # <<<<<<<<<<<<<<
 *         nindices, ncolumns = len(lst_index[0]), len(lst_columns[0])
 *         assert index_names is None or nindices == len(index_names)
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dic, __pyx_n_s_values); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 498, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = NULL;
  __pyx_t_6 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_6 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
    __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 498, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 498, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_to_tuple);
  __Pyx_GIVEREF(__pyx_v_to_tuple);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_to_tuple)) __PYX_ERR(0, 498, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4)) __PYX_ERR(0, 498, __pyx_L1_error);
  __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 498, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PySequence_ListKeepNew(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 498, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_lst_columns = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "amplpy/dataframe.pxi":499
 *         lst_index = list(map(to_tuple, dic.keys()))
 *         lst_columns = list(map(to_tuple, dic.values()))
 *         nindices, ncolumns = len(lst_index[0]), len(lst_columns[0])             # <<<<<<<<<<<<<<
 *         assert index_names is None or nindices == len(index_names)
 *         assert column_names is None or ncolumns == len(column_names)
 */
  __pyx_t_3 = PyList_GET_ITEM(__pyx_v_lst_index, 0);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_2 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 499, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyList_GET_ITEM(__pyx_v_lst_columns, 0);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_7 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 499, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_cur_scope->__pyx_v_nindices = __pyx_t_2;
  __pyx_cur_scope->__pyx_v_ncolumns = __pyx_t_7;

  /* "amplpy/dataframe.pxi":500
 *         lst_columns = list(map(to_tuple, dic.values()))
 *         nindices, ncolumns = len(lst_index[0]), len(lst_columns[0])
 *         assert index_names is None or nindices == len(index_names)             # <<<<<<<<<<<<<<
 *         assert column_names is None or ncolumns == len(column_names)
 *         assert all(len(k) == nindices for k in lst_index)
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_8 = (__pyx_v_index_names == Py_None);
    if (!__pyx_t_8) {
    } else {
      __pyx_t_1 = __pyx_t_8;
      goto __pyx_L3_bool_binop_done;
    }
    __pyx_t_7 = PyObject_Length(__pyx_v_index_names); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 500, __pyx_L1_error)
    __pyx_t_8 = (__pyx_cur_scope->__pyx_v_nindices == __pyx_t_7);
    __pyx_t_1 = __pyx_t_8;
    __pyx_L3_bool_binop_done:;
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 500, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 500, __pyx_L1_error)
  #endif

  /* "amplpy/dataframe.pxi":501
 *         nindices, ncolumns = len(lst_index[0]), len(lst_columns[0])
 *         assert index_names is None or nindices == len(index_names)
 *         assert column_names is None or ncolumns == len(column_names)             # <<<<<<<<<<<<<<
 *         assert all(len(k) == nindices for k in lst_index)
 *         assert all(len(v) == ncolumns for v in lst_columns)
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_8 = (__pyx_v_column_names == Py_None);
    if (!__pyx_t_8) {
    } else {
      __pyx_t_1 = __pyx_t_8;
      goto __pyx_L5_bool_binop_done;
    }
    __pyx_t_7 = PyObject_Length(__pyx_v_column_names); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 501, __pyx_L1_error)
    __pyx_t_8 = (__pyx_cur_scope->__pyx_v_ncolumns == __pyx_t_7);
    __pyx_t_1 = __pyx_t_8;
    __pyx_L5_bool_binop_done:;
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 501, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 501, __pyx_L1_error)
  #endif

  /* "amplpy/dataframe.pxi":502
 *         assert index_names is None or nindices == len(index_names)
 *         assert column_names is None or ncolumns == len(column_names)
 *         assert all(len(k) == nindices for k in lst_index)             # <<<<<<<<<<<<<<
 *         assert all(len(v) == ncolumns for v in lst_columns)
 * 
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_3 = __pyx_pf_7_amplpy_9DataFrame_9from_dict_2genexpr(((PyObject*)__pyx_cur_scope), __pyx_v_lst_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 502, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_Generator_Next(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 502, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 502, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 502, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 502, __pyx_L1_error)
  #endif

  /* "amplpy/dataframe.pxi":503
 *         assert column_names is None or ncolumns == len(column_names)
 *         assert all(len(k) == nindices for k in lst_index)
 *         assert all(len(v) == ncolumns for v in lst_columns)             # <<<<<<<<<<<<<<
 * 
 *         index = zip(*lst_index)
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_4 = __pyx_pf_7_amplpy_9DataFrame_9from_dict_5genexpr(((PyObject*)__pyx_cur_scope), __pyx_v_lst_columns); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 503, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_Generator_Next(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 503, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 503, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 503, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 503, __pyx_L1_error)
  #endif

  /* "amplpy/dataframe.pxi":505
 *         assert all(len(v) == ncolumns for v in lst_columns)
 * 
 *         index = zip(*lst_index)             # <<<<<<<<<<<<<<
 *         columns = zip(*lst_columns)
 * 
 */
  __pyx_t_3 = PySequence_Tuple(__pyx_v_lst_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 505, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 505, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_index = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "amplpy/dataframe.pxi":506
 * 
 *         index = zip(*lst_index)
 *         columns = zip(*lst_columns)             # <<<<<<<<<<<<<<
 * 
 *         if index_names is None:
 */
  __pyx_t_4 = PySequence_Tuple(__pyx_v_lst_columns); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 506, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 506, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_columns = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "amplpy/dataframe.pxi":508
 *         columns = zip(*lst_columns)
 * 
 *         if index_names is None:             # <<<<<<<<<<<<<<
 *             index_names = [f"index{i}" for i in range(nindices)]
 * 
 */
  __pyx_t_1 = (__pyx_v_index_names == Py_None);
  if (__pyx_t_1) {

    /* "amplpy/dataframe.pxi":509
 * 
 *         if index_names is None:
 *             index_names = [f"index{i}" for i in range(nindices)]             # <<<<<<<<<<<<<<
 * 
 *         if column_names is None:
 */
    { /* enter inner scope */
      __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 509, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_7 = __pyx_cur_scope->__pyx_v_nindices;
      __pyx_t_2 = __pyx_t_7;
      for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_2; __pyx_t_9+=1) {
        __pyx_9genexpr17__pyx_v_i = __pyx_t_9;
        __pyx_t_4 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_9genexpr17__pyx_v_i, 0, ' ', 'd'); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 509, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_n_u_index, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 509, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 509, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      }
    } /* exit inner scope */
    __Pyx_DECREF_SET(__pyx_v_index_names, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "amplpy/dataframe.pxi":508
 *         columns = zip(*lst_columns)
 * 
 *         if index_names is None:             # <<<<<<<<<<<<<<
 *             index_names = [f"index{i}" for i in range(nindices)]
 * 
 */
  }

  /* "amplpy/dataframe.pxi":511
 *             index_names = [f"index{i}" for i in range(nindices)]
 * 
 *         if column_names is None:             # <<<<<<<<<<<<<<
 *             column_names = [f"value{i}" for i in range(ncolumns)]
 * 
 */
  __pyx_t_1 = (__pyx_v_column_names == Py_None);
  if (__pyx_t_1) {

    /* "amplpy/dataframe.pxi":512
 * 
 *         if column_names is None:
 *             column_names = [f"value{i}" for i in range(ncolumns)]             # <<<<<<<<<<<<<<
 * 
 *         index = [(index_names[i], cindex) for i, cindex in enumerate(zip(*lst_index))]
 */
    { /* enter inner scope */
      __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 512, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_7 = __pyx_cur_scope->__pyx_v_ncolumns;
      __pyx_t_2 = __pyx_t_7;
      for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_2; __pyx_t_9+=1) {
        __pyx_9genexpr18__pyx_v_i = __pyx_t_9;
        __pyx_t_5 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_9genexpr18__pyx_v_i, 0, ' ', 'd'); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 512, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_n_u_value, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 512, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 512, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }
    } /* exit inner scope */
    __Pyx_DECREF_SET(__pyx_v_column_names, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "amplpy/dataframe.pxi":511
 *             index_names = [f"index{i}" for i in range(nindices)]
 * 
 *         if column_names is None:             # <<<<<<<<<<<<<<
 *             column_names = [f"value{i}" for i in range(ncolumns)]
 * 
 */
  }

  /* "amplpy/dataframe.pxi":514
 *             column_names = [f"value{i}" for i in range(ncolumns)]
 * 
 *         index = [(index_names[i], cindex) for i, cindex in enumerate(zip(*lst_index))]             # <<<<<<<<<<<<<<
 *         columns = [
 *             (column_names[i], column) for i, column in enumerate(zip(*lst_columns))
 */
  { /* enter inner scope */
    __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 514, __pyx_L15_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_int_0);
    __pyx_t_4 = __pyx_int_0;
    __pyx_t_5 = PySequence_Tuple(__pyx_v_lst_index); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 514, __pyx_L15_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_5, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 514, __pyx_L15_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (likely(PyList_CheckExact(__pyx_t_10)) || PyTuple_CheckExact(__pyx_t_10)) {
      __pyx_t_5 = __pyx_t_10; __Pyx_INCREF(__pyx_t_5);
      __pyx_t_7 = 0;
      __pyx_t_11 = NULL;
    } else {
      __pyx_t_7 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_10); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 514, __pyx_L15_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 514, __pyx_L15_error)
    }
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    for (;;) {
      if (likely(!__pyx_t_11)) {
        if (likely(PyList_CheckExact(__pyx_t_5))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_5);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 514, __pyx_L15_error)
            #endif
            if (__pyx_t_7 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_10 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_10); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 514, __pyx_L15_error)
          #else
          __pyx_t_10 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 514, __pyx_L15_error)
          __Pyx_GOTREF(__pyx_t_10);
          #endif
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_5);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 514, __pyx_L15_error)
            #endif
            if (__pyx_t_7 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_10); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 514, __pyx_L15_error)
          #else
          __pyx_t_10 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 514, __pyx_L15_error)
          __Pyx_GOTREF(__pyx_t_10);
          #endif
        }
      } else {
        __pyx_t_10 = __pyx_t_11(__pyx_t_5);
        if (unlikely(!__pyx_t_10)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 514, __pyx_L15_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_10);
      }
      __Pyx_XDECREF_SET(__pyx_9genexpr19__pyx_v_cindex, __pyx_t_10);
      __pyx_t_10 = 0;
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_XDECREF_SET(__pyx_9genexpr19__pyx_v_i, __pyx_t_4);
      __pyx_t_10 = __Pyx_PyInt_AddObjC(__pyx_t_4, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 514, __pyx_L15_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_4);
      __pyx_t_4 = __pyx_t_10;
      __pyx_t_10 = 0;
      __pyx_t_10 = __Pyx_PyObject_GetItem(__pyx_v_index_names, __pyx_9genexpr19__pyx_v_i); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 514, __pyx_L15_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 514, __pyx_L15_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_GIVEREF(__pyx_t_10);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_10)) __PYX_ERR(0, 514, __pyx_L15_error);
      __Pyx_INCREF(__pyx_9genexpr19__pyx_v_cindex);
      __Pyx_GIVEREF(__pyx_9genexpr19__pyx_v_cindex);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_9genexpr19__pyx_v_cindex)) __PYX_ERR(0, 514, __pyx_L15_error);
      __pyx_t_10 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_12))) __PYX_ERR(0, 514, __pyx_L15_error)
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_9genexpr19__pyx_v_cindex); __pyx_9genexpr19__pyx_v_cindex = 0;
    __Pyx_XDECREF(__pyx_9genexpr19__pyx_v_i); __pyx_9genexpr19__pyx_v_i = 0;
    goto __pyx_L19_exit_scope;
    __pyx_L15_error:;
    __Pyx_XDECREF(__pyx_9genexpr19__pyx_v_cindex); __pyx_9genexpr19__pyx_v_cindex = 0;
    __Pyx_XDECREF(__pyx_9genexpr19__pyx_v_i); __pyx_9genexpr19__pyx_v_i = 0;
    goto __pyx_L1_error;
    __pyx_L19_exit_scope:;
  } /* exit inner scope */
  __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_3);
  __pyx_t_3 = 0;

  /* "amplpy/dataframe.pxi":515
 * 
 *         index = [(index_names[i], cindex) for i, cindex in enumerate(zip(*lst_index))]
 *         columns = [             # <<<<<<<<<<<<<<
 *             (column_names[i], column) for i, column in enumerate(zip(*lst_columns))
 *         ]
 */
  { /* enter inner scope */
    __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 515, __pyx_L22_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_int_0);
    __pyx_t_4 = __pyx_int_0;

    /* "amplpy/dataframe.pxi":516
 *         index = [(index_names[i], cindex) for i, cindex in enumerate(zip(*lst_index))]
 *         columns = [
 *             (column_names[i], column) for i, column in enumerate(zip(*lst_columns))             # <<<<<<<<<<<<<<
 *         ]
 *         return cls(index=index, columns=columns)
 */
    __pyx_t_5 = PySequence_Tuple(__pyx_v_lst_columns); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 516, __pyx_L22_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_12 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_5, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 516, __pyx_L22_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (likely(PyList_CheckExact(__pyx_t_12)) || PyTuple_CheckExact(__pyx_t_12)) {
      __pyx_t_5 = __pyx_t_12; __Pyx_INCREF(__pyx_t_5);
      __pyx_t_7 = 0;
      __pyx_t_11 = NULL;
    } else {
      __pyx_t_7 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_12); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 516, __pyx_L22_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 516, __pyx_L22_error)
    }
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    for (;;) {
      if (likely(!__pyx_t_11)) {
        if (likely(PyList_CheckExact(__pyx_t_5))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_5);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 516, __pyx_L22_error)
            #endif
            if (__pyx_t_7 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_12 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_12); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 516, __pyx_L22_error)
          #else
          __pyx_t_12 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 516, __pyx_L22_error)
          __Pyx_GOTREF(__pyx_t_12);
          #endif
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_5);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 516, __pyx_L22_error)
            #endif
            if (__pyx_t_7 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_12 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_12); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 516, __pyx_L22_error)
          #else
          __pyx_t_12 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 516, __pyx_L22_error)
          __Pyx_GOTREF(__pyx_t_12);
          #endif
        }
      } else {
        __pyx_t_12 = __pyx_t_11(__pyx_t_5);
        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, 516, __pyx_L22_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_12);
      }
      __Pyx_XDECREF_SET(__pyx_9genexpr20__pyx_v_column, __pyx_t_12);
      __pyx_t_12 = 0;
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_XDECREF_SET(__pyx_9genexpr20__pyx_v_i, __pyx_t_4);
      __pyx_t_12 = __Pyx_PyInt_AddObjC(__pyx_t_4, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 516, __pyx_L22_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_4);
      __pyx_t_4 = __pyx_t_12;
      __pyx_t_12 = 0;

      /* "amplpy/dataframe.pxi":515
 * 
 *         index = [(index_names[i], cindex) for i, cindex in enumerate(zip(*lst_index))]
 *         columns = [             # <<<<<<<<<<<<<<
 *             (column_names[i], column) for i, column in enumerate(zip(*lst_columns))
 *         ]
 */
      __pyx_t_12 = __Pyx_PyObject_GetItem(__pyx_v_column_names, __pyx_9genexpr20__pyx_v_i); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 516, __pyx_L22_error)
      __Pyx_GOTREF(__pyx_t_12);

      /* "amplpy/dataframe.pxi":516
 *         index = [(index_names[i], cindex) for i, cindex in enumerate(zip(*lst_index))]
 *         columns = [
 *             (column_names[i], column) for i, column in enumerate(zip(*lst_columns))             # <<<<<<<<<<<<<<
 *         ]
 *         return cls(index=index, columns=columns)
 */
      __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 516, __pyx_L22_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_GIVEREF(__pyx_t_12);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_12)) __PYX_ERR(0, 516, __pyx_L22_error);
      __Pyx_INCREF(__pyx_9genexpr20__pyx_v_column);
      __Pyx_GIVEREF(__pyx_9genexpr20__pyx_v_column);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_9genexpr20__pyx_v_column)) __PYX_ERR(0, 516, __pyx_L22_error);
      __pyx_t_12 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_10))) __PYX_ERR(0, 515, __pyx_L22_error)
      __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;
    __Pyx_XDECREF(__pyx_9genexpr20__pyx_v_column); __pyx_9genexpr20__pyx_v_column = 0;
    __Pyx_XDECREF(__pyx_9genexpr20__pyx_v_i); __pyx_9genexpr20__pyx_v_i = 0;
    goto __pyx_L26_exit_scope;
    __pyx_L22_error:;
    __Pyx_XDECREF(__pyx_9genexpr20__pyx_v_column); __pyx_9genexpr20__pyx_v_column = 0;
    __Pyx_XDECREF(__pyx_9genexpr20__pyx_v_i); __pyx_9genexpr20__pyx_v_i = 0;
    goto __pyx_L1_error;
    __pyx_L26_exit_scope:;
  } /* exit inner scope */
  __Pyx_DECREF_SET(__pyx_v_columns, __pyx_t_3);
  __pyx_t_3 = 0;

  /* "amplpy/dataframe.pxi":518
 *             (column_names[i], column) for i, column in enumerate(zip(*lst_columns))
 *         ]
 *         return cls(index=index, columns=columns)             # <<<<<<<<<<<<<<
 * 
 *     @classmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 518, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_index, __pyx_v_index) < 0) __PYX_ERR(0, 518, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_columns, __pyx_v_columns) < 0) __PYX_ERR(0, 518, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_v_cls), __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 518, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "amplpy/dataframe.pxi":478
 *                 return pd.DataFrame(columns, index=index)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def from_dict(cls, dic, index_names=None, column_names=None):
 *         """
 */

  /* 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_10);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("_amplpy.DataFrame.from_dict", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_to_tuple);
  __Pyx_XDECREF(__pyx_v_lst_index);
  __Pyx_XDECREF(__pyx_v_lst_columns);
  __Pyx_XDECREF(__pyx_v_index);
  __Pyx_XDECREF(__pyx_v_columns);
  __Pyx_XDECREF(__pyx_gb_7_amplpy_9DataFrame_9from_dict_4generator4);
  __Pyx_XDECREF(__pyx_gb_7_amplpy_9DataFrame_9from_dict_7generator5);
  __Pyx_XDECREF(__pyx_9genexpr19__pyx_v_i);
  __Pyx_XDECREF(__pyx_9genexpr19__pyx_v_cindex);
  __Pyx_XDECREF(__pyx_9genexpr20__pyx_v_i);
  __Pyx_XDECREF(__pyx_9genexpr20__pyx_v_column);
  __Pyx_XDECREF(__pyx_v_index_names);
  __Pyx_XDECREF(__pyx_v_column_names);
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/dataframe.pxi":520
 *         return cls(index=index, columns=columns)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def from_pandas(cls, df, index_names=None, indexarity=None):
 *         """
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_9DataFrame_41from_pandas(PyObject *__pyx_v_cls, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_9DataFrame_40from_pandas, "DataFrame.from_pandas(cls, df, index_names=None, indexarity=None)\n\n        Create a :class:`~amplpy.DataFrame` from a pandas DataFrame.\n\n        Args:\n            df: Pandas DataFrame to load.\n            index_names: index names to use.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_9DataFrame_41from_pandas = {"from_pandas", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_9DataFrame_41from_pandas, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_9DataFrame_40from_pandas};
static PyObject *__pyx_pw_7_amplpy_9DataFrame_41from_pandas(PyObject *__pyx_v_cls, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_df = 0;
  PyObject *__pyx_v_index_names = 0;
  PyObject *__pyx_v_indexarity = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("from_pandas (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_df,&__pyx_n_s_index_names,&__pyx_n_s_indexarity,0};

    /* "amplpy/dataframe.pxi":521
 * 
 *     @classmethod
 *     def from_pandas(cls, df, index_names=None, indexarity=None):             # <<<<<<<<<<<<<<
 *         """
 *         Create a :class:`~amplpy.DataFrame` from a pandas DataFrame.
 */
    values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_df)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 520, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_index_names);
          if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 520, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_indexarity);
          if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 520, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "from_pandas") < 0)) __PYX_ERR(0, 520, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_df = values[0];
    __pyx_v_index_names = values[1];
    __pyx_v_indexarity = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("from_pandas", 0, 1, 3, __pyx_nargs); __PYX_ERR(0, 520, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.DataFrame.from_pandas", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_9DataFrame_40from_pandas(((PyTypeObject*)__pyx_v_cls), __pyx_v_df, __pyx_v_index_names, __pyx_v_indexarity);

  /* "amplpy/dataframe.pxi":520
 *         return cls(index=index, columns=columns)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def from_pandas(cls, df, index_names=None, indexarity=None):
 *         """
 */

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_9DataFrame_40from_pandas(PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_df, PyObject *__pyx_v_index_names, PyObject *__pyx_v_indexarity) {
  PyObject *__pyx_v_keys = NULL;
  PyObject *__pyx_v_index = NULL;
  Py_ssize_t __pyx_v_i;
  PyObject *__pyx_v_columns = NULL;
  PyObject *__pyx_9genexpr21__pyx_v_key = NULL;
  PyObject *__pyx_9genexpr22__pyx_v_i = NULL;
  PyObject *__pyx_9genexpr22__pyx_v_cindex = NULL;
  PyObject *__pyx_9genexpr23__pyx_v_cname = 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;
  unsigned int __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *(*__pyx_t_9)(PyObject *);
  Py_ssize_t __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("from_pandas", 0);
  __Pyx_INCREF(__pyx_v_df);

  /* "amplpy/dataframe.pxi":529
 *             index_names: index names to use.
 *         """
 *         assert pd is not None             # <<<<<<<<<<<<<<
 *         if isinstance(df, pd.Series):
 *             df = pd.DataFrame(df)
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_pd); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 529, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = (__pyx_t_1 != Py_None);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_2)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 529, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 529, __pyx_L1_error)
  #endif

  /* "amplpy/dataframe.pxi":530
 *         """
 *         assert pd is not None
 *         if isinstance(df, pd.Series):             # <<<<<<<<<<<<<<
 *             df = pd.DataFrame(df)
 *         else:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_pd); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 530, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_Series); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 530, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_2 = PyObject_IsInstance(__pyx_v_df, __pyx_t_3); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 530, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_2) {

    /* "amplpy/dataframe.pxi":531
 *         assert pd is not None
 *         if isinstance(df, pd.Series):
 *             df = pd.DataFrame(df)             # <<<<<<<<<<<<<<
 *         else:
 *             assert isinstance(df, pd.DataFrame)
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_pd); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_DataFrame); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 531, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_df};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 531, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF_SET(__pyx_v_df, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "amplpy/dataframe.pxi":530
 *         """
 *         assert pd is not None
 *         if isinstance(df, pd.Series):             # <<<<<<<<<<<<<<
 *             df = pd.DataFrame(df)
 *         else:
 */
    goto __pyx_L3;
  }

  /* "amplpy/dataframe.pxi":533
 *             df = pd.DataFrame(df)
 *         else:
 *             assert isinstance(df, pd.DataFrame)             # <<<<<<<<<<<<<<
 *         if len(df) == 0:
 *             return cls(index=df.index.names, columns=df.columns.tolist())
 */
  /*else*/ {
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(__pyx_assertions_enabled())) {
      __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pd); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 533, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_DataFrame); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 533, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_2 = PyObject_IsInstance(__pyx_v_df, __pyx_t_4); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 533, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) {
        __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
        __PYX_ERR(0, 533, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(0, 533, __pyx_L1_error)
    #endif
  }
  __pyx_L3:;

  /* "amplpy/dataframe.pxi":534
 *         else:
 *             assert isinstance(df, pd.DataFrame)
 *         if len(df) == 0:             # <<<<<<<<<<<<<<
 *             return cls(index=df.index.names, columns=df.columns.tolist())
 *         if isinstance(df.index[0], tuple):
 */
  __pyx_t_6 = PyObject_Length(__pyx_v_df); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 534, __pyx_L1_error)
  __pyx_t_2 = (__pyx_t_6 == 0);
  if (__pyx_t_2) {

    /* "amplpy/dataframe.pxi":535
 *             assert isinstance(df, pd.DataFrame)
 *         if len(df) == 0:
 *             return cls(index=df.index.names, columns=df.columns.tolist())             # <<<<<<<<<<<<<<
 *         if isinstance(df.index[0], tuple):
 *             df.index = pd.MultiIndex.from_tuples(df.index.tolist())
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 535, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_df, __pyx_n_s_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 535, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_names); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 535, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_index, __pyx_t_1) < 0) __PYX_ERR(0, 535, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_df, __pyx_n_s_columns); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 535, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_tolist); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 535, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 535, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_columns, __pyx_t_1) < 0) __PYX_ERR(0, 535, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_v_cls), __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 535, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "amplpy/dataframe.pxi":534
 *         else:
 *             assert isinstance(df, pd.DataFrame)
 *         if len(df) == 0:             # <<<<<<<<<<<<<<
 *             return cls(index=df.index.names, columns=df.columns.tolist())
 *         if isinstance(df.index[0], tuple):
 */
  }

  /* "amplpy/dataframe.pxi":536
 *         if len(df) == 0:
 *             return cls(index=df.index.names, columns=df.columns.tolist())
 *         if isinstance(df.index[0], tuple):             # <<<<<<<<<<<<<<
 *             df.index = pd.MultiIndex.from_tuples(df.index.tolist())
 *         if indexarity == df.index.nlevels + 1:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_df, __pyx_n_s_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 536, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 536, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_2 = PyTuple_Check(__pyx_t_4); 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_2) {

    /* "amplpy/dataframe.pxi":537
 *             return cls(index=df.index.names, columns=df.columns.tolist())
 *         if isinstance(df.index[0], tuple):
 *             df.index = pd.MultiIndex.from_tuples(df.index.tolist())             # <<<<<<<<<<<<<<
 *         if indexarity == df.index.nlevels + 1:
 *             df = df.stack()
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_pd); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 537, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_MultiIndex); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 537, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_from_tuples); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 537, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_df, __pyx_n_s_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 537, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_tolist); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 537, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_8);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_8, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 537, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __pyx_t_8 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_7};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 537, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_df, __pyx_n_s_index, __pyx_t_4) < 0) __PYX_ERR(0, 537, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "amplpy/dataframe.pxi":536
 *         if len(df) == 0:
 *             return cls(index=df.index.names, columns=df.columns.tolist())
 *         if isinstance(df.index[0], tuple):             # <<<<<<<<<<<<<<
 *             df.index = pd.MultiIndex.from_tuples(df.index.tolist())
 *         if indexarity == df.index.nlevels + 1:
 */
  }

  /* "amplpy/dataframe.pxi":538
 *         if isinstance(df.index[0], tuple):
 *             df.index = pd.MultiIndex.from_tuples(df.index.tolist())
 *         if indexarity == df.index.nlevels + 1:             # <<<<<<<<<<<<<<
 *             df = df.stack()
 *             if isinstance(df, pd.Series):
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_df, __pyx_n_s_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 538, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_nlevels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 538, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 538, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_indexarity, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 538, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 538, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "amplpy/dataframe.pxi":539
 *             df.index = pd.MultiIndex.from_tuples(df.index.tolist())
 *         if indexarity == df.index.nlevels + 1:
 *             df = df.stack()             # <<<<<<<<<<<<<<
 *             if isinstance(df, pd.Series):
 *                 df = pd.DataFrame(df)
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_df, __pyx_n_s_stack); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 539, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 539, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF_SET(__pyx_v_df, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "amplpy/dataframe.pxi":540
 *         if indexarity == df.index.nlevels + 1:
 *             df = df.stack()
 *             if isinstance(df, pd.Series):             # <<<<<<<<<<<<<<
 *                 df = pd.DataFrame(df)
 *         if isinstance(df.index[0], tuple):
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_pd); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 540, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_Series); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 540, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_2 = PyObject_IsInstance(__pyx_v_df, __pyx_t_4); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 540, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_2) {

      /* "amplpy/dataframe.pxi":541
 *             df = df.stack()
 *             if isinstance(df, pd.Series):
 *                 df = pd.DataFrame(df)             # <<<<<<<<<<<<<<
 *         if isinstance(df.index[0], tuple):
 *             keys = df.index.tolist()
 */
      __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_pd); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 541, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_DataFrame); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 541, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = NULL;
      __pyx_t_5 = 0;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_5 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_df};
        __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 541, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF_SET(__pyx_v_df, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "amplpy/dataframe.pxi":540
 *         if indexarity == df.index.nlevels + 1:
 *             df = df.stack()
 *             if isinstance(df, pd.Series):             # <<<<<<<<<<<<<<
 *                 df = pd.DataFrame(df)
 *         if isinstance(df.index[0], tuple):
 */
    }

    /* "amplpy/dataframe.pxi":538
 *         if isinstance(df.index[0], tuple):
 *             df.index = pd.MultiIndex.from_tuples(df.index.tolist())
 *         if indexarity == df.index.nlevels + 1:             # <<<<<<<<<<<<<<
 *             df = df.stack()
 *             if isinstance(df, pd.Series):
 */
  }

  /* "amplpy/dataframe.pxi":542
 *             if isinstance(df, pd.Series):
 *                 df = pd.DataFrame(df)
 *         if isinstance(df.index[0], tuple):             # <<<<<<<<<<<<<<
 *             keys = df.index.tolist()
 *         else:
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_df, __pyx_n_s_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 542, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 542, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_2 = PyTuple_Check(__pyx_t_7); 
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (__pyx_t_2) {

    /* "amplpy/dataframe.pxi":543
 *                 df = pd.DataFrame(df)
 *         if isinstance(df.index[0], tuple):
 *             keys = df.index.tolist()             # <<<<<<<<<<<<<<
 *         else:
 *             keys = [(key,) for key in df.index]
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_df, __pyx_n_s_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 543, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_tolist); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 543, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
      __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 543, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __pyx_v_keys = __pyx_t_7;
    __pyx_t_7 = 0;

    /* "amplpy/dataframe.pxi":542
 *             if isinstance(df, pd.Series):
 *                 df = pd.DataFrame(df)
 *         if isinstance(df.index[0], tuple):             # <<<<<<<<<<<<<<
 *             keys = df.index.tolist()
 *         else:
 */
    goto __pyx_L8;
  }

  /* "amplpy/dataframe.pxi":545
 *             keys = df.index.tolist()
 *         else:
 *             keys = [(key,) for key in df.index]             # <<<<<<<<<<<<<<
 *         index = [(f"index{i}", cindex) for i, cindex in enumerate(zip(*keys))]
 *         if index_names is not None:
 */
  /*else*/ {
    { /* enter inner scope */
      __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 545, __pyx_L11_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_df, __pyx_n_s_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 545, __pyx_L11_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
        __pyx_t_4 = __pyx_t_1; __Pyx_INCREF(__pyx_t_4);
        __pyx_t_6 = 0;
        __pyx_t_9 = NULL;
      } else {
        __pyx_t_6 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 545, __pyx_L11_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 545, __pyx_L11_error)
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      for (;;) {
        if (likely(!__pyx_t_9)) {
          if (likely(PyList_CheckExact(__pyx_t_4))) {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4);
              #if !CYTHON_ASSUME_SAFE_MACROS
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 545, __pyx_L11_error)
              #endif
              if (__pyx_t_6 >= __pyx_temp) break;
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_1 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 545, __pyx_L11_error)
            #else
            __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 545, __pyx_L11_error)
            __Pyx_GOTREF(__pyx_t_1);
            #endif
          } else {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4);
              #if !CYTHON_ASSUME_SAFE_MACROS
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 545, __pyx_L11_error)
              #endif
              if (__pyx_t_6 >= __pyx_temp) break;
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 545, __pyx_L11_error)
            #else
            __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 545, __pyx_L11_error)
            __Pyx_GOTREF(__pyx_t_1);
            #endif
          }
        } else {
          __pyx_t_1 = __pyx_t_9(__pyx_t_4);
          if (unlikely(!__pyx_t_1)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(0, 545, __pyx_L11_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_1);
        }
        __Pyx_XDECREF_SET(__pyx_9genexpr21__pyx_v_key, __pyx_t_1);
        __pyx_t_1 = 0;
        __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 545, __pyx_L11_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_INCREF(__pyx_9genexpr21__pyx_v_key);
        __Pyx_GIVEREF(__pyx_9genexpr21__pyx_v_key);
        if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_9genexpr21__pyx_v_key)) __PYX_ERR(0, 545, __pyx_L11_error);
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_7, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 545, __pyx_L11_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_9genexpr21__pyx_v_key); __pyx_9genexpr21__pyx_v_key = 0;
      goto __pyx_L15_exit_scope;
      __pyx_L11_error:;
      __Pyx_XDECREF(__pyx_9genexpr21__pyx_v_key); __pyx_9genexpr21__pyx_v_key = 0;
      goto __pyx_L1_error;
      __pyx_L15_exit_scope:;
    } /* exit inner scope */
    __pyx_v_keys = __pyx_t_7;
    __pyx_t_7 = 0;
  }
  __pyx_L8:;

  /* "amplpy/dataframe.pxi":546
 *         else:
 *             keys = [(key,) for key in df.index]
 *         index = [(f"index{i}", cindex) for i, cindex in enumerate(zip(*keys))]             # <<<<<<<<<<<<<<
 *         if index_names is not None:
 *             assert len(index) == len(index_names)
 */
  { /* enter inner scope */
    __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 546, __pyx_L18_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_INCREF(__pyx_int_0);
    __pyx_t_4 = __pyx_int_0;
    __pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_v_keys); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 546, __pyx_L18_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_1, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 546, __pyx_L18_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (likely(PyList_CheckExact(__pyx_t_8)) || PyTuple_CheckExact(__pyx_t_8)) {
      __pyx_t_1 = __pyx_t_8; __Pyx_INCREF(__pyx_t_1);
      __pyx_t_6 = 0;
      __pyx_t_9 = NULL;
    } else {
      __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 546, __pyx_L18_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 546, __pyx_L18_error)
    }
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    for (;;) {
      if (likely(!__pyx_t_9)) {
        if (likely(PyList_CheckExact(__pyx_t_1))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 546, __pyx_L18_error)
            #endif
            if (__pyx_t_6 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_8 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 546, __pyx_L18_error)
          #else
          __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 546, __pyx_L18_error)
          __Pyx_GOTREF(__pyx_t_8);
          #endif
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 546, __pyx_L18_error)
            #endif
            if (__pyx_t_6 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 546, __pyx_L18_error)
          #else
          __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 546, __pyx_L18_error)
          __Pyx_GOTREF(__pyx_t_8);
          #endif
        }
      } else {
        __pyx_t_8 = __pyx_t_9(__pyx_t_1);
        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, 546, __pyx_L18_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_8);
      }
      __Pyx_XDECREF_SET(__pyx_9genexpr22__pyx_v_cindex, __pyx_t_8);
      __pyx_t_8 = 0;
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_XDECREF_SET(__pyx_9genexpr22__pyx_v_i, __pyx_t_4);
      __pyx_t_8 = __Pyx_PyInt_AddObjC(__pyx_t_4, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 546, __pyx_L18_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_4);
      __pyx_t_4 = __pyx_t_8;
      __pyx_t_8 = 0;
      __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_9genexpr22__pyx_v_i, __pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 546, __pyx_L18_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_n_u_index, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 546, __pyx_L18_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 546, __pyx_L18_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_3);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3)) __PYX_ERR(0, 546, __pyx_L18_error);
      __Pyx_INCREF(__pyx_9genexpr22__pyx_v_cindex);
      __Pyx_GIVEREF(__pyx_9genexpr22__pyx_v_cindex);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_9genexpr22__pyx_v_cindex)) __PYX_ERR(0, 546, __pyx_L18_error);
      __pyx_t_3 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_7, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 546, __pyx_L18_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_9genexpr22__pyx_v_cindex); __pyx_9genexpr22__pyx_v_cindex = 0;
    __Pyx_XDECREF(__pyx_9genexpr22__pyx_v_i); __pyx_9genexpr22__pyx_v_i = 0;
    goto __pyx_L22_exit_scope;
    __pyx_L18_error:;
    __Pyx_XDECREF(__pyx_9genexpr22__pyx_v_cindex); __pyx_9genexpr22__pyx_v_cindex = 0;
    __Pyx_XDECREF(__pyx_9genexpr22__pyx_v_i); __pyx_9genexpr22__pyx_v_i = 0;
    goto __pyx_L1_error;
    __pyx_L22_exit_scope:;
  } /* exit inner scope */
  __pyx_v_index = ((PyObject*)__pyx_t_7);
  __pyx_t_7 = 0;

  /* "amplpy/dataframe.pxi":547
 *             keys = [(key,) for key in df.index]
 *         index = [(f"index{i}", cindex) for i, cindex in enumerate(zip(*keys))]
 *         if index_names is not None:             # <<<<<<<<<<<<<<
 *             assert len(index) == len(index_names)
 *             for i in range(len(index)):
 */
  __pyx_t_2 = (__pyx_v_index_names != Py_None);
  if (__pyx_t_2) {

    /* "amplpy/dataframe.pxi":548
 *         index = [(f"index{i}", cindex) for i, cindex in enumerate(zip(*keys))]
 *         if index_names is not None:
 *             assert len(index) == len(index_names)             # <<<<<<<<<<<<<<
 *             for i in range(len(index)):
 *                 index[i] = (index_names[i], index[i][1])
 */
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(__pyx_assertions_enabled())) {
      __pyx_t_6 = __Pyx_PyList_GET_SIZE(__pyx_v_index); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 548, __pyx_L1_error)
      __pyx_t_10 = PyObject_Length(__pyx_v_index_names); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(0, 548, __pyx_L1_error)
      __pyx_t_2 = (__pyx_t_6 == __pyx_t_10);
      if (unlikely(!__pyx_t_2)) {
        __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
        __PYX_ERR(0, 548, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(0, 548, __pyx_L1_error)
    #endif

    /* "amplpy/dataframe.pxi":549
 *         if index_names is not None:
 *             assert len(index) == len(index_names)
 *             for i in range(len(index)):             # <<<<<<<<<<<<<<
 *                 index[i] = (index_names[i], index[i][1])
 *         columns = [(str(cname), df[cname].tolist()) for cname in df.columns.tolist()]
 */
    __pyx_t_10 = __Pyx_PyList_GET_SIZE(__pyx_v_index); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(0, 549, __pyx_L1_error)
    __pyx_t_6 = __pyx_t_10;
    for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_6; __pyx_t_11+=1) {
      __pyx_v_i = __pyx_t_11;

      /* "amplpy/dataframe.pxi":550
 *             assert len(index) == len(index_names)
 *             for i in range(len(index)):
 *                 index[i] = (index_names[i], index[i][1])             # <<<<<<<<<<<<<<
 *         columns = [(str(cname), df[cname].tolist()) for cname in df.columns.tolist()]
 *         return cls(index=index, columns=columns)
 */
      __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_index_names, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 550, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_4 = __Pyx_GetItemInt(PyList_GET_ITEM(__pyx_v_index, __pyx_v_i), 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 550, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 550, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_7);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_7)) __PYX_ERR(0, 550, __pyx_L1_error);
      __Pyx_GIVEREF(__pyx_t_4);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4)) __PYX_ERR(0, 550, __pyx_L1_error);
      __pyx_t_7 = 0;
      __pyx_t_4 = 0;
      if (unlikely((__Pyx_SetItemInt(__pyx_v_index, __pyx_v_i, __pyx_t_1, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 0, 0) < 0))) __PYX_ERR(0, 550, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }

    /* "amplpy/dataframe.pxi":547
 *             keys = [(key,) for key in df.index]
 *         index = [(f"index{i}", cindex) for i, cindex in enumerate(zip(*keys))]
 *         if index_names is not None:             # <<<<<<<<<<<<<<
 *             assert len(index) == len(index_names)
 *             for i in range(len(index)):
 */
  }

  /* "amplpy/dataframe.pxi":551
 *             for i in range(len(index)):
 *                 index[i] = (index_names[i], index[i][1])
 *         columns = [(str(cname), df[cname].tolist()) for cname in df.columns.tolist()]             # <<<<<<<<<<<<<<
 *         return cls(index=index, columns=columns)
 * 
 */
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 551, __pyx_L28_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_df, __pyx_n_s_columns); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 551, __pyx_L28_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_tolist); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 551, __pyx_L28_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (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);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 551, __pyx_L28_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
      __pyx_t_8 = __pyx_t_4; __Pyx_INCREF(__pyx_t_8);
      __pyx_t_10 = 0;
      __pyx_t_9 = NULL;
    } else {
      __pyx_t_10 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 551, __pyx_L28_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 551, __pyx_L28_error)
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    for (;;) {
      if (likely(!__pyx_t_9)) {
        if (likely(PyList_CheckExact(__pyx_t_8))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_8);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 551, __pyx_L28_error)
            #endif
            if (__pyx_t_10 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_4 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_10); __Pyx_INCREF(__pyx_t_4); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 551, __pyx_L28_error)
          #else
          __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_8, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 551, __pyx_L28_error)
          __Pyx_GOTREF(__pyx_t_4);
          #endif
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_8);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 551, __pyx_L28_error)
            #endif
            if (__pyx_t_10 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_10); __Pyx_INCREF(__pyx_t_4); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 551, __pyx_L28_error)
          #else
          __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_8, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 551, __pyx_L28_error)
          __Pyx_GOTREF(__pyx_t_4);
          #endif
        }
      } else {
        __pyx_t_4 = __pyx_t_9(__pyx_t_8);
        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, 551, __pyx_L28_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_4);
      }
      __Pyx_XDECREF_SET(__pyx_9genexpr23__pyx_v_cname, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_Unicode(__pyx_9genexpr23__pyx_v_cname); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 551, __pyx_L28_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_df, __pyx_9genexpr23__pyx_v_cname); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 551, __pyx_L28_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_tolist); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 551, __pyx_L28_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = NULL;
      __pyx_t_5 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_12))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_12);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_12, function);
          __pyx_t_5 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
        __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 551, __pyx_L28_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }
      __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 551, __pyx_L28_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_GIVEREF(__pyx_t_4);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_4)) __PYX_ERR(0, 551, __pyx_L28_error);
      __Pyx_GIVEREF(__pyx_t_7);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_7)) __PYX_ERR(0, 551, __pyx_L28_error);
      __pyx_t_4 = 0;
      __pyx_t_7 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_12))) __PYX_ERR(0, 551, __pyx_L28_error)
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    }
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_9genexpr23__pyx_v_cname); __pyx_9genexpr23__pyx_v_cname = 0;
    goto __pyx_L32_exit_scope;
    __pyx_L28_error:;
    __Pyx_XDECREF(__pyx_9genexpr23__pyx_v_cname); __pyx_9genexpr23__pyx_v_cname = 0;
    goto __pyx_L1_error;
    __pyx_L32_exit_scope:;
  } /* exit inner scope */
  __pyx_v_columns = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "amplpy/dataframe.pxi":552
 *                 index[i] = (index_names[i], index[i][1])
 *         columns = [(str(cname), df[cname].tolist()) for cname in df.columns.tolist()]
 *         return cls(index=index, columns=columns)             # <<<<<<<<<<<<<<
 * 
 *     @classmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 552, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_index, __pyx_v_index) < 0) __PYX_ERR(0, 552, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_columns, __pyx_v_columns) < 0) __PYX_ERR(0, 552, __pyx_L1_error)
  __pyx_t_8 = __Pyx_PyObject_Call(((PyObject *)__pyx_v_cls), __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 552, __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;

  /* "amplpy/dataframe.pxi":520
 *         return cls(index=index, columns=columns)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def from_pandas(cls, df, index_names=None, indexarity=None):
 *         """
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("_amplpy.DataFrame.from_pandas", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_keys);
  __Pyx_XDECREF(__pyx_v_index);
  __Pyx_XDECREF(__pyx_v_columns);
  __Pyx_XDECREF(__pyx_9genexpr21__pyx_v_key);
  __Pyx_XDECREF(__pyx_9genexpr22__pyx_v_i);
  __Pyx_XDECREF(__pyx_9genexpr22__pyx_v_cindex);
  __Pyx_XDECREF(__pyx_9genexpr23__pyx_v_cname);
  __Pyx_XDECREF(__pyx_v_df);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/dataframe.pxi":554
 *         return cls(index=index, columns=columns)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def from_numpy(cls, data):
 *         """
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_9DataFrame_43from_numpy(PyObject *__pyx_v_cls, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_9DataFrame_42from_numpy, "DataFrame.from_numpy(cls, data)\n\n        Create a :class:`~amplpy.DataFrame` from a numpy array or matrix.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_9DataFrame_43from_numpy = {"from_numpy", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_9DataFrame_43from_numpy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_9DataFrame_42from_numpy};
static PyObject *__pyx_pw_7_amplpy_9DataFrame_43from_numpy(PyObject *__pyx_v_cls, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_data = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("from_numpy (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 554, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "from_numpy") < 0)) __PYX_ERR(0, 554, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_data = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("from_numpy", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 554, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.DataFrame.from_numpy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_9DataFrame_42from_numpy(((PyTypeObject*)__pyx_v_cls), __pyx_v_data);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_9DataFrame_42from_numpy(PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_data) {
  PyObject *__pyx_v_index = NULL;
  PyObject *__pyx_v_columns = NULL;
  PyObject *__pyx_9genexpr24__pyx_v_i = NULL;
  PyObject *__pyx_9genexpr24__pyx_v_col = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  unsigned int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *(*__pyx_t_9)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("from_numpy", 1);

  /* "amplpy/dataframe.pxi":559
 *         Create a :class:`~amplpy.DataFrame` from a numpy array or matrix.
 *         """
 *         assert np is not None             # <<<<<<<<<<<<<<
 *         if isinstance(data, np.ndarray):
 *             index = []
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 559, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = (__pyx_t_1 != Py_None);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_2)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 559, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 559, __pyx_L1_error)
  #endif

  /* "amplpy/dataframe.pxi":560
 *         """
 *         assert np is not None
 *         if isinstance(data, np.ndarray):             # <<<<<<<<<<<<<<
 *             index = []
 *             if len(data.shape) == 1:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 560, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ndarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 560, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_2 = PyObject_IsInstance(__pyx_v_data, __pyx_t_3); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 560, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (likely(__pyx_t_2)) {

    /* "amplpy/dataframe.pxi":561
 *         assert np is not None
 *         if isinstance(data, np.ndarray):
 *             index = []             # <<<<<<<<<<<<<<
 *             if len(data.shape) == 1:
 *                 columns = [("value", data.tolist())]
 */
    __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 561, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_index = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "amplpy/dataframe.pxi":562
 *         if isinstance(data, np.ndarray):
 *             index = []
 *             if len(data.shape) == 1:             # <<<<<<<<<<<<<<
 *                 columns = [("value", data.tolist())]
 *             elif len(data.shape) == 2:
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 562, __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, 562, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_2 = (__pyx_t_4 == 1);
    if (__pyx_t_2) {

      /* "amplpy/dataframe.pxi":563
 *             index = []
 *             if len(data.shape) == 1:
 *                 columns = [("value", data.tolist())]             # <<<<<<<<<<<<<<
 *             elif len(data.shape) == 2:
 *                 columns = [(f"c{i}", col) for i, col in enumerate(zip(*data.tolist()))]
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_tolist); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 563, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = NULL;
      __pyx_t_6 = 0;
      #if CYTHON_UNPACK_METHODS
      if (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_6 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
        __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6);
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 563, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      }
      __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 563, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_n_u_value);
      __Pyx_GIVEREF(__pyx_n_u_value);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_n_u_value)) __PYX_ERR(0, 563, __pyx_L1_error);
      __Pyx_GIVEREF(__pyx_t_3);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3)) __PYX_ERR(0, 563, __pyx_L1_error);
      __pyx_t_3 = 0;
      __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 563, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 563, __pyx_L1_error);
      __pyx_t_1 = 0;
      __pyx_v_columns = ((PyObject*)__pyx_t_3);
      __pyx_t_3 = 0;

      /* "amplpy/dataframe.pxi":562
 *         if isinstance(data, np.ndarray):
 *             index = []
 *             if len(data.shape) == 1:             # <<<<<<<<<<<<<<
 *                 columns = [("value", data.tolist())]
 *             elif len(data.shape) == 2:
 */
      goto __pyx_L4;
    }

    /* "amplpy/dataframe.pxi":564
 *             if len(data.shape) == 1:
 *                 columns = [("value", data.tolist())]
 *             elif len(data.shape) == 2:             # <<<<<<<<<<<<<<
 *                 columns = [(f"c{i}", col) for i, col in enumerate(zip(*data.tolist()))]
 *             else:
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 564, __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, 564, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_2 = (__pyx_t_4 == 2);
    if (likely(__pyx_t_2)) {

      /* "amplpy/dataframe.pxi":565
 *                 columns = [("value", data.tolist())]
 *             elif len(data.shape) == 2:
 *                 columns = [(f"c{i}", col) for i, col in enumerate(zip(*data.tolist()))]             # <<<<<<<<<<<<<<
 *             else:
 *                 raise TypeError
 */
      { /* enter inner scope */
        __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 565, __pyx_L7_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_INCREF(__pyx_int_0);
        __pyx_t_1 = __pyx_int_0;
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_tolist); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 565, __pyx_L7_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_8 = NULL;
        __pyx_t_6 = 0;
        #if CYTHON_UNPACK_METHODS
        if (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_6 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_8, NULL};
          __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6);
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 565, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        }
        __pyx_t_7 = __Pyx_PySequence_Tuple(__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 565, __pyx_L7_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 565, __pyx_L7_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        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_4 = 0;
          __pyx_t_9 = NULL;
        } else {
          __pyx_t_4 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 565, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 565, __pyx_L7_error)
        }
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        for (;;) {
          if (likely(!__pyx_t_9)) {
            if (likely(PyList_CheckExact(__pyx_t_7))) {
              {
                Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_7);
                #if !CYTHON_ASSUME_SAFE_MACROS
                if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 565, __pyx_L7_error)
                #endif
                if (__pyx_t_4 >= __pyx_temp) break;
              }
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_5 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_4); __Pyx_INCREF(__pyx_t_5); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 565, __pyx_L7_error)
              #else
              __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 565, __pyx_L7_error)
              __Pyx_GOTREF(__pyx_t_5);
              #endif
            } else {
              {
                Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_7);
                #if !CYTHON_ASSUME_SAFE_MACROS
                if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 565, __pyx_L7_error)
                #endif
                if (__pyx_t_4 >= __pyx_temp) break;
              }
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_4); __Pyx_INCREF(__pyx_t_5); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 565, __pyx_L7_error)
              #else
              __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 565, __pyx_L7_error)
              __Pyx_GOTREF(__pyx_t_5);
              #endif
            }
          } else {
            __pyx_t_5 = __pyx_t_9(__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, 565, __pyx_L7_error)
              }
              break;
            }
            __Pyx_GOTREF(__pyx_t_5);
          }
          __Pyx_XDECREF_SET(__pyx_9genexpr24__pyx_v_col, __pyx_t_5);
          __pyx_t_5 = 0;
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_XDECREF_SET(__pyx_9genexpr24__pyx_v_i, __pyx_t_1);
          __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 565, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_1);
          __pyx_t_1 = __pyx_t_5;
          __pyx_t_5 = 0;
          __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_9genexpr24__pyx_v_i, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 565, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_8 = __Pyx_PyUnicode_Concat(__pyx_n_u_c, __pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 565, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 565, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_8);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_8)) __PYX_ERR(0, 565, __pyx_L7_error);
          __Pyx_INCREF(__pyx_9genexpr24__pyx_v_col);
          __Pyx_GIVEREF(__pyx_9genexpr24__pyx_v_col);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_9genexpr24__pyx_v_col)) __PYX_ERR(0, 565, __pyx_L7_error);
          __pyx_t_8 = 0;
          if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 565, __pyx_L7_error)
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_9genexpr24__pyx_v_col); __pyx_9genexpr24__pyx_v_col = 0;
        __Pyx_XDECREF(__pyx_9genexpr24__pyx_v_i); __pyx_9genexpr24__pyx_v_i = 0;
        goto __pyx_L11_exit_scope;
        __pyx_L7_error:;
        __Pyx_XDECREF(__pyx_9genexpr24__pyx_v_col); __pyx_9genexpr24__pyx_v_col = 0;
        __Pyx_XDECREF(__pyx_9genexpr24__pyx_v_i); __pyx_9genexpr24__pyx_v_i = 0;
        goto __pyx_L1_error;
        __pyx_L11_exit_scope:;
      } /* exit inner scope */
      __pyx_v_columns = ((PyObject*)__pyx_t_3);
      __pyx_t_3 = 0;

      /* "amplpy/dataframe.pxi":564
 *             if len(data.shape) == 1:
 *                 columns = [("value", data.tolist())]
 *             elif len(data.shape) == 2:             # <<<<<<<<<<<<<<
 *                 columns = [(f"c{i}", col) for i, col in enumerate(zip(*data.tolist()))]
 *             else:
 */
      goto __pyx_L4;
    }

    /* "amplpy/dataframe.pxi":567
 *                 columns = [(f"c{i}", col) for i, col in enumerate(zip(*data.tolist()))]
 *             else:
 *                 raise TypeError             # <<<<<<<<<<<<<<
 *         else:
 *             raise TypeError
 */
    /*else*/ {
      __Pyx_Raise(__pyx_builtin_TypeError, 0, 0, 0);
      __PYX_ERR(0, 567, __pyx_L1_error)
    }
    __pyx_L4:;

    /* "amplpy/dataframe.pxi":560
 *         """
 *         assert np is not None
 *         if isinstance(data, np.ndarray):             # <<<<<<<<<<<<<<
 *             index = []
 *             if len(data.shape) == 1:
 */
    goto __pyx_L3;
  }

  /* "amplpy/dataframe.pxi":569
 *                 raise TypeError
 *         else:
 *             raise TypeError             # <<<<<<<<<<<<<<
 *         return cls(index=index, columns=columns)
 * 
 */
  /*else*/ {
    __Pyx_Raise(__pyx_builtin_TypeError, 0, 0, 0);
    __PYX_ERR(0, 569, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "amplpy/dataframe.pxi":570
 *         else:
 *             raise TypeError
 *         return cls(index=index, columns=columns)             # <<<<<<<<<<<<<<
 * 
 *     @classmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 570, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_index, __pyx_v_index) < 0) __PYX_ERR(0, 570, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_columns, __pyx_v_columns) < 0) __PYX_ERR(0, 570, __pyx_L1_error)
  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_v_cls), __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 570, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "amplpy/dataframe.pxi":554
 *         return cls(index=index, columns=columns)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def from_numpy(cls, data):
 *         """
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("_amplpy.DataFrame.from_numpy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_index);
  __Pyx_XDECREF(__pyx_v_columns);
  __Pyx_XDECREF(__pyx_9genexpr24__pyx_v_i);
  __Pyx_XDECREF(__pyx_9genexpr24__pyx_v_col);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/dataframe.pxi":572
 *         return cls(index=index, columns=columns)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def _from_data_frame_ref(cls, df_ref):
 *         return cls(None, None, _impl=df_ref)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_9DataFrame_45_from_data_frame_ref(PyObject *__pyx_v_cls, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_9DataFrame_44_from_data_frame_ref, "DataFrame._from_data_frame_ref(cls, df_ref)");
static PyMethodDef __pyx_mdef_7_amplpy_9DataFrame_45_from_data_frame_ref = {"_from_data_frame_ref", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_9DataFrame_45_from_data_frame_ref, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_9DataFrame_44_from_data_frame_ref};
static PyObject *__pyx_pw_7_amplpy_9DataFrame_45_from_data_frame_ref(PyObject *__pyx_v_cls, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_df_ref = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_from_data_frame_ref (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_df_ref,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_df_ref)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 572, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_from_data_frame_ref") < 0)) __PYX_ERR(0, 572, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_df_ref = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_from_data_frame_ref", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 572, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.DataFrame._from_data_frame_ref", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_9DataFrame_44_from_data_frame_ref(((PyTypeObject*)__pyx_v_cls), __pyx_v_df_ref);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_9DataFrame_44_from_data_frame_ref(PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_df_ref) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_from_data_frame_ref", 1);

  /* "amplpy/dataframe.pxi":574
 *     @classmethod
 *     def _from_data_frame_ref(cls, df_ref):
 *         return cls(None, None, _impl=df_ref)             # <<<<<<<<<<<<<<
 * 
 *     # Aliases
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 574, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_impl, __pyx_v_df_ref) < 0) __PYX_ERR(0, 574, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_v_cls), __pyx_tuple__20, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 574, __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;

  /* "amplpy/dataframe.pxi":572
 *         return cls(index=index, columns=columns)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def _from_data_frame_ref(cls, df_ref):
 *         return cls(None, None, _impl=df_ref)
 */

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

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_9DataFrame_47__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_9DataFrame_46__reduce_cython__, "DataFrame.__reduce_cython__(self)");
static PyMethodDef __pyx_mdef_7_amplpy_9DataFrame_47__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_9DataFrame_47__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_9DataFrame_46__reduce_cython__};
static PyObject *__pyx_pw_7_amplpy_9DataFrame_47__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_9DataFrame_46__reduce_cython__(((struct __pyx_obj_7_amplpy_DataFrame *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_9DataFrame_46__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7_amplpy_DataFrame *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 1);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(8, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */

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

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_9DataFrame_49__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_9DataFrame_48__setstate_cython__, "DataFrame.__setstate_cython__(self, __pyx_state)");
static PyMethodDef __pyx_mdef_7_amplpy_9DataFrame_49__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_9DataFrame_49__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_9DataFrame_48__setstate_cython__};
static PyObject *__pyx_pw_7_amplpy_9DataFrame_49__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 3, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(8, 3, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(8, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.DataFrame.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_9DataFrame_48__setstate_cython__(((struct __pyx_obj_7_amplpy_DataFrame *)__pyx_v_self), __pyx_v___pyx_state);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_9DataFrame_48__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7_amplpy_DataFrame *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 1);

  /* "(tree fragment)":4
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"             # <<<<<<<<<<<<<<
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(8, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */

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

/* "amplpy/entity.pxi":42
 * 
 *     @staticmethod
 *     cdef create(campl.AMPL* ampl_c, char *name, campl.AMPL_TUPLE* index, object parent):             # <<<<<<<<<<<<<<
 *         cdef campl.AMPL_ERRORINFO* errorinfo
 *         cdef campl.AMPL_RETCODE rc
 */

static PyObject *__pyx_f_7_amplpy_6Entity_create(AMPL *__pyx_v_ampl_c, char *__pyx_v_name, AMPL_TUPLE *__pyx_v_index, PyObject *__pyx_v_parent) {
  AMPL_ERRORINFO *__pyx_v_errorinfo;
  AMPL_RETCODE __pyx_v_rc;
  AMPL_ENTITYTYPE __pyx_v_entitytype;
  struct __pyx_obj_7_amplpy_Entity *__pyx_v_entity = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("create", 1);

  /* "amplpy/entity.pxi":46
 *         cdef campl.AMPL_RETCODE rc
 *         cdef campl.AMPL_ENTITYTYPE entitytype
 *         errorinfo = campl.AMPL_EntityGetType(ampl_c, name, &entitytype)             # <<<<<<<<<<<<<<
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:
 */
  __pyx_v_errorinfo = AMPL_EntityGetType(__pyx_v_ampl_c, __pyx_v_name, (&__pyx_v_entitytype));

  /* "amplpy/entity.pxi":47
 *         cdef campl.AMPL_ENTITYTYPE entitytype
 *         errorinfo = campl.AMPL_EntityGetType(ampl_c, name, &entitytype)
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)             # <<<<<<<<<<<<<<
 *         if rc != campl.AMPL_OK:
 *             free(name)
 */
  __pyx_v_rc = AMPL_ErrorInfoGetError(__pyx_v_errorinfo);

  /* "amplpy/entity.pxi":48
 *         errorinfo = campl.AMPL_EntityGetType(ampl_c, name, &entitytype)
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:             # <<<<<<<<<<<<<<
 *             free(name)
 *             PY_AMPL_CALL(errorinfo)
 */
  __pyx_t_1 = (__pyx_v_rc != AMPL_OK);
  if (__pyx_t_1) {

    /* "amplpy/entity.pxi":49
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:
 *             free(name)             # <<<<<<<<<<<<<<
 *             PY_AMPL_CALL(errorinfo)
 *         entity = Entity()
 */
    free(__pyx_v_name);

    /* "amplpy/entity.pxi":50
 *         if rc != campl.AMPL_OK:
 *             free(name)
 *             PY_AMPL_CALL(errorinfo)             # <<<<<<<<<<<<<<
 *         entity = Entity()
 *         entity._c_ampl = ampl_c
 */
    __pyx_t_2 = __pyx_f_7_amplpy_PY_AMPL_CALL(__pyx_v_errorinfo); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 50, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "amplpy/entity.pxi":48
 *         errorinfo = campl.AMPL_EntityGetType(ampl_c, name, &entitytype)
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:             # <<<<<<<<<<<<<<
 *             free(name)
 *             PY_AMPL_CALL(errorinfo)
 */
  }

  /* "amplpy/entity.pxi":51
 *             free(name)
 *             PY_AMPL_CALL(errorinfo)
 *         entity = Entity()             # <<<<<<<<<<<<<<
 *         entity._c_ampl = ampl_c
 *         entity._name = name
 */
  __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_7_amplpy_Entity)); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 51, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_entity = ((struct __pyx_obj_7_amplpy_Entity *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "amplpy/entity.pxi":52
 *             PY_AMPL_CALL(errorinfo)
 *         entity = Entity()
 *         entity._c_ampl = ampl_c             # <<<<<<<<<<<<<<
 *         entity._name = name
 *         entity._index = index
 */
  __pyx_v_entity->_c_ampl = __pyx_v_ampl_c;

  /* "amplpy/entity.pxi":53
 *         entity = Entity()
 *         entity._c_ampl = ampl_c
 *         entity._name = name             # <<<<<<<<<<<<<<
 *         entity._index = index
 *         entity.wrap_function = entitytype
 */
  __pyx_v_entity->_name = __pyx_v_name;

  /* "amplpy/entity.pxi":54
 *         entity._c_ampl = ampl_c
 *         entity._name = name
 *         entity._index = index             # <<<<<<<<<<<<<<
 *         entity.wrap_function = entitytype
 *         entity._entity = parent
 */
  __pyx_v_entity->_index = __pyx_v_index;

  /* "amplpy/entity.pxi":55
 *         entity._name = name
 *         entity._index = index
 *         entity.wrap_function = entitytype             # <<<<<<<<<<<<<<
 *         entity._entity = parent
 *         if entity._entity is not None:
 */
  __pyx_v_entity->wrap_function = __pyx_v_entitytype;

  /* "amplpy/entity.pxi":56
 *         entity._index = index
 *         entity.wrap_function = entitytype
 *         entity._entity = parent             # <<<<<<<<<<<<<<
 *         if entity._entity is not None:
 *             Py_INCREF(entity._entity)
 */
  __Pyx_INCREF(__pyx_v_parent);
  __Pyx_GIVEREF(__pyx_v_parent);
  __Pyx_GOTREF(__pyx_v_entity->_entity);
  __Pyx_DECREF(__pyx_v_entity->_entity);
  __pyx_v_entity->_entity = __pyx_v_parent;

  /* "amplpy/entity.pxi":57
 *         entity.wrap_function = entitytype
 *         entity._entity = parent
 *         if entity._entity is not None:             # <<<<<<<<<<<<<<
 *             Py_INCREF(entity._entity)
 *         return entity
 */
  __pyx_t_1 = (__pyx_v_entity->_entity != Py_None);
  if (__pyx_t_1) {

    /* "amplpy/entity.pxi":58
 *         entity._entity = parent
 *         if entity._entity is not None:
 *             Py_INCREF(entity._entity)             # <<<<<<<<<<<<<<
 *         return entity
 * 
 */
    __pyx_t_2 = __pyx_v_entity->_entity;
    __Pyx_INCREF(__pyx_t_2);
    Py_INCREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "amplpy/entity.pxi":57
 *         entity.wrap_function = entitytype
 *         entity._entity = parent
 *         if entity._entity is not None:             # <<<<<<<<<<<<<<
 *             Py_INCREF(entity._entity)
 *         return entity
 */
  }

  /* "amplpy/entity.pxi":59
 *         if entity._entity is not None:
 *             Py_INCREF(entity._entity)
 *         return entity             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_entity);
  __pyx_r = ((PyObject *)__pyx_v_entity);
  goto __pyx_L0;

  /* "amplpy/entity.pxi":42
 * 
 *     @staticmethod
 *     cdef create(campl.AMPL* ampl_c, char *name, campl.AMPL_TUPLE* index, object parent):             # <<<<<<<<<<<<<<
 *         cdef campl.AMPL_ERRORINFO* errorinfo
 *         cdef campl.AMPL_RETCODE rc
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("_amplpy.Entity.create", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_entity);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/entity.pxi":61
 *         return entity
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         if self._entity is not None:
 *             Py_DECREF(self._entity)
 */

/* Python wrapper */
static void __pyx_pw_7_amplpy_6Entity_1__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_7_amplpy_6Entity_1__dealloc__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_pf_7_amplpy_6Entity___dealloc__(((struct __pyx_obj_7_amplpy_Entity *)__pyx_v_self));

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

static void __pyx_pf_7_amplpy_6Entity___dealloc__(struct __pyx_obj_7_amplpy_Entity *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__dealloc__", 1);

  /* "amplpy/entity.pxi":62
 * 
 *     def __dealloc__(self):
 *         if self._entity is not None:             # <<<<<<<<<<<<<<
 *             Py_DECREF(self._entity)
 *         if self._index is not NULL:
 */
  __pyx_t_1 = (__pyx_v_self->_entity != Py_None);
  if (__pyx_t_1) {

    /* "amplpy/entity.pxi":63
 *     def __dealloc__(self):
 *         if self._entity is not None:
 *             Py_DECREF(self._entity)             # <<<<<<<<<<<<<<
 *         if self._index is not NULL:
 *             campl.AMPL_TupleFree(&self._index)
 */
    __pyx_t_2 = __pyx_v_self->_entity;
    __Pyx_INCREF(__pyx_t_2);
    Py_DECREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "amplpy/entity.pxi":62
 * 
 *     def __dealloc__(self):
 *         if self._entity is not None:             # <<<<<<<<<<<<<<
 *             Py_DECREF(self._entity)
 *         if self._index is not NULL:
 */
  }

  /* "amplpy/entity.pxi":64
 *         if self._entity is not None:
 *             Py_DECREF(self._entity)
 *         if self._index is not NULL:             # <<<<<<<<<<<<<<
 *             campl.AMPL_TupleFree(&self._index)
 *         else:
 */
  __pyx_t_1 = (__pyx_v_self->_index != NULL);
  if (__pyx_t_1) {

    /* "amplpy/entity.pxi":65
 *             Py_DECREF(self._entity)
 *         if self._index is not NULL:
 *             campl.AMPL_TupleFree(&self._index)             # <<<<<<<<<<<<<<
 *         else:
 *             campl.AMPL_StringFree(&self._name)
 */
    (void)(AMPL_TupleFree((&__pyx_v_self->_index)));

    /* "amplpy/entity.pxi":64
 *         if self._entity is not None:
 *             Py_DECREF(self._entity)
 *         if self._index is not NULL:             # <<<<<<<<<<<<<<
 *             campl.AMPL_TupleFree(&self._index)
 *         else:
 */
    goto __pyx_L4;
  }

  /* "amplpy/entity.pxi":67
 *             campl.AMPL_TupleFree(&self._index)
 *         else:
 *             campl.AMPL_StringFree(&self._name)             # <<<<<<<<<<<<<<
 * 
 *     def to_string(self):
 */
  /*else*/ {
    (void)(AMPL_StringFree((&__pyx_v_self->_name)));
  }
  __pyx_L4:;

  /* "amplpy/entity.pxi":61
 *         return entity
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         if self._entity is not None:
 *             Py_DECREF(self._entity)
 */

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

/* "amplpy/entity.pxi":69
 *             campl.AMPL_StringFree(&self._name)
 * 
 *     def to_string(self):             # <<<<<<<<<<<<<<
 *         cdef char* output_c
 *         campl.AMPL_EntityGetDeclaration(self._c_ampl, self._name, &output_c)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_6Entity_3to_string(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_6Entity_2to_string, "Entity.to_string(self)");
static PyMethodDef __pyx_mdef_7_amplpy_6Entity_3to_string = {"to_string", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_6Entity_3to_string, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_6Entity_2to_string};
static PyObject *__pyx_pw_7_amplpy_6Entity_3to_string(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_string (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("to_string", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "to_string", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_6Entity_2to_string(((struct __pyx_obj_7_amplpy_Entity *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_6Entity_2to_string(struct __pyx_obj_7_amplpy_Entity *__pyx_v_self) {
  char *__pyx_v_output_c;
  PyObject *__pyx_v_output = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_string", 1);

  /* "amplpy/entity.pxi":71
 *     def to_string(self):
 *         cdef char* output_c
 *         campl.AMPL_EntityGetDeclaration(self._c_ampl, self._name, &output_c)             # <<<<<<<<<<<<<<
 *         output = str(output_c.decode('utf-8'))
 *         campl.AMPL_StringFree(&output_c)
 */
  (void)(AMPL_EntityGetDeclaration(__pyx_v_self->_c_ampl, __pyx_v_self->_name, (&__pyx_v_output_c)));

  /* "amplpy/entity.pxi":72
 *         cdef char* output_c
 *         campl.AMPL_EntityGetDeclaration(self._c_ampl, self._name, &output_c)
 *         output = str(output_c.decode('utf-8'))             # <<<<<<<<<<<<<<
 *         campl.AMPL_StringFree(&output_c)
 * 
 */
  __pyx_t_1 = __Pyx_ssize_strlen(__pyx_v_output_c); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(9, 72, __pyx_L1_error)
  __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_output_c, 0, __pyx_t_1, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 72, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_output = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "amplpy/entity.pxi":73
 *         campl.AMPL_EntityGetDeclaration(self._c_ampl, self._name, &output_c)
 *         output = str(output_c.decode('utf-8'))
 *         campl.AMPL_StringFree(&output_c)             # <<<<<<<<<<<<<<
 * 
 *         return output
 */
  (void)(AMPL_StringFree((&__pyx_v_output_c)));

  /* "amplpy/entity.pxi":75
 *         campl.AMPL_StringFree(&output_c)
 * 
 *         return output             # <<<<<<<<<<<<<<
 * 
 *     def __str__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_output);
  __pyx_r = __pyx_v_output;
  goto __pyx_L0;

  /* "amplpy/entity.pxi":69
 *             campl.AMPL_StringFree(&self._name)
 * 
 *     def to_string(self):             # <<<<<<<<<<<<<<
 *         cdef char* output_c
 *         campl.AMPL_EntityGetDeclaration(self._c_ampl, self._name, &output_c)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("_amplpy.Entity.to_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_output);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/entity.pxi":77
 *         return output
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return self.to_string()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_6Entity_5__str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7_amplpy_6Entity_5__str__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7_amplpy_6Entity_4__str__(((struct __pyx_obj_7_amplpy_Entity *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_6Entity_4__str__(struct __pyx_obj_7_amplpy_Entity *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__str__", 1);

  /* "amplpy/entity.pxi":78
 * 
 *     def __str__(self):
 *         return self.to_string()             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_to_string); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 78, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 78, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "amplpy/entity.pxi":77
 *         return output
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return self.to_string()
 * 
 */

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

/* "amplpy/entity.pxi":80
 *         return self.to_string()
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         assert self.wrap_function is not None
 *         return InstanceIterator.create(self._c_ampl, self._name, self.wrap_function, self)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_6Entity_7__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7_amplpy_6Entity_7__iter__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7_amplpy_6Entity_6__iter__(((struct __pyx_obj_7_amplpy_Entity *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_6Entity_6__iter__(struct __pyx_obj_7_amplpy_Entity *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__iter__", 1);

  /* "amplpy/entity.pxi":81
 * 
 *     def __iter__(self):
 *         assert self.wrap_function is not None             # <<<<<<<<<<<<<<
 *         return InstanceIterator.create(self._c_ampl, self._name, self.wrap_function, self)
 * 
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = __Pyx_PyInt_From_AMPL_ENTITYTYPE(__pyx_v_self->wrap_function); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 81, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = (__pyx_t_1 != Py_None);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_2)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(9, 81, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(9, 81, __pyx_L1_error)
  #endif

  /* "amplpy/entity.pxi":82
 *     def __iter__(self):
 *         assert self.wrap_function is not None
 *         return InstanceIterator.create(self._c_ampl, self._name, self.wrap_function, self)             # <<<<<<<<<<<<<<
 * 
 *     def __getitem__(self, index):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7_amplpy_16InstanceIterator_create(__pyx_v_self->_c_ampl, __pyx_v_self->_name, __pyx_v_self->wrap_function, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 82, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "amplpy/entity.pxi":80
 *         return self.to_string()
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         assert self.wrap_function is not None
 *         return InstanceIterator.create(self._c_ampl, self._name, self.wrap_function, self)
 */

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

/* "amplpy/entity.pxi":84
 *         return InstanceIterator.create(self._c_ampl, self._name, self.wrap_function, self)
 * 
 *     def __getitem__(self, index):             # <<<<<<<<<<<<<<
 *         if not isinstance(index, (tuple, list)):
 *             index = [index]
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_6Entity_9__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/
static PyObject *__pyx_pw_7_amplpy_6Entity_9__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7_amplpy_6Entity_8__getitem__(((struct __pyx_obj_7_amplpy_Entity *)__pyx_v_self), ((PyObject *)__pyx_v_index));

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

static PyObject *__pyx_pf_7_amplpy_6Entity_8__getitem__(struct __pyx_obj_7_amplpy_Entity *__pyx_v_self, PyObject *__pyx_v_index) {
  AMPL_TUPLE *__pyx_v_tuple_c;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  AMPL_TUPLE *__pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getitem__", 0);
  __Pyx_INCREF(__pyx_v_index);

  /* "amplpy/entity.pxi":85
 * 
 *     def __getitem__(self, index):
 *         if not isinstance(index, (tuple, list)):             # <<<<<<<<<<<<<<
 *             index = [index]
 *         cdef campl.AMPL_TUPLE* tuple_c =  to_c_tuple(index)
 */
  __pyx_t_2 = PyTuple_Check(__pyx_v_index); 
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = PyList_Check(__pyx_v_index); 
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  __pyx_t_2 = (!__pyx_t_1);
  if (__pyx_t_2) {

    /* "amplpy/entity.pxi":86
 *     def __getitem__(self, index):
 *         if not isinstance(index, (tuple, list)):
 *             index = [index]             # <<<<<<<<<<<<<<
 *         cdef campl.AMPL_TUPLE* tuple_c =  to_c_tuple(index)
 *         return create_entity(self.wrap_function, self._c_ampl, self._name, tuple_c, self)
 */
    __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 86, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_index);
    __Pyx_GIVEREF(__pyx_v_index);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_v_index)) __PYX_ERR(9, 86, __pyx_L1_error);
    __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "amplpy/entity.pxi":85
 * 
 *     def __getitem__(self, index):
 *         if not isinstance(index, (tuple, list)):             # <<<<<<<<<<<<<<
 *             index = [index]
 *         cdef campl.AMPL_TUPLE* tuple_c =  to_c_tuple(index)
 */
  }

  /* "amplpy/entity.pxi":87
 *         if not isinstance(index, (tuple, list)):
 *             index = [index]
 *         cdef campl.AMPL_TUPLE* tuple_c =  to_c_tuple(index)             # <<<<<<<<<<<<<<
 *         return create_entity(self.wrap_function, self._c_ampl, self._name, tuple_c, self)
 * 
 */
  __pyx_t_4 = __pyx_f_7_amplpy_to_c_tuple(__pyx_v_index); if (unlikely(__pyx_t_4 == ((AMPL_TUPLE *)NULL) && PyErr_Occurred())) __PYX_ERR(9, 87, __pyx_L1_error)
  __pyx_v_tuple_c = __pyx_t_4;

  /* "amplpy/entity.pxi":88
 *             index = [index]
 *         cdef campl.AMPL_TUPLE* tuple_c =  to_c_tuple(index)
 *         return create_entity(self.wrap_function, self._c_ampl, self._name, tuple_c, self)             # <<<<<<<<<<<<<<
 * 
 *     def get(self, *index):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __pyx_f_7_amplpy_create_entity(__pyx_v_self->wrap_function, __pyx_v_self->_c_ampl, __pyx_v_self->_name, __pyx_v_tuple_c, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 88, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "amplpy/entity.pxi":84
 *         return InstanceIterator.create(self._c_ampl, self._name, self.wrap_function, self)
 * 
 *     def __getitem__(self, index):             # <<<<<<<<<<<<<<
 *         if not isinstance(index, (tuple, list)):
 *             index = [index]
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("_amplpy.Entity.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_index);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/entity.pxi":90
 *         return create_entity(self.wrap_function, self._c_ampl, self._name, tuple_c, self)
 * 
 *     def get(self, *index):             # <<<<<<<<<<<<<<
 *         """
 *         Get the instance with the specified index.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_6Entity_11get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_6Entity_10get, "Entity.get(self, *index)\n\n        Get the instance with the specified index.\n\n        Returns:\n            The corresponding instance.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_6Entity_11get = {"get", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7_amplpy_6Entity_11get, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7_amplpy_6Entity_10get};
static PyObject *__pyx_pw_7_amplpy_6Entity_11get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_index = 0;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get", 0))) return NULL;
  __Pyx_INCREF(__pyx_args);
  __pyx_v_index = __pyx_args;
  __pyx_r = __pyx_pf_7_amplpy_6Entity_10get(((struct __pyx_obj_7_amplpy_Entity *)__pyx_v_self), __pyx_v_index);

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

static PyObject *__pyx_pf_7_amplpy_6Entity_10get(struct __pyx_obj_7_amplpy_Entity *__pyx_v_self, PyObject *__pyx_v_index) {
  AMPL_TUPLE *__pyx_v_tuple_c;
  char *__pyx_v_name_c;
  PyObject *__pyx_v_entity = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  AMPL_TUPLE *__pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  unsigned int __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get", 0);
  __Pyx_INCREF(__pyx_v_index);

  /* "amplpy/entity.pxi":97
 *             The corresponding instance.
 *         """
 *         assert self.wrap_function is not None             # <<<<<<<<<<<<<<
 *         cdef campl.AMPL_TUPLE* tuple_c
 *         cdef char* name_c
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = __Pyx_PyInt_From_AMPL_ENTITYTYPE(__pyx_v_self->wrap_function); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 97, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = (__pyx_t_1 != Py_None);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_2)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(9, 97, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(9, 97, __pyx_L1_error)
  #endif

  /* "amplpy/entity.pxi":100
 *         cdef campl.AMPL_TUPLE* tuple_c
 *         cdef char* name_c
 *         if len(index) == 1 and isinstance(index[0], (tuple, list)):             # <<<<<<<<<<<<<<
 *             index = index[0]
 *             index = list(index)
 */
  __pyx_t_3 = PyObject_Length(__pyx_v_index); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(9, 100, __pyx_L1_error)
  __pyx_t_4 = (__pyx_t_3 == 1);
  if (__pyx_t_4) {
  } else {
    __pyx_t_2 = __pyx_t_4;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_index, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 100, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = PyTuple_Check(__pyx_t_1); 
  if (!__pyx_t_5) {
  } else {
    __pyx_t_4 = __pyx_t_5;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_5 = PyList_Check(__pyx_t_1); 
  __pyx_t_4 = __pyx_t_5;
  __pyx_L6_bool_binop_done:;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_2 = __pyx_t_4;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "amplpy/entity.pxi":101
 *         cdef char* name_c
 *         if len(index) == 1 and isinstance(index[0], (tuple, list)):
 *             index = index[0]             # <<<<<<<<<<<<<<
 *             index = list(index)
 *         if len(index) == 0:
 */
    __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v_index, 0);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "amplpy/entity.pxi":102
 *         if len(index) == 1 and isinstance(index[0], (tuple, list)):
 *             index = index[0]
 *             index = list(index)             # <<<<<<<<<<<<<<
 *         if len(index) == 0:
 *             return create_entity(self.wrap_function, self._c_ampl, self._name, NULL, None)
 */
    __pyx_t_1 = PySequence_List(__pyx_v_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 102, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "amplpy/entity.pxi":100
 *         cdef campl.AMPL_TUPLE* tuple_c
 *         cdef char* name_c
 *         if len(index) == 1 and isinstance(index[0], (tuple, list)):             # <<<<<<<<<<<<<<
 *             index = index[0]
 *             index = list(index)
 */
  }

  /* "amplpy/entity.pxi":103
 *             index = index[0]
 *             index = list(index)
 *         if len(index) == 0:             # <<<<<<<<<<<<<<
 *             return create_entity(self.wrap_function, self._c_ampl, self._name, NULL, None)
 *         else:
 */
  __pyx_t_3 = PyObject_Length(__pyx_v_index); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(9, 103, __pyx_L1_error)
  __pyx_t_2 = (__pyx_t_3 == 0);
  if (__pyx_t_2) {

    /* "amplpy/entity.pxi":104
 *             index = list(index)
 *         if len(index) == 0:
 *             return create_entity(self.wrap_function, self._c_ampl, self._name, NULL, None)             # <<<<<<<<<<<<<<
 *         else:
 *             tuple_c =  to_c_tuple(index)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __pyx_f_7_amplpy_create_entity(__pyx_v_self->wrap_function, __pyx_v_self->_c_ampl, __pyx_v_self->_name, NULL, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 104, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "amplpy/entity.pxi":103
 *             index = index[0]
 *             index = list(index)
 *         if len(index) == 0:             # <<<<<<<<<<<<<<
 *             return create_entity(self.wrap_function, self._c_ampl, self._name, NULL, None)
 *         else:
 */
  }

  /* "amplpy/entity.pxi":106
 *             return create_entity(self.wrap_function, self._c_ampl, self._name, NULL, None)
 *         else:
 *             tuple_c =  to_c_tuple(index)             # <<<<<<<<<<<<<<
 *             if self.wrap_function == campl.AMPL_PARAMETER:
 *                 campl.AMPL_InstanceGetName(self._c_ampl, self._name, tuple_c, &name_c)
 */
  /*else*/ {
    __pyx_t_6 = __pyx_f_7_amplpy_to_c_tuple(__pyx_v_index); if (unlikely(__pyx_t_6 == ((AMPL_TUPLE *)NULL) && PyErr_Occurred())) __PYX_ERR(9, 106, __pyx_L1_error)
    __pyx_v_tuple_c = __pyx_t_6;

    /* "amplpy/entity.pxi":107
 *         else:
 *             tuple_c =  to_c_tuple(index)
 *             if self.wrap_function == campl.AMPL_PARAMETER:             # <<<<<<<<<<<<<<
 *                 campl.AMPL_InstanceGetName(self._c_ampl, self._name, tuple_c, &name_c)
 *                 campl.AMPL_TupleFree(&tuple_c)
 */
    __pyx_t_2 = (__pyx_v_self->wrap_function == AMPL_PARAMETER);
    if (__pyx_t_2) {

      /* "amplpy/entity.pxi":108
 *             tuple_c =  to_c_tuple(index)
 *             if self.wrap_function == campl.AMPL_PARAMETER:
 *                 campl.AMPL_InstanceGetName(self._c_ampl, self._name, tuple_c, &name_c)             # <<<<<<<<<<<<<<
 *                 campl.AMPL_TupleFree(&tuple_c)
 *                 entity = create_entity(self.wrap_function, self._c_ampl, name_c, NULL, None).value()
 */
      (void)(AMPL_InstanceGetName(__pyx_v_self->_c_ampl, __pyx_v_self->_name, __pyx_v_tuple_c, (&__pyx_v_name_c)));

      /* "amplpy/entity.pxi":109
 *             if self.wrap_function == campl.AMPL_PARAMETER:
 *                 campl.AMPL_InstanceGetName(self._c_ampl, self._name, tuple_c, &name_c)
 *                 campl.AMPL_TupleFree(&tuple_c)             # <<<<<<<<<<<<<<
 *                 entity = create_entity(self.wrap_function, self._c_ampl, name_c, NULL, None).value()
 *                 return entity
 */
      (void)(AMPL_TupleFree((&__pyx_v_tuple_c)));

      /* "amplpy/entity.pxi":110
 *                 campl.AMPL_InstanceGetName(self._c_ampl, self._name, tuple_c, &name_c)
 *                 campl.AMPL_TupleFree(&tuple_c)
 *                 entity = create_entity(self.wrap_function, self._c_ampl, name_c, NULL, None).value()             # <<<<<<<<<<<<<<
 *                 return entity
 *             else:
 */
      __pyx_t_7 = __pyx_f_7_amplpy_create_entity(__pyx_v_self->wrap_function, __pyx_v_self->_c_ampl, __pyx_v_name_c, NULL, Py_None); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 110, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_value); if (unlikely(!__pyx_t_8)) __PYX_ERR(9, 110, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = NULL;
      __pyx_t_9 = 0;
      #if CYTHON_UNPACK_METHODS
      if (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);
          __pyx_t_9 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL};
        __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_9, 0+__pyx_t_9);
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 110, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
      __pyx_v_entity = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "amplpy/entity.pxi":111
 *                 campl.AMPL_TupleFree(&tuple_c)
 *                 entity = create_entity(self.wrap_function, self._c_ampl, name_c, NULL, None).value()
 *                 return entity             # <<<<<<<<<<<<<<
 *             else:
 *                 return create_entity(self.wrap_function, self._c_ampl, self._name, tuple_c, self)
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_entity);
      __pyx_r = __pyx_v_entity;
      goto __pyx_L0;

      /* "amplpy/entity.pxi":107
 *         else:
 *             tuple_c =  to_c_tuple(index)
 *             if self.wrap_function == campl.AMPL_PARAMETER:             # <<<<<<<<<<<<<<
 *                 campl.AMPL_InstanceGetName(self._c_ampl, self._name, tuple_c, &name_c)
 *                 campl.AMPL_TupleFree(&tuple_c)
 */
    }

    /* "amplpy/entity.pxi":113
 *                 return entity
 *             else:
 *                 return create_entity(self.wrap_function, self._c_ampl, self._name, tuple_c, self)             # <<<<<<<<<<<<<<
 * 
 *     def find(self, index):
 */
    /*else*/ {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = __pyx_f_7_amplpy_create_entity(__pyx_v_self->wrap_function, __pyx_v_self->_c_ampl, __pyx_v_self->_name, __pyx_v_tuple_c, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 113, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;
    }
  }

  /* "amplpy/entity.pxi":90
 *         return create_entity(self.wrap_function, self._c_ampl, self._name, tuple_c, self)
 * 
 *     def get(self, *index):             # <<<<<<<<<<<<<<
 *         """
 *         Get the instance with the specified index.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("_amplpy.Entity.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_index);
  __Pyx_XDECREF(__pyx_v_entity);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/entity.pxi":115
 *                 return create_entity(self.wrap_function, self._c_ampl, self._name, tuple_c, self)
 * 
 *     def find(self, index):             # <<<<<<<<<<<<<<
 *         """
 *         Searches the current entity for an instance with the specified index.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_6Entity_13find(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_6Entity_12find, "Entity.find(self, index)\n\n        Searches the current entity for an instance with the specified index.\n\n        Returns:\n            The wanted instance if found, otherwise it returns `None`.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_6Entity_13find = {"find", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_6Entity_13find, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_6Entity_12find};
static PyObject *__pyx_pw_7_amplpy_6Entity_13find(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_index = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("find (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_index)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(9, 115, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "find") < 0)) __PYX_ERR(9, 115, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_index = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("find", 1, 1, 1, __pyx_nargs); __PYX_ERR(9, 115, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.Entity.find", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_6Entity_12find(((struct __pyx_obj_7_amplpy_Entity *)__pyx_v_self), __pyx_v_index);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_6Entity_12find(struct __pyx_obj_7_amplpy_Entity *__pyx_v_self, PyObject *__pyx_v_index) {
  size_t __pyx_v_i;
  AMPL_TUPLE *__pyx_v_index_c;
  AMPL_TUPLE **__pyx_v_indices_c;
  size_t __pyx_v_size;
  size_t __pyx_v_j;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  AMPL_TUPLE *__pyx_t_3;
  size_t __pyx_t_4;
  size_t __pyx_t_5;
  size_t __pyx_t_6;
  size_t __pyx_t_7;
  size_t __pyx_t_8;
  size_t __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("find", 1);

  /* "amplpy/entity.pxi":122
 *             The wanted instance if found, otherwise it returns `None`.
 *         """
 *         assert self.wrap_function is not None             # <<<<<<<<<<<<<<
 *         cdef size_t i
 *         cdef campl.AMPL_TUPLE* index_c = to_c_tuple(index)
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = __Pyx_PyInt_From_AMPL_ENTITYTYPE(__pyx_v_self->wrap_function); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 122, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = (__pyx_t_1 != Py_None);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_2)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(9, 122, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(9, 122, __pyx_L1_error)
  #endif

  /* "amplpy/entity.pxi":124
 *         assert self.wrap_function is not None
 *         cdef size_t i
 *         cdef campl.AMPL_TUPLE* index_c = to_c_tuple(index)             # <<<<<<<<<<<<<<
 *         cdef campl.AMPL_TUPLE** indices_c
 *         cdef size_t size
 */
  __pyx_t_3 = __pyx_f_7_amplpy_to_c_tuple(__pyx_v_index); if (unlikely(__pyx_t_3 == ((AMPL_TUPLE *)NULL) && PyErr_Occurred())) __PYX_ERR(9, 124, __pyx_L1_error)
  __pyx_v_index_c = __pyx_t_3;

  /* "amplpy/entity.pxi":127
 *         cdef campl.AMPL_TUPLE** indices_c
 *         cdef size_t size
 *         campl.AMPL_EntityGetTuples(self._c_ampl, self._name, &indices_c, &size)             # <<<<<<<<<<<<<<
 *         for i in range(size):
 *             if campl.AMPL_TupleCompare(index_c, indices_c[i]) == 0:
 */
  (void)(AMPL_EntityGetTuples(__pyx_v_self->_c_ampl, __pyx_v_self->_name, (&__pyx_v_indices_c), (&__pyx_v_size)));

  /* "amplpy/entity.pxi":128
 *         cdef size_t size
 *         campl.AMPL_EntityGetTuples(self._c_ampl, self._name, &indices_c, &size)
 *         for i in range(size):             # <<<<<<<<<<<<<<
 *             if campl.AMPL_TupleCompare(index_c, indices_c[i]) == 0:
 *                 for j in range(size):
 */
  __pyx_t_4 = __pyx_v_size;
  __pyx_t_5 = __pyx_t_4;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "amplpy/entity.pxi":129
 *         campl.AMPL_EntityGetTuples(self._c_ampl, self._name, &indices_c, &size)
 *         for i in range(size):
 *             if campl.AMPL_TupleCompare(index_c, indices_c[i]) == 0:             # <<<<<<<<<<<<<<
 *                 for j in range(size):
 *                     campl.AMPL_TupleFree(&indices_c[j])
 */
    __pyx_t_2 = (AMPL_TupleCompare(__pyx_v_index_c, (__pyx_v_indices_c[__pyx_v_i])) == 0);
    if (__pyx_t_2) {

      /* "amplpy/entity.pxi":130
 *         for i in range(size):
 *             if campl.AMPL_TupleCompare(index_c, indices_c[i]) == 0:
 *                 for j in range(size):             # <<<<<<<<<<<<<<
 *                     campl.AMPL_TupleFree(&indices_c[j])
 *                 free(indices_c)
 */
      __pyx_t_7 = __pyx_v_size;
      __pyx_t_8 = __pyx_t_7;
      for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
        __pyx_v_j = __pyx_t_9;

        /* "amplpy/entity.pxi":131
 *             if campl.AMPL_TupleCompare(index_c, indices_c[i]) == 0:
 *                 for j in range(size):
 *                     campl.AMPL_TupleFree(&indices_c[j])             # <<<<<<<<<<<<<<
 *                 free(indices_c)
 *                 return create_entity(self.wrap_function, self._c_ampl, self._name, index_c, self)
 */
        (void)(AMPL_TupleFree((&(__pyx_v_indices_c[__pyx_v_j]))));
      }

      /* "amplpy/entity.pxi":132
 *                 for j in range(size):
 *                     campl.AMPL_TupleFree(&indices_c[j])
 *                 free(indices_c)             # <<<<<<<<<<<<<<
 *                 return create_entity(self.wrap_function, self._c_ampl, self._name, index_c, self)
 *         for i in range(size):
 */
      free(__pyx_v_indices_c);

      /* "amplpy/entity.pxi":133
 *                     campl.AMPL_TupleFree(&indices_c[j])
 *                 free(indices_c)
 *                 return create_entity(self.wrap_function, self._c_ampl, self._name, index_c, self)             # <<<<<<<<<<<<<<
 *         for i in range(size):
 *             campl.AMPL_TupleFree(&indices_c[i])
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = __pyx_f_7_amplpy_create_entity(__pyx_v_self->wrap_function, __pyx_v_self->_c_ampl, __pyx_v_self->_name, __pyx_v_index_c, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 133, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;

      /* "amplpy/entity.pxi":129
 *         campl.AMPL_EntityGetTuples(self._c_ampl, self._name, &indices_c, &size)
 *         for i in range(size):
 *             if campl.AMPL_TupleCompare(index_c, indices_c[i]) == 0:             # <<<<<<<<<<<<<<
 *                 for j in range(size):
 *                     campl.AMPL_TupleFree(&indices_c[j])
 */
    }
  }

  /* "amplpy/entity.pxi":134
 *                 free(indices_c)
 *                 return create_entity(self.wrap_function, self._c_ampl, self._name, index_c, self)
 *         for i in range(size):             # <<<<<<<<<<<<<<
 *             campl.AMPL_TupleFree(&indices_c[i])
 *         free(indices_c)
 */
  __pyx_t_4 = __pyx_v_size;
  __pyx_t_5 = __pyx_t_4;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "amplpy/entity.pxi":135
 *                 return create_entity(self.wrap_function, self._c_ampl, self._name, index_c, self)
 *         for i in range(size):
 *             campl.AMPL_TupleFree(&indices_c[i])             # <<<<<<<<<<<<<<
 *         free(indices_c)
 *         campl.AMPL_TupleFree(&index_c)
 */
    (void)(AMPL_TupleFree((&(__pyx_v_indices_c[__pyx_v_i]))));
  }

  /* "amplpy/entity.pxi":136
 *         for i in range(size):
 *             campl.AMPL_TupleFree(&indices_c[i])
 *         free(indices_c)             # <<<<<<<<<<<<<<
 *         campl.AMPL_TupleFree(&index_c)
 *         return None
 */
  free(__pyx_v_indices_c);

  /* "amplpy/entity.pxi":137
 *             campl.AMPL_TupleFree(&indices_c[i])
 *         free(indices_c)
 *         campl.AMPL_TupleFree(&index_c)             # <<<<<<<<<<<<<<
 *         return None
 * 
 */
  (void)(AMPL_TupleFree((&__pyx_v_index_c)));

  /* "amplpy/entity.pxi":138
 *         free(indices_c)
 *         campl.AMPL_TupleFree(&index_c)
 *         return None             # <<<<<<<<<<<<<<
 * 
 *     def instances(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;

  /* "amplpy/entity.pxi":115
 *                 return create_entity(self.wrap_function, self._c_ampl, self._name, tuple_c, self)
 * 
 *     def find(self, index):             # <<<<<<<<<<<<<<
 *         """
 *         Searches the current entity for an instance with the specified index.
 */

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

/* "amplpy/entity.pxi":140
 *         return None
 * 
 *     def instances(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get all the instances in this entity.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_6Entity_15instances(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_6Entity_14instances, "Entity.instances(self)\n\n        Get all the instances in this entity.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_6Entity_15instances = {"instances", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_6Entity_15instances, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_6Entity_14instances};
static PyObject *__pyx_pw_7_amplpy_6Entity_15instances(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("instances (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("instances", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "instances", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_6Entity_14instances(((struct __pyx_obj_7_amplpy_Entity *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_6Entity_14instances(struct __pyx_obj_7_amplpy_Entity *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("instances", 1);

  /* "amplpy/entity.pxi":144
 *         Get all the instances in this entity.
 *         """
 *         return InstanceIterator.create(self._c_ampl, self._name, self.wrap_function, self)             # <<<<<<<<<<<<<<
 * 
 *     def name(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7_amplpy_16InstanceIterator_create(__pyx_v_self->_c_ampl, __pyx_v_self->_name, __pyx_v_self->wrap_function, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 144, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "amplpy/entity.pxi":140
 *         return None
 * 
 *     def instances(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get all the instances in this entity.
 */

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

/* "amplpy/entity.pxi":146
 *         return InstanceIterator.create(self._c_ampl, self._name, self.wrap_function, self)
 * 
 *     def name(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the name of this entity.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_6Entity_17name(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_6Entity_16name, "Entity.name(self)\n\n        Get the name of this entity.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_6Entity_17name = {"name", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_6Entity_17name, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_6Entity_16name};
static PyObject *__pyx_pw_7_amplpy_6Entity_17name(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("name (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("name", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "name", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_6Entity_16name(((struct __pyx_obj_7_amplpy_Entity *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_6Entity_16name(struct __pyx_obj_7_amplpy_Entity *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  char *__pyx_t_1;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("name", 1);

  /* "amplpy/entity.pxi":150
 *         Get the name of this entity.
 *         """
 *         return self._name.decode('utf-8')             # <<<<<<<<<<<<<<
 * 
 *     def indexarity(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_v_self->_name;
  __pyx_t_2 = __Pyx_ssize_strlen(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(9, 150, __pyx_L1_error)
  __pyx_t_3 = __Pyx_decode_c_string(__pyx_t_1, 0, __pyx_t_2, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 150, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "amplpy/entity.pxi":146
 *         return InstanceIterator.create(self._c_ampl, self._name, self.wrap_function, self)
 * 
 *     def name(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the name of this entity.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("_amplpy.Entity.name", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/entity.pxi":152
 *         return self._name.decode('utf-8')
 * 
 *     def indexarity(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the indexarity of this entity (sum of the dimensions of the
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_6Entity_19indexarity(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_6Entity_18indexarity, "Entity.indexarity(self)\n\n        Get the indexarity of this entity (sum of the dimensions of the\n        indexing sets).\n        This value indicates the arity of the tuple to be passed to the method\n        :func:`~amplpy.Entity.get` in order to access an instance of this\n        entity. See the following AMPL examples:\n\n        .. code-block:: ampl\n\n            var x;               # indexarity = 0\n            var y {1..2};        # indexarity = 1\n            var z {1..2,3..4};   # indexarity = 2\n            var zz {{(1, 2)}};   # indexarity = 2\n\n        Returns:\n            The sum of the dimensions of the indexing sets or 0 if the\n            entity is not indexed.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_6Entity_19indexarity = {"indexarity", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_6Entity_19indexarity, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_6Entity_18indexarity};
static PyObject *__pyx_pw_7_amplpy_6Entity_19indexarity(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("indexarity (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("indexarity", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "indexarity", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_6Entity_18indexarity(((struct __pyx_obj_7_amplpy_Entity *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_6Entity_18indexarity(struct __pyx_obj_7_amplpy_Entity *__pyx_v_self) {
  size_t __pyx_v_indexarity;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("indexarity", 1);

  /* "amplpy/entity.pxi":172
 *         """
 *         cdef size_t indexarity
 *         if self._index is not NULL:             # <<<<<<<<<<<<<<
 *             indexarity = 0
 *         else:
 */
  __pyx_t_1 = (__pyx_v_self->_index != NULL);
  if (__pyx_t_1) {

    /* "amplpy/entity.pxi":173
 *         cdef size_t indexarity
 *         if self._index is not NULL:
 *             indexarity = 0             # <<<<<<<<<<<<<<
 *         else:
 *             PY_AMPL_CALL(campl.AMPL_EntityGetIndexarity(self._c_ampl, self._name, &indexarity))
 */
    __pyx_v_indexarity = 0;

    /* "amplpy/entity.pxi":172
 *         """
 *         cdef size_t indexarity
 *         if self._index is not NULL:             # <<<<<<<<<<<<<<
 *             indexarity = 0
 *         else:
 */
    goto __pyx_L3;
  }

  /* "amplpy/entity.pxi":175
 *             indexarity = 0
 *         else:
 *             PY_AMPL_CALL(campl.AMPL_EntityGetIndexarity(self._c_ampl, self._name, &indexarity))             # <<<<<<<<<<<<<<
 *         return indexarity
 * 
 */
  /*else*/ {
    __pyx_t_2 = __pyx_f_7_amplpy_PY_AMPL_CALL(AMPL_EntityGetIndexarity(__pyx_v_self->_c_ampl, __pyx_v_self->_name, (&__pyx_v_indexarity))); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 175, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_L3:;

  /* "amplpy/entity.pxi":176
 *         else:
 *             PY_AMPL_CALL(campl.AMPL_EntityGetIndexarity(self._c_ampl, self._name, &indexarity))
 *         return indexarity             # <<<<<<<<<<<<<<
 * 
 *     def is_scalar(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_indexarity); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 176, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "amplpy/entity.pxi":152
 *         return self._name.decode('utf-8')
 * 
 *     def indexarity(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the indexarity of this entity (sum of the dimensions of the
 */

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

/* "amplpy/entity.pxi":178
 *         return indexarity
 * 
 *     def is_scalar(self):             # <<<<<<<<<<<<<<
 *         """
 *         Check whether this entity is scalar. Equivalent to testing whether
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_6Entity_21is_scalar(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_6Entity_20is_scalar, "Entity.is_scalar(self)\n\n        Check whether this entity is scalar. Equivalent to testing whether\n        :func:`~amplpy.Entity.indexarity` is equal to zero.\n\n        Returns:\n            True if the entity is scalar (not indexed over any set).\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_6Entity_21is_scalar = {"is_scalar", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_6Entity_21is_scalar, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_6Entity_20is_scalar};
static PyObject *__pyx_pw_7_amplpy_6Entity_21is_scalar(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_scalar (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("is_scalar", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "is_scalar", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_6Entity_20is_scalar(((struct __pyx_obj_7_amplpy_Entity *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_6Entity_20is_scalar(struct __pyx_obj_7_amplpy_Entity *__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;
  unsigned int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("is_scalar", 1);

  /* "amplpy/entity.pxi":186
 *             True if the entity is scalar (not indexed over any set).
 *         """
 *         try:             # <<<<<<<<<<<<<<
 *             return self.indexarity() == 0
 *         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:*/ {

      /* "amplpy/entity.pxi":187
 *         """
 *         try:
 *             return self.indexarity() == 0             # <<<<<<<<<<<<<<
 *         except:
 *             return True
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_indexarity); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 187, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      __pyx_t_7 = 0;
      #if CYTHON_UNPACK_METHODS
      if (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_7 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
        __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 0+__pyx_t_7);
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 187, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      }
      __pyx_t_5 = __Pyx_PyInt_EqObjC(__pyx_t_4, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 187, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_r = __pyx_t_5;
      __pyx_t_5 = 0;
      goto __pyx_L7_try_return;

      /* "amplpy/entity.pxi":186
 *             True if the entity is scalar (not indexed over any set).
 *         """
 *         try:             # <<<<<<<<<<<<<<
 *             return self.indexarity() == 0
 *         except:
 */
    }
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "amplpy/entity.pxi":188
 *         try:
 *             return self.indexarity() == 0
 *         except:             # <<<<<<<<<<<<<<
 *             return True
 * 
 */
    /*except:*/ {
      __Pyx_AddTraceback("_amplpy.Entity.is_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_6) < 0) __PYX_ERR(9, 188, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_6);

      /* "amplpy/entity.pxi":189
 *             return self.indexarity() == 0
 *         except:
 *             return True             # <<<<<<<<<<<<<<
 * 
 *     def num_instances(self):
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_True);
      __pyx_r = Py_True;
      __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;
    }

    /* "amplpy/entity.pxi":186
 *             True if the entity is scalar (not indexed over any set).
 *         """
 *         try:             # <<<<<<<<<<<<<<
 *             return self.indexarity() == 0
 *         except:
 */
    __pyx_L5_except_error:;
    __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;
  }

  /* "amplpy/entity.pxi":178
 *         return indexarity
 * 
 *     def is_scalar(self):             # <<<<<<<<<<<<<<
 *         """
 *         Check whether this entity is scalar. Equivalent to testing whether
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("_amplpy.Entity.is_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/entity.pxi":191
 *             return True
 * 
 *     def num_instances(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the number of instances in this entity.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_6Entity_23num_instances(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_6Entity_22num_instances, "Entity.num_instances(self)\n\n        Get the number of instances in this entity.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_6Entity_23num_instances = {"num_instances", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_6Entity_23num_instances, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_6Entity_22num_instances};
static PyObject *__pyx_pw_7_amplpy_6Entity_23num_instances(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("num_instances (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("num_instances", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "num_instances", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_6Entity_22num_instances(((struct __pyx_obj_7_amplpy_Entity *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_6Entity_22num_instances(struct __pyx_obj_7_amplpy_Entity *__pyx_v_self) {
  size_t __pyx_v_size;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("num_instances", 1);

  /* "amplpy/entity.pxi":196
 *         """
 *         cdef size_t size
 *         PY_AMPL_CALL(campl.AMPL_EntityGetNumInstances(self._c_ampl, self._name, &size))             # <<<<<<<<<<<<<<
 *         return int(size)
 * 
 */
  __pyx_t_1 = __pyx_f_7_amplpy_PY_AMPL_CALL(AMPL_EntityGetNumInstances(__pyx_v_self->_c_ampl, __pyx_v_self->_name, (&__pyx_v_size))); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 196, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "amplpy/entity.pxi":197
 *         cdef size_t size
 *         PY_AMPL_CALL(campl.AMPL_EntityGetNumInstances(self._c_ampl, self._name, &size))
 *         return int(size)             # <<<<<<<<<<<<<<
 * 
 *     def get_indexing_sets(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 197, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyInt_Type)), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 197, __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;

  /* "amplpy/entity.pxi":191
 *             return True
 * 
 *     def num_instances(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the number of instances in this entity.
 */

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

/* "amplpy/entity.pxi":199
 *         return int(size)
 * 
 *     def get_indexing_sets(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the AMPL string representation of the sets on which this entity is
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_6Entity_25get_indexing_sets(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_6Entity_24get_indexing_sets, "Entity.get_indexing_sets(self)\n\n        Get the AMPL string representation of the sets on which this entity is\n        indexed. The obtained vector can be modified without any effect to the\n        entity.\n\n        Returns:\n            The string representation of the indexing sets for this entity or\n            an empty array if the entity is scalar.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_6Entity_25get_indexing_sets = {"get_indexing_sets", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_6Entity_25get_indexing_sets, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_6Entity_24get_indexing_sets};
static PyObject *__pyx_pw_7_amplpy_6Entity_25get_indexing_sets(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_indexing_sets (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("get_indexing_sets", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_indexing_sets", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_6Entity_24get_indexing_sets(((struct __pyx_obj_7_amplpy_Entity *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_6Entity_24get_indexing_sets(struct __pyx_obj_7_amplpy_Entity *__pyx_v_self) {
  size_t __pyx_v_i;
  size_t __pyx_v_size;
  char **__pyx_v_sets;
  PyObject *__pyx_v_pylist = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  size_t __pyx_t_2;
  size_t __pyx_t_3;
  size_t __pyx_t_4;
  int __pyx_t_5;
  char *__pyx_t_6;
  Py_ssize_t __pyx_t_7;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_indexing_sets", 1);

  /* "amplpy/entity.pxi":212
 *         cdef size_t size
 *         cdef char** sets
 *         cdef list pylist = []             # <<<<<<<<<<<<<<
 *         campl.AMPL_EntityGetIndexingSets(self._c_ampl, self._name, &sets, &size)
 *         for i in range(size):
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 212, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_pylist = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "amplpy/entity.pxi":213
 *         cdef char** sets
 *         cdef list pylist = []
 *         campl.AMPL_EntityGetIndexingSets(self._c_ampl, self._name, &sets, &size)             # <<<<<<<<<<<<<<
 *         for i in range(size):
 *             if sets[i] != NULL:
 */
  (void)(AMPL_EntityGetIndexingSets(__pyx_v_self->_c_ampl, __pyx_v_self->_name, (&__pyx_v_sets), (&__pyx_v_size)));

  /* "amplpy/entity.pxi":214
 *         cdef list pylist = []
 *         campl.AMPL_EntityGetIndexingSets(self._c_ampl, self._name, &sets, &size)
 *         for i in range(size):             # <<<<<<<<<<<<<<
 *             if sets[i] != NULL:
 *                 pylist.append(sets[i].decode('utf-8'))
 */
  __pyx_t_2 = __pyx_v_size;
  __pyx_t_3 = __pyx_t_2;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
    __pyx_v_i = __pyx_t_4;

    /* "amplpy/entity.pxi":215
 *         campl.AMPL_EntityGetIndexingSets(self._c_ampl, self._name, &sets, &size)
 *         for i in range(size):
 *             if sets[i] != NULL:             # <<<<<<<<<<<<<<
 *                 pylist.append(sets[i].decode('utf-8'))
 *             else:
 */
    __pyx_t_5 = ((__pyx_v_sets[__pyx_v_i]) != NULL);
    if (__pyx_t_5) {

      /* "amplpy/entity.pxi":216
 *         for i in range(size):
 *             if sets[i] != NULL:
 *                 pylist.append(sets[i].decode('utf-8'))             # <<<<<<<<<<<<<<
 *             else:
 *                 pylist.append(None)
 */
      __pyx_t_6 = (__pyx_v_sets[__pyx_v_i]);
      __pyx_t_7 = __Pyx_ssize_strlen(__pyx_t_6); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(9, 216, __pyx_L1_error)
      __pyx_t_1 = __Pyx_decode_c_string(__pyx_t_6, 0, __pyx_t_7, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 216, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_pylist, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(9, 216, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "amplpy/entity.pxi":215
 *         campl.AMPL_EntityGetIndexingSets(self._c_ampl, self._name, &sets, &size)
 *         for i in range(size):
 *             if sets[i] != NULL:             # <<<<<<<<<<<<<<
 *                 pylist.append(sets[i].decode('utf-8'))
 *             else:
 */
      goto __pyx_L5;
    }

    /* "amplpy/entity.pxi":218
 *                 pylist.append(sets[i].decode('utf-8'))
 *             else:
 *                 pylist.append(None)             # <<<<<<<<<<<<<<
 *             campl.AMPL_StringFree(&sets[i])
 *         free(sets)
 */
    /*else*/ {
      __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_pylist, Py_None); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(9, 218, __pyx_L1_error)
    }
    __pyx_L5:;

    /* "amplpy/entity.pxi":219
 *             else:
 *                 pylist.append(None)
 *             campl.AMPL_StringFree(&sets[i])             # <<<<<<<<<<<<<<
 *         free(sets)
 * 
 */
    (void)(AMPL_StringFree((&(__pyx_v_sets[__pyx_v_i]))));
  }

  /* "amplpy/entity.pxi":220
 *                 pylist.append(None)
 *             campl.AMPL_StringFree(&sets[i])
 *         free(sets)             # <<<<<<<<<<<<<<
 * 
 *         return pylist
 */
  free(__pyx_v_sets);

  /* "amplpy/entity.pxi":222
 *         free(sets)
 * 
 *         return pylist             # <<<<<<<<<<<<<<
 * 
 *     def xref(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_pylist);
  __pyx_r = __pyx_v_pylist;
  goto __pyx_L0;

  /* "amplpy/entity.pxi":199
 *         return int(size)
 * 
 *     def get_indexing_sets(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the AMPL string representation of the sets on which this entity is
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("_amplpy.Entity.get_indexing_sets", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_pylist);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/entity.pxi":224
 *         return pylist
 * 
 *     def xref(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the names of all entities which depend on this one.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_6Entity_27xref(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_6Entity_26xref, "Entity.xref(self)\n\n        Get the names of all entities which depend on this one.\n\n        Returns:\n            A list with the names of all entities which depend on this one.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_6Entity_27xref = {"xref", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_6Entity_27xref, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_6Entity_26xref};
static PyObject *__pyx_pw_7_amplpy_6Entity_27xref(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("xref (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("xref", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "xref", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_6Entity_26xref(((struct __pyx_obj_7_amplpy_Entity *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_6Entity_26xref(struct __pyx_obj_7_amplpy_Entity *__pyx_v_self) {
  size_t __pyx_v_size;
  char **__pyx_v_xref;
  PyObject *__pyx_v_pylist = 0;
  size_t __pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  size_t __pyx_t_2;
  size_t __pyx_t_3;
  size_t __pyx_t_4;
  int __pyx_t_5;
  char *__pyx_t_6;
  Py_ssize_t __pyx_t_7;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("xref", 1);

  /* "amplpy/entity.pxi":233
 *         cdef size_t size
 *         cdef char** xref
 *         cdef list pylist = []             # <<<<<<<<<<<<<<
 *         campl.AMPL_EntityGetXref(self._c_ampl, self._name, &xref, &size)
 *         for i in range(size):
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 233, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_pylist = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "amplpy/entity.pxi":234
 *         cdef char** xref
 *         cdef list pylist = []
 *         campl.AMPL_EntityGetXref(self._c_ampl, self._name, &xref, &size)             # <<<<<<<<<<<<<<
 *         for i in range(size):
 *             if xref[i] != NULL:
 */
  (void)(AMPL_EntityGetXref(__pyx_v_self->_c_ampl, __pyx_v_self->_name, (&__pyx_v_xref), (&__pyx_v_size)));

  /* "amplpy/entity.pxi":235
 *         cdef list pylist = []
 *         campl.AMPL_EntityGetXref(self._c_ampl, self._name, &xref, &size)
 *         for i in range(size):             # <<<<<<<<<<<<<<
 *             if xref[i] != NULL:
 *                 pylist.append(xref[i].decode('utf-8'))
 */
  __pyx_t_2 = __pyx_v_size;
  __pyx_t_3 = __pyx_t_2;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
    __pyx_v_i = __pyx_t_4;

    /* "amplpy/entity.pxi":236
 *         campl.AMPL_EntityGetXref(self._c_ampl, self._name, &xref, &size)
 *         for i in range(size):
 *             if xref[i] != NULL:             # <<<<<<<<<<<<<<
 *                 pylist.append(xref[i].decode('utf-8'))
 *                 campl.AMPL_StringFree(&xref[i])
 */
    __pyx_t_5 = ((__pyx_v_xref[__pyx_v_i]) != NULL);
    if (__pyx_t_5) {

      /* "amplpy/entity.pxi":237
 *         for i in range(size):
 *             if xref[i] != NULL:
 *                 pylist.append(xref[i].decode('utf-8'))             # <<<<<<<<<<<<<<
 *                 campl.AMPL_StringFree(&xref[i])
 *             else:
 */
      __pyx_t_6 = (__pyx_v_xref[__pyx_v_i]);
      __pyx_t_7 = __Pyx_ssize_strlen(__pyx_t_6); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(9, 237, __pyx_L1_error)
      __pyx_t_1 = __Pyx_decode_c_string(__pyx_t_6, 0, __pyx_t_7, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 237, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_pylist, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(9, 237, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "amplpy/entity.pxi":238
 *             if xref[i] != NULL:
 *                 pylist.append(xref[i].decode('utf-8'))
 *                 campl.AMPL_StringFree(&xref[i])             # <<<<<<<<<<<<<<
 *             else:
 *                 pylist.append(None)
 */
      (void)(AMPL_StringFree((&(__pyx_v_xref[__pyx_v_i]))));

      /* "amplpy/entity.pxi":236
 *         campl.AMPL_EntityGetXref(self._c_ampl, self._name, &xref, &size)
 *         for i in range(size):
 *             if xref[i] != NULL:             # <<<<<<<<<<<<<<
 *                 pylist.append(xref[i].decode('utf-8'))
 *                 campl.AMPL_StringFree(&xref[i])
 */
      goto __pyx_L5;
    }

    /* "amplpy/entity.pxi":240
 *                 campl.AMPL_StringFree(&xref[i])
 *             else:
 *                 pylist.append(None)             # <<<<<<<<<<<<<<
 *         free(xref)
 *         return pylist
 */
    /*else*/ {
      __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_pylist, Py_None); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(9, 240, __pyx_L1_error)
    }
    __pyx_L5:;
  }

  /* "amplpy/entity.pxi":241
 *             else:
 *                 pylist.append(None)
 *         free(xref)             # <<<<<<<<<<<<<<
 *         return pylist
 * 
 */
  free(__pyx_v_xref);

  /* "amplpy/entity.pxi":242
 *                 pylist.append(None)
 *         free(xref)
 *         return pylist             # <<<<<<<<<<<<<<
 * 
 *     def get_values(self, suffixes=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_pylist);
  __pyx_r = __pyx_v_pylist;
  goto __pyx_L0;

  /* "amplpy/entity.pxi":224
 *         return pylist
 * 
 *     def xref(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the names of all entities which depend on this one.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("_amplpy.Entity.xref", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_pylist);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/entity.pxi":244
 *         return pylist
 * 
 *     def get_values(self, suffixes=None):             # <<<<<<<<<<<<<<
 *         """
 *         If a list of suffixes is provided, get the specified suffixes value for
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_6Entity_29get_values(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_6Entity_28get_values, "Entity.get_values(self, suffixes=None)\n\n        If a list of suffixes is provided, get the specified suffixes value for\n        all instances. Otherwise, get all the principal values of this entity.\n        The specific returned value depends on the type of entity (see list\n        below). For:\n\n        - Variables and Objectives it returns the suffix ``val``.\n        - Parameters it returns their values.\n        - Constraints it returns the suffix ``dual``.\n        - Sets it returns all the members of the set. Note that it does not\n          apply to indexed sets. See :func:`~amplpy.Set.get_values`.\n\n        Raises:\n            RuntimeError: if there are issues with the data.\n\n        Retruns:\n            A :class:`~amplpy.DataFrame` containing the values for all\n            instances.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_6Entity_29get_values = {"get_values", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_6Entity_29get_values, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_6Entity_28get_values};
static PyObject *__pyx_pw_7_amplpy_6Entity_29get_values(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_suffixes = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_values (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_suffixes,0};
    values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_suffixes);
          if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(9, 244, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get_values") < 0)) __PYX_ERR(9, 244, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_suffixes = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_values", 0, 0, 1, __pyx_nargs); __PYX_ERR(9, 244, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.Entity.get_values", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_6Entity_28get_values(((struct __pyx_obj_7_amplpy_Entity *)__pyx_v_self), __pyx_v_suffixes);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_6Entity_28get_values(struct __pyx_obj_7_amplpy_Entity *__pyx_v_self, PyObject *__pyx_v_suffixes) {
  AMPL_DATAFRAME *__pyx_v_df_c;
  char **__pyx_v_suffixes_c;
  size_t __pyx_v_n;
  Py_ssize_t __pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  unsigned int __pyx_t_8;
  char const *__pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_values", 0);
  __Pyx_INCREF(__pyx_v_suffixes);

  /* "amplpy/entity.pxi":267
 *         cdef char** suffixes_c
 *         cdef size_t n
 *         if suffixes is None:             # <<<<<<<<<<<<<<
 *             n = 0
 *             PY_AMPL_CALL(campl.AMPL_EntityGetValues(self._c_ampl, self._name, NULL, n, &df_c))
 */
  __pyx_t_1 = (__pyx_v_suffixes == Py_None);
  if (__pyx_t_1) {

    /* "amplpy/entity.pxi":268
 *         cdef size_t n
 *         if suffixes is None:
 *             n = 0             # <<<<<<<<<<<<<<
 *             PY_AMPL_CALL(campl.AMPL_EntityGetValues(self._c_ampl, self._name, NULL, n, &df_c))
 *         else:
 */
    __pyx_v_n = 0;

    /* "amplpy/entity.pxi":269
 *         if suffixes is None:
 *             n = 0
 *             PY_AMPL_CALL(campl.AMPL_EntityGetValues(self._c_ampl, self._name, NULL, n, &df_c))             # <<<<<<<<<<<<<<
 *         else:
 *             if isinstance(suffixes, str):
 */
    __pyx_t_2 = __pyx_f_7_amplpy_PY_AMPL_CALL(AMPL_EntityGetValues(__pyx_v_self->_c_ampl, __pyx_v_self->_name, NULL, __pyx_v_n, (&__pyx_v_df_c))); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 269, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "amplpy/entity.pxi":267
 *         cdef char** suffixes_c
 *         cdef size_t n
 *         if suffixes is None:             # <<<<<<<<<<<<<<
 *             n = 0
 *             PY_AMPL_CALL(campl.AMPL_EntityGetValues(self._c_ampl, self._name, NULL, n, &df_c))
 */
    goto __pyx_L3;
  }

  /* "amplpy/entity.pxi":271
 *             PY_AMPL_CALL(campl.AMPL_EntityGetValues(self._c_ampl, self._name, NULL, n, &df_c))
 *         else:
 *             if isinstance(suffixes, str):             # <<<<<<<<<<<<<<
 *                 suffixes = [suffixes]
 *             else:
 */
  /*else*/ {
    __pyx_t_1 = PyUnicode_Check(__pyx_v_suffixes); 
    if (__pyx_t_1) {

      /* "amplpy/entity.pxi":272
 *         else:
 *             if isinstance(suffixes, str):
 *                 suffixes = [suffixes]             # <<<<<<<<<<<<<<
 *             else:
 *                 suffixes = list(map(str, suffixes))
 */
      __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 272, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_suffixes);
      __Pyx_GIVEREF(__pyx_v_suffixes);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_v_suffixes)) __PYX_ERR(9, 272, __pyx_L1_error);
      __Pyx_DECREF_SET(__pyx_v_suffixes, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "amplpy/entity.pxi":271
 *             PY_AMPL_CALL(campl.AMPL_EntityGetValues(self._c_ampl, self._name, NULL, n, &df_c))
 *         else:
 *             if isinstance(suffixes, str):             # <<<<<<<<<<<<<<
 *                 suffixes = [suffixes]
 *             else:
 */
      goto __pyx_L4;
    }

    /* "amplpy/entity.pxi":274
 *                 suffixes = [suffixes]
 *             else:
 *                 suffixes = list(map(str, suffixes))             # <<<<<<<<<<<<<<
 *             suffixes_c = <char**> malloc(len(suffixes) * sizeof(char*))
 *             for i in range(len(suffixes)):
 */
    /*else*/ {
      __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 274, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF((PyObject *)(&PyUnicode_Type));
      __Pyx_GIVEREF((PyObject *)(&PyUnicode_Type));
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)(&PyUnicode_Type)))) __PYX_ERR(9, 274, __pyx_L1_error);
      __Pyx_INCREF(__pyx_v_suffixes);
      __Pyx_GIVEREF(__pyx_v_suffixes);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_suffixes)) __PYX_ERR(9, 274, __pyx_L1_error);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 274, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_PySequence_ListKeepNew(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 274, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF_SET(__pyx_v_suffixes, __pyx_t_2);
      __pyx_t_2 = 0;
    }
    __pyx_L4:;

    /* "amplpy/entity.pxi":275
 *             else:
 *                 suffixes = list(map(str, suffixes))
 *             suffixes_c = <char**> malloc(len(suffixes) * sizeof(char*))             # <<<<<<<<<<<<<<
 *             for i in range(len(suffixes)):
 *                 suffixes_c[i] = strdup(suffixes[i].encode('utf-8'))
 */
    __pyx_t_4 = PyObject_Length(__pyx_v_suffixes); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(9, 275, __pyx_L1_error)
    __pyx_v_suffixes_c = ((char **)malloc((__pyx_t_4 * (sizeof(char *)))));

    /* "amplpy/entity.pxi":276
 *                 suffixes = list(map(str, suffixes))
 *             suffixes_c = <char**> malloc(len(suffixes) * sizeof(char*))
 *             for i in range(len(suffixes)):             # <<<<<<<<<<<<<<
 *                 suffixes_c[i] = strdup(suffixes[i].encode('utf-8'))
 *             n = len(suffixes)
 */
    __pyx_t_4 = PyObject_Length(__pyx_v_suffixes); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(9, 276, __pyx_L1_error)
    __pyx_t_5 = __pyx_t_4;
    for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
      __pyx_v_i = __pyx_t_6;

      /* "amplpy/entity.pxi":277
 *             suffixes_c = <char**> malloc(len(suffixes) * sizeof(char*))
 *             for i in range(len(suffixes)):
 *                 suffixes_c[i] = strdup(suffixes[i].encode('utf-8'))             # <<<<<<<<<<<<<<
 *             n = len(suffixes)
 *             campl.AMPL_EntityGetValues(self._c_ampl, self._name, suffixes_c, n, &df_c)
 */
      __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_suffixes, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 277, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_encode); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 277, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = NULL;
      __pyx_t_8 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_8 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_u_utf_8};
        __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 277, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __pyx_t_9 = __Pyx_PyObject_AsString(__pyx_t_2); if (unlikely((!__pyx_t_9) && PyErr_Occurred())) __PYX_ERR(9, 277, __pyx_L1_error)
      (__pyx_v_suffixes_c[__pyx_v_i]) = strdup(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }

    /* "amplpy/entity.pxi":278
 *             for i in range(len(suffixes)):
 *                 suffixes_c[i] = strdup(suffixes[i].encode('utf-8'))
 *             n = len(suffixes)             # <<<<<<<<<<<<<<
 *             campl.AMPL_EntityGetValues(self._c_ampl, self._name, suffixes_c, n, &df_c)
 *             for i in range(len(suffixes)):
 */
    __pyx_t_4 = PyObject_Length(__pyx_v_suffixes); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(9, 278, __pyx_L1_error)
    __pyx_v_n = __pyx_t_4;

    /* "amplpy/entity.pxi":279
 *                 suffixes_c[i] = strdup(suffixes[i].encode('utf-8'))
 *             n = len(suffixes)
 *             campl.AMPL_EntityGetValues(self._c_ampl, self._name, suffixes_c, n, &df_c)             # <<<<<<<<<<<<<<
 *             for i in range(len(suffixes)):
 *                 free(suffixes_c[i])
 */
    (void)(AMPL_EntityGetValues(__pyx_v_self->_c_ampl, __pyx_v_self->_name, __pyx_v_suffixes_c, __pyx_v_n, (&__pyx_v_df_c)));

    /* "amplpy/entity.pxi":280
 *             n = len(suffixes)
 *             campl.AMPL_EntityGetValues(self._c_ampl, self._name, suffixes_c, n, &df_c)
 *             for i in range(len(suffixes)):             # <<<<<<<<<<<<<<
 *                 free(suffixes_c[i])
 *             free(suffixes_c)
 */
    __pyx_t_4 = PyObject_Length(__pyx_v_suffixes); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(9, 280, __pyx_L1_error)
    __pyx_t_5 = __pyx_t_4;
    for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
      __pyx_v_i = __pyx_t_6;

      /* "amplpy/entity.pxi":281
 *             campl.AMPL_EntityGetValues(self._c_ampl, self._name, suffixes_c, n, &df_c)
 *             for i in range(len(suffixes)):
 *                 free(suffixes_c[i])             # <<<<<<<<<<<<<<
 *             free(suffixes_c)
 * 
 */
      free((__pyx_v_suffixes_c[__pyx_v_i]));
    }

    /* "amplpy/entity.pxi":282
 *             for i in range(len(suffixes)):
 *                 free(suffixes_c[i])
 *             free(suffixes_c)             # <<<<<<<<<<<<<<
 * 
 *         return DataFrame.create(df_c)
 */
    free(__pyx_v_suffixes_c);
  }
  __pyx_L3:;

  /* "amplpy/entity.pxi":284
 *             free(suffixes_c)
 * 
 *         return DataFrame.create(df_c)             # <<<<<<<<<<<<<<
 * 
 *     def to_pandas(self, **kwargs):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_7_amplpy_9DataFrame_create(__pyx_v_df_c); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 284, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "amplpy/entity.pxi":244
 *         return pylist
 * 
 *     def get_values(self, suffixes=None):             # <<<<<<<<<<<<<<
 *         """
 *         If a list of suffixes is provided, get the specified suffixes value for
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("_amplpy.Entity.get_values", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_suffixes);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/entity.pxi":286
 *         return DataFrame.create(df_c)
 * 
 *     def to_pandas(self, **kwargs):             # <<<<<<<<<<<<<<
 *         """
 *         Equivalent to ``Entity.get_values().``:func:`~amplpy.DataFrame.to_pandas`.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_6Entity_31to_pandas(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_6Entity_30to_pandas, "Entity.to_pandas(self, **kwargs)\n\n        Equivalent to ``Entity.get_values().``:func:`~amplpy.DataFrame.to_pandas`.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_6Entity_31to_pandas = {"to_pandas", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_6Entity_31to_pandas, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_6Entity_30to_pandas};
static PyObject *__pyx_pw_7_amplpy_6Entity_31to_pandas(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_kwargs = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_pandas (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("to_pandas", 1, 0, 0, __pyx_nargs); return NULL;}
  if (__pyx_kwds && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "to_pandas", 1))) return NULL;
  if (__pyx_kwds) {
    __pyx_v_kwargs = __Pyx_KwargsAsDict_FASTCALL(__pyx_kwds, __pyx_kwvalues);
    if (unlikely(!__pyx_v_kwargs)) return NULL;
    __Pyx_GOTREF(__pyx_v_kwargs);
  } else {
    __pyx_v_kwargs = PyDict_New();
    if (unlikely(!__pyx_v_kwargs)) return NULL;
    __Pyx_GOTREF(__pyx_v_kwargs);
  }
  __pyx_r = __pyx_pf_7_amplpy_6Entity_30to_pandas(((struct __pyx_obj_7_amplpy_Entity *)__pyx_v_self), __pyx_v_kwargs);

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

static PyObject *__pyx_pf_7_amplpy_6Entity_30to_pandas(struct __pyx_obj_7_amplpy_Entity *__pyx_v_self, PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_pandas", 1);

  /* "amplpy/entity.pxi":290
 *         Equivalent to ``Entity.get_values().``:func:`~amplpy.DataFrame.to_pandas`.
 *         """
 *         return self.get_values().to_pandas(**kwargs)             # <<<<<<<<<<<<<<
 * 
 *     def to_dict(self, **kwargs):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_values); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 290, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 290, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_to_pandas); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 290, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyDict_Copy(__pyx_v_kwargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 290, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 290, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "amplpy/entity.pxi":286
 *         return DataFrame.create(df_c)
 * 
 *     def to_pandas(self, **kwargs):             # <<<<<<<<<<<<<<
 *         """
 *         Equivalent to ``Entity.get_values().``:func:`~amplpy.DataFrame.to_pandas`.
 */

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

/* "amplpy/entity.pxi":292
 *         return self.get_values().to_pandas(**kwargs)
 * 
 *     def to_dict(self, **kwargs):             # <<<<<<<<<<<<<<
 *         """
 *         Equivalent to ``Entity.get_values().``:func:`~amplpy.DataFrame.to_dict`.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_6Entity_33to_dict(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_6Entity_32to_dict, "Entity.to_dict(self, **kwargs)\n\n        Equivalent to ``Entity.get_values().``:func:`~amplpy.DataFrame.to_dict`.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_6Entity_33to_dict = {"to_dict", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_6Entity_33to_dict, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_6Entity_32to_dict};
static PyObject *__pyx_pw_7_amplpy_6Entity_33to_dict(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_kwargs = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_dict (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("to_dict", 1, 0, 0, __pyx_nargs); return NULL;}
  if (__pyx_kwds && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "to_dict", 1))) return NULL;
  if (__pyx_kwds) {
    __pyx_v_kwargs = __Pyx_KwargsAsDict_FASTCALL(__pyx_kwds, __pyx_kwvalues);
    if (unlikely(!__pyx_v_kwargs)) return NULL;
    __Pyx_GOTREF(__pyx_v_kwargs);
  } else {
    __pyx_v_kwargs = PyDict_New();
    if (unlikely(!__pyx_v_kwargs)) return NULL;
    __Pyx_GOTREF(__pyx_v_kwargs);
  }
  __pyx_r = __pyx_pf_7_amplpy_6Entity_32to_dict(((struct __pyx_obj_7_amplpy_Entity *)__pyx_v_self), __pyx_v_kwargs);

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

static PyObject *__pyx_pf_7_amplpy_6Entity_32to_dict(struct __pyx_obj_7_amplpy_Entity *__pyx_v_self, PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_dict", 1);

  /* "amplpy/entity.pxi":296
 *         Equivalent to ``Entity.get_values().``:func:`~amplpy.DataFrame.to_dict`.
 *         """
 *         return self.get_values().to_dict(**kwargs)             # <<<<<<<<<<<<<<
 * 
 *     def to_list(self, **kwargs):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_values); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 296, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 296, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_to_dict); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 296, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyDict_Copy(__pyx_v_kwargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 296, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 296, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "amplpy/entity.pxi":292
 *         return self.get_values().to_pandas(**kwargs)
 * 
 *     def to_dict(self, **kwargs):             # <<<<<<<<<<<<<<
 *         """
 *         Equivalent to ``Entity.get_values().``:func:`~amplpy.DataFrame.to_dict`.
 */

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

/* "amplpy/entity.pxi":298
 *         return self.get_values().to_dict(**kwargs)
 * 
 *     def to_list(self, **kwargs):             # <<<<<<<<<<<<<<
 *         """
 *         Equivalent to ``Entity.get_values().``:func:`~amplpy.DataFrame.to_list`.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_6Entity_35to_list(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_6Entity_34to_list, "Entity.to_list(self, **kwargs)\n\n        Equivalent to ``Entity.get_values().``:func:`~amplpy.DataFrame.to_list`.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_6Entity_35to_list = {"to_list", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_6Entity_35to_list, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_6Entity_34to_list};
static PyObject *__pyx_pw_7_amplpy_6Entity_35to_list(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_kwargs = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_list (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("to_list", 1, 0, 0, __pyx_nargs); return NULL;}
  if (__pyx_kwds && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "to_list", 1))) return NULL;
  if (__pyx_kwds) {
    __pyx_v_kwargs = __Pyx_KwargsAsDict_FASTCALL(__pyx_kwds, __pyx_kwvalues);
    if (unlikely(!__pyx_v_kwargs)) return NULL;
    __Pyx_GOTREF(__pyx_v_kwargs);
  } else {
    __pyx_v_kwargs = PyDict_New();
    if (unlikely(!__pyx_v_kwargs)) return NULL;
    __Pyx_GOTREF(__pyx_v_kwargs);
  }
  __pyx_r = __pyx_pf_7_amplpy_6Entity_34to_list(((struct __pyx_obj_7_amplpy_Entity *)__pyx_v_self), __pyx_v_kwargs);

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

static PyObject *__pyx_pf_7_amplpy_6Entity_34to_list(struct __pyx_obj_7_amplpy_Entity *__pyx_v_self, PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_list", 1);

  /* "amplpy/entity.pxi":302
 *         Equivalent to ``Entity.get_values().``:func:`~amplpy.DataFrame.to_list`.
 *         """
 *         return self.get_values().to_list(**kwargs)             # <<<<<<<<<<<<<<
 * 
 *     def set_values(self, data):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_values); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 302, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 302, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_to_list); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 302, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyDict_Copy(__pyx_v_kwargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 302, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 302, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "amplpy/entity.pxi":298
 *         return self.get_values().to_dict(**kwargs)
 * 
 *     def to_list(self, **kwargs):             # <<<<<<<<<<<<<<
 *         """
 *         Equivalent to ``Entity.get_values().``:func:`~amplpy.DataFrame.to_list`.
 */

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

/* "amplpy/entity.pxi":304
 *         return self.get_values().to_list(**kwargs)
 * 
 *     def set_values(self, data):             # <<<<<<<<<<<<<<
 *         """
 *         Set the values of this entiy to the correponding values of a
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_6Entity_37set_values(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_6Entity_36set_values, "Entity.set_values(self, data)\n\n        Set the values of this entiy to the correponding values of a\n        DataFrame indexed over the same sets (or a subset).\n        This function assigns the values in the first data column of\n        the passed dataframe to the entity the function is called from.\n        In particular, the statement:\n\n        .. code-block:: python\n\n            x.set_values(y.get_values())\n\n        is semantically equivalent to the AMPL statement:\n\n        .. code-block:: ampl\n\n            let {s in S} x[s] := y[s];\n\n        Args:\n            data: The data to set the entity to.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_6Entity_37set_values = {"set_values", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_6Entity_37set_values, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_6Entity_36set_values};
static PyObject *__pyx_pw_7_amplpy_6Entity_37set_values(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_data = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_values (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(9, 304, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_values") < 0)) __PYX_ERR(9, 304, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_data = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_values", 1, 1, 1, __pyx_nargs); __PYX_ERR(9, 304, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.Entity.set_values", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_6Entity_36set_values(((struct __pyx_obj_7_amplpy_Entity *)__pyx_v_self), __pyx_v_data);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_6Entity_36set_values(struct __pyx_obj_7_amplpy_Entity *__pyx_v_self, PyObject *__pyx_v_data) {
  struct __pyx_obj_7_amplpy_DataFrame *__pyx_v_df = 0;
  AMPL_DATAFRAME *__pyx_v_df_c;
  char *__pyx_v__name_c;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  AMPL_DATAFRAME *__pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  unsigned int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  Py_ssize_t __pyx_t_12;
  Py_UCS4 __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_values", 1);

  /* "amplpy/entity.pxi":328
 *         cdef campl.AMPL_DATAFRAME* df_c
 *         cdef char* _name_c
 *         campl.AMPL_InstanceGetName(self._c_ampl, self._name, self._index, &_name_c)             # <<<<<<<<<<<<<<
 *         if isinstance(data, DataFrame):
 *             df = data
 */
  (void)(AMPL_InstanceGetName(__pyx_v_self->_c_ampl, __pyx_v_self->_name, __pyx_v_self->_index, (&__pyx_v__name_c)));

  /* "amplpy/entity.pxi":329
 *         cdef char* _name_c
 *         campl.AMPL_InstanceGetName(self._c_ampl, self._name, self._index, &_name_c)
 *         if isinstance(data, DataFrame):             # <<<<<<<<<<<<<<
 *             df = data
 *             df_c = df.get_ptr()
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_data, __pyx_ptype_7_amplpy_DataFrame); 
  if (__pyx_t_1) {

    /* "amplpy/entity.pxi":330
 *         campl.AMPL_InstanceGetName(self._c_ampl, self._name, self._index, &_name_c)
 *         if isinstance(data, DataFrame):
 *             df = data             # <<<<<<<<<<<<<<
 *             df_c = df.get_ptr()
 *             campl.AMPL_EntitySetValues(self._c_ampl, _name_c, df_c)
 */
    if (!(likely(((__pyx_v_data) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_data, __pyx_ptype_7_amplpy_DataFrame))))) __PYX_ERR(9, 330, __pyx_L1_error)
    __pyx_t_2 = __pyx_v_data;
    __Pyx_INCREF(__pyx_t_2);
    __pyx_v_df = ((struct __pyx_obj_7_amplpy_DataFrame *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "amplpy/entity.pxi":331
 *         if isinstance(data, DataFrame):
 *             df = data
 *             df_c = df.get_ptr()             # <<<<<<<<<<<<<<
 *             campl.AMPL_EntitySetValues(self._c_ampl, _name_c, df_c)
 *             campl.AMPL_StringFree(&_name_c)
 */
    __pyx_t_3 = ((struct __pyx_vtabstruct_7_amplpy_DataFrame *)__pyx_v_df->__pyx_vtab)->get_ptr(__pyx_v_df); if (unlikely(PyErr_Occurred())) __PYX_ERR(9, 331, __pyx_L1_error)
    __pyx_v_df_c = __pyx_t_3;

    /* "amplpy/entity.pxi":332
 *             df = data
 *             df_c = df.get_ptr()
 *             campl.AMPL_EntitySetValues(self._c_ampl, _name_c, df_c)             # <<<<<<<<<<<<<<
 *             campl.AMPL_StringFree(&_name_c)
 *         elif isinstance(data, dict):
 */
    (void)(AMPL_EntitySetValues(__pyx_v_self->_c_ampl, __pyx_v__name_c, __pyx_v_df_c));

    /* "amplpy/entity.pxi":333
 *             df_c = df.get_ptr()
 *             campl.AMPL_EntitySetValues(self._c_ampl, _name_c, df_c)
 *             campl.AMPL_StringFree(&_name_c)             # <<<<<<<<<<<<<<
 *         elif isinstance(data, dict):
 *             df = DataFrame.from_dict(data)
 */
    (void)(AMPL_StringFree((&__pyx_v__name_c)));

    /* "amplpy/entity.pxi":329
 *         cdef char* _name_c
 *         campl.AMPL_InstanceGetName(self._c_ampl, self._name, self._index, &_name_c)
 *         if isinstance(data, DataFrame):             # <<<<<<<<<<<<<<
 *             df = data
 *             df_c = df.get_ptr()
 */
    goto __pyx_L3;
  }

  /* "amplpy/entity.pxi":334
 *             campl.AMPL_EntitySetValues(self._c_ampl, _name_c, df_c)
 *             campl.AMPL_StringFree(&_name_c)
 *         elif isinstance(data, dict):             # <<<<<<<<<<<<<<
 *             df = DataFrame.from_dict(data)
 *             df_c = df.get_ptr()
 */
  __pyx_t_1 = PyDict_Check(__pyx_v_data); 
  if (__pyx_t_1) {

    /* "amplpy/entity.pxi":335
 *             campl.AMPL_StringFree(&_name_c)
 *         elif isinstance(data, dict):
 *             df = DataFrame.from_dict(data)             # <<<<<<<<<<<<<<
 *             df_c = df.get_ptr()
 *             campl.AMPL_EntitySetValues(self._c_ampl, _name_c, df_c)
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7_amplpy_DataFrame), __pyx_n_s_from_dict); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 335, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_6 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_data};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 335, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_7_amplpy_DataFrame))))) __PYX_ERR(9, 335, __pyx_L1_error)
    __pyx_v_df = ((struct __pyx_obj_7_amplpy_DataFrame *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "amplpy/entity.pxi":336
 *         elif isinstance(data, dict):
 *             df = DataFrame.from_dict(data)
 *             df_c = df.get_ptr()             # <<<<<<<<<<<<<<
 *             campl.AMPL_EntitySetValues(self._c_ampl, _name_c, df_c)
 *             campl.AMPL_StringFree(&_name_c)
 */
    __pyx_t_3 = ((struct __pyx_vtabstruct_7_amplpy_DataFrame *)__pyx_v_df->__pyx_vtab)->get_ptr(__pyx_v_df); if (unlikely(PyErr_Occurred())) __PYX_ERR(9, 336, __pyx_L1_error)
    __pyx_v_df_c = __pyx_t_3;

    /* "amplpy/entity.pxi":337
 *             df = DataFrame.from_dict(data)
 *             df_c = df.get_ptr()
 *             campl.AMPL_EntitySetValues(self._c_ampl, _name_c, df_c)             # <<<<<<<<<<<<<<
 *             campl.AMPL_StringFree(&_name_c)
 *         else:
 */
    (void)(AMPL_EntitySetValues(__pyx_v_self->_c_ampl, __pyx_v__name_c, __pyx_v_df_c));

    /* "amplpy/entity.pxi":338
 *             df_c = df.get_ptr()
 *             campl.AMPL_EntitySetValues(self._c_ampl, _name_c, df_c)
 *             campl.AMPL_StringFree(&_name_c)             # <<<<<<<<<<<<<<
 *         else:
 *             if pd is not None and isinstance(data, (pd.DataFrame, pd.Series)):
 */
    (void)(AMPL_StringFree((&__pyx_v__name_c)));

    /* "amplpy/entity.pxi":334
 *             campl.AMPL_EntitySetValues(self._c_ampl, _name_c, df_c)
 *             campl.AMPL_StringFree(&_name_c)
 *         elif isinstance(data, dict):             # <<<<<<<<<<<<<<
 *             df = DataFrame.from_dict(data)
 *             df_c = df.get_ptr()
 */
    goto __pyx_L3;
  }

  /* "amplpy/entity.pxi":340
 *             campl.AMPL_StringFree(&_name_c)
 *         else:
 *             if pd is not None and isinstance(data, (pd.DataFrame, pd.Series)):             # <<<<<<<<<<<<<<
 *                 df = DataFrame.from_pandas(data, indexarity=self.indexarity())
 *                 df_c = df.get_ptr()
 */
  /*else*/ {
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_pd); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 340, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_7 = (__pyx_t_2 != Py_None);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_7) {
    } else {
      __pyx_t_1 = __pyx_t_7;
      goto __pyx_L5_bool_binop_done;
    }
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_pd); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 340, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_DataFrame); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 340, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_pd); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 340, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_Series); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 340, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_8 = PyObject_IsInstance(__pyx_v_data, __pyx_t_4); 
    if (!__pyx_t_8) {
    } else {
      __pyx_t_7 = __pyx_t_8;
      goto __pyx_L7_bool_binop_done;
    }
    __pyx_t_8 = PyObject_IsInstance(__pyx_v_data, __pyx_t_5); 
    __pyx_t_7 = __pyx_t_8;
    __pyx_L7_bool_binop_done:;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_1 = __pyx_t_7;
    __pyx_L5_bool_binop_done:;
    if (__pyx_t_1) {

      /* "amplpy/entity.pxi":341
 *         else:
 *             if pd is not None and isinstance(data, (pd.DataFrame, pd.Series)):
 *                 df = DataFrame.from_pandas(data, indexarity=self.indexarity())             # <<<<<<<<<<<<<<
 *                 df_c = df.get_ptr()
 *                 campl.AMPL_EntitySetValues(self._c_ampl, _name_c, df_c)
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7_amplpy_DataFrame), __pyx_n_s_from_pandas); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 341, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 341, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_v_data);
      __Pyx_GIVEREF(__pyx_v_data);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_data)) __PYX_ERR(9, 341, __pyx_L1_error);
      __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 341, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_indexarity); if (unlikely(!__pyx_t_10)) __PYX_ERR(9, 341, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_11 = NULL;
      __pyx_t_6 = 0;
      #if CYTHON_UNPACK_METHODS
      if (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);
          __pyx_t_6 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_11, NULL};
        __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6);
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        if (unlikely(!__pyx_t_9)) __PYX_ERR(9, 341, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      }
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_indexarity, __pyx_t_9) < 0) __PYX_ERR(9, 341, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(9, 341, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_7_amplpy_DataFrame))))) __PYX_ERR(9, 341, __pyx_L1_error)
      __pyx_v_df = ((struct __pyx_obj_7_amplpy_DataFrame *)__pyx_t_9);
      __pyx_t_9 = 0;

      /* "amplpy/entity.pxi":342
 *             if pd is not None and isinstance(data, (pd.DataFrame, pd.Series)):
 *                 df = DataFrame.from_pandas(data, indexarity=self.indexarity())
 *                 df_c = df.get_ptr()             # <<<<<<<<<<<<<<
 *                 campl.AMPL_EntitySetValues(self._c_ampl, _name_c, df_c)
 *                 campl.AMPL_StringFree(&_name_c)
 */
      __pyx_t_3 = ((struct __pyx_vtabstruct_7_amplpy_DataFrame *)__pyx_v_df->__pyx_vtab)->get_ptr(__pyx_v_df); if (unlikely(PyErr_Occurred())) __PYX_ERR(9, 342, __pyx_L1_error)
      __pyx_v_df_c = __pyx_t_3;

      /* "amplpy/entity.pxi":343
 *                 df = DataFrame.from_pandas(data, indexarity=self.indexarity())
 *                 df_c = df.get_ptr()
 *                 campl.AMPL_EntitySetValues(self._c_ampl, _name_c, df_c)             # <<<<<<<<<<<<<<
 *                 campl.AMPL_StringFree(&_name_c)
 *                 return
 */
      (void)(AMPL_EntitySetValues(__pyx_v_self->_c_ampl, __pyx_v__name_c, __pyx_v_df_c));

      /* "amplpy/entity.pxi":344
 *                 df_c = df.get_ptr()
 *                 campl.AMPL_EntitySetValues(self._c_ampl, _name_c, df_c)
 *                 campl.AMPL_StringFree(&_name_c)             # <<<<<<<<<<<<<<
 *                 return
 *             raise TypeError(f"Unexpected data type: {type(data)}.")
 */
      (void)(AMPL_StringFree((&__pyx_v__name_c)));

      /* "amplpy/entity.pxi":345
 *                 campl.AMPL_EntitySetValues(self._c_ampl, _name_c, df_c)
 *                 campl.AMPL_StringFree(&_name_c)
 *                 return             # <<<<<<<<<<<<<<
 *             raise TypeError(f"Unexpected data type: {type(data)}.")
 * 
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      goto __pyx_L0;

      /* "amplpy/entity.pxi":340
 *             campl.AMPL_StringFree(&_name_c)
 *         else:
 *             if pd is not None and isinstance(data, (pd.DataFrame, pd.Series)):             # <<<<<<<<<<<<<<
 *                 df = DataFrame.from_pandas(data, indexarity=self.indexarity())
 *                 df_c = df.get_ptr()
 */
    }

    /* "amplpy/entity.pxi":346
 *                 campl.AMPL_StringFree(&_name_c)
 *                 return
 *             raise TypeError(f"Unexpected data type: {type(data)}.")             # <<<<<<<<<<<<<<
 * 
 *     # Aliases
 */
    __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(9, 346, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_12 = 0;
    __pyx_t_13 = 127;
    __Pyx_INCREF(__pyx_kp_u_Unexpected_data_type);
    __pyx_t_12 += 22;
    __Pyx_GIVEREF(__pyx_kp_u_Unexpected_data_type);
    PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_kp_u_Unexpected_data_type);
    __pyx_t_2 = __Pyx_PyObject_FormatSimple(((PyObject *)Py_TYPE(__pyx_v_data)), __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 346, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_13 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) > __pyx_t_13) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) : __pyx_t_13;
    __pyx_t_12 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_2);
    __pyx_t_2 = 0;
    __Pyx_INCREF(__pyx_kp_u__21);
    __pyx_t_12 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__21);
    PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_kp_u__21);
    __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_9, 3, __pyx_t_12, __pyx_t_13); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 346, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(9, 346, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_9, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __PYX_ERR(9, 346, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "amplpy/entity.pxi":304
 *         return self.get_values().to_list(**kwargs)
 * 
 *     def set_values(self, data):             # <<<<<<<<<<<<<<
 *         """
 *         Set the values of this entiy to the correponding values of a
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("_amplpy.Entity.set_values", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_df);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._c_ampl,self._index cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_6Entity_39__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_6Entity_38__reduce_cython__, "Entity.__reduce_cython__(self)");
static PyMethodDef __pyx_mdef_7_amplpy_6Entity_39__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_6Entity_39__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_6Entity_38__reduce_cython__};
static PyObject *__pyx_pw_7_amplpy_6Entity_39__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_6Entity_38__reduce_cython__(((struct __pyx_obj_7_amplpy_Entity *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_6Entity_38__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7_amplpy_Entity *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 1);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "self._c_ampl,self._index cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self._c_ampl,self._index cannot be converted to a Python object for pickling"
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_self__c_ampl_self__index_cannot, 0, 0);
  __PYX_ERR(8, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._c_ampl,self._index cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 */

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

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._c_ampl,self._index cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._c_ampl,self._index cannot be converted to a Python object for pickling"
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_6Entity_41__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_6Entity_40__setstate_cython__, "Entity.__setstate_cython__(self, __pyx_state)");
static PyMethodDef __pyx_mdef_7_amplpy_6Entity_41__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_6Entity_41__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_6Entity_40__setstate_cython__};
static PyObject *__pyx_pw_7_amplpy_6Entity_41__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 3, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(8, 3, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(8, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.Entity.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_6Entity_40__setstate_cython__(((struct __pyx_obj_7_amplpy_Entity *)__pyx_v_self), __pyx_v___pyx_state);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_6Entity_40__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7_amplpy_Entity *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 1);

  /* "(tree fragment)":4
 *     raise TypeError, "self._c_ampl,self._index cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self._c_ampl,self._index cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_self__c_ampl_self__index_cannot, 0, 0);
  __PYX_ERR(8, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._c_ampl,self._index cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._c_ampl,self._index cannot be converted to a Python object for pickling"
 */

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

/* "amplpy/environment.pxi":12
 *     cdef campl.AMPL_ENVIRONMENT* _c_env
 * 
 *     def __cinit__(self, binary_directory=None, binary_name=None):             # <<<<<<<<<<<<<<
 *         """
 *         Constructor with ability to select the location of the AMPL binary.
 */

/* Python wrapper */
static int __pyx_pw_7_amplpy_11Environment_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7_amplpy_11Environment_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_binary_directory = 0;
  PyObject *__pyx_v_binary_name = 0;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_binary_directory,&__pyx_n_s_binary_name,0};
    values[0] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)Py_None));
    values[1] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)Py_None));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_binary_directory);
          if (value) { values[0] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(10, 12, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_binary_name);
          if (value) { values[1] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(10, 12, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__cinit__") < 0)) __PYX_ERR(10, 12, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_binary_directory = values[0];
    __pyx_v_binary_name = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 2, __pyx_nargs); __PYX_ERR(10, 12, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.Environment.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_11Environment___cinit__(((struct __pyx_obj_7_amplpy_Environment *)__pyx_v_self), __pyx_v_binary_directory, __pyx_v_binary_name);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7_amplpy_11Environment___cinit__(struct __pyx_obj_7_amplpy_Environment *__pyx_v_self, PyObject *__pyx_v_binary_directory, PyObject *__pyx_v_binary_name) {
  PyObject *__pyx_v_option_name = NULL;
  PyObject *__pyx_v_option_value = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  unsigned int __pyx_t_5;
  char const *__pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  char const *__pyx_t_8;
  Py_ssize_t __pyx_t_9;
  char const *__pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  char const *__pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__cinit__", 0);
  __Pyx_INCREF(__pyx_v_binary_directory);
  __Pyx_INCREF(__pyx_v_binary_name);

  /* "amplpy/environment.pxi":22
 *             binary_name: The name of the AMPL executable.
 *         """
 *         if binary_directory is None:             # <<<<<<<<<<<<<<
 *             binary_directory = ""
 *         if binary_name is None:
 */
  __pyx_t_1 = (__pyx_v_binary_directory == Py_None);
  if (__pyx_t_1) {

    /* "amplpy/environment.pxi":23
 *         """
 *         if binary_directory is None:
 *             binary_directory = ""             # <<<<<<<<<<<<<<
 *         if binary_name is None:
 *             binary_name = ""
 */
    __Pyx_INCREF(__pyx_kp_u__22);
    __Pyx_DECREF_SET(__pyx_v_binary_directory, __pyx_kp_u__22);

    /* "amplpy/environment.pxi":22
 *             binary_name: The name of the AMPL executable.
 *         """
 *         if binary_directory is None:             # <<<<<<<<<<<<<<
 *             binary_directory = ""
 *         if binary_name is None:
 */
  }

  /* "amplpy/environment.pxi":24
 *         if binary_directory is None:
 *             binary_directory = ""
 *         if binary_name is None:             # <<<<<<<<<<<<<<
 *             binary_name = ""
 *         campl.AMPL_EnvironmentCreate(&self._c_env, binary_directory.encode('utf-8'), binary_name.encode('utf-8'))
 */
  __pyx_t_1 = (__pyx_v_binary_name == Py_None);
  if (__pyx_t_1) {

    /* "amplpy/environment.pxi":25
 *             binary_directory = ""
 *         if binary_name is None:
 *             binary_name = ""             # <<<<<<<<<<<<<<
 *         campl.AMPL_EnvironmentCreate(&self._c_env, binary_directory.encode('utf-8'), binary_name.encode('utf-8'))
 *         if os.name == "nt":
 */
    __Pyx_INCREF(__pyx_kp_u__22);
    __Pyx_DECREF_SET(__pyx_v_binary_name, __pyx_kp_u__22);

    /* "amplpy/environment.pxi":24
 *         if binary_directory is None:
 *             binary_directory = ""
 *         if binary_name is None:             # <<<<<<<<<<<<<<
 *             binary_name = ""
 *         campl.AMPL_EnvironmentCreate(&self._c_env, binary_directory.encode('utf-8'), binary_name.encode('utf-8'))
 */
  }

  /* "amplpy/environment.pxi":26
 *         if binary_name is None:
 *             binary_name = ""
 *         campl.AMPL_EnvironmentCreate(&self._c_env, binary_directory.encode('utf-8'), binary_name.encode('utf-8'))             # <<<<<<<<<<<<<<
 *         if os.name == "nt":
 *             # Workaround for Windows issue with environment variables
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_binary_directory, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 26, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_u_utf_8};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 26, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_t_2); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(10, 26, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_binary_name, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 26, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_kp_u_utf_8};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 26, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __pyx_t_8 = __Pyx_PyObject_AsString(__pyx_t_3); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(10, 26, __pyx_L1_error)
  (void)(AMPL_EnvironmentCreate((&__pyx_v_self->_c_env), __pyx_t_6, __pyx_t_8));
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "amplpy/environment.pxi":27
 *             binary_name = ""
 *         campl.AMPL_EnvironmentCreate(&self._c_env, binary_directory.encode('utf-8'), binary_name.encode('utf-8'))
 *         if os.name == "nt":             # <<<<<<<<<<<<<<
 *             # Workaround for Windows issue with environment variables
 *             for option_name in ["ampl_libpath", "solver"]:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_n_u_nt, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(10, 27, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_1) {

    /* "amplpy/environment.pxi":29
 *         if os.name == "nt":
 *             # Workaround for Windows issue with environment variables
 *             for option_name in ["ampl_libpath", "solver"]:             # <<<<<<<<<<<<<<
 *                 option_value = os.environ.get(option_name, "")
 *                 if option_value:
 */
    __pyx_t_2 = __pyx_tuple__23; __Pyx_INCREF(__pyx_t_2);
    __pyx_t_9 = 0;
    for (;;) {
      if (__pyx_t_9 >= 2) break;
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_9); __Pyx_INCREF(__pyx_t_3); __pyx_t_9++; if (unlikely((0 < 0))) __PYX_ERR(10, 29, __pyx_L1_error)
      #else
      __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 29, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      #endif
      __Pyx_XDECREF_SET(__pyx_v_option_name, ((PyObject*)__pyx_t_3));
      __pyx_t_3 = 0;

      /* "amplpy/environment.pxi":30
 *             # Workaround for Windows issue with environment variables
 *             for option_name in ["ampl_libpath", "solver"]:
 *                 option_value = os.environ.get(option_name, "")             # <<<<<<<<<<<<<<
 *                 if option_value:
 *                     campl.AMPL_EnvironmentAddEnvironmentVariable(self._c_env, option_name.encode('utf-8'), option_value.encode('utf-8'))
 */
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_os); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 30, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_environ); if (unlikely(!__pyx_t_7)) __PYX_ERR(10, 30, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_get); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 30, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = NULL;
      __pyx_t_5 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
          __pyx_t_5 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_v_option_name, __pyx_kp_u__22};
        __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5);
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 30, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }
      __Pyx_XDECREF_SET(__pyx_v_option_value, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "amplpy/environment.pxi":31
 *             for option_name in ["ampl_libpath", "solver"]:
 *                 option_value = os.environ.get(option_name, "")
 *                 if option_value:             # <<<<<<<<<<<<<<
 *                     campl.AMPL_EnvironmentAddEnvironmentVariable(self._c_env, option_name.encode('utf-8'), option_value.encode('utf-8'))
 * 
 */
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_option_value); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(10, 31, __pyx_L1_error)
      if (__pyx_t_1) {

        /* "amplpy/environment.pxi":32
 *                 option_value = os.environ.get(option_name, "")
 *                 if option_value:
 *                     campl.AMPL_EnvironmentAddEnvironmentVariable(self._c_env, option_name.encode('utf-8'), option_value.encode('utf-8'))             # <<<<<<<<<<<<<<
 * 
 *     cdef campl.AMPL_ENVIRONMENT* get_c_pointer(self):
 */
        if (unlikely(__pyx_v_option_name == Py_None)) {
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "encode");
          __PYX_ERR(10, 32, __pyx_L1_error)
        }
        __pyx_t_3 = PyUnicode_AsUTF8String(__pyx_v_option_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 32, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_10 = __Pyx_PyBytes_AsString(__pyx_t_3); if (unlikely((!__pyx_t_10) && PyErr_Occurred())) __PYX_ERR(10, 32, __pyx_L1_error)
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_option_value, __pyx_n_s_encode); if (unlikely(!__pyx_t_7)) __PYX_ERR(10, 32, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_11 = NULL;
        __pyx_t_5 = 0;
        #if CYTHON_UNPACK_METHODS
        if (likely(PyMethod_Check(__pyx_t_7))) {
          __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_7);
          if (likely(__pyx_t_11)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
            __Pyx_INCREF(__pyx_t_11);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_7, function);
            __pyx_t_5 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_kp_u_utf_8};
          __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 32, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        }
        __pyx_t_12 = __Pyx_PyObject_AsString(__pyx_t_4); if (unlikely((!__pyx_t_12) && PyErr_Occurred())) __PYX_ERR(10, 32, __pyx_L1_error)
        (void)(AMPL_EnvironmentAddEnvironmentVariable(__pyx_v_self->_c_env, __pyx_t_10, __pyx_t_12));
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "amplpy/environment.pxi":31
 *             for option_name in ["ampl_libpath", "solver"]:
 *                 option_value = os.environ.get(option_name, "")
 *                 if option_value:             # <<<<<<<<<<<<<<
 *                     campl.AMPL_EnvironmentAddEnvironmentVariable(self._c_env, option_name.encode('utf-8'), option_value.encode('utf-8'))
 * 
 */
      }

      /* "amplpy/environment.pxi":29
 *         if os.name == "nt":
 *             # Workaround for Windows issue with environment variables
 *             for option_name in ["ampl_libpath", "solver"]:             # <<<<<<<<<<<<<<
 *                 option_value = os.environ.get(option_name, "")
 *                 if option_value:
 */
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "amplpy/environment.pxi":27
 *             binary_name = ""
 *         campl.AMPL_EnvironmentCreate(&self._c_env, binary_directory.encode('utf-8'), binary_name.encode('utf-8'))
 *         if os.name == "nt":             # <<<<<<<<<<<<<<
 *             # Workaround for Windows issue with environment variables
 *             for option_name in ["ampl_libpath", "solver"]:
 */
  }

  /* "amplpy/environment.pxi":12
 *     cdef campl.AMPL_ENVIRONMENT* _c_env
 * 
 *     def __cinit__(self, binary_directory=None, binary_name=None):             # <<<<<<<<<<<<<<
 *         """
 *         Constructor with ability to select the location of the AMPL binary.
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("_amplpy.Environment.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_option_name);
  __Pyx_XDECREF(__pyx_v_option_value);
  __Pyx_XDECREF(__pyx_v_binary_directory);
  __Pyx_XDECREF(__pyx_v_binary_name);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/environment.pxi":34
 *                     campl.AMPL_EnvironmentAddEnvironmentVariable(self._c_env, option_name.encode('utf-8'), option_value.encode('utf-8'))
 * 
 *     cdef campl.AMPL_ENVIRONMENT* get_c_pointer(self):             # <<<<<<<<<<<<<<
 *         return self._c_env
 * 
 */

static AMPL_ENVIRONMENT *__pyx_f_7_amplpy_11Environment_get_c_pointer(struct __pyx_obj_7_amplpy_Environment *__pyx_v_self) {
  AMPL_ENVIRONMENT *__pyx_r;

  /* "amplpy/environment.pxi":35
 * 
 *     cdef campl.AMPL_ENVIRONMENT* get_c_pointer(self):
 *         return self._c_env             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
  __pyx_r = __pyx_v_self->_c_env;
  goto __pyx_L0;

  /* "amplpy/environment.pxi":34
 *                     campl.AMPL_EnvironmentAddEnvironmentVariable(self._c_env, option_name.encode('utf-8'), option_value.encode('utf-8'))
 * 
 *     cdef campl.AMPL_ENVIRONMENT* get_c_pointer(self):             # <<<<<<<<<<<<<<
 *         return self._c_env
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "amplpy/environment.pxi":37
 *         return self._c_env
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         campl.AMPL_EnvironmentFree(&self._c_env)
 * 
 */

/* Python wrapper */
static void __pyx_pw_7_amplpy_11Environment_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_7_amplpy_11Environment_3__dealloc__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_pf_7_amplpy_11Environment_2__dealloc__(((struct __pyx_obj_7_amplpy_Environment *)__pyx_v_self));

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

static void __pyx_pf_7_amplpy_11Environment_2__dealloc__(struct __pyx_obj_7_amplpy_Environment *__pyx_v_self) {

  /* "amplpy/environment.pxi":38
 * 
 *     def __dealloc__(self):
 *         campl.AMPL_EnvironmentFree(&self._c_env)             # <<<<<<<<<<<<<<
 * 
 *     def __str__(self):
 */
  (void)(AMPL_EnvironmentFree((&__pyx_v_self->_c_env)));

  /* "amplpy/environment.pxi":37
 *         return self._c_env
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         campl.AMPL_EnvironmentFree(&self._c_env)
 * 
 */

  /* function exit code */
}

/* "amplpy/environment.pxi":40
 *         campl.AMPL_EnvironmentFree(&self._c_env)
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return self.to_string()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_11Environment_5__str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7_amplpy_11Environment_5__str__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7_amplpy_11Environment_4__str__(((struct __pyx_obj_7_amplpy_Environment *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_11Environment_4__str__(struct __pyx_obj_7_amplpy_Environment *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__str__", 1);

  /* "amplpy/environment.pxi":41
 * 
 *     def __str__(self):
 *         return self.to_string()             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_to_string); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 41, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 41, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "amplpy/environment.pxi":40
 *         campl.AMPL_EnvironmentFree(&self._c_env)
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return self.to_string()
 * 
 */

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

/* "amplpy/environment.pxi":43
 *         return self.to_string()
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return EnvIterator.create(self._c_env)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_11Environment_7__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7_amplpy_11Environment_7__iter__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7_amplpy_11Environment_6__iter__(((struct __pyx_obj_7_amplpy_Environment *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_11Environment_6__iter__(struct __pyx_obj_7_amplpy_Environment *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__iter__", 1);

  /* "amplpy/environment.pxi":44
 * 
 *     def __iter__(self):
 *         return EnvIterator.create(self._c_env)             # <<<<<<<<<<<<<<
 * 
 *     def __setitem__(self, name, value):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7_amplpy_11EnvIterator_create(__pyx_v_self->_c_env); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 44, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "amplpy/environment.pxi":43
 *         return self.to_string()
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return EnvIterator.create(self._c_env)
 * 
 */

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

/* "amplpy/environment.pxi":46
 *         return EnvIterator.create(self._c_env)
 * 
 *     def __setitem__(self, name, value):             # <<<<<<<<<<<<<<
 *         """
 *         Add an environment variable to the environment, or change its value if
 */

/* Python wrapper */
static int __pyx_pw_7_amplpy_11Environment_9__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_11Environment_8__setitem__, "\n        Add an environment variable to the environment, or change its value if\n        already defined.\n\n        Args:\n            name: Name of the environment variable.\n\n            value: Value to be assigned.\n        ");
#if CYTHON_UPDATE_DESCRIPTOR_DOC
struct wrapperbase __pyx_wrapperbase_7_amplpy_11Environment_8__setitem__;
#endif
static int __pyx_pw_7_amplpy_11Environment_9__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7_amplpy_11Environment_8__setitem__(((struct __pyx_obj_7_amplpy_Environment *)__pyx_v_self), ((PyObject *)__pyx_v_name), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_7_amplpy_11Environment_8__setitem__(struct __pyx_obj_7_amplpy_Environment *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  char const *__pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  char const *__pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setitem__", 1);

  /* "amplpy/environment.pxi":56
 *             value: Value to be assigned.
 *         """
 *         campl.AMPL_EnvironmentAddEnvironmentVariable(self._c_env, name.encode('utf-8'), value.encode('utf-8'))             # <<<<<<<<<<<<<<
 * 
 *     def __getitem__(self, name):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 56, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_u_utf_8};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 56, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_t_5 = __Pyx_PyObject_AsString(__pyx_t_1); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) __PYX_ERR(10, 56, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 56, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (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);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_kp_u_utf_8};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 56, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_t_7 = __Pyx_PyObject_AsString(__pyx_t_2); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(10, 56, __pyx_L1_error)
  (void)(AMPL_EnvironmentAddEnvironmentVariable(__pyx_v_self->_c_env, __pyx_t_5, __pyx_t_7));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "amplpy/environment.pxi":46
 *         return EnvIterator.create(self._c_env)
 * 
 *     def __setitem__(self, name, value):             # <<<<<<<<<<<<<<
 *         """
 *         Add an environment variable to the environment, or change its value if
 */

  /* function exit code */
  __pyx_r = 0;
  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("_amplpy.Environment.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/environment.pxi":58
 *         campl.AMPL_EnvironmentAddEnvironmentVariable(self._c_env, name.encode('utf-8'), value.encode('utf-8'))
 * 
 *     def __getitem__(self, name):             # <<<<<<<<<<<<<<
 *         """
 *         Searches the current object for an environment variable called name and
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_11Environment_11__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_name); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_11Environment_10__getitem__, "\n        Searches the current object for an environment variable called name and\n        returns an iterator to it if found, otherwise it returns `None`.\n        ");
#if CYTHON_UPDATE_DESCRIPTOR_DOC
struct wrapperbase __pyx_wrapperbase_7_amplpy_11Environment_10__getitem__;
#endif
static PyObject *__pyx_pw_7_amplpy_11Environment_11__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_name) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7_amplpy_11Environment_10__getitem__(((struct __pyx_obj_7_amplpy_Environment *)__pyx_v_self), ((PyObject *)__pyx_v_name));

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

static PyObject *__pyx_pf_7_amplpy_11Environment_10__getitem__(struct __pyx_obj_7_amplpy_Environment *__pyx_v_self, PyObject *__pyx_v_name) {
  AMPL_ENVIRONMENTVAR *__pyx_v_iterator;
  char *__pyx_v_value_c;
  PyObject *__pyx_v_value = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  char const *__pyx_t_5;
  int __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getitem__", 1);

  /* "amplpy/environment.pxi":65
 *         cdef campl.AMPL_ENVIRONMENTVAR* iterator
 *         cdef char* value_c
 *         if not campl.AMPL_EnvironmentFindEnvironmentVar(self._c_env, name.encode('utf-8'), &iterator):             # <<<<<<<<<<<<<<
 *             campl.AMPL_EnvironmentVarGetValue(iterator, &value_c)
 *             value = str(value_c.decode('utf-8'))
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 65, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_u_utf_8};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 65, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_t_5 = __Pyx_PyObject_AsString(__pyx_t_1); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) __PYX_ERR(10, 65, __pyx_L1_error)
  __pyx_t_6 = (!(AMPL_EnvironmentFindEnvironmentVar(__pyx_v_self->_c_env, __pyx_t_5, (&__pyx_v_iterator)) != 0));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_6) {

    /* "amplpy/environment.pxi":66
 *         cdef char* value_c
 *         if not campl.AMPL_EnvironmentFindEnvironmentVar(self._c_env, name.encode('utf-8'), &iterator):
 *             campl.AMPL_EnvironmentVarGetValue(iterator, &value_c)             # <<<<<<<<<<<<<<
 *             value = str(value_c.decode('utf-8'))
 *             return value
 */
    (void)(AMPL_EnvironmentVarGetValue(__pyx_v_iterator, (&__pyx_v_value_c)));

    /* "amplpy/environment.pxi":67
 *         if not campl.AMPL_EnvironmentFindEnvironmentVar(self._c_env, name.encode('utf-8'), &iterator):
 *             campl.AMPL_EnvironmentVarGetValue(iterator, &value_c)
 *             value = str(value_c.decode('utf-8'))             # <<<<<<<<<<<<<<
 *             return value
 *         else:
 */
    __pyx_t_7 = __Pyx_ssize_strlen(__pyx_v_value_c); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(10, 67, __pyx_L1_error)
    __pyx_t_1 = __Pyx_decode_c_string(__pyx_v_value_c, 0, __pyx_t_7, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 67, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_value = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "amplpy/environment.pxi":68
 *             campl.AMPL_EnvironmentVarGetValue(iterator, &value_c)
 *             value = str(value_c.decode('utf-8'))
 *             return value             # <<<<<<<<<<<<<<
 *         else:
 *             return None
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_value);
    __pyx_r = __pyx_v_value;
    goto __pyx_L0;

    /* "amplpy/environment.pxi":65
 *         cdef campl.AMPL_ENVIRONMENTVAR* iterator
 *         cdef char* value_c
 *         if not campl.AMPL_EnvironmentFindEnvironmentVar(self._c_env, name.encode('utf-8'), &iterator):             # <<<<<<<<<<<<<<
 *             campl.AMPL_EnvironmentVarGetValue(iterator, &value_c)
 *             value = str(value_c.decode('utf-8'))
 */
  }

  /* "amplpy/environment.pxi":70
 *             return value
 *         else:
 *             return None             # <<<<<<<<<<<<<<
 * 
 *     def to_string(self):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "amplpy/environment.pxi":58
 *         campl.AMPL_EnvironmentAddEnvironmentVariable(self._c_env, name.encode('utf-8'), value.encode('utf-8'))
 * 
 *     def __getitem__(self, name):             # <<<<<<<<<<<<<<
 *         """
 *         Searches the current object for an environment variable called name and
 */

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

/* "amplpy/environment.pxi":72
 *             return None
 * 
 *     def to_string(self):             # <<<<<<<<<<<<<<
 *         cdef const char* to_string_c
 *         campl.AMPL_EnvironmentToString(self._c_env, &to_string_c)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_11Environment_13to_string(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_11Environment_12to_string, "Environment.to_string(self)");
static PyMethodDef __pyx_mdef_7_amplpy_11Environment_13to_string = {"to_string", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_11Environment_13to_string, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_11Environment_12to_string};
static PyObject *__pyx_pw_7_amplpy_11Environment_13to_string(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_string (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("to_string", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "to_string", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_11Environment_12to_string(((struct __pyx_obj_7_amplpy_Environment *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_11Environment_12to_string(struct __pyx_obj_7_amplpy_Environment *__pyx_v_self) {
  char const *__pyx_v_to_string_c;
  PyObject *__pyx_v_to_string = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_string", 1);

  /* "amplpy/environment.pxi":74
 *     def to_string(self):
 *         cdef const char* to_string_c
 *         campl.AMPL_EnvironmentToString(self._c_env, &to_string_c)             # <<<<<<<<<<<<<<
 *         to_string = str(to_string_c.decode('utf-8'))
 *         return to_string
 */
  (void)(AMPL_EnvironmentToString(__pyx_v_self->_c_env, (&__pyx_v_to_string_c)));

  /* "amplpy/environment.pxi":75
 *         cdef const char* to_string_c
 *         campl.AMPL_EnvironmentToString(self._c_env, &to_string_c)
 *         to_string = str(to_string_c.decode('utf-8'))             # <<<<<<<<<<<<<<
 *         return to_string
 * 
 */
  __pyx_t_1 = __Pyx_ssize_strlen(__pyx_v_to_string_c); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(10, 75, __pyx_L1_error)
  __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_to_string_c, 0, __pyx_t_1, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 75, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_to_string = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "amplpy/environment.pxi":76
 *         campl.AMPL_EnvironmentToString(self._c_env, &to_string_c)
 *         to_string = str(to_string_c.decode('utf-8'))
 *         return to_string             # <<<<<<<<<<<<<<
 * 
 *     def set_bin_dir(self, binary_directory):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_to_string);
  __pyx_r = __pyx_v_to_string;
  goto __pyx_L0;

  /* "amplpy/environment.pxi":72
 *             return None
 * 
 *     def to_string(self):             # <<<<<<<<<<<<<<
 *         cdef const char* to_string_c
 *         campl.AMPL_EnvironmentToString(self._c_env, &to_string_c)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("_amplpy.Environment.to_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_to_string);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/environment.pxi":78
 *         return to_string
 * 
 *     def set_bin_dir(self, binary_directory):             # <<<<<<<<<<<<<<
 *         """
 *         Set the location where AMPL API will search for the AMPL executable.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_11Environment_15set_bin_dir(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_11Environment_14set_bin_dir, "Environment.set_bin_dir(self, binary_directory)\n\n        Set the location where AMPL API will search for the AMPL executable.\n\n        Args:\n            binary_directory: The directory in which look for the AMPL executable.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_11Environment_15set_bin_dir = {"set_bin_dir", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_11Environment_15set_bin_dir, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_11Environment_14set_bin_dir};
static PyObject *__pyx_pw_7_amplpy_11Environment_15set_bin_dir(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_binary_directory = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_bin_dir (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_binary_directory,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_binary_directory)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(10, 78, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_bin_dir") < 0)) __PYX_ERR(10, 78, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_binary_directory = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_bin_dir", 1, 1, 1, __pyx_nargs); __PYX_ERR(10, 78, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.Environment.set_bin_dir", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_11Environment_14set_bin_dir(((struct __pyx_obj_7_amplpy_Environment *)__pyx_v_self), __pyx_v_binary_directory);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_11Environment_14set_bin_dir(struct __pyx_obj_7_amplpy_Environment *__pyx_v_self, PyObject *__pyx_v_binary_directory) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  char const *__pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_bin_dir", 1);

  /* "amplpy/environment.pxi":85
 *             binary_directory: The directory in which look for the AMPL executable.
 *         """
 *         campl.AMPL_EnvironmentSetBinaryDirectory(self._c_env, binary_directory.encode('utf-8'))             # <<<<<<<<<<<<<<
 * 
 *     def get_bin_dir(self):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_binary_directory, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 85, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_u_utf_8};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 85, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_t_5 = __Pyx_PyObject_AsString(__pyx_t_1); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) __PYX_ERR(10, 85, __pyx_L1_error)
  (void)(AMPL_EnvironmentSetBinaryDirectory(__pyx_v_self->_c_env, __pyx_t_5));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "amplpy/environment.pxi":78
 *         return to_string
 * 
 *     def set_bin_dir(self, binary_directory):             # <<<<<<<<<<<<<<
 *         """
 *         Set the location where AMPL API will search for the AMPL executable.
 */

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

/* "amplpy/environment.pxi":87
 *         campl.AMPL_EnvironmentSetBinaryDirectory(self._c_env, binary_directory.encode('utf-8'))
 * 
 *     def get_bin_dir(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the location where AMPL API will search for the AMPL executable.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_11Environment_17get_bin_dir(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_11Environment_16get_bin_dir, "Environment.get_bin_dir(self)\n\n        Get the location where AMPL API will search for the AMPL executable.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_11Environment_17get_bin_dir = {"get_bin_dir", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_11Environment_17get_bin_dir, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_11Environment_16get_bin_dir};
static PyObject *__pyx_pw_7_amplpy_11Environment_17get_bin_dir(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_bin_dir (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("get_bin_dir", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_bin_dir", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_11Environment_16get_bin_dir(((struct __pyx_obj_7_amplpy_Environment *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_11Environment_16get_bin_dir(struct __pyx_obj_7_amplpy_Environment *__pyx_v_self) {
  char const *__pyx_v_bin_dir_c;
  PyObject *__pyx_v_bin_dir = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_bin_dir", 1);

  /* "amplpy/environment.pxi":92
 *         """
 *         cdef const char* bin_dir_c
 *         campl.AMPL_EnvironmentGetBinaryDirectory(self._c_env, &bin_dir_c)             # <<<<<<<<<<<<<<
 *         bin_dir = str(bin_dir_c.decode('utf-8'))
 *         return bin_dir
 */
  (void)(AMPL_EnvironmentGetBinaryDirectory(__pyx_v_self->_c_env, (&__pyx_v_bin_dir_c)));

  /* "amplpy/environment.pxi":93
 *         cdef const char* bin_dir_c
 *         campl.AMPL_EnvironmentGetBinaryDirectory(self._c_env, &bin_dir_c)
 *         bin_dir = str(bin_dir_c.decode('utf-8'))             # <<<<<<<<<<<<<<
 *         return bin_dir
 * 
 */
  __pyx_t_1 = __Pyx_ssize_strlen(__pyx_v_bin_dir_c); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(10, 93, __pyx_L1_error)
  __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_bin_dir_c, 0, __pyx_t_1, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 93, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_bin_dir = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "amplpy/environment.pxi":94
 *         campl.AMPL_EnvironmentGetBinaryDirectory(self._c_env, &bin_dir_c)
 *         bin_dir = str(bin_dir_c.decode('utf-8'))
 *         return bin_dir             # <<<<<<<<<<<<<<
 * 
 *     def set_bin_name(self, binary_name):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_bin_dir);
  __pyx_r = __pyx_v_bin_dir;
  goto __pyx_L0;

  /* "amplpy/environment.pxi":87
 *         campl.AMPL_EnvironmentSetBinaryDirectory(self._c_env, binary_directory.encode('utf-8'))
 * 
 *     def get_bin_dir(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the location where AMPL API will search for the AMPL executable.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("_amplpy.Environment.get_bin_dir", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_bin_dir);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/environment.pxi":96
 *         return bin_dir
 * 
 *     def set_bin_name(self, binary_name):             # <<<<<<<<<<<<<<
 *         """
 *         Set the name of the AMPL executable.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_11Environment_19set_bin_name(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_11Environment_18set_bin_name, "Environment.set_bin_name(self, binary_name)\n\n        Set the name of the AMPL executable.\n\n        Args:\n            binary_name: The name of the AMPL executable.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_11Environment_19set_bin_name = {"set_bin_name", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_11Environment_19set_bin_name, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_11Environment_18set_bin_name};
static PyObject *__pyx_pw_7_amplpy_11Environment_19set_bin_name(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_binary_name = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_bin_name (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_binary_name,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_binary_name)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(10, 96, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_bin_name") < 0)) __PYX_ERR(10, 96, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_binary_name = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_bin_name", 1, 1, 1, __pyx_nargs); __PYX_ERR(10, 96, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.Environment.set_bin_name", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_11Environment_18set_bin_name(((struct __pyx_obj_7_amplpy_Environment *)__pyx_v_self), __pyx_v_binary_name);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_11Environment_18set_bin_name(struct __pyx_obj_7_amplpy_Environment *__pyx_v_self, PyObject *__pyx_v_binary_name) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  char const *__pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_bin_name", 1);

  /* "amplpy/environment.pxi":103
 *             binary_name: The name of the AMPL executable.
 *         """
 *         campl.AMPL_EnvironmentSetBinaryName(self._c_env, binary_name.encode('utf-8'))             # <<<<<<<<<<<<<<
 * 
 *     def get_bin_name(self):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_binary_name, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 103, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_u_utf_8};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 103, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_t_5 = __Pyx_PyObject_AsString(__pyx_t_1); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) __PYX_ERR(10, 103, __pyx_L1_error)
  (void)(AMPL_EnvironmentSetBinaryName(__pyx_v_self->_c_env, __pyx_t_5));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "amplpy/environment.pxi":96
 *         return bin_dir
 * 
 *     def set_bin_name(self, binary_name):             # <<<<<<<<<<<<<<
 *         """
 *         Set the name of the AMPL executable.
 */

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

/* "amplpy/environment.pxi":105
 *         campl.AMPL_EnvironmentSetBinaryName(self._c_env, binary_name.encode('utf-8'))
 * 
 *     def get_bin_name(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the name of the AMPL executable.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_11Environment_21get_bin_name(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_11Environment_20get_bin_name, "Environment.get_bin_name(self)\n\n        Get the name of the AMPL executable.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_11Environment_21get_bin_name = {"get_bin_name", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_11Environment_21get_bin_name, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_11Environment_20get_bin_name};
static PyObject *__pyx_pw_7_amplpy_11Environment_21get_bin_name(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_bin_name (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("get_bin_name", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_bin_name", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_11Environment_20get_bin_name(((struct __pyx_obj_7_amplpy_Environment *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_11Environment_20get_bin_name(struct __pyx_obj_7_amplpy_Environment *__pyx_v_self) {
  char const *__pyx_v_bin_name_c;
  PyObject *__pyx_v_bin_name = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_bin_name", 1);

  /* "amplpy/environment.pxi":110
 *         """
 *         cdef const char* bin_name_c
 *         campl.AMPL_EnvironmentGetBinaryName(self._c_env, &bin_name_c)             # <<<<<<<<<<<<<<
 *         bin_name = str(bin_name_c.decode('utf-8'))
 *         return bin_name
 */
  (void)(AMPL_EnvironmentGetBinaryName(__pyx_v_self->_c_env, (&__pyx_v_bin_name_c)));

  /* "amplpy/environment.pxi":111
 *         cdef const char* bin_name_c
 *         campl.AMPL_EnvironmentGetBinaryName(self._c_env, &bin_name_c)
 *         bin_name = str(bin_name_c.decode('utf-8'))             # <<<<<<<<<<<<<<
 *         return bin_name
 * 
 */
  __pyx_t_1 = __Pyx_ssize_strlen(__pyx_v_bin_name_c); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(10, 111, __pyx_L1_error)
  __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_bin_name_c, 0, __pyx_t_1, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 111, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_bin_name = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "amplpy/environment.pxi":112
 *         campl.AMPL_EnvironmentGetBinaryName(self._c_env, &bin_name_c)
 *         bin_name = str(bin_name_c.decode('utf-8'))
 *         return bin_name             # <<<<<<<<<<<<<<
 * 
 *     # Aliases
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_bin_name);
  __pyx_r = __pyx_v_bin_name;
  goto __pyx_L0;

  /* "amplpy/environment.pxi":105
 *         campl.AMPL_EnvironmentSetBinaryName(self._c_env, binary_name.encode('utf-8'))
 * 
 *     def get_bin_name(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the name of the AMPL executable.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("_amplpy.Environment.get_bin_name", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_bin_name);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_11Environment_23__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_11Environment_22__reduce_cython__, "Environment.__reduce_cython__(self)");
static PyMethodDef __pyx_mdef_7_amplpy_11Environment_23__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_11Environment_23__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_11Environment_22__reduce_cython__};
static PyObject *__pyx_pw_7_amplpy_11Environment_23__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_11Environment_22__reduce_cython__(((struct __pyx_obj_7_amplpy_Environment *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_11Environment_22__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7_amplpy_Environment *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 1);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(8, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */

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

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_11Environment_25__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_11Environment_24__setstate_cython__, "Environment.__setstate_cython__(self, __pyx_state)");
static PyMethodDef __pyx_mdef_7_amplpy_11Environment_25__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_11Environment_25__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_11Environment_24__setstate_cython__};
static PyObject *__pyx_pw_7_amplpy_11Environment_25__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 3, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(8, 3, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(8, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.Environment.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_11Environment_24__setstate_cython__(((struct __pyx_obj_7_amplpy_Environment *)__pyx_v_self), __pyx_v___pyx_state);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_11Environment_24__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7_amplpy_Environment *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 1);

  /* "(tree fragment)":4
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"             # <<<<<<<<<<<<<<
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(8, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */

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

/* "amplpy/errorhandler.pxi":7
 *     _SUPPORT_MESSAGE = ""
 * 
 * def display_error_message(exception, error=True):             # <<<<<<<<<<<<<<
 *     msg = "\t" + str(exception).replace("\n", "\n\t")
 *     if error:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_1display_error_message(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_display_error_message, "display_error_message(exception, error=True)");
static PyMethodDef __pyx_mdef_7_amplpy_1display_error_message = {"display_error_message", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_1display_error_message, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_display_error_message};
static PyObject *__pyx_pw_7_amplpy_1display_error_message(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_exception = 0;
  PyObject *__pyx_v_error = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("display_error_message (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_exception,&__pyx_n_s_error,0};
    values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_True)));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_exception)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(11, 7, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_error);
          if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(11, 7, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "display_error_message") < 0)) __PYX_ERR(11, 7, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_exception = values[0];
    __pyx_v_error = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("display_error_message", 0, 1, 2, __pyx_nargs); __PYX_ERR(11, 7, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.display_error_message", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_display_error_message(__pyx_self, __pyx_v_exception, __pyx_v_error);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_display_error_message(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_exception, PyObject *__pyx_v_error) {
  PyObject *__pyx_v_msg = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  Py_UCS4 __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("display_error_message", 1);

  /* "amplpy/errorhandler.pxi":8
 * 
 * def display_error_message(exception, error=True):
 *     msg = "\t" + str(exception).replace("\n", "\n\t")             # <<<<<<<<<<<<<<
 *     if error:
 *         print(f"Error:\n{msg}{_SUPPORT_MESSAGE}")
 */
  __pyx_t_1 = __Pyx_PyObject_Unicode(__pyx_v_exception); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 8, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyUnicode_Replace(((PyObject*)__pyx_t_1), __pyx_kp_u__25, __pyx_kp_u__26, -1L); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 8, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_kp_u__24, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 8, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_msg = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "amplpy/errorhandler.pxi":9
 * def display_error_message(exception, error=True):
 *     msg = "\t" + str(exception).replace("\n", "\n\t")
 *     if error:             # <<<<<<<<<<<<<<
 *         print(f"Error:\n{msg}{_SUPPORT_MESSAGE}")
 *     else:
 */
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_error); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(11, 9, __pyx_L1_error)
  if (__pyx_t_3) {

    /* "amplpy/errorhandler.pxi":10
 *     msg = "\t" + str(exception).replace("\n", "\n\t")
 *     if error:
 *         print(f"Error:\n{msg}{_SUPPORT_MESSAGE}")             # <<<<<<<<<<<<<<
 *     else:
 *         print(f"Warning:\n{msg}")
 */
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 10, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = 0;
    __pyx_t_5 = 127;
    __Pyx_INCREF(__pyx_kp_u_Error);
    __pyx_t_4 += 7;
    __Pyx_GIVEREF(__pyx_kp_u_Error);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_Error);
    __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_msg, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 10, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) > __pyx_t_5) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) : __pyx_t_5;
    __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
    __pyx_t_2 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_SUPPORT_MESSAGE); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 10, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = __Pyx_PyObject_FormatSimple(__pyx_t_2, __pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(11, 10, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) > __pyx_t_5) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) : __pyx_t_5;
    __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_6);
    __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyUnicode_Join(__pyx_t_1, 3, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(11, 10, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_print, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 10, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "amplpy/errorhandler.pxi":9
 * def display_error_message(exception, error=True):
 *     msg = "\t" + str(exception).replace("\n", "\n\t")
 *     if error:             # <<<<<<<<<<<<<<
 *         print(f"Error:\n{msg}{_SUPPORT_MESSAGE}")
 *     else:
 */
    goto __pyx_L3;
  }

  /* "amplpy/errorhandler.pxi":12
 *         print(f"Error:\n{msg}{_SUPPORT_MESSAGE}")
 *     else:
 *         print(f"Warning:\n{msg}")             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_v_msg, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 12, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Warning, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(11, 12, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_print, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 12, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_L3:;

  /* "amplpy/errorhandler.pxi":7
 *     _SUPPORT_MESSAGE = ""
 * 
 * def display_error_message(exception, error=True):             # <<<<<<<<<<<<<<
 *     msg = "\t" + str(exception).replace("\n", "\n\t")
 *     if error:
 */

  /* 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_6);
  __Pyx_AddTraceback("_amplpy.display_error_message", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_msg);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/errorhandler.pxi":25
 *     """
 * 
 *     def error(self, exception):             # <<<<<<<<<<<<<<
 *         """
 *         Receives notification of an error.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_12ErrorHandler_1error(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_12ErrorHandler_error, "ErrorHandler.error(self, exception)\n\n        Receives notification of an error.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_12ErrorHandler_1error = {"error", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_12ErrorHandler_1error, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_12ErrorHandler_error};
static PyObject *__pyx_pw_7_amplpy_12ErrorHandler_1error(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_exception = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("error (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_exception,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_exception)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(11, 25, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "error") < 0)) __PYX_ERR(11, 25, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_exception = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("error", 1, 1, 1, __pyx_nargs); __PYX_ERR(11, 25, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.ErrorHandler.error", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_12ErrorHandler_error(((struct __pyx_obj_7_amplpy_ErrorHandler *)__pyx_v_self), __pyx_v_exception);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_12ErrorHandler_error(CYTHON_UNUSED struct __pyx_obj_7_amplpy_ErrorHandler *__pyx_v_self, PyObject *__pyx_v_exception) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("error", 1);

  /* "amplpy/errorhandler.pxi":29
 *         Receives notification of an error.
 *         """
 *         display_error_message(exception)             # <<<<<<<<<<<<<<
 *         raise exception
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_display_error_message); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_exception};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 29, __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;

  /* "amplpy/errorhandler.pxi":30
 *         """
 *         display_error_message(exception)
 *         raise exception             # <<<<<<<<<<<<<<
 * 
 *     def warning(self, exception):
 */
  __Pyx_Raise(__pyx_v_exception, 0, 0, 0);
  __PYX_ERR(11, 30, __pyx_L1_error)

  /* "amplpy/errorhandler.pxi":25
 *     """
 * 
 *     def error(self, exception):             # <<<<<<<<<<<<<<
 *         """
 *         Receives notification of an error.
 */

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

/* "amplpy/errorhandler.pxi":32
 *         raise exception
 * 
 *     def warning(self, exception):             # <<<<<<<<<<<<<<
 *         """
 *         Receives notification of a warning.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_12ErrorHandler_3warning(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_12ErrorHandler_2warning, "ErrorHandler.warning(self, exception)\n\n        Receives notification of a warning.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_12ErrorHandler_3warning = {"warning", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_12ErrorHandler_3warning, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_12ErrorHandler_2warning};
static PyObject *__pyx_pw_7_amplpy_12ErrorHandler_3warning(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_exception = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("warning (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_exception,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_exception)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(11, 32, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "warning") < 0)) __PYX_ERR(11, 32, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_exception = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("warning", 1, 1, 1, __pyx_nargs); __PYX_ERR(11, 32, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.ErrorHandler.warning", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_12ErrorHandler_2warning(((struct __pyx_obj_7_amplpy_ErrorHandler *)__pyx_v_self), __pyx_v_exception);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_12ErrorHandler_2warning(CYTHON_UNUSED struct __pyx_obj_7_amplpy_ErrorHandler *__pyx_v_self, PyObject *__pyx_v_exception) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("warning", 1);

  /* "amplpy/errorhandler.pxi":36
 *         Receives notification of a warning.
 *         """
 *         display_error_message(exception, error=False)             # <<<<<<<<<<<<<<
 * 
 * cdef void PyError(bool_c isWarning, const char* filename, int row, int offset, const char* message, void* errorHandler) except * with gil:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_display_error_message); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_exception);
  __Pyx_GIVEREF(__pyx_v_exception);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_exception)) __PYX_ERR(11, 36, __pyx_L1_error);
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_error, Py_False) < 0) __PYX_ERR(11, 36, __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(11, 36, __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_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "amplpy/errorhandler.pxi":32
 *         raise exception
 * 
 *     def warning(self, exception):             # <<<<<<<<<<<<<<
 *         """
 *         Receives notification of a warning.
 */

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

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_12ErrorHandler_5__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_12ErrorHandler_4__reduce_cython__, "ErrorHandler.__reduce_cython__(self)");
static PyMethodDef __pyx_mdef_7_amplpy_12ErrorHandler_5__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_12ErrorHandler_5__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_12ErrorHandler_4__reduce_cython__};
static PyObject *__pyx_pw_7_amplpy_12ErrorHandler_5__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_12ErrorHandler_4__reduce_cython__(((struct __pyx_obj_7_amplpy_ErrorHandler *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_12ErrorHandler_4__reduce_cython__(struct __pyx_obj_7_amplpy_ErrorHandler *__pyx_v_self) {
  PyObject *__pyx_v_state = 0;
  PyObject *__pyx_v__dict = 0;
  int __pyx_v_use_setstate;
  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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 1);

  /* "(tree fragment)":5
 *     cdef object _dict
 *     cdef bint use_setstate
 *     state = ()             # <<<<<<<<<<<<<<
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 */
  __Pyx_INCREF(__pyx_empty_tuple);
  __pyx_v_state = __pyx_empty_tuple;

  /* "(tree fragment)":6
 *     cdef bint use_setstate
 *     state = ()
 *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
 *     if _dict is not None:
 *         state += (_dict,)
 */
  __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v__dict = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "(tree fragment)":7
 *     state = ()
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
 */
  __pyx_t_2 = (__pyx_v__dict != Py_None);
  if (__pyx_t_2) {

    /* "(tree fragment)":8
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 *         state += (_dict,)             # <<<<<<<<<<<<<<
 *         use_setstate = True
 *     else:
 */
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v__dict);
    __Pyx_GIVEREF(__pyx_v__dict);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict)) __PYX_ERR(8, 8, __pyx_L1_error);
    __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "(tree fragment)":9
 *     if _dict is not None:
 *         state += (_dict,)
 *         use_setstate = True             # <<<<<<<<<<<<<<
 *     else:
 *         use_setstate = False
 */
    __pyx_v_use_setstate = 1;

    /* "(tree fragment)":7
 *     state = ()
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
 */
    goto __pyx_L3;
  }

  /* "(tree fragment)":11
 *         use_setstate = True
 *     else:
 *         use_setstate = False             # <<<<<<<<<<<<<<
 *     if use_setstate:
 *         return __pyx_unpickle_ErrorHandler, (type(self), 0xe3b0c44, None), state
 */
  /*else*/ {
    __pyx_v_use_setstate = 0;
  }
  __pyx_L3:;

  /* "(tree fragment)":12
 *     else:
 *         use_setstate = False
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_ErrorHandler, (type(self), 0xe3b0c44, None), state
 *     else:
 */
  if (__pyx_v_use_setstate) {

    /* "(tree fragment)":13
 *         use_setstate = False
 *     if use_setstate:
 *         return __pyx_unpickle_ErrorHandler, (type(self), 0xe3b0c44, None), state             # <<<<<<<<<<<<<<
 *     else:
 *         return __pyx_unpickle_ErrorHandler, (type(self), 0xe3b0c44, state)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pyx_unpickle_ErrorHandler); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))))) __PYX_ERR(8, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_int_238750788);
    __Pyx_GIVEREF(__pyx_int_238750788);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_238750788)) __PYX_ERR(8, 13, __pyx_L1_error);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None)) __PYX_ERR(8, 13, __pyx_L1_error);
    __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_3);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3)) __PYX_ERR(8, 13, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1)) __PYX_ERR(8, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_state)) __PYX_ERR(8, 13, __pyx_L1_error);
    __pyx_t_3 = 0;
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "(tree fragment)":12
 *     else:
 *         use_setstate = False
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_ErrorHandler, (type(self), 0xe3b0c44, None), state
 *     else:
 */
  }

  /* "(tree fragment)":15
 *         return __pyx_unpickle_ErrorHandler, (type(self), 0xe3b0c44, None), state
 *     else:
 *         return __pyx_unpickle_ErrorHandler, (type(self), 0xe3b0c44, state)             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_ErrorHandler__set_state(self, __pyx_state)
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_ErrorHandler); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))))) __PYX_ERR(8, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_int_238750788);
    __Pyx_GIVEREF(__pyx_int_238750788);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_238750788)) __PYX_ERR(8, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state)) __PYX_ERR(8, 15, __pyx_L1_error);
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_4);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4)) __PYX_ERR(8, 15, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1)) __PYX_ERR(8, 15, __pyx_L1_error);
    __pyx_t_4 = 0;
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
  }

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("_amplpy.ErrorHandler.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_state);
  __Pyx_XDECREF(__pyx_v__dict);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_ErrorHandler, (type(self), 0xe3b0c44, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_ErrorHandler__set_state(self, __pyx_state)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_12ErrorHandler_7__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_12ErrorHandler_6__setstate_cython__, "ErrorHandler.__setstate_cython__(self, __pyx_state)");
static PyMethodDef __pyx_mdef_7_amplpy_12ErrorHandler_7__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_12ErrorHandler_7__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_12ErrorHandler_6__setstate_cython__};
static PyObject *__pyx_pw_7_amplpy_12ErrorHandler_7__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 16, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(8, 16, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(8, 16, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.ErrorHandler.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_12ErrorHandler_6__setstate_cython__(((struct __pyx_obj_7_amplpy_ErrorHandler *)__pyx_v_self), __pyx_v___pyx_state);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_12ErrorHandler_6__setstate_cython__(struct __pyx_obj_7_amplpy_ErrorHandler *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 1);

  /* "(tree fragment)":17
 *         return __pyx_unpickle_ErrorHandler, (type(self), 0xe3b0c44, state)
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_ErrorHandler__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
 */
  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(8, 17, __pyx_L1_error)
  __pyx_t_1 = __pyx_f_7_amplpy___pyx_unpickle_ErrorHandler__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_ErrorHandler, (type(self), 0xe3b0c44, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_ErrorHandler__set_state(self, __pyx_state)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("_amplpy.ErrorHandler.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/errorhandler.pxi":38
 *         display_error_message(exception, error=False)
 * 
 * cdef void PyError(bool_c isWarning, const char* filename, int row, int offset, const char* message, void* errorHandler) except * with gil:             # <<<<<<<<<<<<<<
 *     handler = <ErrorHandler>errorHandler
 *     exception = AMPLException(filename.decode('utf-8'), row, offset, message.decode('utf-8'))
 */

static void __pyx_f_7_amplpy_PyError(bool __pyx_v_isWarning, char const *__pyx_v_filename, int __pyx_v_row, int __pyx_v_offset, char const *__pyx_v_message, void *__pyx_v_errorHandler) {
  struct __pyx_obj_7_amplpy_ErrorHandler *__pyx_v_handler = NULL;
  PyObject *__pyx_v_exception = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  unsigned int __pyx_t_9;
  int __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("PyError", 0);

  /* "amplpy/errorhandler.pxi":39
 * 
 * cdef void PyError(bool_c isWarning, const char* filename, int row, int offset, const char* message, void* errorHandler) except * with gil:
 *     handler = <ErrorHandler>errorHandler             # <<<<<<<<<<<<<<
 *     exception = AMPLException(filename.decode('utf-8'), row, offset, message.decode('utf-8'))
 *     if isWarning:
 */
  __pyx_t_1 = ((PyObject *)__pyx_v_errorHandler);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_handler = ((struct __pyx_obj_7_amplpy_ErrorHandler *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "amplpy/errorhandler.pxi":40
 * cdef void PyError(bool_c isWarning, const char* filename, int row, int offset, const char* message, void* errorHandler) except * with gil:
 *     handler = <ErrorHandler>errorHandler
 *     exception = AMPLException(filename.decode('utf-8'), row, offset, message.decode('utf-8'))             # <<<<<<<<<<<<<<
 *     if isWarning:
 *         handler.warning(exception)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_AMPLException); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 40, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_ssize_strlen(__pyx_v_filename); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(11, 40, __pyx_L1_error)
  __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_filename, 0, __pyx_t_3, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 40, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_row); if (unlikely(!__pyx_t_5)) __PYX_ERR(11, 40, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_offset); if (unlikely(!__pyx_t_6)) __PYX_ERR(11, 40, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_3 = __Pyx_ssize_strlen(__pyx_v_message); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(11, 40, __pyx_L1_error)
  __pyx_t_7 = __Pyx_decode_c_string(__pyx_v_message, 0, __pyx_t_3, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_7)) __PYX_ERR(11, 40, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = NULL;
  __pyx_t_9 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_9 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[5] = {__pyx_t_8, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_9, 4+__pyx_t_9);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 40, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_v_exception = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "amplpy/errorhandler.pxi":41
 *     handler = <ErrorHandler>errorHandler
 *     exception = AMPLException(filename.decode('utf-8'), row, offset, message.decode('utf-8'))
 *     if isWarning:             # <<<<<<<<<<<<<<
 *         handler.warning(exception)
 *     else:
 */
  __pyx_t_10 = (__pyx_v_isWarning != 0);
  if (__pyx_t_10) {

    /* "amplpy/errorhandler.pxi":42
 *     exception = AMPLException(filename.decode('utf-8'), row, offset, message.decode('utf-8'))
 *     if isWarning:
 *         handler.warning(exception)             # <<<<<<<<<<<<<<
 *     else:
 *         handler.error(exception)
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_handler), __pyx_n_s_warning); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 42, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_7 = NULL;
    __pyx_t_9 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_9 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_exception};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 42, __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;

    /* "amplpy/errorhandler.pxi":41
 *     handler = <ErrorHandler>errorHandler
 *     exception = AMPLException(filename.decode('utf-8'), row, offset, message.decode('utf-8'))
 *     if isWarning:             # <<<<<<<<<<<<<<
 *         handler.warning(exception)
 *     else:
 */
    goto __pyx_L3;
  }

  /* "amplpy/errorhandler.pxi":44
 *         handler.warning(exception)
 *     else:
 *         handler.error(exception)             # <<<<<<<<<<<<<<
 */
  /*else*/ {
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_handler), __pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 44, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_7 = NULL;
    __pyx_t_9 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_9 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_exception};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 44, __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;
  }
  __pyx_L3:;

  /* "amplpy/errorhandler.pxi":38
 *         display_error_message(exception, error=False)
 * 
 * cdef void PyError(bool_c isWarning, const char* filename, int row, int offset, const char* message, void* errorHandler) except * with gil:             # <<<<<<<<<<<<<<
 *     handler = <ErrorHandler>errorHandler
 *     exception = AMPLException(filename.decode('utf-8'), row, offset, message.decode('utf-8'))
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("_amplpy.PyError", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_handler);
  __Pyx_XDECREF(__pyx_v_exception);
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
}

/* "amplpy/exceptions.pxi":9
 *     """
 * 
 *     def __init__(self, source_name, line_number, offset, message):             # <<<<<<<<<<<<<<
 *         super(AMPLException, self).__init__()
 *         self.source_name = source_name
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_13AMPLException_1__init__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_13AMPLException___init__, "AMPLException.__init__(self, source_name, line_number, offset, message)");
static PyMethodDef __pyx_mdef_7_amplpy_13AMPLException_1__init__ = {"__init__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_13AMPLException_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_13AMPLException___init__};
static PyObject *__pyx_pw_7_amplpy_13AMPLException_1__init__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_source_name = 0;
  PyObject *__pyx_v_line_number = 0;
  PyObject *__pyx_v_offset = 0;
  PyObject *__pyx_v_message = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[5] = {0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_source_name,&__pyx_n_s_line_number,&__pyx_n_s_offset,&__pyx_n_s_message,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 9, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_source_name)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 9, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 5, 5, 1); __PYX_ERR(1, 9, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_line_number)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 9, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 5, 5, 2); __PYX_ERR(1, 9, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_offset)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[3]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 9, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 5, 5, 3); __PYX_ERR(1, 9, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_message)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[4]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 9, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 5, 5, 4); __PYX_ERR(1, 9, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(1, 9, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 5)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
      values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
      values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
      values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
    }
    __pyx_v_self = values[0];
    __pyx_v_source_name = values[1];
    __pyx_v_line_number = values[2];
    __pyx_v_offset = values[3];
    __pyx_v_message = values[4];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 5, 5, __pyx_nargs); __PYX_ERR(1, 9, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.AMPLException.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_13AMPLException___init__(__pyx_self, __pyx_v_self, __pyx_v_source_name, __pyx_v_line_number, __pyx_v_offset, __pyx_v_message);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_13AMPLException___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_source_name, PyObject *__pyx_v_line_number, PyObject *__pyx_v_offset, PyObject *__pyx_v_message) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 1);

  /* "amplpy/exceptions.pxi":10
 * 
 *     def __init__(self, source_name, line_number, offset, message):
 *         super(AMPLException, self).__init__()             # <<<<<<<<<<<<<<
 *         self.source_name = source_name
 *         self.line_number = line_number
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_AMPLException); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 10, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 10, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(1, 10, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self)) __PYX_ERR(1, 10, __pyx_L1_error);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 10, __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(1, 10, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __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;

  /* "amplpy/exceptions.pxi":11
 *     def __init__(self, source_name, line_number, offset, message):
 *         super(AMPLException, self).__init__()
 *         self.source_name = source_name             # <<<<<<<<<<<<<<
 *         self.line_number = line_number
 *         self.offset = offset
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_source_name, __pyx_v_source_name) < 0) __PYX_ERR(1, 11, __pyx_L1_error)

  /* "amplpy/exceptions.pxi":12
 *         super(AMPLException, self).__init__()
 *         self.source_name = source_name
 *         self.line_number = line_number             # <<<<<<<<<<<<<<
 *         self.offset = offset
 *         self.message = message
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_line_number, __pyx_v_line_number) < 0) __PYX_ERR(1, 12, __pyx_L1_error)

  /* "amplpy/exceptions.pxi":13
 *         self.source_name = source_name
 *         self.line_number = line_number
 *         self.offset = offset             # <<<<<<<<<<<<<<
 *         self.message = message
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_offset, __pyx_v_offset) < 0) __PYX_ERR(1, 13, __pyx_L1_error)

  /* "amplpy/exceptions.pxi":14
 *         self.line_number = line_number
 *         self.offset = offset
 *         self.message = message             # <<<<<<<<<<<<<<
 * 
 *     def get_source_name(self):
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_message, __pyx_v_message) < 0) __PYX_ERR(1, 14, __pyx_L1_error)

  /* "amplpy/exceptions.pxi":9
 *     """
 * 
 *     def __init__(self, source_name, line_number, offset, message):             # <<<<<<<<<<<<<<
 *         super(AMPLException, self).__init__()
 *         self.source_name = source_name
 */

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

/* "amplpy/exceptions.pxi":16
 *         self.message = message
 * 
 *     def get_source_name(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the name of the file where the error was detected.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_13AMPLException_3get_source_name(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_13AMPLException_2get_source_name, "AMPLException.get_source_name(self)\n\n        Get the name of the file where the error was detected.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_13AMPLException_3get_source_name = {"get_source_name", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_13AMPLException_3get_source_name, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_13AMPLException_2get_source_name};
static PyObject *__pyx_pw_7_amplpy_13AMPLException_3get_source_name(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_source_name (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 16, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get_source_name") < 0)) __PYX_ERR(1, 16, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_source_name", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 16, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.AMPLException.get_source_name", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_13AMPLException_2get_source_name(__pyx_self, __pyx_v_self);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_13AMPLException_2get_source_name(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_source_name", 1);

  /* "amplpy/exceptions.pxi":20
 *         Get the name of the file where the error was detected.
 *         """
 *         return self.source_name             # <<<<<<<<<<<<<<
 * 
 *     def get_line_number(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_source_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "amplpy/exceptions.pxi":16
 *         self.message = message
 * 
 *     def get_source_name(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the name of the file where the error was detected.
 */

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

/* "amplpy/exceptions.pxi":22
 *         return self.source_name
 * 
 *     def get_line_number(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the row where the error is located.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_13AMPLException_5get_line_number(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_13AMPLException_4get_line_number, "AMPLException.get_line_number(self)\n\n        Get the row where the error is located.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_13AMPLException_5get_line_number = {"get_line_number", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_13AMPLException_5get_line_number, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_13AMPLException_4get_line_number};
static PyObject *__pyx_pw_7_amplpy_13AMPLException_5get_line_number(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_line_number (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 22, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get_line_number") < 0)) __PYX_ERR(1, 22, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_line_number", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 22, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.AMPLException.get_line_number", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_13AMPLException_4get_line_number(__pyx_self, __pyx_v_self);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_13AMPLException_4get_line_number(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_line_number", 1);

  /* "amplpy/exceptions.pxi":26
 *         Get the row where the error is located.
 *         """
 *         return self.line_number             # <<<<<<<<<<<<<<
 * 
 *     def get_offset(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_line_number); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 26, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "amplpy/exceptions.pxi":22
 *         return self.source_name
 * 
 *     def get_line_number(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the row where the error is located.
 */

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

/* "amplpy/exceptions.pxi":28
 *         return self.line_number
 * 
 *     def get_offset(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the offset where the error is located.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_13AMPLException_7get_offset(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_13AMPLException_6get_offset, "AMPLException.get_offset(self)\n\n        Get the offset where the error is located.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_13AMPLException_7get_offset = {"get_offset", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_13AMPLException_7get_offset, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_13AMPLException_6get_offset};
static PyObject *__pyx_pw_7_amplpy_13AMPLException_7get_offset(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_offset (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 28, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get_offset") < 0)) __PYX_ERR(1, 28, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_offset", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 28, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.AMPLException.get_offset", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_13AMPLException_6get_offset(__pyx_self, __pyx_v_self);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_13AMPLException_6get_offset(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_offset", 1);

  /* "amplpy/exceptions.pxi":32
 *         Get the offset where the error is located.
 *         """
 *         return self.offset             # <<<<<<<<<<<<<<
 * 
 *     def get_message(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_offset); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "amplpy/exceptions.pxi":28
 *         return self.line_number
 * 
 *     def get_offset(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the offset where the error is located.
 */

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

/* "amplpy/exceptions.pxi":34
 *         return self.offset
 * 
 *     def get_message(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the error message.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_13AMPLException_9get_message(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_13AMPLException_8get_message, "AMPLException.get_message(self)\n\n        Get the error message.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_13AMPLException_9get_message = {"get_message", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_13AMPLException_9get_message, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_13AMPLException_8get_message};
static PyObject *__pyx_pw_7_amplpy_13AMPLException_9get_message(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_message (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 34, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get_message") < 0)) __PYX_ERR(1, 34, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_message", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 34, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.AMPLException.get_message", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_13AMPLException_8get_message(__pyx_self, __pyx_v_self);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_13AMPLException_8get_message(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_message", 1);

  /* "amplpy/exceptions.pxi":38
 *         Get the error message.
 *         """
 *         return self.message             # <<<<<<<<<<<<<<
 * 
 *     def __str__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_message); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 38, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "amplpy/exceptions.pxi":34
 *         return self.offset
 * 
 *     def get_message(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the error message.
 */

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

/* "amplpy/exceptions.pxi":40
 *         return self.message
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return "file: " + self.source_name + self.message + _SUPPORT_MESSAGE #discuss with Filipe
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_13AMPLException_11__str__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_13AMPLException_10__str__, "AMPLException.__str__(self)");
static PyMethodDef __pyx_mdef_7_amplpy_13AMPLException_11__str__ = {"__str__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_13AMPLException_11__str__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_13AMPLException_10__str__};
static PyObject *__pyx_pw_7_amplpy_13AMPLException_11__str__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 40, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__str__") < 0)) __PYX_ERR(1, 40, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__str__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 40, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.AMPLException.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_13AMPLException_10__str__(__pyx_self, __pyx_v_self);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_13AMPLException_10__str__(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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__str__", 1);

  /* "amplpy/exceptions.pxi":41
 * 
 *     def __str__(self):
 *         return "file: " + self.source_name + self.message + _SUPPORT_MESSAGE #discuss with Filipe             # <<<<<<<<<<<<<<
 * 
 *     # Aliases
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_source_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 41, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyNumber_Add(__pyx_kp_u_file, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 41, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_message); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 41, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 41, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_SUPPORT_MESSAGE); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 41, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 41, __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_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "amplpy/exceptions.pxi":40
 *         return self.message
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return "file: " + self.source_name + self.message + _SUPPORT_MESSAGE #discuss with Filipe
 * 
 */

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

/* "amplpy/iterators.pxi":8
 * 
 *     @staticmethod
 *     cdef create(campl.AMPL_ENVIRONMENT* env_c):             # <<<<<<<<<<<<<<
 *         envit = EnvIterator()
 *         envit.env_c = env_c
 */

static PyObject *__pyx_f_7_amplpy_11EnvIterator_create(AMPL_ENVIRONMENT *__pyx_v_env_c) {
  struct __pyx_obj_7_amplpy_EnvIterator *__pyx_v_envit = NULL;
  size_t __pyx_v_size;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  AMPL_ENVIRONMENTVAR *__pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("create", 1);

  /* "amplpy/iterators.pxi":9
 *     @staticmethod
 *     cdef create(campl.AMPL_ENVIRONMENT* env_c):
 *         envit = EnvIterator()             # <<<<<<<<<<<<<<
 *         envit.env_c = env_c
 *         envit.begin = NULL
 */
  __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_7_amplpy_EnvIterator)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_envit = ((struct __pyx_obj_7_amplpy_EnvIterator *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "amplpy/iterators.pxi":10
 *     cdef create(campl.AMPL_ENVIRONMENT* env_c):
 *         envit = EnvIterator()
 *         envit.env_c = env_c             # <<<<<<<<<<<<<<
 *         envit.begin = NULL
 *         envit.end = NULL
 */
  __pyx_v_envit->env_c = __pyx_v_env_c;

  /* "amplpy/iterators.pxi":11
 *         envit = EnvIterator()
 *         envit.env_c = env_c
 *         envit.begin = NULL             # <<<<<<<<<<<<<<
 *         envit.end = NULL
 *         envit.iterator = NULL
 */
  __pyx_v_envit->begin = NULL;

  /* "amplpy/iterators.pxi":12
 *         envit.env_c = env_c
 *         envit.begin = NULL
 *         envit.end = NULL             # <<<<<<<<<<<<<<
 *         envit.iterator = NULL
 *         campl.AMPL_EnvironmentGetEnvironmentVar(envit.env_c, &envit.begin)
 */
  __pyx_v_envit->end = NULL;

  /* "amplpy/iterators.pxi":13
 *         envit.begin = NULL
 *         envit.end = NULL
 *         envit.iterator = NULL             # <<<<<<<<<<<<<<
 *         campl.AMPL_EnvironmentGetEnvironmentVar(envit.env_c, &envit.begin)
 *         cdef size_t size
 */
  __pyx_v_envit->iterator = NULL;

  /* "amplpy/iterators.pxi":14
 *         envit.end = NULL
 *         envit.iterator = NULL
 *         campl.AMPL_EnvironmentGetEnvironmentVar(envit.env_c, &envit.begin)             # <<<<<<<<<<<<<<
 *         cdef size_t size
 *         campl.AMPL_EnvironmentGetSize(envit.env_c, &size)
 */
  (void)(AMPL_EnvironmentGetEnvironmentVar(__pyx_v_envit->env_c, (&__pyx_v_envit->begin)));

  /* "amplpy/iterators.pxi":16
 *         campl.AMPL_EnvironmentGetEnvironmentVar(envit.env_c, &envit.begin)
 *         cdef size_t size
 *         campl.AMPL_EnvironmentGetSize(envit.env_c, &size)             # <<<<<<<<<<<<<<
 *         envit.end = envit.begin + size
 *         envit.iterator = envit.begin
 */
  (void)(AMPL_EnvironmentGetSize(__pyx_v_envit->env_c, (&__pyx_v_size)));

  /* "amplpy/iterators.pxi":17
 *         cdef size_t size
 *         campl.AMPL_EnvironmentGetSize(envit.env_c, &size)
 *         envit.end = envit.begin + size             # <<<<<<<<<<<<<<
 *         envit.iterator = envit.begin
 *         return envit
 */
  __pyx_v_envit->end = (__pyx_v_envit->begin + __pyx_v_size);

  /* "amplpy/iterators.pxi":18
 *         campl.AMPL_EnvironmentGetSize(envit.env_c, &size)
 *         envit.end = envit.begin + size
 *         envit.iterator = envit.begin             # <<<<<<<<<<<<<<
 *         return envit
 * 
 */
  __pyx_t_2 = __pyx_v_envit->begin;
  __pyx_v_envit->iterator = __pyx_t_2;

  /* "amplpy/iterators.pxi":19
 *         envit.end = envit.begin + size
 *         envit.iterator = envit.begin
 *         return envit             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_envit);
  __pyx_r = ((PyObject *)__pyx_v_envit);
  goto __pyx_L0;

  /* "amplpy/iterators.pxi":8
 * 
 *     @staticmethod
 *     cdef create(campl.AMPL_ENVIRONMENT* env_c):             # <<<<<<<<<<<<<<
 *         envit = EnvIterator()
 *         envit.env_c = env_c
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("_amplpy.EnvIterator.create", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_envit);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/iterators.pxi":21
 *         return envit
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_11EnvIterator_1__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7_amplpy_11EnvIterator_1__iter__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7_amplpy_11EnvIterator___iter__(((struct __pyx_obj_7_amplpy_EnvIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_11EnvIterator___iter__(struct __pyx_obj_7_amplpy_EnvIterator *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 1);

  /* "amplpy/iterators.pxi":22
 * 
 *     def __iter__(self):
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     def __next__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "amplpy/iterators.pxi":21
 *         return envit
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

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

/* "amplpy/iterators.pxi":24
 *         return self
 * 
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         if self.iterator >= self.end:
 *             raise StopIteration
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_11EnvIterator_3__next__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7_amplpy_11EnvIterator_3__next__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__next__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7_amplpy_11EnvIterator_2__next__(((struct __pyx_obj_7_amplpy_EnvIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_11EnvIterator_2__next__(struct __pyx_obj_7_amplpy_EnvIterator *__pyx_v_self) {
  AMPL_ENVIRONMENTVAR *__pyx_v_it;
  char *__pyx_v_name_c;
  char *__pyx_v_value_c;
  PyObject *__pyx_v_name = NULL;
  PyObject *__pyx_v_value = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_error_without_exception = 0; /* StopIteration */
  int __pyx_t_1;
  AMPL_ENVIRONMENTVAR *__pyx_t_2;
  Py_ssize_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__next__", 1);

  /* "amplpy/iterators.pxi":25
 * 
 *     def __next__(self):
 *         if self.iterator >= self.end:             # <<<<<<<<<<<<<<
 *             raise StopIteration
 *         cdef campl.AMPL_ENVIRONMENTVAR* it = self.iterator
 */
  __pyx_t_1 = (__pyx_v_self->iterator >= __pyx_v_self->end);
  if (unlikely(__pyx_t_1)) {

    /* "amplpy/iterators.pxi":26
 *     def __next__(self):
 *         if self.iterator >= self.end:
 *             raise StopIteration             # <<<<<<<<<<<<<<
 *         cdef campl.AMPL_ENVIRONMENTVAR* it = self.iterator
 *         self.iterator += 1
 */
    __pyx_error_without_exception = 1;
    goto __pyx_L1_error;;

    /* "amplpy/iterators.pxi":25
 * 
 *     def __next__(self):
 *         if self.iterator >= self.end:             # <<<<<<<<<<<<<<
 *             raise StopIteration
 *         cdef campl.AMPL_ENVIRONMENTVAR* it = self.iterator
 */
  }

  /* "amplpy/iterators.pxi":27
 *         if self.iterator >= self.end:
 *             raise StopIteration
 *         cdef campl.AMPL_ENVIRONMENTVAR* it = self.iterator             # <<<<<<<<<<<<<<
 *         self.iterator += 1
 *         cdef char* name_c
 */
  __pyx_t_2 = __pyx_v_self->iterator;
  __pyx_v_it = __pyx_t_2;

  /* "amplpy/iterators.pxi":28
 *             raise StopIteration
 *         cdef campl.AMPL_ENVIRONMENTVAR* it = self.iterator
 *         self.iterator += 1             # <<<<<<<<<<<<<<
 *         cdef char* name_c
 *         cdef char* value_c
 */
  __pyx_v_self->iterator = (__pyx_v_self->iterator + 1);

  /* "amplpy/iterators.pxi":31
 *         cdef char* name_c
 *         cdef char* value_c
 *         campl.AMPL_EnvironmentVarGetName(it, &name_c)             # <<<<<<<<<<<<<<
 *         campl.AMPL_EnvironmentVarGetValue(it, &value_c)
 *         name = name_c.decode('utf-8')
 */
  (void)(AMPL_EnvironmentVarGetName(__pyx_v_it, (&__pyx_v_name_c)));

  /* "amplpy/iterators.pxi":32
 *         cdef char* value_c
 *         campl.AMPL_EnvironmentVarGetName(it, &name_c)
 *         campl.AMPL_EnvironmentVarGetValue(it, &value_c)             # <<<<<<<<<<<<<<
 *         name = name_c.decode('utf-8')
 *         value = value_c.decode('utf-8')
 */
  (void)(AMPL_EnvironmentVarGetValue(__pyx_v_it, (&__pyx_v_value_c)));

  /* "amplpy/iterators.pxi":33
 *         campl.AMPL_EnvironmentVarGetName(it, &name_c)
 *         campl.AMPL_EnvironmentVarGetValue(it, &value_c)
 *         name = name_c.decode('utf-8')             # <<<<<<<<<<<<<<
 *         value = value_c.decode('utf-8')
 *         return (name, value)
 */
  __pyx_t_3 = __Pyx_ssize_strlen(__pyx_v_name_c); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(6, 33, __pyx_L1_error)
  __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_name_c, 0, __pyx_t_3, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 33, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_v_name = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "amplpy/iterators.pxi":34
 *         campl.AMPL_EnvironmentVarGetValue(it, &value_c)
 *         name = name_c.decode('utf-8')
 *         value = value_c.decode('utf-8')             # <<<<<<<<<<<<<<
 *         return (name, value)
 * 
 */
  __pyx_t_3 = __Pyx_ssize_strlen(__pyx_v_value_c); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(6, 34, __pyx_L1_error)
  __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_value_c, 0, __pyx_t_3, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_v_value = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "amplpy/iterators.pxi":35
 *         name = name_c.decode('utf-8')
 *         value = value_c.decode('utf-8')
 *         return (name, value)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_name);
  __Pyx_GIVEREF(__pyx_v_name);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_name)) __PYX_ERR(6, 35, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_value)) __PYX_ERR(6, 35, __pyx_L1_error);
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "amplpy/iterators.pxi":24
 *         return self
 * 
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         if self.iterator >= self.end:
 *             raise StopIteration
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  if (!__pyx_error_without_exception) {
    __Pyx_AddTraceback("_amplpy.EnvIterator.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  }
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.begin,self.end,self.env_c,self.iterator cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_11EnvIterator_5__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_11EnvIterator_4__reduce_cython__, "EnvIterator.__reduce_cython__(self)");
static PyMethodDef __pyx_mdef_7_amplpy_11EnvIterator_5__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_11EnvIterator_5__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_11EnvIterator_4__reduce_cython__};
static PyObject *__pyx_pw_7_amplpy_11EnvIterator_5__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_11EnvIterator_4__reduce_cython__(((struct __pyx_obj_7_amplpy_EnvIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_11EnvIterator_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7_amplpy_EnvIterator *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 1);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "self.begin,self.end,self.env_c,self.iterator cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self.begin,self.end,self.env_c,self.iterator cannot be converted to a Python object for pickling"
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_self_begin_self_end_self_env_c_s, 0, 0);
  __PYX_ERR(8, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.begin,self.end,self.env_c,self.iterator cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 */

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

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self.begin,self.end,self.env_c,self.iterator cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.begin,self.end,self.env_c,self.iterator cannot be converted to a Python object for pickling"
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_11EnvIterator_7__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_11EnvIterator_6__setstate_cython__, "EnvIterator.__setstate_cython__(self, __pyx_state)");
static PyMethodDef __pyx_mdef_7_amplpy_11EnvIterator_7__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_11EnvIterator_7__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_11EnvIterator_6__setstate_cython__};
static PyObject *__pyx_pw_7_amplpy_11EnvIterator_7__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 3, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(8, 3, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(8, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.EnvIterator.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_11EnvIterator_6__setstate_cython__(((struct __pyx_obj_7_amplpy_EnvIterator *)__pyx_v_self), __pyx_v___pyx_state);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_11EnvIterator_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7_amplpy_EnvIterator *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 1);

  /* "(tree fragment)":4
 *     raise TypeError, "self.begin,self.end,self.env_c,self.iterator cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self.begin,self.end,self.env_c,self.iterator cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_self_begin_self_end_self_env_c_s, 0, 0);
  __PYX_ERR(8, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self.begin,self.end,self.env_c,self.iterator cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.begin,self.end,self.env_c,self.iterator cannot be converted to a Python object for pickling"
 */

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

/* "amplpy/iterators.pxi":47
 * 
 *     @staticmethod
 *     cdef create(campl.AMPL* ampl, campl.AMPL_ENTITYTYPE entity_class):             # <<<<<<<<<<<<<<
 *         cdef campl.AMPL_ERRORINFO* errorinfo
 *         cdef campl.AMPL_RETCODE rc
 */

static PyObject *__pyx_f_7_amplpy_9EntityMap_create(AMPL *__pyx_v_ampl, AMPL_ENTITYTYPE __pyx_v_entity_class) {
  AMPL_ERRORINFO *__pyx_v_errorinfo;
  AMPL_RETCODE __pyx_v_rc;
  struct __pyx_obj_7_amplpy_EntityMap *__pyx_v_entityit = NULL;
  size_t __pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  size_t __pyx_t_3;
  size_t __pyx_t_4;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("create", 1);

  /* "amplpy/iterators.pxi":50
 *         cdef campl.AMPL_ERRORINFO* errorinfo
 *         cdef campl.AMPL_RETCODE rc
 *         entityit = EntityMap()             # <<<<<<<<<<<<<<
 *         entityit._c_ampl = ampl
 *         entityit.entity_class = entity_class
 */
  __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_7_amplpy_EntityMap)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 50, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_entityit = ((struct __pyx_obj_7_amplpy_EntityMap *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "amplpy/iterators.pxi":51
 *         cdef campl.AMPL_RETCODE rc
 *         entityit = EntityMap()
 *         entityit._c_ampl = ampl             # <<<<<<<<<<<<<<
 *         entityit.entity_class = entity_class
 *         if entity_class == campl.AMPL_VARIABLE:
 */
  __pyx_v_entityit->_c_ampl = __pyx_v_ampl;

  /* "amplpy/iterators.pxi":52
 *         entityit = EntityMap()
 *         entityit._c_ampl = ampl
 *         entityit.entity_class = entity_class             # <<<<<<<<<<<<<<
 *         if entity_class == campl.AMPL_VARIABLE:
 *             errorinfo = campl.AMPL_GetVariables(entityit._c_ampl, &entityit._size, &entityit.begin)
 */
  __pyx_v_entityit->entity_class = __pyx_v_entity_class;

  /* "amplpy/iterators.pxi":53
 *         entityit._c_ampl = ampl
 *         entityit.entity_class = entity_class
 *         if entity_class == campl.AMPL_VARIABLE:             # <<<<<<<<<<<<<<
 *             errorinfo = campl.AMPL_GetVariables(entityit._c_ampl, &entityit._size, &entityit.begin)
 *         elif entity_class == campl.AMPL_CONSTRAINT:
 */
  switch (__pyx_v_entity_class) {
    case AMPL_VARIABLE:

    /* "amplpy/iterators.pxi":54
 *         entityit.entity_class = entity_class
 *         if entity_class == campl.AMPL_VARIABLE:
 *             errorinfo = campl.AMPL_GetVariables(entityit._c_ampl, &entityit._size, &entityit.begin)             # <<<<<<<<<<<<<<
 *         elif entity_class == campl.AMPL_CONSTRAINT:
 *             errorinfo = campl.AMPL_GetConstraints(entityit._c_ampl, &entityit._size, &entityit.begin)
 */
    __pyx_v_errorinfo = AMPL_GetVariables(__pyx_v_entityit->_c_ampl, (&__pyx_v_entityit->_size), (&__pyx_v_entityit->begin));

    /* "amplpy/iterators.pxi":53
 *         entityit._c_ampl = ampl
 *         entityit.entity_class = entity_class
 *         if entity_class == campl.AMPL_VARIABLE:             # <<<<<<<<<<<<<<
 *             errorinfo = campl.AMPL_GetVariables(entityit._c_ampl, &entityit._size, &entityit.begin)
 *         elif entity_class == campl.AMPL_CONSTRAINT:
 */
    break;
    case AMPL_CONSTRAINT:

    /* "amplpy/iterators.pxi":56
 *             errorinfo = campl.AMPL_GetVariables(entityit._c_ampl, &entityit._size, &entityit.begin)
 *         elif entity_class == campl.AMPL_CONSTRAINT:
 *             errorinfo = campl.AMPL_GetConstraints(entityit._c_ampl, &entityit._size, &entityit.begin)             # <<<<<<<<<<<<<<
 *         elif entity_class == campl.AMPL_OBJECTIVE:
 *             errorinfo = campl.AMPL_GetObjectives(entityit._c_ampl, &entityit._size, &entityit.begin)
 */
    __pyx_v_errorinfo = AMPL_GetConstraints(__pyx_v_entityit->_c_ampl, (&__pyx_v_entityit->_size), (&__pyx_v_entityit->begin));

    /* "amplpy/iterators.pxi":55
 *         if entity_class == campl.AMPL_VARIABLE:
 *             errorinfo = campl.AMPL_GetVariables(entityit._c_ampl, &entityit._size, &entityit.begin)
 *         elif entity_class == campl.AMPL_CONSTRAINT:             # <<<<<<<<<<<<<<
 *             errorinfo = campl.AMPL_GetConstraints(entityit._c_ampl, &entityit._size, &entityit.begin)
 *         elif entity_class == campl.AMPL_OBJECTIVE:
 */
    break;
    case AMPL_OBJECTIVE:

    /* "amplpy/iterators.pxi":58
 *             errorinfo = campl.AMPL_GetConstraints(entityit._c_ampl, &entityit._size, &entityit.begin)
 *         elif entity_class == campl.AMPL_OBJECTIVE:
 *             errorinfo = campl.AMPL_GetObjectives(entityit._c_ampl, &entityit._size, &entityit.begin)             # <<<<<<<<<<<<<<
 *         elif entity_class == campl.AMPL_SET:
 *             errorinfo = campl.AMPL_GetSets(entityit._c_ampl, &entityit._size, &entityit.begin)
 */
    __pyx_v_errorinfo = AMPL_GetObjectives(__pyx_v_entityit->_c_ampl, (&__pyx_v_entityit->_size), (&__pyx_v_entityit->begin));

    /* "amplpy/iterators.pxi":57
 *         elif entity_class == campl.AMPL_CONSTRAINT:
 *             errorinfo = campl.AMPL_GetConstraints(entityit._c_ampl, &entityit._size, &entityit.begin)
 *         elif entity_class == campl.AMPL_OBJECTIVE:             # <<<<<<<<<<<<<<
 *             errorinfo = campl.AMPL_GetObjectives(entityit._c_ampl, &entityit._size, &entityit.begin)
 *         elif entity_class == campl.AMPL_SET:
 */
    break;
    case AMPL_SET:

    /* "amplpy/iterators.pxi":60
 *             errorinfo = campl.AMPL_GetObjectives(entityit._c_ampl, &entityit._size, &entityit.begin)
 *         elif entity_class == campl.AMPL_SET:
 *             errorinfo = campl.AMPL_GetSets(entityit._c_ampl, &entityit._size, &entityit.begin)             # <<<<<<<<<<<<<<
 *         elif entity_class == campl.AMPL_PARAMETER:
 *             errorinfo = campl.AMPL_GetParameters(entityit._c_ampl, &entityit._size, &entityit.begin)
 */
    __pyx_v_errorinfo = AMPL_GetSets(__pyx_v_entityit->_c_ampl, (&__pyx_v_entityit->_size), (&__pyx_v_entityit->begin));

    /* "amplpy/iterators.pxi":59
 *         elif entity_class == campl.AMPL_OBJECTIVE:
 *             errorinfo = campl.AMPL_GetObjectives(entityit._c_ampl, &entityit._size, &entityit.begin)
 *         elif entity_class == campl.AMPL_SET:             # <<<<<<<<<<<<<<
 *             errorinfo = campl.AMPL_GetSets(entityit._c_ampl, &entityit._size, &entityit.begin)
 *         elif entity_class == campl.AMPL_PARAMETER:
 */
    break;
    case AMPL_PARAMETER:

    /* "amplpy/iterators.pxi":62
 *             errorinfo = campl.AMPL_GetSets(entityit._c_ampl, &entityit._size, &entityit.begin)
 *         elif entity_class == campl.AMPL_PARAMETER:
 *             errorinfo = campl.AMPL_GetParameters(entityit._c_ampl, &entityit._size, &entityit.begin)             # <<<<<<<<<<<<<<
 *         else:
 *             raise ValueError(f"Unknown entity class.")
 */
    __pyx_v_errorinfo = AMPL_GetParameters(__pyx_v_entityit->_c_ampl, (&__pyx_v_entityit->_size), (&__pyx_v_entityit->begin));

    /* "amplpy/iterators.pxi":61
 *         elif entity_class == campl.AMPL_SET:
 *             errorinfo = campl.AMPL_GetSets(entityit._c_ampl, &entityit._size, &entityit.begin)
 *         elif entity_class == campl.AMPL_PARAMETER:             # <<<<<<<<<<<<<<
 *             errorinfo = campl.AMPL_GetParameters(entityit._c_ampl, &entityit._size, &entityit.begin)
 *         else:
 */
    break;
    default:

    /* "amplpy/iterators.pxi":64
 *             errorinfo = campl.AMPL_GetParameters(entityit._c_ampl, &entityit._size, &entityit.begin)
 *         else:
 *             raise ValueError(f"Unknown entity class.")             # <<<<<<<<<<<<<<
 * 
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 64, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(6, 64, __pyx_L1_error)
    break;
  }

  /* "amplpy/iterators.pxi":66
 *             raise ValueError(f"Unknown entity class.")
 * 
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)             # <<<<<<<<<<<<<<
 *         if rc != campl.AMPL_OK:
 *             for i in range(entityit._size):
 */
  __pyx_v_rc = AMPL_ErrorInfoGetError(__pyx_v_errorinfo);

  /* "amplpy/iterators.pxi":67
 * 
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:             # <<<<<<<<<<<<<<
 *             for i in range(entityit._size):
 *                 campl.AMPL_StringFree(&entityit.begin[i])
 */
  __pyx_t_2 = (__pyx_v_rc != AMPL_OK);
  if (__pyx_t_2) {

    /* "amplpy/iterators.pxi":68
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:
 *             for i in range(entityit._size):             # <<<<<<<<<<<<<<
 *                 campl.AMPL_StringFree(&entityit.begin[i])
 *             free(entityit.begin)
 */
    __pyx_t_3 = __pyx_v_entityit->_size;
    __pyx_t_4 = __pyx_t_3;
    for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
      __pyx_v_i = __pyx_t_5;

      /* "amplpy/iterators.pxi":69
 *         if rc != campl.AMPL_OK:
 *             for i in range(entityit._size):
 *                 campl.AMPL_StringFree(&entityit.begin[i])             # <<<<<<<<<<<<<<
 *             free(entityit.begin)
 *             PY_AMPL_CALL(errorinfo)
 */
      (void)(AMPL_StringFree((&(__pyx_v_entityit->begin[__pyx_v_i]))));
    }

    /* "amplpy/iterators.pxi":70
 *             for i in range(entityit._size):
 *                 campl.AMPL_StringFree(&entityit.begin[i])
 *             free(entityit.begin)             # <<<<<<<<<<<<<<
 *             PY_AMPL_CALL(errorinfo)
 * 
 */
    free(__pyx_v_entityit->begin);

    /* "amplpy/iterators.pxi":71
 *                 campl.AMPL_StringFree(&entityit.begin[i])
 *             free(entityit.begin)
 *             PY_AMPL_CALL(errorinfo)             # <<<<<<<<<<<<<<
 * 
 *         entityit.iterator = 0
 */
    __pyx_t_1 = __pyx_f_7_amplpy_PY_AMPL_CALL(__pyx_v_errorinfo); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 71, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "amplpy/iterators.pxi":67
 * 
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:             # <<<<<<<<<<<<<<
 *             for i in range(entityit._size):
 *                 campl.AMPL_StringFree(&entityit.begin[i])
 */
  }

  /* "amplpy/iterators.pxi":73
 *             PY_AMPL_CALL(errorinfo)
 * 
 *         entityit.iterator = 0             # <<<<<<<<<<<<<<
 *         entityit.end = entityit.begin + entityit._size
 *         return entityit
 */
  __pyx_v_entityit->iterator = 0;

  /* "amplpy/iterators.pxi":74
 * 
 *         entityit.iterator = 0
 *         entityit.end = entityit.begin + entityit._size             # <<<<<<<<<<<<<<
 *         return entityit
 * 
 */
  __pyx_v_entityit->end = (__pyx_v_entityit->begin + __pyx_v_entityit->_size);

  /* "amplpy/iterators.pxi":75
 *         entityit.iterator = 0
 *         entityit.end = entityit.begin + entityit._size
 *         return entityit             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_entityit);
  __pyx_r = ((PyObject *)__pyx_v_entityit);
  goto __pyx_L0;

  /* "amplpy/iterators.pxi":47
 * 
 *     @staticmethod
 *     cdef create(campl.AMPL* ampl, campl.AMPL_ENTITYTYPE entity_class):             # <<<<<<<<<<<<<<
 *         cdef campl.AMPL_ERRORINFO* errorinfo
 *         cdef campl.AMPL_RETCODE rc
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("_amplpy.EntityMap.create", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_entityit);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/iterators.pxi":77
 *         return entityit
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         if self.iterator < self._size:
 *             for i in range(self.iterator, self._size):
 */

/* Python wrapper */
static void __pyx_pw_7_amplpy_9EntityMap_1__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_7_amplpy_9EntityMap_1__dealloc__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_pf_7_amplpy_9EntityMap___dealloc__(((struct __pyx_obj_7_amplpy_EntityMap *)__pyx_v_self));

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

static void __pyx_pf_7_amplpy_9EntityMap___dealloc__(struct __pyx_obj_7_amplpy_EntityMap *__pyx_v_self) {
  size_t __pyx_v_i;
  int __pyx_t_1;
  size_t __pyx_t_2;
  size_t __pyx_t_3;
  size_t __pyx_t_4;

  /* "amplpy/iterators.pxi":78
 * 
 *     def __dealloc__(self):
 *         if self.iterator < self._size:             # <<<<<<<<<<<<<<
 *             for i in range(self.iterator, self._size):
 *                 campl.AMPL_StringFree(&self.begin[i])
 */
  __pyx_t_1 = (__pyx_v_self->iterator < __pyx_v_self->_size);
  if (__pyx_t_1) {

    /* "amplpy/iterators.pxi":79
 *     def __dealloc__(self):
 *         if self.iterator < self._size:
 *             for i in range(self.iterator, self._size):             # <<<<<<<<<<<<<<
 *                 campl.AMPL_StringFree(&self.begin[i])
 *         if self.begin != NULL:
 */
    __pyx_t_2 = __pyx_v_self->_size;
    __pyx_t_3 = __pyx_t_2;
    for (__pyx_t_4 = __pyx_v_self->iterator; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
      __pyx_v_i = __pyx_t_4;

      /* "amplpy/iterators.pxi":80
 *         if self.iterator < self._size:
 *             for i in range(self.iterator, self._size):
 *                 campl.AMPL_StringFree(&self.begin[i])             # <<<<<<<<<<<<<<
 *         if self.begin != NULL:
 *             free(self.begin)
 */
      (void)(AMPL_StringFree((&(__pyx_v_self->begin[__pyx_v_i]))));
    }

    /* "amplpy/iterators.pxi":78
 * 
 *     def __dealloc__(self):
 *         if self.iterator < self._size:             # <<<<<<<<<<<<<<
 *             for i in range(self.iterator, self._size):
 *                 campl.AMPL_StringFree(&self.begin[i])
 */
  }

  /* "amplpy/iterators.pxi":81
 *             for i in range(self.iterator, self._size):
 *                 campl.AMPL_StringFree(&self.begin[i])
 *         if self.begin != NULL:             # <<<<<<<<<<<<<<
 *             free(self.begin)
 *             self.begin = NULL
 */
  __pyx_t_1 = (__pyx_v_self->begin != NULL);
  if (__pyx_t_1) {

    /* "amplpy/iterators.pxi":82
 *                 campl.AMPL_StringFree(&self.begin[i])
 *         if self.begin != NULL:
 *             free(self.begin)             # <<<<<<<<<<<<<<
 *             self.begin = NULL
 * 
 */
    free(__pyx_v_self->begin);

    /* "amplpy/iterators.pxi":83
 *         if self.begin != NULL:
 *             free(self.begin)
 *             self.begin = NULL             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
 */
    __pyx_v_self->begin = NULL;

    /* "amplpy/iterators.pxi":81
 *             for i in range(self.iterator, self._size):
 *                 campl.AMPL_StringFree(&self.begin[i])
 *         if self.begin != NULL:             # <<<<<<<<<<<<<<
 *             free(self.begin)
 *             self.begin = NULL
 */
  }

  /* "amplpy/iterators.pxi":77
 *         return entityit
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         if self.iterator < self._size:
 *             for i in range(self.iterator, self._size):
 */

  /* function exit code */
}

/* "amplpy/iterators.pxi":85
 *             self.begin = NULL
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_9EntityMap_3__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7_amplpy_9EntityMap_3__iter__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7_amplpy_9EntityMap_2__iter__(((struct __pyx_obj_7_amplpy_EntityMap *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_9EntityMap_2__iter__(struct __pyx_obj_7_amplpy_EntityMap *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 1);

  /* "amplpy/iterators.pxi":86
 * 
 *     def __iter__(self):
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     def __next__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "amplpy/iterators.pxi":85
 *             self.begin = NULL
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

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

/* "amplpy/iterators.pxi":88
 *         return self
 * 
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         if self.iterator >= self._size:
 *             raise StopIteration
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_9EntityMap_5__next__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7_amplpy_9EntityMap_5__next__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__next__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7_amplpy_9EntityMap_4__next__(((struct __pyx_obj_7_amplpy_EntityMap *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_9EntityMap_4__next__(struct __pyx_obj_7_amplpy_EntityMap *__pyx_v_self) {
  PyObject *__pyx_v_tuple = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_error_without_exception = 0; /* StopIteration */
  int __pyx_t_1;
  char *__pyx_t_2;
  Py_ssize_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__next__", 1);

  /* "amplpy/iterators.pxi":89
 * 
 *     def __next__(self):
 *         if self.iterator >= self._size:             # <<<<<<<<<<<<<<
 *             raise StopIteration
 *         tuple = (self.begin[self.iterator].decode('utf-8'), create_entity(self.entity_class, self._c_ampl, self.begin[self.iterator], NULL, None))
 */
  __pyx_t_1 = (__pyx_v_self->iterator >= __pyx_v_self->_size);
  if (unlikely(__pyx_t_1)) {

    /* "amplpy/iterators.pxi":90
 *     def __next__(self):
 *         if self.iterator >= self._size:
 *             raise StopIteration             # <<<<<<<<<<<<<<
 *         tuple = (self.begin[self.iterator].decode('utf-8'), create_entity(self.entity_class, self._c_ampl, self.begin[self.iterator], NULL, None))
 *         self.iterator += 1
 */
    __pyx_error_without_exception = 1;
    goto __pyx_L1_error;;

    /* "amplpy/iterators.pxi":89
 * 
 *     def __next__(self):
 *         if self.iterator >= self._size:             # <<<<<<<<<<<<<<
 *             raise StopIteration
 *         tuple = (self.begin[self.iterator].decode('utf-8'), create_entity(self.entity_class, self._c_ampl, self.begin[self.iterator], NULL, None))
 */
  }

  /* "amplpy/iterators.pxi":91
 *         if self.iterator >= self._size:
 *             raise StopIteration
 *         tuple = (self.begin[self.iterator].decode('utf-8'), create_entity(self.entity_class, self._c_ampl, self.begin[self.iterator], NULL, None))             # <<<<<<<<<<<<<<
 *         self.iterator += 1
 *         return tuple
 */
  __pyx_t_2 = (__pyx_v_self->begin[__pyx_v_self->iterator]);
  __pyx_t_3 = __Pyx_ssize_strlen(__pyx_t_2); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(6, 91, __pyx_L1_error)
  __pyx_t_4 = __Pyx_decode_c_string(__pyx_t_2, 0, __pyx_t_3, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 91, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __pyx_f_7_amplpy_create_entity(__pyx_v_self->entity_class, __pyx_v_self->_c_ampl, (__pyx_v_self->begin[__pyx_v_self->iterator]), NULL, Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 91, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 91, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_INCREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4)) __PYX_ERR(6, 91, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_5);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5)) __PYX_ERR(6, 91, __pyx_L1_error);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_5 = 0;
  __pyx_v_tuple = ((PyObject*)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "amplpy/iterators.pxi":92
 *             raise StopIteration
 *         tuple = (self.begin[self.iterator].decode('utf-8'), create_entity(self.entity_class, self._c_ampl, self.begin[self.iterator], NULL, None))
 *         self.iterator += 1             # <<<<<<<<<<<<<<
 *         return tuple
 * 
 */
  __pyx_v_self->iterator = (__pyx_v_self->iterator + 1);

  /* "amplpy/iterators.pxi":93
 *         tuple = (self.begin[self.iterator].decode('utf-8'), create_entity(self.entity_class, self._c_ampl, self.begin[self.iterator], NULL, None))
 *         self.iterator += 1
 *         return tuple             # <<<<<<<<<<<<<<
 * 
 *     def __getitem__(self, key):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_tuple);
  __pyx_r = __pyx_v_tuple;
  goto __pyx_L0;

  /* "amplpy/iterators.pxi":88
 *         return self
 * 
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         if self.iterator >= self._size:
 *             raise StopIteration
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  if (!__pyx_error_without_exception) {
    __Pyx_AddTraceback("_amplpy.EntityMap.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  }
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_tuple);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/iterators.pxi":95
 *         return tuple
 * 
 *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
 *         assert isinstance(key, str)
 *         cdef campl.AMPL_ERRORINFO* errorinfo
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_9EntityMap_7__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_7_amplpy_9EntityMap_7__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7_amplpy_9EntityMap_6__getitem__(((struct __pyx_obj_7_amplpy_EntityMap *)__pyx_v_self), ((PyObject *)__pyx_v_key));

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

static PyObject *__pyx_pf_7_amplpy_9EntityMap_6__getitem__(struct __pyx_obj_7_amplpy_EntityMap *__pyx_v_self, PyObject *__pyx_v_key) {
  AMPL_ERRORINFO *__pyx_v_errorinfo;
  AMPL_RETCODE __pyx_v_rc;
  AMPL_ENTITYTYPE __pyx_v_entitytype;
  char *__pyx_v_name_c;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  unsigned int __pyx_t_5;
  char const *__pyx_t_6;
  char *__pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getitem__", 1);

  /* "amplpy/iterators.pxi":96
 * 
 *     def __getitem__(self, key):
 *         assert isinstance(key, str)             # <<<<<<<<<<<<<<
 *         cdef campl.AMPL_ERRORINFO* errorinfo
 *         cdef campl.AMPL_RETCODE rc
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = PyUnicode_Check(__pyx_v_key); 
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(6, 96, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(6, 96, __pyx_L1_error)
  #endif

  /* "amplpy/iterators.pxi":100
 *         cdef campl.AMPL_RETCODE rc
 *         cdef campl.AMPL_ENTITYTYPE entitytype
 *         cdef char* name_c = strdup(key.encode('utf-8'))             # <<<<<<<<<<<<<<
 *         errorinfo = campl.AMPL_EntityGetType(self._c_ampl, name_c, &entitytype)
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 100, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_u_utf_8};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 100, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_t_2); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(6, 100, __pyx_L1_error)
  __pyx_v_name_c = strdup(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "amplpy/iterators.pxi":101
 *         cdef campl.AMPL_ENTITYTYPE entitytype
 *         cdef char* name_c = strdup(key.encode('utf-8'))
 *         errorinfo = campl.AMPL_EntityGetType(self._c_ampl, name_c, &entitytype)             # <<<<<<<<<<<<<<
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:
 */
  __pyx_v_errorinfo = AMPL_EntityGetType(__pyx_v_self->_c_ampl, __pyx_v_name_c, (&__pyx_v_entitytype));

  /* "amplpy/iterators.pxi":102
 *         cdef char* name_c = strdup(key.encode('utf-8'))
 *         errorinfo = campl.AMPL_EntityGetType(self._c_ampl, name_c, &entitytype)
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)             # <<<<<<<<<<<<<<
 *         if rc != campl.AMPL_OK:
 *             free(name_c)
 */
  __pyx_v_rc = AMPL_ErrorInfoGetError(__pyx_v_errorinfo);

  /* "amplpy/iterators.pxi":103
 *         errorinfo = campl.AMPL_EntityGetType(self._c_ampl, name_c, &entitytype)
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:             # <<<<<<<<<<<<<<
 *             free(name_c)
 *             PY_AMPL_CALL(errorinfo)
 */
  __pyx_t_1 = (__pyx_v_rc != AMPL_OK);
  if (__pyx_t_1) {

    /* "amplpy/iterators.pxi":104
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:
 *             free(name_c)             # <<<<<<<<<<<<<<
 *             PY_AMPL_CALL(errorinfo)
 *         if entitytype != self.entity_class:
 */
    free(__pyx_v_name_c);

    /* "amplpy/iterators.pxi":105
 *         if rc != campl.AMPL_OK:
 *             free(name_c)
 *             PY_AMPL_CALL(errorinfo)             # <<<<<<<<<<<<<<
 *         if entitytype != self.entity_class:
 *             free(name_c)
 */
    __pyx_t_2 = __pyx_f_7_amplpy_PY_AMPL_CALL(__pyx_v_errorinfo); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 105, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "amplpy/iterators.pxi":103
 *         errorinfo = campl.AMPL_EntityGetType(self._c_ampl, name_c, &entitytype)
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:             # <<<<<<<<<<<<<<
 *             free(name_c)
 *             PY_AMPL_CALL(errorinfo)
 */
  }

  /* "amplpy/iterators.pxi":106
 *             free(name_c)
 *             PY_AMPL_CALL(errorinfo)
 *         if entitytype != self.entity_class:             # <<<<<<<<<<<<<<
 *             free(name_c)
 *             raiseKeyError(self.entity_class, key)
 */
  __pyx_t_1 = (__pyx_v_entitytype != __pyx_v_self->entity_class);
  if (__pyx_t_1) {

    /* "amplpy/iterators.pxi":107
 *             PY_AMPL_CALL(errorinfo)
 *         if entitytype != self.entity_class:
 *             free(name_c)             # <<<<<<<<<<<<<<
 *             raiseKeyError(self.entity_class, key)
 *         return create_entity(self.entity_class, self._c_ampl, name_c, NULL, None)
 */
    free(__pyx_v_name_c);

    /* "amplpy/iterators.pxi":108
 *         if entitytype != self.entity_class:
 *             free(name_c)
 *             raiseKeyError(self.entity_class, key)             # <<<<<<<<<<<<<<
 *         return create_entity(self.entity_class, self._c_ampl, name_c, NULL, None)
 * 
 */
    __pyx_t_7 = __Pyx_PyObject_AsWritableString(__pyx_v_key); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(6, 108, __pyx_L1_error)
    __pyx_t_2 = __pyx_f_7_amplpy_raiseKeyError(__pyx_v_self->entity_class, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 108, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "amplpy/iterators.pxi":106
 *             free(name_c)
 *             PY_AMPL_CALL(errorinfo)
 *         if entitytype != self.entity_class:             # <<<<<<<<<<<<<<
 *             free(name_c)
 *             raiseKeyError(self.entity_class, key)
 */
  }

  /* "amplpy/iterators.pxi":109
 *             free(name_c)
 *             raiseKeyError(self.entity_class, key)
 *         return create_entity(self.entity_class, self._c_ampl, name_c, NULL, None)             # <<<<<<<<<<<<<<
 * 
 *     def size(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_7_amplpy_create_entity(__pyx_v_self->entity_class, __pyx_v_self->_c_ampl, __pyx_v_name_c, NULL, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 109, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "amplpy/iterators.pxi":95
 *         return tuple
 * 
 *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
 *         assert isinstance(key, str)
 *         cdef campl.AMPL_ERRORINFO* errorinfo
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("_amplpy.EntityMap.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/iterators.pxi":111
 *         return create_entity(self.entity_class, self._c_ampl, name_c, NULL, None)
 * 
 *     def size(self):             # <<<<<<<<<<<<<<
 *         return int(self._size)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_9EntityMap_9size(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_9EntityMap_8size, "EntityMap.size(self)");
static PyMethodDef __pyx_mdef_7_amplpy_9EntityMap_9size = {"size", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_9EntityMap_9size, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_9EntityMap_8size};
static PyObject *__pyx_pw_7_amplpy_9EntityMap_9size(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("size (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("size", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "size", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_9EntityMap_8size(((struct __pyx_obj_7_amplpy_EntityMap *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_9EntityMap_8size(struct __pyx_obj_7_amplpy_EntityMap *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("size", 1);

  /* "amplpy/iterators.pxi":112
 * 
 *     def size(self):
 *         return int(self._size)             # <<<<<<<<<<<<<<
 * 
 *     def __len__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_self->_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 112, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyInt_Type)), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 112, __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;

  /* "amplpy/iterators.pxi":111
 *         return create_entity(self.entity_class, self._c_ampl, name_c, NULL, None)
 * 
 *     def size(self):             # <<<<<<<<<<<<<<
 *         return int(self._size)
 * 
 */

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

/* "amplpy/iterators.pxi":114
 *         return int(self._size)
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         return self.size()
 * 
 */

/* Python wrapper */
static Py_ssize_t __pyx_pw_7_amplpy_9EntityMap_11__len__(PyObject *__pyx_v_self); /*proto*/
static Py_ssize_t __pyx_pw_7_amplpy_9EntityMap_11__len__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7_amplpy_9EntityMap_10__len__(((struct __pyx_obj_7_amplpy_EntityMap *)__pyx_v_self));

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

static Py_ssize_t __pyx_pf_7_amplpy_9EntityMap_10__len__(struct __pyx_obj_7_amplpy_EntityMap *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__len__", 1);

  /* "amplpy/iterators.pxi":115
 * 
 *     def __len__(self):
 *         return self.size()             # <<<<<<<<<<<<<<
 * 
 * cdef class InstanceIterator(object):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 115, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 115, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(6, 115, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_5;
  goto __pyx_L0;

  /* "amplpy/iterators.pxi":114
 *         return int(self._size)
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         return self.size()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("_amplpy.EntityMap.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._c_ampl,self.begin,self.end cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_9EntityMap_13__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_9EntityMap_12__reduce_cython__, "EntityMap.__reduce_cython__(self)");
static PyMethodDef __pyx_mdef_7_amplpy_9EntityMap_13__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_9EntityMap_13__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_9EntityMap_12__reduce_cython__};
static PyObject *__pyx_pw_7_amplpy_9EntityMap_13__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_9EntityMap_12__reduce_cython__(((struct __pyx_obj_7_amplpy_EntityMap *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_9EntityMap_12__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7_amplpy_EntityMap *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 1);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "self._c_ampl,self.begin,self.end cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self._c_ampl,self.begin,self.end cannot be converted to a Python object for pickling"
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_self__c_ampl_self_begin_self_end, 0, 0);
  __PYX_ERR(8, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._c_ampl,self.begin,self.end cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 */

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

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._c_ampl,self.begin,self.end cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._c_ampl,self.begin,self.end cannot be converted to a Python object for pickling"
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_9EntityMap_15__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_9EntityMap_14__setstate_cython__, "EntityMap.__setstate_cython__(self, __pyx_state)");
static PyMethodDef __pyx_mdef_7_amplpy_9EntityMap_15__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_9EntityMap_15__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_9EntityMap_14__setstate_cython__};
static PyObject *__pyx_pw_7_amplpy_9EntityMap_15__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 3, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(8, 3, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(8, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.EntityMap.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_9EntityMap_14__setstate_cython__(((struct __pyx_obj_7_amplpy_EntityMap *)__pyx_v_self), __pyx_v___pyx_state);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_9EntityMap_14__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7_amplpy_EntityMap *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 1);

  /* "(tree fragment)":4
 *     raise TypeError, "self._c_ampl,self.begin,self.end cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self._c_ampl,self.begin,self.end cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_self__c_ampl_self_begin_self_end, 0, 0);
  __PYX_ERR(8, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._c_ampl,self.begin,self.end cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._c_ampl,self.begin,self.end cannot be converted to a Python object for pickling"
 */

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

/* "amplpy/iterators.pxi":128
 * 
 *     @staticmethod
 *     cdef create(campl.AMPL* ampl, char* name, campl.AMPL_ENTITYTYPE entity_class, parent):             # <<<<<<<<<<<<<<
 *         cdef campl.AMPL_ERRORINFO* errorinfo
 *         cdef campl.AMPL_RETCODE rc
 */

static PyObject *__pyx_f_7_amplpy_16InstanceIterator_create(AMPL *__pyx_v_ampl, char *__pyx_v_name, AMPL_ENTITYTYPE __pyx_v_entity_class, PyObject *__pyx_v_parent) {
  AMPL_ERRORINFO *__pyx_v_errorinfo;
  AMPL_RETCODE __pyx_v_rc;
  struct __pyx_obj_7_amplpy_InstanceIterator *__pyx_v_instanceit = NULL;
  size_t __pyx_v_arity;
  size_t __pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  size_t __pyx_t_3;
  size_t __pyx_t_4;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("create", 1);

  /* "amplpy/iterators.pxi":131
 *         cdef campl.AMPL_ERRORINFO* errorinfo
 *         cdef campl.AMPL_RETCODE rc
 *         instanceit = InstanceIterator()             # <<<<<<<<<<<<<<
 *         cdef size_t arity
 *         instanceit._c_ampl = ampl
 */
  __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_7_amplpy_InstanceIterator)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 131, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_instanceit = ((struct __pyx_obj_7_amplpy_InstanceIterator *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "amplpy/iterators.pxi":133
 *         instanceit = InstanceIterator()
 *         cdef size_t arity
 *         instanceit._c_ampl = ampl             # <<<<<<<<<<<<<<
 *         instanceit._name = name
 *         instanceit.entity_class = entity_class
 */
  __pyx_v_instanceit->_c_ampl = __pyx_v_ampl;

  /* "amplpy/iterators.pxi":134
 *         cdef size_t arity
 *         instanceit._c_ampl = ampl
 *         instanceit._name = name             # <<<<<<<<<<<<<<
 *         instanceit.entity_class = entity_class
 *         instanceit._entity = parent
 */
  __pyx_v_instanceit->_name = __pyx_v_name;

  /* "amplpy/iterators.pxi":135
 *         instanceit._c_ampl = ampl
 *         instanceit._name = name
 *         instanceit.entity_class = entity_class             # <<<<<<<<<<<<<<
 *         instanceit._entity = parent
 *         PY_AMPL_CALL(campl.AMPL_EntityGetIndexarity(instanceit._c_ampl, instanceit._name, &arity))
 */
  __pyx_v_instanceit->entity_class = __pyx_v_entity_class;

  /* "amplpy/iterators.pxi":136
 *         instanceit._name = name
 *         instanceit.entity_class = entity_class
 *         instanceit._entity = parent             # <<<<<<<<<<<<<<
 *         PY_AMPL_CALL(campl.AMPL_EntityGetIndexarity(instanceit._c_ampl, instanceit._name, &arity))
 *         if arity == 0:
 */
  __Pyx_INCREF(__pyx_v_parent);
  __Pyx_GIVEREF(__pyx_v_parent);
  __Pyx_GOTREF(__pyx_v_instanceit->_entity);
  __Pyx_DECREF(__pyx_v_instanceit->_entity);
  __pyx_v_instanceit->_entity = __pyx_v_parent;

  /* "amplpy/iterators.pxi":137
 *         instanceit.entity_class = entity_class
 *         instanceit._entity = parent
 *         PY_AMPL_CALL(campl.AMPL_EntityGetIndexarity(instanceit._c_ampl, instanceit._name, &arity))             # <<<<<<<<<<<<<<
 *         if arity == 0:
 *             instanceit._size = 1
 */
  __pyx_t_1 = __pyx_f_7_amplpy_PY_AMPL_CALL(AMPL_EntityGetIndexarity(__pyx_v_instanceit->_c_ampl, __pyx_v_instanceit->_name, (&__pyx_v_arity))); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 137, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "amplpy/iterators.pxi":138
 *         instanceit._entity = parent
 *         PY_AMPL_CALL(campl.AMPL_EntityGetIndexarity(instanceit._c_ampl, instanceit._name, &arity))
 *         if arity == 0:             # <<<<<<<<<<<<<<
 *             instanceit._size = 1
 *             instanceit.begin = NULL
 */
  __pyx_t_2 = (__pyx_v_arity == 0);
  if (__pyx_t_2) {

    /* "amplpy/iterators.pxi":139
 *         PY_AMPL_CALL(campl.AMPL_EntityGetIndexarity(instanceit._c_ampl, instanceit._name, &arity))
 *         if arity == 0:
 *             instanceit._size = 1             # <<<<<<<<<<<<<<
 *             instanceit.begin = NULL
 *             instanceit.iterator = 0
 */
    __pyx_v_instanceit->_size = 1;

    /* "amplpy/iterators.pxi":140
 *         if arity == 0:
 *             instanceit._size = 1
 *             instanceit.begin = NULL             # <<<<<<<<<<<<<<
 *             instanceit.iterator = 0
 *             instanceit.end = NULL
 */
    __pyx_v_instanceit->begin = NULL;

    /* "amplpy/iterators.pxi":141
 *             instanceit._size = 1
 *             instanceit.begin = NULL
 *             instanceit.iterator = 0             # <<<<<<<<<<<<<<
 *             instanceit.end = NULL
 *             return instanceit
 */
    __pyx_v_instanceit->iterator = 0;

    /* "amplpy/iterators.pxi":142
 *             instanceit.begin = NULL
 *             instanceit.iterator = 0
 *             instanceit.end = NULL             # <<<<<<<<<<<<<<
 *             return instanceit
 *         errorinfo = campl.AMPL_EntityGetTuples(instanceit._c_ampl, instanceit._name, &instanceit.begin, &instanceit._size)
 */
    __pyx_v_instanceit->end = NULL;

    /* "amplpy/iterators.pxi":143
 *             instanceit.iterator = 0
 *             instanceit.end = NULL
 *             return instanceit             # <<<<<<<<<<<<<<
 *         errorinfo = campl.AMPL_EntityGetTuples(instanceit._c_ampl, instanceit._name, &instanceit.begin, &instanceit._size)
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF((PyObject *)__pyx_v_instanceit);
    __pyx_r = ((PyObject *)__pyx_v_instanceit);
    goto __pyx_L0;

    /* "amplpy/iterators.pxi":138
 *         instanceit._entity = parent
 *         PY_AMPL_CALL(campl.AMPL_EntityGetIndexarity(instanceit._c_ampl, instanceit._name, &arity))
 *         if arity == 0:             # <<<<<<<<<<<<<<
 *             instanceit._size = 1
 *             instanceit.begin = NULL
 */
  }

  /* "amplpy/iterators.pxi":144
 *             instanceit.end = NULL
 *             return instanceit
 *         errorinfo = campl.AMPL_EntityGetTuples(instanceit._c_ampl, instanceit._name, &instanceit.begin, &instanceit._size)             # <<<<<<<<<<<<<<
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:
 */
  __pyx_v_errorinfo = AMPL_EntityGetTuples(__pyx_v_instanceit->_c_ampl, __pyx_v_instanceit->_name, (&__pyx_v_instanceit->begin), (&__pyx_v_instanceit->_size));

  /* "amplpy/iterators.pxi":145
 *             return instanceit
 *         errorinfo = campl.AMPL_EntityGetTuples(instanceit._c_ampl, instanceit._name, &instanceit.begin, &instanceit._size)
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)             # <<<<<<<<<<<<<<
 *         if rc != campl.AMPL_OK:
 *             for i in range(instanceit._size):
 */
  __pyx_v_rc = AMPL_ErrorInfoGetError(__pyx_v_errorinfo);

  /* "amplpy/iterators.pxi":146
 *         errorinfo = campl.AMPL_EntityGetTuples(instanceit._c_ampl, instanceit._name, &instanceit.begin, &instanceit._size)
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:             # <<<<<<<<<<<<<<
 *             for i in range(instanceit._size):
 *                 campl.AMPL_TupleFree(&instanceit.begin[i])
 */
  __pyx_t_2 = (__pyx_v_rc != AMPL_OK);
  if (__pyx_t_2) {

    /* "amplpy/iterators.pxi":147
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:
 *             for i in range(instanceit._size):             # <<<<<<<<<<<<<<
 *                 campl.AMPL_TupleFree(&instanceit.begin[i])
 *             free(instanceit.begin)
 */
    __pyx_t_3 = __pyx_v_instanceit->_size;
    __pyx_t_4 = __pyx_t_3;
    for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
      __pyx_v_i = __pyx_t_5;

      /* "amplpy/iterators.pxi":148
 *         if rc != campl.AMPL_OK:
 *             for i in range(instanceit._size):
 *                 campl.AMPL_TupleFree(&instanceit.begin[i])             # <<<<<<<<<<<<<<
 *             free(instanceit.begin)
 *             PY_AMPL_CALL(errorinfo)
 */
      (void)(AMPL_TupleFree((&(__pyx_v_instanceit->begin[__pyx_v_i]))));
    }

    /* "amplpy/iterators.pxi":149
 *             for i in range(instanceit._size):
 *                 campl.AMPL_TupleFree(&instanceit.begin[i])
 *             free(instanceit.begin)             # <<<<<<<<<<<<<<
 *             PY_AMPL_CALL(errorinfo)
 *         if instanceit._size == 0:
 */
    free(__pyx_v_instanceit->begin);

    /* "amplpy/iterators.pxi":150
 *                 campl.AMPL_TupleFree(&instanceit.begin[i])
 *             free(instanceit.begin)
 *             PY_AMPL_CALL(errorinfo)             # <<<<<<<<<<<<<<
 *         if instanceit._size == 0:
 *             instanceit.iterator = 0
 */
    __pyx_t_1 = __pyx_f_7_amplpy_PY_AMPL_CALL(__pyx_v_errorinfo); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 150, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "amplpy/iterators.pxi":146
 *         errorinfo = campl.AMPL_EntityGetTuples(instanceit._c_ampl, instanceit._name, &instanceit.begin, &instanceit._size)
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:             # <<<<<<<<<<<<<<
 *             for i in range(instanceit._size):
 *                 campl.AMPL_TupleFree(&instanceit.begin[i])
 */
  }

  /* "amplpy/iterators.pxi":151
 *             free(instanceit.begin)
 *             PY_AMPL_CALL(errorinfo)
 *         if instanceit._size == 0:             # <<<<<<<<<<<<<<
 *             instanceit.iterator = 0
 *             instanceit.end = NULL
 */
  __pyx_t_2 = (__pyx_v_instanceit->_size == 0);
  if (__pyx_t_2) {

    /* "amplpy/iterators.pxi":152
 *             PY_AMPL_CALL(errorinfo)
 *         if instanceit._size == 0:
 *             instanceit.iterator = 0             # <<<<<<<<<<<<<<
 *             instanceit.end = NULL
 *         else:
 */
    __pyx_v_instanceit->iterator = 0;

    /* "amplpy/iterators.pxi":153
 *         if instanceit._size == 0:
 *             instanceit.iterator = 0
 *             instanceit.end = NULL             # <<<<<<<<<<<<<<
 *         else:
 *             instanceit.iterator = -1
 */
    __pyx_v_instanceit->end = NULL;

    /* "amplpy/iterators.pxi":151
 *             free(instanceit.begin)
 *             PY_AMPL_CALL(errorinfo)
 *         if instanceit._size == 0:             # <<<<<<<<<<<<<<
 *             instanceit.iterator = 0
 *             instanceit.end = NULL
 */
    goto __pyx_L7;
  }

  /* "amplpy/iterators.pxi":155
 *             instanceit.end = NULL
 *         else:
 *             instanceit.iterator = -1             # <<<<<<<<<<<<<<
 *             instanceit.end = instanceit.begin + instanceit._size
 *         return instanceit
 */
  /*else*/ {
    __pyx_v_instanceit->iterator = -1L;

    /* "amplpy/iterators.pxi":156
 *         else:
 *             instanceit.iterator = -1
 *             instanceit.end = instanceit.begin + instanceit._size             # <<<<<<<<<<<<<<
 *         return instanceit
 * 
 */
    __pyx_v_instanceit->end = (__pyx_v_instanceit->begin + __pyx_v_instanceit->_size);
  }
  __pyx_L7:;

  /* "amplpy/iterators.pxi":157
 *             instanceit.iterator = -1
 *             instanceit.end = instanceit.begin + instanceit._size
 *         return instanceit             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_instanceit);
  __pyx_r = ((PyObject *)__pyx_v_instanceit);
  goto __pyx_L0;

  /* "amplpy/iterators.pxi":128
 * 
 *     @staticmethod
 *     cdef create(campl.AMPL* ampl, char* name, campl.AMPL_ENTITYTYPE entity_class, parent):             # <<<<<<<<<<<<<<
 *         cdef campl.AMPL_ERRORINFO* errorinfo
 *         cdef campl.AMPL_RETCODE rc
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("_amplpy.InstanceIterator.create", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_instanceit);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/iterators.pxi":159
 *         return instanceit
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         if self.iterator+1 < self._size:
 *             for i in range(self.iterator+1, self._size):
 */

/* Python wrapper */
static void __pyx_pw_7_amplpy_16InstanceIterator_1__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_7_amplpy_16InstanceIterator_1__dealloc__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_pf_7_amplpy_16InstanceIterator___dealloc__(((struct __pyx_obj_7_amplpy_InstanceIterator *)__pyx_v_self));

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

static void __pyx_pf_7_amplpy_16InstanceIterator___dealloc__(struct __pyx_obj_7_amplpy_InstanceIterator *__pyx_v_self) {
  size_t __pyx_v_i;
  int __pyx_t_1;
  size_t __pyx_t_2;
  size_t __pyx_t_3;
  size_t __pyx_t_4;

  /* "amplpy/iterators.pxi":160
 * 
 *     def __dealloc__(self):
 *         if self.iterator+1 < self._size:             # <<<<<<<<<<<<<<
 *             for i in range(self.iterator+1, self._size):
 *                 campl.AMPL_TupleFree(&self.begin[i])
 */
  __pyx_t_1 = ((__pyx_v_self->iterator + 1) < __pyx_v_self->_size);
  if (__pyx_t_1) {

    /* "amplpy/iterators.pxi":161
 *     def __dealloc__(self):
 *         if self.iterator+1 < self._size:
 *             for i in range(self.iterator+1, self._size):             # <<<<<<<<<<<<<<
 *                 campl.AMPL_TupleFree(&self.begin[i])
 *         if self.begin != NULL:
 */
    __pyx_t_2 = __pyx_v_self->_size;
    __pyx_t_3 = __pyx_t_2;
    for (__pyx_t_4 = (__pyx_v_self->iterator + 1); __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
      __pyx_v_i = __pyx_t_4;

      /* "amplpy/iterators.pxi":162
 *         if self.iterator+1 < self._size:
 *             for i in range(self.iterator+1, self._size):
 *                 campl.AMPL_TupleFree(&self.begin[i])             # <<<<<<<<<<<<<<
 *         if self.begin != NULL:
 *             free(self.begin)
 */
      (void)(AMPL_TupleFree((&(__pyx_v_self->begin[__pyx_v_i]))));
    }

    /* "amplpy/iterators.pxi":160
 * 
 *     def __dealloc__(self):
 *         if self.iterator+1 < self._size:             # <<<<<<<<<<<<<<
 *             for i in range(self.iterator+1, self._size):
 *                 campl.AMPL_TupleFree(&self.begin[i])
 */
  }

  /* "amplpy/iterators.pxi":163
 *             for i in range(self.iterator+1, self._size):
 *                 campl.AMPL_TupleFree(&self.begin[i])
 *         if self.begin != NULL:             # <<<<<<<<<<<<<<
 *             free(self.begin)
 *             self.begin = NULL
 */
  __pyx_t_1 = (__pyx_v_self->begin != NULL);
  if (__pyx_t_1) {

    /* "amplpy/iterators.pxi":164
 *                 campl.AMPL_TupleFree(&self.begin[i])
 *         if self.begin != NULL:
 *             free(self.begin)             # <<<<<<<<<<<<<<
 *             self.begin = NULL
 * 
 */
    free(__pyx_v_self->begin);

    /* "amplpy/iterators.pxi":165
 *         if self.begin != NULL:
 *             free(self.begin)
 *             self.begin = NULL             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
 */
    __pyx_v_self->begin = NULL;

    /* "amplpy/iterators.pxi":163
 *             for i in range(self.iterator+1, self._size):
 *                 campl.AMPL_TupleFree(&self.begin[i])
 *         if self.begin != NULL:             # <<<<<<<<<<<<<<
 *             free(self.begin)
 *             self.begin = NULL
 */
  }

  /* "amplpy/iterators.pxi":159
 *         return instanceit
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         if self.iterator+1 < self._size:
 *             for i in range(self.iterator+1, self._size):
 */

  /* function exit code */
}

/* "amplpy/iterators.pxi":167
 *             self.begin = NULL
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_16InstanceIterator_3__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7_amplpy_16InstanceIterator_3__iter__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7_amplpy_16InstanceIterator_2__iter__(((struct __pyx_obj_7_amplpy_InstanceIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_16InstanceIterator_2__iter__(struct __pyx_obj_7_amplpy_InstanceIterator *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 1);

  /* "amplpy/iterators.pxi":168
 * 
 *     def __iter__(self):
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     def __next__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "amplpy/iterators.pxi":167
 *             self.begin = NULL
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

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

/* "amplpy/iterators.pxi":170
 *         return self
 * 
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         if self.iterator >= self._size:
 *             raise StopIteration
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_16InstanceIterator_5__next__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7_amplpy_16InstanceIterator_5__next__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__next__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7_amplpy_16InstanceIterator_4__next__(((struct __pyx_obj_7_amplpy_InstanceIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_16InstanceIterator_4__next__(struct __pyx_obj_7_amplpy_InstanceIterator *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_error_without_exception = 0; /* StopIteration */
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__next__", 1);

  /* "amplpy/iterators.pxi":171
 * 
 *     def __next__(self):
 *         if self.iterator >= self._size:             # <<<<<<<<<<<<<<
 *             raise StopIteration
 *         self.iterator += 1
 */
  __pyx_t_1 = (__pyx_v_self->iterator >= __pyx_v_self->_size);
  if (unlikely(__pyx_t_1)) {

    /* "amplpy/iterators.pxi":172
 *     def __next__(self):
 *         if self.iterator >= self._size:
 *             raise StopIteration             # <<<<<<<<<<<<<<
 *         self.iterator += 1
 *         if self.begin == NULL:
 */
    __pyx_error_without_exception = 1;
    goto __pyx_L1_error;;

    /* "amplpy/iterators.pxi":171
 * 
 *     def __next__(self):
 *         if self.iterator >= self._size:             # <<<<<<<<<<<<<<
 *             raise StopIteration
 *         self.iterator += 1
 */
  }

  /* "amplpy/iterators.pxi":173
 *         if self.iterator >= self._size:
 *             raise StopIteration
 *         self.iterator += 1             # <<<<<<<<<<<<<<
 *         if self.begin == NULL:
 *             return (None, self._entity)
 */
  __pyx_v_self->iterator = (__pyx_v_self->iterator + 1);

  /* "amplpy/iterators.pxi":174
 *             raise StopIteration
 *         self.iterator += 1
 *         if self.begin == NULL:             # <<<<<<<<<<<<<<
 *             return (None, self._entity)
 *         else:
 */
  __pyx_t_1 = (__pyx_v_self->begin == NULL);
  if (__pyx_t_1) {

    /* "amplpy/iterators.pxi":175
 *         self.iterator += 1
 *         if self.begin == NULL:
 *             return (None, self._entity)             # <<<<<<<<<<<<<<
 *         else:
 *             return (to_py_tuple(self.begin[self.iterator]), create_entity(self.entity_class, self._c_ampl, self._name, self.begin[self.iterator], self._entity))
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 175, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, Py_None)) __PYX_ERR(6, 175, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_self->_entity);
    __Pyx_GIVEREF(__pyx_v_self->_entity);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_self->_entity)) __PYX_ERR(6, 175, __pyx_L1_error);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "amplpy/iterators.pxi":174
 *             raise StopIteration
 *         self.iterator += 1
 *         if self.begin == NULL:             # <<<<<<<<<<<<<<
 *             return (None, self._entity)
 *         else:
 */
  }

  /* "amplpy/iterators.pxi":177
 *             return (None, self._entity)
 *         else:
 *             return (to_py_tuple(self.begin[self.iterator]), create_entity(self.entity_class, self._c_ampl, self._name, self.begin[self.iterator], self._entity))             # <<<<<<<<<<<<<<
 * 
 *     def __getitem__(self, key):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __pyx_f_7_amplpy_to_py_tuple((__pyx_v_self->begin[__pyx_v_self->iterator])); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 177, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __pyx_v_self->_entity;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_4 = __pyx_f_7_amplpy_create_entity(__pyx_v_self->entity_class, __pyx_v_self->_c_ampl, __pyx_v_self->_name, (__pyx_v_self->begin[__pyx_v_self->iterator]), __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 177, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 177, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_2);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(6, 177, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_4);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4)) __PYX_ERR(6, 177, __pyx_L1_error);
    __pyx_t_2 = 0;
    __pyx_t_4 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
  }

  /* "amplpy/iterators.pxi":170
 *         return self
 * 
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         if self.iterator >= self._size:
 *             raise StopIteration
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  if (!__pyx_error_without_exception) {
    __Pyx_AddTraceback("_amplpy.InstanceIterator.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  }
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/iterators.pxi":179
 *             return (to_py_tuple(self.begin[self.iterator]), create_entity(self.entity_class, self._c_ampl, self._name, self.begin[self.iterator], self._entity))
 * 
 *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
 *         assert isinstance(key, str)
 *         key = tuple(key)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_16InstanceIterator_7__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_7_amplpy_16InstanceIterator_7__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7_amplpy_16InstanceIterator_6__getitem__(((struct __pyx_obj_7_amplpy_InstanceIterator *)__pyx_v_self), ((PyObject *)__pyx_v_key));

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

static PyObject *__pyx_pf_7_amplpy_16InstanceIterator_6__getitem__(struct __pyx_obj_7_amplpy_InstanceIterator *__pyx_v_self, PyObject *__pyx_v_key) {
  AMPL_TUPLE *__pyx_v_tuple_c;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  AMPL_TUPLE *__pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getitem__", 0);
  __Pyx_INCREF(__pyx_v_key);

  /* "amplpy/iterators.pxi":180
 * 
 *     def __getitem__(self, key):
 *         assert isinstance(key, str)             # <<<<<<<<<<<<<<
 *         key = tuple(key)
 *         cdef campl.AMPL_TUPLE* tuple_c = to_c_tuple(key)
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = PyUnicode_Check(__pyx_v_key); 
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(6, 180, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(6, 180, __pyx_L1_error)
  #endif

  /* "amplpy/iterators.pxi":181
 *     def __getitem__(self, key):
 *         assert isinstance(key, str)
 *         key = tuple(key)             # <<<<<<<<<<<<<<
 *         cdef campl.AMPL_TUPLE* tuple_c = to_c_tuple(key)
 *         return create_entity(self.entity_class, self._c_ampl, self._name, tuple_c, self._entity)
 */
  __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 181, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF_SET(__pyx_v_key, __pyx_t_2);
  __pyx_t_2 = 0;

  /* "amplpy/iterators.pxi":182
 *         assert isinstance(key, str)
 *         key = tuple(key)
 *         cdef campl.AMPL_TUPLE* tuple_c = to_c_tuple(key)             # <<<<<<<<<<<<<<
 *         return create_entity(self.entity_class, self._c_ampl, self._name, tuple_c, self._entity)
 * 
 */
  __pyx_t_3 = __pyx_f_7_amplpy_to_c_tuple(__pyx_v_key); if (unlikely(__pyx_t_3 == ((AMPL_TUPLE *)NULL) && PyErr_Occurred())) __PYX_ERR(6, 182, __pyx_L1_error)
  __pyx_v_tuple_c = __pyx_t_3;

  /* "amplpy/iterators.pxi":183
 *         key = tuple(key)
 *         cdef campl.AMPL_TUPLE* tuple_c = to_c_tuple(key)
 *         return create_entity(self.entity_class, self._c_ampl, self._name, tuple_c, self._entity)             # <<<<<<<<<<<<<<
 * 
 *     def size(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_v_self->_entity;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_4 = __pyx_f_7_amplpy_create_entity(__pyx_v_self->entity_class, __pyx_v_self->_c_ampl, __pyx_v_self->_name, __pyx_v_tuple_c, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 183, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "amplpy/iterators.pxi":179
 *             return (to_py_tuple(self.begin[self.iterator]), create_entity(self.entity_class, self._c_ampl, self._name, self.begin[self.iterator], self._entity))
 * 
 *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
 *         assert isinstance(key, str)
 *         key = tuple(key)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("_amplpy.InstanceIterator.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/iterators.pxi":185
 *         return create_entity(self.entity_class, self._c_ampl, self._name, tuple_c, self._entity)
 * 
 *     def size(self):             # <<<<<<<<<<<<<<
 *         return int(self._size)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_16InstanceIterator_9size(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_16InstanceIterator_8size, "InstanceIterator.size(self)");
static PyMethodDef __pyx_mdef_7_amplpy_16InstanceIterator_9size = {"size", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_16InstanceIterator_9size, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_16InstanceIterator_8size};
static PyObject *__pyx_pw_7_amplpy_16InstanceIterator_9size(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("size (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("size", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "size", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_16InstanceIterator_8size(((struct __pyx_obj_7_amplpy_InstanceIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_16InstanceIterator_8size(struct __pyx_obj_7_amplpy_InstanceIterator *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("size", 1);

  /* "amplpy/iterators.pxi":186
 * 
 *     def size(self):
 *         return int(self._size)             # <<<<<<<<<<<<<<
 * 
 *     def __len__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_self->_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 186, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyInt_Type)), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 186, __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;

  /* "amplpy/iterators.pxi":185
 *         return create_entity(self.entity_class, self._c_ampl, self._name, tuple_c, self._entity)
 * 
 *     def size(self):             # <<<<<<<<<<<<<<
 *         return int(self._size)
 * 
 */

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

/* "amplpy/iterators.pxi":188
 *         return int(self._size)
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         return self.size()
 * 
 */

/* Python wrapper */
static Py_ssize_t __pyx_pw_7_amplpy_16InstanceIterator_11__len__(PyObject *__pyx_v_self); /*proto*/
static Py_ssize_t __pyx_pw_7_amplpy_16InstanceIterator_11__len__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7_amplpy_16InstanceIterator_10__len__(((struct __pyx_obj_7_amplpy_InstanceIterator *)__pyx_v_self));

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

static Py_ssize_t __pyx_pf_7_amplpy_16InstanceIterator_10__len__(struct __pyx_obj_7_amplpy_InstanceIterator *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__len__", 1);

  /* "amplpy/iterators.pxi":189
 * 
 *     def __len__(self):
 *         return self.size()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 189, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 189, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(6, 189, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_5;
  goto __pyx_L0;

  /* "amplpy/iterators.pxi":188
 *         return int(self._size)
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         return self.size()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("_amplpy.InstanceIterator.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._c_ampl,self.begin,self.end cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_16InstanceIterator_13__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_16InstanceIterator_12__reduce_cython__, "InstanceIterator.__reduce_cython__(self)");
static PyMethodDef __pyx_mdef_7_amplpy_16InstanceIterator_13__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_16InstanceIterator_13__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_16InstanceIterator_12__reduce_cython__};
static PyObject *__pyx_pw_7_amplpy_16InstanceIterator_13__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_16InstanceIterator_12__reduce_cython__(((struct __pyx_obj_7_amplpy_InstanceIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_16InstanceIterator_12__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7_amplpy_InstanceIterator *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 1);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "self._c_ampl,self.begin,self.end cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self._c_ampl,self.begin,self.end cannot be converted to a Python object for pickling"
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_self__c_ampl_self_begin_self_end, 0, 0);
  __PYX_ERR(8, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._c_ampl,self.begin,self.end cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 */

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

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._c_ampl,self.begin,self.end cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._c_ampl,self.begin,self.end cannot be converted to a Python object for pickling"
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_16InstanceIterator_15__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_16InstanceIterator_14__setstate_cython__, "InstanceIterator.__setstate_cython__(self, __pyx_state)");
static PyMethodDef __pyx_mdef_7_amplpy_16InstanceIterator_15__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_16InstanceIterator_15__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_16InstanceIterator_14__setstate_cython__};
static PyObject *__pyx_pw_7_amplpy_16InstanceIterator_15__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 3, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(8, 3, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(8, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.InstanceIterator.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_16InstanceIterator_14__setstate_cython__(((struct __pyx_obj_7_amplpy_InstanceIterator *)__pyx_v_self), __pyx_v___pyx_state);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_16InstanceIterator_14__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7_amplpy_InstanceIterator *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 1);

  /* "(tree fragment)":4
 *     raise TypeError, "self._c_ampl,self.begin,self.end cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self._c_ampl,self.begin,self.end cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_self__c_ampl_self_begin_self_end, 0, 0);
  __PYX_ERR(8, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._c_ampl,self.begin,self.end cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._c_ampl,self.begin,self.end cannot be converted to a Python object for pickling"
 */

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

/* "amplpy/iterators.pxi":204
 * 
 *     @staticmethod
 *     cdef create(campl.AMPL* ampl, char* name, campl.AMPL_TUPLE* index, parent):             # <<<<<<<<<<<<<<
 *         cdef campl.AMPL_ERRORINFO* errorinfo
 *         cdef campl.AMPL_RETCODE rc
 */

static PyObject *__pyx_f_7_amplpy_19MemberRangeIterator_create(AMPL *__pyx_v_ampl, char *__pyx_v_name, AMPL_TUPLE *__pyx_v_index, PyObject *__pyx_v_parent) {
  AMPL_ERRORINFO *__pyx_v_errorinfo;
  AMPL_RETCODE __pyx_v_rc;
  struct __pyx_obj_7_amplpy_MemberRangeIterator *__pyx_v_instanceit = NULL;
  size_t __pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  size_t __pyx_t_3;
  size_t __pyx_t_4;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("create", 1);

  /* "amplpy/iterators.pxi":207
 *         cdef campl.AMPL_ERRORINFO* errorinfo
 *         cdef campl.AMPL_RETCODE rc
 *         instanceit = MemberRangeIterator()             # <<<<<<<<<<<<<<
 *         instanceit._c_ampl = ampl
 *         instanceit._name = name
 */
  __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_7_amplpy_MemberRangeIterator)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_instanceit = ((struct __pyx_obj_7_amplpy_MemberRangeIterator *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "amplpy/iterators.pxi":208
 *         cdef campl.AMPL_RETCODE rc
 *         instanceit = MemberRangeIterator()
 *         instanceit._c_ampl = ampl             # <<<<<<<<<<<<<<
 *         instanceit._name = name
 *         instanceit._index = index
 */
  __pyx_v_instanceit->_c_ampl = __pyx_v_ampl;

  /* "amplpy/iterators.pxi":209
 *         instanceit = MemberRangeIterator()
 *         instanceit._c_ampl = ampl
 *         instanceit._name = name             # <<<<<<<<<<<<<<
 *         instanceit._index = index
 *         instanceit._entity = parent
 */
  __pyx_v_instanceit->_name = __pyx_v_name;

  /* "amplpy/iterators.pxi":210
 *         instanceit._c_ampl = ampl
 *         instanceit._name = name
 *         instanceit._index = index             # <<<<<<<<<<<<<<
 *         instanceit._entity = parent
 *         if instanceit._entity is not None:
 */
  __pyx_v_instanceit->_index = __pyx_v_index;

  /* "amplpy/iterators.pxi":211
 *         instanceit._name = name
 *         instanceit._index = index
 *         instanceit._entity = parent             # <<<<<<<<<<<<<<
 *         if instanceit._entity is not None:
 *             Py_INCREF(instanceit._entity)
 */
  __Pyx_INCREF(__pyx_v_parent);
  __Pyx_GIVEREF(__pyx_v_parent);
  __Pyx_GOTREF(__pyx_v_instanceit->_entity);
  __Pyx_DECREF(__pyx_v_instanceit->_entity);
  __pyx_v_instanceit->_entity = __pyx_v_parent;

  /* "amplpy/iterators.pxi":212
 *         instanceit._index = index
 *         instanceit._entity = parent
 *         if instanceit._entity is not None:             # <<<<<<<<<<<<<<
 *             Py_INCREF(instanceit._entity)
 *         errorinfo = campl.AMPL_SetInstanceGetValues(instanceit._c_ampl, instanceit._name, instanceit._index, &instanceit.begin, &instanceit._size)
 */
  __pyx_t_2 = (__pyx_v_instanceit->_entity != Py_None);
  if (__pyx_t_2) {

    /* "amplpy/iterators.pxi":213
 *         instanceit._entity = parent
 *         if instanceit._entity is not None:
 *             Py_INCREF(instanceit._entity)             # <<<<<<<<<<<<<<
 *         errorinfo = campl.AMPL_SetInstanceGetValues(instanceit._c_ampl, instanceit._name, instanceit._index, &instanceit.begin, &instanceit._size)
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 */
    __pyx_t_1 = __pyx_v_instanceit->_entity;
    __Pyx_INCREF(__pyx_t_1);
    Py_INCREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "amplpy/iterators.pxi":212
 *         instanceit._index = index
 *         instanceit._entity = parent
 *         if instanceit._entity is not None:             # <<<<<<<<<<<<<<
 *             Py_INCREF(instanceit._entity)
 *         errorinfo = campl.AMPL_SetInstanceGetValues(instanceit._c_ampl, instanceit._name, instanceit._index, &instanceit.begin, &instanceit._size)
 */
  }

  /* "amplpy/iterators.pxi":214
 *         if instanceit._entity is not None:
 *             Py_INCREF(instanceit._entity)
 *         errorinfo = campl.AMPL_SetInstanceGetValues(instanceit._c_ampl, instanceit._name, instanceit._index, &instanceit.begin, &instanceit._size)             # <<<<<<<<<<<<<<
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:
 */
  __pyx_v_errorinfo = AMPL_SetInstanceGetValues(__pyx_v_instanceit->_c_ampl, __pyx_v_instanceit->_name, __pyx_v_instanceit->_index, (&__pyx_v_instanceit->begin), (&__pyx_v_instanceit->_size));

  /* "amplpy/iterators.pxi":215
 *             Py_INCREF(instanceit._entity)
 *         errorinfo = campl.AMPL_SetInstanceGetValues(instanceit._c_ampl, instanceit._name, instanceit._index, &instanceit.begin, &instanceit._size)
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)             # <<<<<<<<<<<<<<
 *         if rc != campl.AMPL_OK:
 *             for i in range(instanceit._size):
 */
  __pyx_v_rc = AMPL_ErrorInfoGetError(__pyx_v_errorinfo);

  /* "amplpy/iterators.pxi":216
 *         errorinfo = campl.AMPL_SetInstanceGetValues(instanceit._c_ampl, instanceit._name, instanceit._index, &instanceit.begin, &instanceit._size)
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:             # <<<<<<<<<<<<<<
 *             for i in range(instanceit._size):
 *                 campl.AMPL_TupleFree(&instanceit.begin[i])
 */
  __pyx_t_2 = (__pyx_v_rc != AMPL_OK);
  if (__pyx_t_2) {

    /* "amplpy/iterators.pxi":217
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:
 *             for i in range(instanceit._size):             # <<<<<<<<<<<<<<
 *                 campl.AMPL_TupleFree(&instanceit.begin[i])
 *             free(instanceit.begin)
 */
    __pyx_t_3 = __pyx_v_instanceit->_size;
    __pyx_t_4 = __pyx_t_3;
    for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
      __pyx_v_i = __pyx_t_5;

      /* "amplpy/iterators.pxi":218
 *         if rc != campl.AMPL_OK:
 *             for i in range(instanceit._size):
 *                 campl.AMPL_TupleFree(&instanceit.begin[i])             # <<<<<<<<<<<<<<
 *             free(instanceit.begin)
 *             PY_AMPL_CALL(errorinfo)
 */
      (void)(AMPL_TupleFree((&(__pyx_v_instanceit->begin[__pyx_v_i]))));
    }

    /* "amplpy/iterators.pxi":219
 *             for i in range(instanceit._size):
 *                 campl.AMPL_TupleFree(&instanceit.begin[i])
 *             free(instanceit.begin)             # <<<<<<<<<<<<<<
 *             PY_AMPL_CALL(errorinfo)
 *         instanceit.iterator = 0
 */
    free(__pyx_v_instanceit->begin);

    /* "amplpy/iterators.pxi":220
 *                 campl.AMPL_TupleFree(&instanceit.begin[i])
 *             free(instanceit.begin)
 *             PY_AMPL_CALL(errorinfo)             # <<<<<<<<<<<<<<
 *         instanceit.iterator = 0
 *         if instanceit._size == 0:
 */
    __pyx_t_1 = __pyx_f_7_amplpy_PY_AMPL_CALL(__pyx_v_errorinfo); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 220, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "amplpy/iterators.pxi":216
 *         errorinfo = campl.AMPL_SetInstanceGetValues(instanceit._c_ampl, instanceit._name, instanceit._index, &instanceit.begin, &instanceit._size)
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:             # <<<<<<<<<<<<<<
 *             for i in range(instanceit._size):
 *                 campl.AMPL_TupleFree(&instanceit.begin[i])
 */
  }

  /* "amplpy/iterators.pxi":221
 *             free(instanceit.begin)
 *             PY_AMPL_CALL(errorinfo)
 *         instanceit.iterator = 0             # <<<<<<<<<<<<<<
 *         if instanceit._size == 0:
 *             instanceit.end = NULL
 */
  __pyx_v_instanceit->iterator = 0;

  /* "amplpy/iterators.pxi":222
 *             PY_AMPL_CALL(errorinfo)
 *         instanceit.iterator = 0
 *         if instanceit._size == 0:             # <<<<<<<<<<<<<<
 *             instanceit.end = NULL
 *         else:
 */
  __pyx_t_2 = (__pyx_v_instanceit->_size == 0);
  if (__pyx_t_2) {

    /* "amplpy/iterators.pxi":223
 *         instanceit.iterator = 0
 *         if instanceit._size == 0:
 *             instanceit.end = NULL             # <<<<<<<<<<<<<<
 *         else:
 *             instanceit.end = instanceit.begin + instanceit._size
 */
    __pyx_v_instanceit->end = NULL;

    /* "amplpy/iterators.pxi":222
 *             PY_AMPL_CALL(errorinfo)
 *         instanceit.iterator = 0
 *         if instanceit._size == 0:             # <<<<<<<<<<<<<<
 *             instanceit.end = NULL
 *         else:
 */
    goto __pyx_L7;
  }

  /* "amplpy/iterators.pxi":225
 *             instanceit.end = NULL
 *         else:
 *             instanceit.end = instanceit.begin + instanceit._size             # <<<<<<<<<<<<<<
 *         return instanceit
 * 
 */
  /*else*/ {
    __pyx_v_instanceit->end = (__pyx_v_instanceit->begin + __pyx_v_instanceit->_size);
  }
  __pyx_L7:;

  /* "amplpy/iterators.pxi":226
 *         else:
 *             instanceit.end = instanceit.begin + instanceit._size
 *         return instanceit             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_instanceit);
  __pyx_r = ((PyObject *)__pyx_v_instanceit);
  goto __pyx_L0;

  /* "amplpy/iterators.pxi":204
 * 
 *     @staticmethod
 *     cdef create(campl.AMPL* ampl, char* name, campl.AMPL_TUPLE* index, parent):             # <<<<<<<<<<<<<<
 *         cdef campl.AMPL_ERRORINFO* errorinfo
 *         cdef campl.AMPL_RETCODE rc
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("_amplpy.MemberRangeIterator.create", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_instanceit);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/iterators.pxi":228
 *         return instanceit
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         if self._entity is not None:
 *             Py_DECREF(self._entity)
 */

/* Python wrapper */
static void __pyx_pw_7_amplpy_19MemberRangeIterator_1__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_7_amplpy_19MemberRangeIterator_1__dealloc__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_pf_7_amplpy_19MemberRangeIterator___dealloc__(((struct __pyx_obj_7_amplpy_MemberRangeIterator *)__pyx_v_self));

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

static void __pyx_pf_7_amplpy_19MemberRangeIterator___dealloc__(struct __pyx_obj_7_amplpy_MemberRangeIterator *__pyx_v_self) {
  size_t __pyx_v_i;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  size_t __pyx_t_4;
  size_t __pyx_t_5;
  __Pyx_RefNannySetupContext("__dealloc__", 1);

  /* "amplpy/iterators.pxi":229
 * 
 *     def __dealloc__(self):
 *         if self._entity is not None:             # <<<<<<<<<<<<<<
 *             Py_DECREF(self._entity)
 *         for i in range(self._size):
 */
  __pyx_t_1 = (__pyx_v_self->_entity != Py_None);
  if (__pyx_t_1) {

    /* "amplpy/iterators.pxi":230
 *     def __dealloc__(self):
 *         if self._entity is not None:
 *             Py_DECREF(self._entity)             # <<<<<<<<<<<<<<
 *         for i in range(self._size):
 *             campl.AMPL_TupleFree(&self.begin[i])
 */
    __pyx_t_2 = __pyx_v_self->_entity;
    __Pyx_INCREF(__pyx_t_2);
    Py_DECREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "amplpy/iterators.pxi":229
 * 
 *     def __dealloc__(self):
 *         if self._entity is not None:             # <<<<<<<<<<<<<<
 *             Py_DECREF(self._entity)
 *         for i in range(self._size):
 */
  }

  /* "amplpy/iterators.pxi":231
 *         if self._entity is not None:
 *             Py_DECREF(self._entity)
 *         for i in range(self._size):             # <<<<<<<<<<<<<<
 *             campl.AMPL_TupleFree(&self.begin[i])
 *         if self.begin != NULL:
 */
  __pyx_t_3 = __pyx_v_self->_size;
  __pyx_t_4 = __pyx_t_3;
  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
    __pyx_v_i = __pyx_t_5;

    /* "amplpy/iterators.pxi":232
 *             Py_DECREF(self._entity)
 *         for i in range(self._size):
 *             campl.AMPL_TupleFree(&self.begin[i])             # <<<<<<<<<<<<<<
 *         if self.begin != NULL:
 *             free(self.begin)
 */
    (void)(AMPL_TupleFree((&(__pyx_v_self->begin[__pyx_v_i]))));
  }

  /* "amplpy/iterators.pxi":233
 *         for i in range(self._size):
 *             campl.AMPL_TupleFree(&self.begin[i])
 *         if self.begin != NULL:             # <<<<<<<<<<<<<<
 *             free(self.begin)
 *             self.begin = NULL
 */
  __pyx_t_1 = (__pyx_v_self->begin != NULL);
  if (__pyx_t_1) {

    /* "amplpy/iterators.pxi":234
 *             campl.AMPL_TupleFree(&self.begin[i])
 *         if self.begin != NULL:
 *             free(self.begin)             # <<<<<<<<<<<<<<
 *             self.begin = NULL
 * 
 */
    free(__pyx_v_self->begin);

    /* "amplpy/iterators.pxi":235
 *         if self.begin != NULL:
 *             free(self.begin)
 *             self.begin = NULL             # <<<<<<<<<<<<<<
 * 
 *     def size(self):
 */
    __pyx_v_self->begin = NULL;

    /* "amplpy/iterators.pxi":233
 *         for i in range(self._size):
 *             campl.AMPL_TupleFree(&self.begin[i])
 *         if self.begin != NULL:             # <<<<<<<<<<<<<<
 *             free(self.begin)
 *             self.begin = NULL
 */
  }

  /* "amplpy/iterators.pxi":228
 *         return instanceit
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         if self._entity is not None:
 *             Py_DECREF(self._entity)
 */

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

/* "amplpy/iterators.pxi":237
 *             self.begin = NULL
 * 
 *     def size(self):             # <<<<<<<<<<<<<<
 *         return int(self._size)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_19MemberRangeIterator_3size(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_19MemberRangeIterator_2size, "MemberRangeIterator.size(self)");
static PyMethodDef __pyx_mdef_7_amplpy_19MemberRangeIterator_3size = {"size", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_19MemberRangeIterator_3size, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_19MemberRangeIterator_2size};
static PyObject *__pyx_pw_7_amplpy_19MemberRangeIterator_3size(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("size (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("size", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "size", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_19MemberRangeIterator_2size(((struct __pyx_obj_7_amplpy_MemberRangeIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_19MemberRangeIterator_2size(struct __pyx_obj_7_amplpy_MemberRangeIterator *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("size", 1);

  /* "amplpy/iterators.pxi":238
 * 
 *     def size(self):
 *         return int(self._size)             # <<<<<<<<<<<<<<
 * 
 *     def __len__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_self->_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 238, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyInt_Type)), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 238, __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;

  /* "amplpy/iterators.pxi":237
 *             self.begin = NULL
 * 
 *     def size(self):             # <<<<<<<<<<<<<<
 *         return int(self._size)
 * 
 */

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

/* "amplpy/iterators.pxi":240
 *         return int(self._size)
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         return self.size()
 * 
 */

/* Python wrapper */
static Py_ssize_t __pyx_pw_7_amplpy_19MemberRangeIterator_5__len__(PyObject *__pyx_v_self); /*proto*/
static Py_ssize_t __pyx_pw_7_amplpy_19MemberRangeIterator_5__len__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7_amplpy_19MemberRangeIterator_4__len__(((struct __pyx_obj_7_amplpy_MemberRangeIterator *)__pyx_v_self));

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

static Py_ssize_t __pyx_pf_7_amplpy_19MemberRangeIterator_4__len__(struct __pyx_obj_7_amplpy_MemberRangeIterator *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__len__", 1);

  /* "amplpy/iterators.pxi":241
 * 
 *     def __len__(self):
 *         return self.size()             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 241, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 241, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(6, 241, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_5;
  goto __pyx_L0;

  /* "amplpy/iterators.pxi":240
 *         return int(self._size)
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         return self.size()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("_amplpy.MemberRangeIterator.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/iterators.pxi":243
 *         return self.size()
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_19MemberRangeIterator_7__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7_amplpy_19MemberRangeIterator_7__iter__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7_amplpy_19MemberRangeIterator_6__iter__(((struct __pyx_obj_7_amplpy_MemberRangeIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_19MemberRangeIterator_6__iter__(struct __pyx_obj_7_amplpy_MemberRangeIterator *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 1);

  /* "amplpy/iterators.pxi":244
 * 
 *     def __iter__(self):
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     def __next__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "amplpy/iterators.pxi":243
 *         return self.size()
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

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

/* "amplpy/iterators.pxi":246
 *         return self
 * 
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         if self.iterator >= self._size:
 *             raise StopIteration
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_19MemberRangeIterator_9__next__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7_amplpy_19MemberRangeIterator_9__next__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__next__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7_amplpy_19MemberRangeIterator_8__next__(((struct __pyx_obj_7_amplpy_MemberRangeIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_19MemberRangeIterator_8__next__(struct __pyx_obj_7_amplpy_MemberRangeIterator *__pyx_v_self) {
  AMPL_TUPLE *__pyx_v_it;
  size_t __pyx_v_size;
  AMPL_VARIANT *__pyx_v_variant;
  PyObject *__pyx_v_py_variant = NULL;
  PyObject *__pyx_v_py_tuple = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_error_without_exception = 0; /* StopIteration */
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__next__", 1);

  /* "amplpy/iterators.pxi":247
 * 
 *     def __next__(self):
 *         if self.iterator >= self._size:             # <<<<<<<<<<<<<<
 *             raise StopIteration
 *         cdef campl.AMPL_TUPLE* it = self.begin[self.iterator]
 */
  __pyx_t_1 = (__pyx_v_self->iterator >= __pyx_v_self->_size);
  if (unlikely(__pyx_t_1)) {

    /* "amplpy/iterators.pxi":248
 *     def __next__(self):
 *         if self.iterator >= self._size:
 *             raise StopIteration             # <<<<<<<<<<<<<<
 *         cdef campl.AMPL_TUPLE* it = self.begin[self.iterator]
 *         cdef size_t size
 */
    __pyx_error_without_exception = 1;
    goto __pyx_L1_error;;

    /* "amplpy/iterators.pxi":247
 * 
 *     def __next__(self):
 *         if self.iterator >= self._size:             # <<<<<<<<<<<<<<
 *             raise StopIteration
 *         cdef campl.AMPL_TUPLE* it = self.begin[self.iterator]
 */
  }

  /* "amplpy/iterators.pxi":249
 *         if self.iterator >= self._size:
 *             raise StopIteration
 *         cdef campl.AMPL_TUPLE* it = self.begin[self.iterator]             # <<<<<<<<<<<<<<
 *         cdef size_t size
 *         cdef campl.AMPL_VARIANT* variant
 */
  __pyx_v_it = (__pyx_v_self->begin[__pyx_v_self->iterator]);

  /* "amplpy/iterators.pxi":252
 *         cdef size_t size
 *         cdef campl.AMPL_VARIANT* variant
 *         campl.AMPL_TupleGetSize(it, &size)             # <<<<<<<<<<<<<<
 *         if size == 1:
 *             campl.AMPL_TupleGetVariant(it, 0, &variant)
 */
  (void)(AMPL_TupleGetSize(__pyx_v_it, (&__pyx_v_size)));

  /* "amplpy/iterators.pxi":253
 *         cdef campl.AMPL_VARIANT* variant
 *         campl.AMPL_TupleGetSize(it, &size)
 *         if size == 1:             # <<<<<<<<<<<<<<
 *             campl.AMPL_TupleGetVariant(it, 0, &variant)
 *             py_variant = to_py_variant(variant)
 */
  __pyx_t_1 = (__pyx_v_size == 1);
  if (__pyx_t_1) {

    /* "amplpy/iterators.pxi":254
 *         campl.AMPL_TupleGetSize(it, &size)
 *         if size == 1:
 *             campl.AMPL_TupleGetVariant(it, 0, &variant)             # <<<<<<<<<<<<<<
 *             py_variant = to_py_variant(variant)
 *             self.iterator += 1
 */
    (void)(AMPL_TupleGetVariant(__pyx_v_it, 0, (&__pyx_v_variant)));

    /* "amplpy/iterators.pxi":255
 *         if size == 1:
 *             campl.AMPL_TupleGetVariant(it, 0, &variant)
 *             py_variant = to_py_variant(variant)             # <<<<<<<<<<<<<<
 *             self.iterator += 1
 *             return py_variant
 */
    __pyx_t_2 = __pyx_f_7_amplpy_to_py_variant(__pyx_v_variant); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 255, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_py_variant = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "amplpy/iterators.pxi":256
 *             campl.AMPL_TupleGetVariant(it, 0, &variant)
 *             py_variant = to_py_variant(variant)
 *             self.iterator += 1             # <<<<<<<<<<<<<<
 *             return py_variant
 *         else:
 */
    __pyx_v_self->iterator = (__pyx_v_self->iterator + 1);

    /* "amplpy/iterators.pxi":257
 *             py_variant = to_py_variant(variant)
 *             self.iterator += 1
 *             return py_variant             # <<<<<<<<<<<<<<
 *         else:
 *             py_tuple = to_py_tuple(it)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_py_variant);
    __pyx_r = __pyx_v_py_variant;
    goto __pyx_L0;

    /* "amplpy/iterators.pxi":253
 *         cdef campl.AMPL_VARIANT* variant
 *         campl.AMPL_TupleGetSize(it, &size)
 *         if size == 1:             # <<<<<<<<<<<<<<
 *             campl.AMPL_TupleGetVariant(it, 0, &variant)
 *             py_variant = to_py_variant(variant)
 */
  }

  /* "amplpy/iterators.pxi":259
 *             return py_variant
 *         else:
 *             py_tuple = to_py_tuple(it)             # <<<<<<<<<<<<<<
 *             self.iterator += 1
 *             return py_tuple
 */
  /*else*/ {
    __pyx_t_2 = __pyx_f_7_amplpy_to_py_tuple(__pyx_v_it); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 259, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_py_tuple = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "amplpy/iterators.pxi":260
 *         else:
 *             py_tuple = to_py_tuple(it)
 *             self.iterator += 1             # <<<<<<<<<<<<<<
 *             return py_tuple
 * 
 */
    __pyx_v_self->iterator = (__pyx_v_self->iterator + 1);

    /* "amplpy/iterators.pxi":261
 *             py_tuple = to_py_tuple(it)
 *             self.iterator += 1
 *             return py_tuple             # <<<<<<<<<<<<<<
 * 
 * cdef class ColIterator(object):
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_py_tuple);
    __pyx_r = __pyx_v_py_tuple;
    goto __pyx_L0;
  }

  /* "amplpy/iterators.pxi":246
 *         return self
 * 
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         if self.iterator >= self._size:
 *             raise StopIteration
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  if (!__pyx_error_without_exception) {
    __Pyx_AddTraceback("_amplpy.MemberRangeIterator.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  }
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_py_variant);
  __Pyx_XDECREF(__pyx_v_py_tuple);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._c_ampl,self._index,self.begin,self.end cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_19MemberRangeIterator_11__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_19MemberRangeIterator_10__reduce_cython__, "MemberRangeIterator.__reduce_cython__(self)");
static PyMethodDef __pyx_mdef_7_amplpy_19MemberRangeIterator_11__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_19MemberRangeIterator_11__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_19MemberRangeIterator_10__reduce_cython__};
static PyObject *__pyx_pw_7_amplpy_19MemberRangeIterator_11__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_19MemberRangeIterator_10__reduce_cython__(((struct __pyx_obj_7_amplpy_MemberRangeIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_19MemberRangeIterator_10__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7_amplpy_MemberRangeIterator *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 1);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "self._c_ampl,self._index,self.begin,self.end cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self._c_ampl,self._index,self.begin,self.end cannot be converted to a Python object for pickling"
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_self__c_ampl_self__index_self_be, 0, 0);
  __PYX_ERR(8, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._c_ampl,self._index,self.begin,self.end cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 */

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

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._c_ampl,self._index,self.begin,self.end cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._c_ampl,self._index,self.begin,self.end cannot be converted to a Python object for pickling"
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_19MemberRangeIterator_13__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_19MemberRangeIterator_12__setstate_cython__, "MemberRangeIterator.__setstate_cython__(self, __pyx_state)");
static PyMethodDef __pyx_mdef_7_amplpy_19MemberRangeIterator_13__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_19MemberRangeIterator_13__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_19MemberRangeIterator_12__setstate_cython__};
static PyObject *__pyx_pw_7_amplpy_19MemberRangeIterator_13__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 3, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(8, 3, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(8, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.MemberRangeIterator.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_19MemberRangeIterator_12__setstate_cython__(((struct __pyx_obj_7_amplpy_MemberRangeIterator *)__pyx_v_self), __pyx_v___pyx_state);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_19MemberRangeIterator_12__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7_amplpy_MemberRangeIterator *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 1);

  /* "(tree fragment)":4
 *     raise TypeError, "self._c_ampl,self._index,self.begin,self.end cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self._c_ampl,self._index,self.begin,self.end cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_self__c_ampl_self__index_self_be, 0, 0);
  __PYX_ERR(8, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._c_ampl,self._index,self.begin,self.end cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._c_ampl,self._index,self.begin,self.end cannot be converted to a Python object for pickling"
 */

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

/* "amplpy/iterators.pxi":270
 * 
 *     @staticmethod
 *     cdef create(campl.AMPL_DATAFRAME* df, size_t index):             # <<<<<<<<<<<<<<
 *         colit = ColIterator()
 *         colit._df = df
 */

static PyObject *__pyx_f_7_amplpy_11ColIterator_create(AMPL_DATAFRAME *__pyx_v_df, size_t __pyx_v_index) {
  struct __pyx_obj_7_amplpy_ColIterator *__pyx_v_colit = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("create", 1);

  /* "amplpy/iterators.pxi":271
 *     @staticmethod
 *     cdef create(campl.AMPL_DATAFRAME* df, size_t index):
 *         colit = ColIterator()             # <<<<<<<<<<<<<<
 *         colit._df = df
 *         colit._index = index
 */
  __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_7_amplpy_ColIterator)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 271, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_colit = ((struct __pyx_obj_7_amplpy_ColIterator *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "amplpy/iterators.pxi":272
 *     cdef create(campl.AMPL_DATAFRAME* df, size_t index):
 *         colit = ColIterator()
 *         colit._df = df             # <<<<<<<<<<<<<<
 *         colit._index = index
 *         colit._rowit = 0
 */
  __pyx_v_colit->_df = __pyx_v_df;

  /* "amplpy/iterators.pxi":273
 *         colit = ColIterator()
 *         colit._df = df
 *         colit._index = index             # <<<<<<<<<<<<<<
 *         colit._rowit = 0
 *         PY_AMPL_CALL(campl.AMPL_DataFrameGetNumRows(colit._df, &colit._rowsize))
 */
  __pyx_v_colit->_index = __pyx_v_index;

  /* "amplpy/iterators.pxi":274
 *         colit._df = df
 *         colit._index = index
 *         colit._rowit = 0             # <<<<<<<<<<<<<<
 *         PY_AMPL_CALL(campl.AMPL_DataFrameGetNumRows(colit._df, &colit._rowsize))
 *         return colit
 */
  __pyx_v_colit->_rowit = 0;

  /* "amplpy/iterators.pxi":275
 *         colit._index = index
 *         colit._rowit = 0
 *         PY_AMPL_CALL(campl.AMPL_DataFrameGetNumRows(colit._df, &colit._rowsize))             # <<<<<<<<<<<<<<
 *         return colit
 * 
 */
  __pyx_t_1 = __pyx_f_7_amplpy_PY_AMPL_CALL(AMPL_DataFrameGetNumRows(__pyx_v_colit->_df, (&__pyx_v_colit->_rowsize))); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 275, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "amplpy/iterators.pxi":276
 *         colit._rowit = 0
 *         PY_AMPL_CALL(campl.AMPL_DataFrameGetNumRows(colit._df, &colit._rowsize))
 *         return colit             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_colit);
  __pyx_r = ((PyObject *)__pyx_v_colit);
  goto __pyx_L0;

  /* "amplpy/iterators.pxi":270
 * 
 *     @staticmethod
 *     cdef create(campl.AMPL_DATAFRAME* df, size_t index):             # <<<<<<<<<<<<<<
 *         colit = ColIterator()
 *         colit._df = df
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("_amplpy.ColIterator.create", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_colit);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/iterators.pxi":278
 *         return colit
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_11ColIterator_1__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7_amplpy_11ColIterator_1__iter__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7_amplpy_11ColIterator___iter__(((struct __pyx_obj_7_amplpy_ColIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_11ColIterator___iter__(struct __pyx_obj_7_amplpy_ColIterator *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 1);

  /* "amplpy/iterators.pxi":279
 * 
 *     def __iter__(self):
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     def __next__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "amplpy/iterators.pxi":278
 *         return colit
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

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

/* "amplpy/iterators.pxi":281
 *         return self
 * 
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         cdef campl.AMPL_VARIANT* v
 *         if self._rowit >= self._rowsize:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_11ColIterator_3__next__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7_amplpy_11ColIterator_3__next__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__next__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7_amplpy_11ColIterator_2__next__(((struct __pyx_obj_7_amplpy_ColIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_11ColIterator_2__next__(struct __pyx_obj_7_amplpy_ColIterator *__pyx_v_self) {
  AMPL_VARIANT *__pyx_v_v;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_error_without_exception = 0; /* StopIteration */
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__next__", 1);

  /* "amplpy/iterators.pxi":283
 *     def __next__(self):
 *         cdef campl.AMPL_VARIANT* v
 *         if self._rowit >= self._rowsize:             # <<<<<<<<<<<<<<
 *             raise StopIteration
 *         PY_AMPL_CALL(campl.AMPL_DataFrameElement(self._df, self._rowit, self._index, &v))
 */
  __pyx_t_1 = (__pyx_v_self->_rowit >= __pyx_v_self->_rowsize);
  if (unlikely(__pyx_t_1)) {

    /* "amplpy/iterators.pxi":284
 *         cdef campl.AMPL_VARIANT* v
 *         if self._rowit >= self._rowsize:
 *             raise StopIteration             # <<<<<<<<<<<<<<
 *         PY_AMPL_CALL(campl.AMPL_DataFrameElement(self._df, self._rowit, self._index, &v))
 *         self._rowit += 1
 */
    __pyx_error_without_exception = 1;
    goto __pyx_L1_error;;

    /* "amplpy/iterators.pxi":283
 *     def __next__(self):
 *         cdef campl.AMPL_VARIANT* v
 *         if self._rowit >= self._rowsize:             # <<<<<<<<<<<<<<
 *             raise StopIteration
 *         PY_AMPL_CALL(campl.AMPL_DataFrameElement(self._df, self._rowit, self._index, &v))
 */
  }

  /* "amplpy/iterators.pxi":285
 *         if self._rowit >= self._rowsize:
 *             raise StopIteration
 *         PY_AMPL_CALL(campl.AMPL_DataFrameElement(self._df, self._rowit, self._index, &v))             # <<<<<<<<<<<<<<
 *         self._rowit += 1
 *         return to_py_variant(v)
 */
  __pyx_t_2 = __pyx_f_7_amplpy_PY_AMPL_CALL(AMPL_DataFrameElement(__pyx_v_self->_df, __pyx_v_self->_rowit, __pyx_v_self->_index, (&__pyx_v_v))); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 285, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "amplpy/iterators.pxi":286
 *             raise StopIteration
 *         PY_AMPL_CALL(campl.AMPL_DataFrameElement(self._df, self._rowit, self._index, &v))
 *         self._rowit += 1             # <<<<<<<<<<<<<<
 *         return to_py_variant(v)
 * 
 */
  __pyx_v_self->_rowit = (__pyx_v_self->_rowit + 1);

  /* "amplpy/iterators.pxi":287
 *         PY_AMPL_CALL(campl.AMPL_DataFrameElement(self._df, self._rowit, self._index, &v))
 *         self._rowit += 1
 *         return to_py_variant(v)             # <<<<<<<<<<<<<<
 * 
 * cdef class RowIterator(object):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_7_amplpy_to_py_variant(__pyx_v_v); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 287, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "amplpy/iterators.pxi":281
 *         return self
 * 
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         cdef campl.AMPL_VARIANT* v
 *         if self._rowit >= self._rowsize:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  if (!__pyx_error_without_exception) {
    __Pyx_AddTraceback("_amplpy.ColIterator.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  }
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._df cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_11ColIterator_5__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_11ColIterator_4__reduce_cython__, "ColIterator.__reduce_cython__(self)");
static PyMethodDef __pyx_mdef_7_amplpy_11ColIterator_5__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_11ColIterator_5__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_11ColIterator_4__reduce_cython__};
static PyObject *__pyx_pw_7_amplpy_11ColIterator_5__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_11ColIterator_4__reduce_cython__(((struct __pyx_obj_7_amplpy_ColIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_11ColIterator_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7_amplpy_ColIterator *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 1);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "self._df cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self._df cannot be converted to a Python object for pickling"
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_self__df_cannot_be_converted_to, 0, 0);
  __PYX_ERR(8, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._df cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 */

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

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._df cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._df cannot be converted to a Python object for pickling"
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_11ColIterator_7__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_11ColIterator_6__setstate_cython__, "ColIterator.__setstate_cython__(self, __pyx_state)");
static PyMethodDef __pyx_mdef_7_amplpy_11ColIterator_7__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_11ColIterator_7__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_11ColIterator_6__setstate_cython__};
static PyObject *__pyx_pw_7_amplpy_11ColIterator_7__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 3, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(8, 3, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(8, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.ColIterator.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_11ColIterator_6__setstate_cython__(((struct __pyx_obj_7_amplpy_ColIterator *)__pyx_v_self), __pyx_v___pyx_state);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_11ColIterator_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7_amplpy_ColIterator *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 1);

  /* "(tree fragment)":4
 *     raise TypeError, "self._df cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self._df cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_self__df_cannot_be_converted_to, 0, 0);
  __PYX_ERR(8, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._df cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._df cannot be converted to a Python object for pickling"
 */

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

/* "amplpy/iterators.pxi":296
 * 
 *     @staticmethod
 *     cdef create(campl.AMPL_DATAFRAME* df, size_t index):             # <<<<<<<<<<<<<<
 *         rowit = RowIterator()
 *         rowit._df = df
 */

static PyObject *__pyx_f_7_amplpy_11RowIterator_create(AMPL_DATAFRAME *__pyx_v_df, size_t __pyx_v_index) {
  struct __pyx_obj_7_amplpy_RowIterator *__pyx_v_rowit = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("create", 1);

  /* "amplpy/iterators.pxi":297
 *     @staticmethod
 *     cdef create(campl.AMPL_DATAFRAME* df, size_t index):
 *         rowit = RowIterator()             # <<<<<<<<<<<<<<
 *         rowit._df = df
 *         rowit._index = index
 */
  __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_7_amplpy_RowIterator)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 297, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_rowit = ((struct __pyx_obj_7_amplpy_RowIterator *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "amplpy/iterators.pxi":298
 *     cdef create(campl.AMPL_DATAFRAME* df, size_t index):
 *         rowit = RowIterator()
 *         rowit._df = df             # <<<<<<<<<<<<<<
 *         rowit._index = index
 *         rowit._columnit = 0
 */
  __pyx_v_rowit->_df = __pyx_v_df;

  /* "amplpy/iterators.pxi":299
 *         rowit = RowIterator()
 *         rowit._df = df
 *         rowit._index = index             # <<<<<<<<<<<<<<
 *         rowit._columnit = 0
 *         PY_AMPL_CALL(campl.AMPL_DataFrameGetNumCols(rowit._df, &rowit._columnsize))
 */
  __pyx_v_rowit->_index = __pyx_v_index;

  /* "amplpy/iterators.pxi":300
 *         rowit._df = df
 *         rowit._index = index
 *         rowit._columnit = 0             # <<<<<<<<<<<<<<
 *         PY_AMPL_CALL(campl.AMPL_DataFrameGetNumCols(rowit._df, &rowit._columnsize))
 *         return rowit
 */
  __pyx_v_rowit->_columnit = 0;

  /* "amplpy/iterators.pxi":301
 *         rowit._index = index
 *         rowit._columnit = 0
 *         PY_AMPL_CALL(campl.AMPL_DataFrameGetNumCols(rowit._df, &rowit._columnsize))             # <<<<<<<<<<<<<<
 *         return rowit
 * 
 */
  __pyx_t_1 = __pyx_f_7_amplpy_PY_AMPL_CALL(AMPL_DataFrameGetNumCols(__pyx_v_rowit->_df, (&__pyx_v_rowit->_columnsize))); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 301, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "amplpy/iterators.pxi":302
 *         rowit._columnit = 0
 *         PY_AMPL_CALL(campl.AMPL_DataFrameGetNumCols(rowit._df, &rowit._columnsize))
 *         return rowit             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_rowit);
  __pyx_r = ((PyObject *)__pyx_v_rowit);
  goto __pyx_L0;

  /* "amplpy/iterators.pxi":296
 * 
 *     @staticmethod
 *     cdef create(campl.AMPL_DATAFRAME* df, size_t index):             # <<<<<<<<<<<<<<
 *         rowit = RowIterator()
 *         rowit._df = df
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("_amplpy.RowIterator.create", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_rowit);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/iterators.pxi":304
 *         return rowit
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_11RowIterator_1__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7_amplpy_11RowIterator_1__iter__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7_amplpy_11RowIterator___iter__(((struct __pyx_obj_7_amplpy_RowIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_11RowIterator___iter__(struct __pyx_obj_7_amplpy_RowIterator *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 1);

  /* "amplpy/iterators.pxi":305
 * 
 *     def __iter__(self):
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     def __next__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "amplpy/iterators.pxi":304
 *         return rowit
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

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

/* "amplpy/iterators.pxi":307
 *         return self
 * 
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         cdef campl.AMPL_VARIANT* v
 *         if self._columnit >= self._columnsize:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_11RowIterator_3__next__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7_amplpy_11RowIterator_3__next__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__next__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7_amplpy_11RowIterator_2__next__(((struct __pyx_obj_7_amplpy_RowIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_11RowIterator_2__next__(struct __pyx_obj_7_amplpy_RowIterator *__pyx_v_self) {
  AMPL_VARIANT *__pyx_v_v;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_error_without_exception = 0; /* StopIteration */
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__next__", 1);

  /* "amplpy/iterators.pxi":309
 *     def __next__(self):
 *         cdef campl.AMPL_VARIANT* v
 *         if self._columnit >= self._columnsize:             # <<<<<<<<<<<<<<
 *             raise StopIteration
 *         PY_AMPL_CALL(campl.AMPL_DataFrameElement(self._df, self._index, self._columnit, &v))
 */
  __pyx_t_1 = (__pyx_v_self->_columnit >= __pyx_v_self->_columnsize);
  if (unlikely(__pyx_t_1)) {

    /* "amplpy/iterators.pxi":310
 *         cdef campl.AMPL_VARIANT* v
 *         if self._columnit >= self._columnsize:
 *             raise StopIteration             # <<<<<<<<<<<<<<
 *         PY_AMPL_CALL(campl.AMPL_DataFrameElement(self._df, self._index, self._columnit, &v))
 *         self._columnit += 1
 */
    __pyx_error_without_exception = 1;
    goto __pyx_L1_error;;

    /* "amplpy/iterators.pxi":309
 *     def __next__(self):
 *         cdef campl.AMPL_VARIANT* v
 *         if self._columnit >= self._columnsize:             # <<<<<<<<<<<<<<
 *             raise StopIteration
 *         PY_AMPL_CALL(campl.AMPL_DataFrameElement(self._df, self._index, self._columnit, &v))
 */
  }

  /* "amplpy/iterators.pxi":311
 *         if self._columnit >= self._columnsize:
 *             raise StopIteration
 *         PY_AMPL_CALL(campl.AMPL_DataFrameElement(self._df, self._index, self._columnit, &v))             # <<<<<<<<<<<<<<
 *         self._columnit += 1
 *         return to_py_variant(v)
 */
  __pyx_t_2 = __pyx_f_7_amplpy_PY_AMPL_CALL(AMPL_DataFrameElement(__pyx_v_self->_df, __pyx_v_self->_index, __pyx_v_self->_columnit, (&__pyx_v_v))); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 311, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "amplpy/iterators.pxi":312
 *             raise StopIteration
 *         PY_AMPL_CALL(campl.AMPL_DataFrameElement(self._df, self._index, self._columnit, &v))
 *         self._columnit += 1             # <<<<<<<<<<<<<<
 *         return to_py_variant(v)
 */
  __pyx_v_self->_columnit = (__pyx_v_self->_columnit + 1);

  /* "amplpy/iterators.pxi":313
 *         PY_AMPL_CALL(campl.AMPL_DataFrameElement(self._df, self._index, self._columnit, &v))
 *         self._columnit += 1
 *         return to_py_variant(v)             # <<<<<<<<<<<<<<
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_7_amplpy_to_py_variant(__pyx_v_v); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 313, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "amplpy/iterators.pxi":307
 *         return self
 * 
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         cdef campl.AMPL_VARIANT* v
 *         if self._columnit >= self._columnsize:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  if (!__pyx_error_without_exception) {
    __Pyx_AddTraceback("_amplpy.RowIterator.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  }
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._df cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_11RowIterator_5__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_11RowIterator_4__reduce_cython__, "RowIterator.__reduce_cython__(self)");
static PyMethodDef __pyx_mdef_7_amplpy_11RowIterator_5__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_11RowIterator_5__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_11RowIterator_4__reduce_cython__};
static PyObject *__pyx_pw_7_amplpy_11RowIterator_5__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_11RowIterator_4__reduce_cython__(((struct __pyx_obj_7_amplpy_RowIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_11RowIterator_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7_amplpy_RowIterator *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 1);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "self._df cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self._df cannot be converted to a Python object for pickling"
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_self__df_cannot_be_converted_to, 0, 0);
  __PYX_ERR(8, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._df cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 */

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

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._df cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._df cannot be converted to a Python object for pickling"
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_11RowIterator_7__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_11RowIterator_6__setstate_cython__, "RowIterator.__setstate_cython__(self, __pyx_state)");
static PyMethodDef __pyx_mdef_7_amplpy_11RowIterator_7__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_11RowIterator_7__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_11RowIterator_6__setstate_cython__};
static PyObject *__pyx_pw_7_amplpy_11RowIterator_7__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 3, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(8, 3, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(8, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.RowIterator.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_11RowIterator_6__setstate_cython__(((struct __pyx_obj_7_amplpy_RowIterator *)__pyx_v_self), __pyx_v___pyx_state);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_11RowIterator_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7_amplpy_RowIterator *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 1);

  /* "(tree fragment)":4
 *     raise TypeError, "self._df cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self._df cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_self__df_cannot_be_converted_to, 0, 0);
  __PYX_ERR(8, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._df cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._df cannot be converted to a Python object for pickling"
 */

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

/* "amplpy/objective.pxi":25
 *     """
 *     @staticmethod
 *     cdef create(campl.AMPL* ampl_c, char* name, campl.AMPL_TUPLE* index, parent):             # <<<<<<<<<<<<<<
 *         entity = Objective()
 *         entity._c_ampl = ampl_c
 */

static PyObject *__pyx_f_7_amplpy_9Objective_create(AMPL *__pyx_v_ampl_c, char *__pyx_v_name, AMPL_TUPLE *__pyx_v_index, PyObject *__pyx_v_parent) {
  struct __pyx_obj_7_amplpy_Objective *__pyx_v_entity = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("create", 1);

  /* "amplpy/objective.pxi":26
 *     @staticmethod
 *     cdef create(campl.AMPL* ampl_c, char* name, campl.AMPL_TUPLE* index, parent):
 *         entity = Objective()             # <<<<<<<<<<<<<<
 *         entity._c_ampl = ampl_c
 *         entity._name = name
 */
  __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_7_amplpy_Objective)); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 26, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_entity = ((struct __pyx_obj_7_amplpy_Objective *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "amplpy/objective.pxi":27
 *     cdef create(campl.AMPL* ampl_c, char* name, campl.AMPL_TUPLE* index, parent):
 *         entity = Objective()
 *         entity._c_ampl = ampl_c             # <<<<<<<<<<<<<<
 *         entity._name = name
 *         entity._index = index
 */
  __pyx_v_entity->__pyx_base._c_ampl = __pyx_v_ampl_c;

  /* "amplpy/objective.pxi":28
 *         entity = Objective()
 *         entity._c_ampl = ampl_c
 *         entity._name = name             # <<<<<<<<<<<<<<
 *         entity._index = index
 *         entity.wrap_function = campl.AMPL_OBJECTIVE
 */
  __pyx_v_entity->__pyx_base._name = __pyx_v_name;

  /* "amplpy/objective.pxi":29
 *         entity._c_ampl = ampl_c
 *         entity._name = name
 *         entity._index = index             # <<<<<<<<<<<<<<
 *         entity.wrap_function = campl.AMPL_OBJECTIVE
 *         entity._entity = parent
 */
  __pyx_v_entity->__pyx_base._index = __pyx_v_index;

  /* "amplpy/objective.pxi":30
 *         entity._name = name
 *         entity._index = index
 *         entity.wrap_function = campl.AMPL_OBJECTIVE             # <<<<<<<<<<<<<<
 *         entity._entity = parent
 *         if entity._entity is not None:
 */
  __pyx_v_entity->__pyx_base.wrap_function = AMPL_OBJECTIVE;

  /* "amplpy/objective.pxi":31
 *         entity._index = index
 *         entity.wrap_function = campl.AMPL_OBJECTIVE
 *         entity._entity = parent             # <<<<<<<<<<<<<<
 *         if entity._entity is not None:
 *             Py_INCREF(entity._entity)
 */
  __Pyx_INCREF(__pyx_v_parent);
  __Pyx_GIVEREF(__pyx_v_parent);
  __Pyx_GOTREF(__pyx_v_entity->__pyx_base._entity);
  __Pyx_DECREF(__pyx_v_entity->__pyx_base._entity);
  __pyx_v_entity->__pyx_base._entity = __pyx_v_parent;

  /* "amplpy/objective.pxi":32
 *         entity.wrap_function = campl.AMPL_OBJECTIVE
 *         entity._entity = parent
 *         if entity._entity is not None:             # <<<<<<<<<<<<<<
 *             Py_INCREF(entity._entity)
 *         return entity
 */
  __pyx_t_2 = (__pyx_v_entity->__pyx_base._entity != Py_None);
  if (__pyx_t_2) {

    /* "amplpy/objective.pxi":33
 *         entity._entity = parent
 *         if entity._entity is not None:
 *             Py_INCREF(entity._entity)             # <<<<<<<<<<<<<<
 *         return entity
 * 
 */
    __pyx_t_1 = __pyx_v_entity->__pyx_base._entity;
    __Pyx_INCREF(__pyx_t_1);
    Py_INCREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "amplpy/objective.pxi":32
 *         entity.wrap_function = campl.AMPL_OBJECTIVE
 *         entity._entity = parent
 *         if entity._entity is not None:             # <<<<<<<<<<<<<<
 *             Py_INCREF(entity._entity)
 *         return entity
 */
  }

  /* "amplpy/objective.pxi":34
 *         if entity._entity is not None:
 *             Py_INCREF(entity._entity)
 *         return entity             # <<<<<<<<<<<<<<
 * 
 *     def value(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_entity);
  __pyx_r = ((PyObject *)__pyx_v_entity);
  goto __pyx_L0;

  /* "amplpy/objective.pxi":25
 *     """
 *     @staticmethod
 *     cdef create(campl.AMPL* ampl_c, char* name, campl.AMPL_TUPLE* index, parent):             # <<<<<<<<<<<<<<
 *         entity = Objective()
 *         entity._c_ampl = ampl_c
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("_amplpy.Objective.create", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_entity);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/objective.pxi":36
 *         return entity
 * 
 *     def value(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the value of the objective.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_9Objective_1value(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_9Objective_value, "Objective.value(self)\n\n        Get the value of the objective.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_9Objective_1value = {"value", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_9Objective_1value, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_9Objective_value};
static PyObject *__pyx_pw_7_amplpy_9Objective_1value(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("value (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("value", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "value", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_9Objective_value(((struct __pyx_obj_7_amplpy_Objective *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_9Objective_value(struct __pyx_obj_7_amplpy_Objective *__pyx_v_self) {
  double __pyx_v_value;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("value", 1);

  /* "amplpy/objective.pxi":41
 *         """
 *         cdef double value
 *         PY_AMPL_CALL(campl.AMPL_InstanceGetDoubleSuffix(self._c_ampl, self._name, NULL, campl.AMPL_NUMERICSUFFIX.AMPL_VALUE, &value))             # <<<<<<<<<<<<<<
 *         return value
 * 
 */
  __pyx_t_1 = __pyx_f_7_amplpy_PY_AMPL_CALL(AMPL_InstanceGetDoubleSuffix(__pyx_v_self->__pyx_base._c_ampl, __pyx_v_self->__pyx_base._name, NULL, AMPL_VALUE, (&__pyx_v_value))); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 41, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "amplpy/objective.pxi":42
 *         cdef double value
 *         PY_AMPL_CALL(campl.AMPL_InstanceGetDoubleSuffix(self._c_ampl, self._name, NULL, campl.AMPL_NUMERICSUFFIX.AMPL_VALUE, &value))
 *         return value             # <<<<<<<<<<<<<<
 * 
 *     def astatus(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 42, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "amplpy/objective.pxi":36
 *         return entity
 * 
 *     def value(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the value of the objective.
 */

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

/* "amplpy/objective.pxi":44
 *         return value
 * 
 *     def astatus(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the AMPL status.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_9Objective_3astatus(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_9Objective_2astatus, "Objective.astatus(self)\n\n        Return the AMPL status.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_9Objective_3astatus = {"astatus", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_9Objective_3astatus, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_9Objective_2astatus};
static PyObject *__pyx_pw_7_amplpy_9Objective_3astatus(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("astatus (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("astatus", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "astatus", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_9Objective_2astatus(((struct __pyx_obj_7_amplpy_Objective *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_9Objective_2astatus(struct __pyx_obj_7_amplpy_Objective *__pyx_v_self) {
  AMPL_ERRORINFO *__pyx_v_errorinfo;
  AMPL_RETCODE __pyx_v_rc;
  char *__pyx_v_value_c;
  PyObject *__pyx_v_value = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("astatus", 1);

  /* "amplpy/objective.pxi":51
 *         cdef campl.AMPL_RETCODE rc
 *         cdef char* value_c
 *         errorinfo = campl.AMPL_InstanceGetStringSuffix(self._c_ampl, self._name, NULL, campl.AMPL_STRINGSUFFIX.AMPL_ASTATUS, &value_c)             # <<<<<<<<<<<<<<
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:
 */
  __pyx_v_errorinfo = AMPL_InstanceGetStringSuffix(__pyx_v_self->__pyx_base._c_ampl, __pyx_v_self->__pyx_base._name, NULL, AMPL_ASTATUS, (&__pyx_v_value_c));

  /* "amplpy/objective.pxi":52
 *         cdef char* value_c
 *         errorinfo = campl.AMPL_InstanceGetStringSuffix(self._c_ampl, self._name, NULL, campl.AMPL_STRINGSUFFIX.AMPL_ASTATUS, &value_c)
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)             # <<<<<<<<<<<<<<
 *         if rc != campl.AMPL_OK:
 *             campl.AMPL_StringFree(&value_c)
 */
  __pyx_v_rc = AMPL_ErrorInfoGetError(__pyx_v_errorinfo);

  /* "amplpy/objective.pxi":53
 *         errorinfo = campl.AMPL_InstanceGetStringSuffix(self._c_ampl, self._name, NULL, campl.AMPL_STRINGSUFFIX.AMPL_ASTATUS, &value_c)
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:             # <<<<<<<<<<<<<<
 *             campl.AMPL_StringFree(&value_c)
 *             PY_AMPL_CALL(errorinfo)
 */
  __pyx_t_1 = (__pyx_v_rc != AMPL_OK);
  if (__pyx_t_1) {

    /* "amplpy/objective.pxi":54
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:
 *             campl.AMPL_StringFree(&value_c)             # <<<<<<<<<<<<<<
 *             PY_AMPL_CALL(errorinfo)
 *         value = str(value_c.decode('utf-8'))
 */
    (void)(AMPL_StringFree((&__pyx_v_value_c)));

    /* "amplpy/objective.pxi":55
 *         if rc != campl.AMPL_OK:
 *             campl.AMPL_StringFree(&value_c)
 *             PY_AMPL_CALL(errorinfo)             # <<<<<<<<<<<<<<
 *         value = str(value_c.decode('utf-8'))
 *         campl.AMPL_StringFree(&value_c)
 */
    __pyx_t_2 = __pyx_f_7_amplpy_PY_AMPL_CALL(__pyx_v_errorinfo); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 55, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "amplpy/objective.pxi":53
 *         errorinfo = campl.AMPL_InstanceGetStringSuffix(self._c_ampl, self._name, NULL, campl.AMPL_STRINGSUFFIX.AMPL_ASTATUS, &value_c)
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:             # <<<<<<<<<<<<<<
 *             campl.AMPL_StringFree(&value_c)
 *             PY_AMPL_CALL(errorinfo)
 */
  }

  /* "amplpy/objective.pxi":56
 *             campl.AMPL_StringFree(&value_c)
 *             PY_AMPL_CALL(errorinfo)
 *         value = str(value_c.decode('utf-8'))             # <<<<<<<<<<<<<<
 *         campl.AMPL_StringFree(&value_c)
 * 
 */
  __pyx_t_3 = __Pyx_ssize_strlen(__pyx_v_value_c); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(12, 56, __pyx_L1_error)
  __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_value_c, 0, __pyx_t_3, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 56, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_value = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "amplpy/objective.pxi":57
 *             PY_AMPL_CALL(errorinfo)
 *         value = str(value_c.decode('utf-8'))
 *         campl.AMPL_StringFree(&value_c)             # <<<<<<<<<<<<<<
 * 
 *         return value
 */
  (void)(AMPL_StringFree((&__pyx_v_value_c)));

  /* "amplpy/objective.pxi":59
 *         campl.AMPL_StringFree(&value_c)
 * 
 *         return value             # <<<<<<<<<<<<<<
 * 
 *     def sstatus(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_value);
  __pyx_r = __pyx_v_value;
  goto __pyx_L0;

  /* "amplpy/objective.pxi":44
 *         return value
 * 
 *     def astatus(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the AMPL status.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("_amplpy.Objective.astatus", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/objective.pxi":61
 *         return value
 * 
 *     def sstatus(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the solver status.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_9Objective_5sstatus(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_9Objective_4sstatus, "Objective.sstatus(self)\n\n        Return the solver status.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_9Objective_5sstatus = {"sstatus", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_9Objective_5sstatus, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_9Objective_4sstatus};
static PyObject *__pyx_pw_7_amplpy_9Objective_5sstatus(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sstatus (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("sstatus", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "sstatus", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_9Objective_4sstatus(((struct __pyx_obj_7_amplpy_Objective *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_9Objective_4sstatus(struct __pyx_obj_7_amplpy_Objective *__pyx_v_self) {
  AMPL_ERRORINFO *__pyx_v_errorinfo;
  AMPL_RETCODE __pyx_v_rc;
  char *__pyx_v_value_c;
  PyObject *__pyx_v_value = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("sstatus", 1);

  /* "amplpy/objective.pxi":68
 *         cdef campl.AMPL_RETCODE rc
 *         cdef char* value_c
 *         errorinfo = campl.AMPL_InstanceGetStringSuffix(self._c_ampl, self._name, NULL, campl.AMPL_STRINGSUFFIX.AMPL_SSTATUS, &value_c)             # <<<<<<<<<<<<<<
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:
 */
  __pyx_v_errorinfo = AMPL_InstanceGetStringSuffix(__pyx_v_self->__pyx_base._c_ampl, __pyx_v_self->__pyx_base._name, NULL, AMPL_SSTATUS, (&__pyx_v_value_c));

  /* "amplpy/objective.pxi":69
 *         cdef char* value_c
 *         errorinfo = campl.AMPL_InstanceGetStringSuffix(self._c_ampl, self._name, NULL, campl.AMPL_STRINGSUFFIX.AMPL_SSTATUS, &value_c)
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)             # <<<<<<<<<<<<<<
 *         if rc != campl.AMPL_OK:
 *             campl.AMPL_StringFree(&value_c)
 */
  __pyx_v_rc = AMPL_ErrorInfoGetError(__pyx_v_errorinfo);

  /* "amplpy/objective.pxi":70
 *         errorinfo = campl.AMPL_InstanceGetStringSuffix(self._c_ampl, self._name, NULL, campl.AMPL_STRINGSUFFIX.AMPL_SSTATUS, &value_c)
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:             # <<<<<<<<<<<<<<
 *             campl.AMPL_StringFree(&value_c)
 *             PY_AMPL_CALL(errorinfo)
 */
  __pyx_t_1 = (__pyx_v_rc != AMPL_OK);
  if (__pyx_t_1) {

    /* "amplpy/objective.pxi":71
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:
 *             campl.AMPL_StringFree(&value_c)             # <<<<<<<<<<<<<<
 *             PY_AMPL_CALL(errorinfo)
 *         value = str(value_c.decode('utf-8'))
 */
    (void)(AMPL_StringFree((&__pyx_v_value_c)));

    /* "amplpy/objective.pxi":72
 *         if rc != campl.AMPL_OK:
 *             campl.AMPL_StringFree(&value_c)
 *             PY_AMPL_CALL(errorinfo)             # <<<<<<<<<<<<<<
 *         value = str(value_c.decode('utf-8'))
 *         campl.AMPL_StringFree(&value_c)
 */
    __pyx_t_2 = __pyx_f_7_amplpy_PY_AMPL_CALL(__pyx_v_errorinfo); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 72, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "amplpy/objective.pxi":70
 *         errorinfo = campl.AMPL_InstanceGetStringSuffix(self._c_ampl, self._name, NULL, campl.AMPL_STRINGSUFFIX.AMPL_SSTATUS, &value_c)
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:             # <<<<<<<<<<<<<<
 *             campl.AMPL_StringFree(&value_c)
 *             PY_AMPL_CALL(errorinfo)
 */
  }

  /* "amplpy/objective.pxi":73
 *             campl.AMPL_StringFree(&value_c)
 *             PY_AMPL_CALL(errorinfo)
 *         value = str(value_c.decode('utf-8'))             # <<<<<<<<<<<<<<
 *         campl.AMPL_StringFree(&value_c)
 * 
 */
  __pyx_t_3 = __Pyx_ssize_strlen(__pyx_v_value_c); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(12, 73, __pyx_L1_error)
  __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_value_c, 0, __pyx_t_3, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 73, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_value = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "amplpy/objective.pxi":74
 *             PY_AMPL_CALL(errorinfo)
 *         value = str(value_c.decode('utf-8'))
 *         campl.AMPL_StringFree(&value_c)             # <<<<<<<<<<<<<<
 * 
 *         return value
 */
  (void)(AMPL_StringFree((&__pyx_v_value_c)));

  /* "amplpy/objective.pxi":76
 *         campl.AMPL_StringFree(&value_c)
 * 
 *         return value             # <<<<<<<<<<<<<<
 * 
 *     def exitcode(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_value);
  __pyx_r = __pyx_v_value;
  goto __pyx_L0;

  /* "amplpy/objective.pxi":61
 *         return value
 * 
 *     def sstatus(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the solver status.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("_amplpy.Objective.sstatus", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/objective.pxi":78
 *         return value
 * 
 *     def exitcode(self):             # <<<<<<<<<<<<<<
 *         """
 *         Exit code returned by solver after most recent solve with this
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_9Objective_7exitcode(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_9Objective_6exitcode, "Objective.exitcode(self)\n\n        Exit code returned by solver after most recent solve with this\n        objective.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_9Objective_7exitcode = {"exitcode", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_9Objective_7exitcode, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_9Objective_6exitcode};
static PyObject *__pyx_pw_7_amplpy_9Objective_7exitcode(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("exitcode (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("exitcode", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "exitcode", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_9Objective_6exitcode(((struct __pyx_obj_7_amplpy_Objective *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_9Objective_6exitcode(struct __pyx_obj_7_amplpy_Objective *__pyx_v_self) {
  int __pyx_v_value;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("exitcode", 1);

  /* "amplpy/objective.pxi":84
 *         """
 *         cdef int value
 *         PY_AMPL_CALL(campl.AMPL_InstanceGetIntSuffix(self._c_ampl, self._name, NULL, campl.AMPL_NUMERICSUFFIX.AMPL_EXITCODE, &value))             # <<<<<<<<<<<<<<
 *         return value
 * 
 */
  __pyx_t_1 = __pyx_f_7_amplpy_PY_AMPL_CALL(AMPL_InstanceGetIntSuffix(__pyx_v_self->__pyx_base._c_ampl, __pyx_v_self->__pyx_base._name, NULL, AMPL_EXITCODE, (&__pyx_v_value))); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 84, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "amplpy/objective.pxi":85
 *         cdef int value
 *         PY_AMPL_CALL(campl.AMPL_InstanceGetIntSuffix(self._c_ampl, self._name, NULL, campl.AMPL_NUMERICSUFFIX.AMPL_EXITCODE, &value))
 *         return value             # <<<<<<<<<<<<<<
 * 
 *     def message(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 85, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "amplpy/objective.pxi":78
 *         return value
 * 
 *     def exitcode(self):             # <<<<<<<<<<<<<<
 *         """
 *         Exit code returned by solver after most recent solve with this
 */

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

/* "amplpy/objective.pxi":87
 *         return value
 * 
 *     def message(self):             # <<<<<<<<<<<<<<
 *         """
 *         Result message returned by solver after most recent solve with this
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_9Objective_9message(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_9Objective_8message, "Objective.message(self)\n\n        Result message returned by solver after most recent solve with this\n        objective.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_9Objective_9message = {"message", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_9Objective_9message, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_9Objective_8message};
static PyObject *__pyx_pw_7_amplpy_9Objective_9message(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("message (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("message", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "message", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_9Objective_8message(((struct __pyx_obj_7_amplpy_Objective *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_9Objective_8message(struct __pyx_obj_7_amplpy_Objective *__pyx_v_self) {
  AMPL_ERRORINFO *__pyx_v_errorinfo;
  AMPL_RETCODE __pyx_v_rc;
  char *__pyx_v_value_c;
  PyObject *__pyx_v_value = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("message", 1);

  /* "amplpy/objective.pxi":95
 *         cdef campl.AMPL_RETCODE rc
 *         cdef char* value_c
 *         errorinfo = campl.AMPL_InstanceGetStringSuffix(self._c_ampl, self._name, NULL, campl.AMPL_STRINGSUFFIX.AMPL_MESSAGE, &value_c)             # <<<<<<<<<<<<<<
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:
 */
  __pyx_v_errorinfo = AMPL_InstanceGetStringSuffix(__pyx_v_self->__pyx_base._c_ampl, __pyx_v_self->__pyx_base._name, NULL, AMPL_MESSAGE, (&__pyx_v_value_c));

  /* "amplpy/objective.pxi":96
 *         cdef char* value_c
 *         errorinfo = campl.AMPL_InstanceGetStringSuffix(self._c_ampl, self._name, NULL, campl.AMPL_STRINGSUFFIX.AMPL_MESSAGE, &value_c)
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)             # <<<<<<<<<<<<<<
 *         if rc != campl.AMPL_OK:
 *             campl.AMPL_StringFree(&value_c)
 */
  __pyx_v_rc = AMPL_ErrorInfoGetError(__pyx_v_errorinfo);

  /* "amplpy/objective.pxi":97
 *         errorinfo = campl.AMPL_InstanceGetStringSuffix(self._c_ampl, self._name, NULL, campl.AMPL_STRINGSUFFIX.AMPL_MESSAGE, &value_c)
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:             # <<<<<<<<<<<<<<
 *             campl.AMPL_StringFree(&value_c)
 *             PY_AMPL_CALL(errorinfo)
 */
  __pyx_t_1 = (__pyx_v_rc != AMPL_OK);
  if (__pyx_t_1) {

    /* "amplpy/objective.pxi":98
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:
 *             campl.AMPL_StringFree(&value_c)             # <<<<<<<<<<<<<<
 *             PY_AMPL_CALL(errorinfo)
 *         value = str(value_c.decode('utf-8'))
 */
    (void)(AMPL_StringFree((&__pyx_v_value_c)));

    /* "amplpy/objective.pxi":99
 *         if rc != campl.AMPL_OK:
 *             campl.AMPL_StringFree(&value_c)
 *             PY_AMPL_CALL(errorinfo)             # <<<<<<<<<<<<<<
 *         value = str(value_c.decode('utf-8'))
 *         campl.AMPL_StringFree(&value_c)
 */
    __pyx_t_2 = __pyx_f_7_amplpy_PY_AMPL_CALL(__pyx_v_errorinfo); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 99, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "amplpy/objective.pxi":97
 *         errorinfo = campl.AMPL_InstanceGetStringSuffix(self._c_ampl, self._name, NULL, campl.AMPL_STRINGSUFFIX.AMPL_MESSAGE, &value_c)
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:             # <<<<<<<<<<<<<<
 *             campl.AMPL_StringFree(&value_c)
 *             PY_AMPL_CALL(errorinfo)
 */
  }

  /* "amplpy/objective.pxi":100
 *             campl.AMPL_StringFree(&value_c)
 *             PY_AMPL_CALL(errorinfo)
 *         value = str(value_c.decode('utf-8'))             # <<<<<<<<<<<<<<
 *         campl.AMPL_StringFree(&value_c)
 * 
 */
  __pyx_t_3 = __Pyx_ssize_strlen(__pyx_v_value_c); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(12, 100, __pyx_L1_error)
  __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_value_c, 0, __pyx_t_3, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 100, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_value = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "amplpy/objective.pxi":101
 *             PY_AMPL_CALL(errorinfo)
 *         value = str(value_c.decode('utf-8'))
 *         campl.AMPL_StringFree(&value_c)             # <<<<<<<<<<<<<<
 * 
 *         return value
 */
  (void)(AMPL_StringFree((&__pyx_v_value_c)));

  /* "amplpy/objective.pxi":103
 *         campl.AMPL_StringFree(&value_c)
 * 
 *         return value             # <<<<<<<<<<<<<<
 * 
 *     def result(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_value);
  __pyx_r = __pyx_v_value;
  goto __pyx_L0;

  /* "amplpy/objective.pxi":87
 *         return value
 * 
 *     def message(self):             # <<<<<<<<<<<<<<
 *         """
 *         Result message returned by solver after most recent solve with this
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("_amplpy.Objective.message", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/objective.pxi":105
 *         return value
 * 
 *     def result(self):             # <<<<<<<<<<<<<<
 *         """
 *         Result string returned by solver after most recent solve with this
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_9Objective_11result(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_9Objective_10result, "Objective.result(self)\n\n        Result string returned by solver after most recent solve with this\n        objective.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_9Objective_11result = {"result", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_9Objective_11result, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_9Objective_10result};
static PyObject *__pyx_pw_7_amplpy_9Objective_11result(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("result (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("result", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "result", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_9Objective_10result(((struct __pyx_obj_7_amplpy_Objective *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_9Objective_10result(struct __pyx_obj_7_amplpy_Objective *__pyx_v_self) {
  AMPL_ERRORINFO *__pyx_v_errorinfo;
  AMPL_RETCODE __pyx_v_rc;
  char *__pyx_v_value_c;
  PyObject *__pyx_v_value = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("result", 1);

  /* "amplpy/objective.pxi":113
 *         cdef campl.AMPL_RETCODE rc
 *         cdef char* value_c
 *         errorinfo = campl.AMPL_InstanceGetStringSuffix(self._c_ampl, self._name, NULL, campl.AMPL_STRINGSUFFIX.AMPL_RESULT, &value_c)             # <<<<<<<<<<<<<<
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:
 */
  __pyx_v_errorinfo = AMPL_InstanceGetStringSuffix(__pyx_v_self->__pyx_base._c_ampl, __pyx_v_self->__pyx_base._name, NULL, AMPL_RESULT, (&__pyx_v_value_c));

  /* "amplpy/objective.pxi":114
 *         cdef char* value_c
 *         errorinfo = campl.AMPL_InstanceGetStringSuffix(self._c_ampl, self._name, NULL, campl.AMPL_STRINGSUFFIX.AMPL_RESULT, &value_c)
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)             # <<<<<<<<<<<<<<
 *         if rc != campl.AMPL_OK:
 *             campl.AMPL_StringFree(&value_c)
 */
  __pyx_v_rc = AMPL_ErrorInfoGetError(__pyx_v_errorinfo);

  /* "amplpy/objective.pxi":115
 *         errorinfo = campl.AMPL_InstanceGetStringSuffix(self._c_ampl, self._name, NULL, campl.AMPL_STRINGSUFFIX.AMPL_RESULT, &value_c)
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:             # <<<<<<<<<<<<<<
 *             campl.AMPL_StringFree(&value_c)
 *             PY_AMPL_CALL(errorinfo)
 */
  __pyx_t_1 = (__pyx_v_rc != AMPL_OK);
  if (__pyx_t_1) {

    /* "amplpy/objective.pxi":116
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:
 *             campl.AMPL_StringFree(&value_c)             # <<<<<<<<<<<<<<
 *             PY_AMPL_CALL(errorinfo)
 *         value = str(value_c.decode('utf-8'))
 */
    (void)(AMPL_StringFree((&__pyx_v_value_c)));

    /* "amplpy/objective.pxi":117
 *         if rc != campl.AMPL_OK:
 *             campl.AMPL_StringFree(&value_c)
 *             PY_AMPL_CALL(errorinfo)             # <<<<<<<<<<<<<<
 *         value = str(value_c.decode('utf-8'))
 *         campl.AMPL_StringFree(&value_c)
 */
    __pyx_t_2 = __pyx_f_7_amplpy_PY_AMPL_CALL(__pyx_v_errorinfo); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 117, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "amplpy/objective.pxi":115
 *         errorinfo = campl.AMPL_InstanceGetStringSuffix(self._c_ampl, self._name, NULL, campl.AMPL_STRINGSUFFIX.AMPL_RESULT, &value_c)
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:             # <<<<<<<<<<<<<<
 *             campl.AMPL_StringFree(&value_c)
 *             PY_AMPL_CALL(errorinfo)
 */
  }

  /* "amplpy/objective.pxi":118
 *             campl.AMPL_StringFree(&value_c)
 *             PY_AMPL_CALL(errorinfo)
 *         value = str(value_c.decode('utf-8'))             # <<<<<<<<<<<<<<
 *         campl.AMPL_StringFree(&value_c)
 * 
 */
  __pyx_t_3 = __Pyx_ssize_strlen(__pyx_v_value_c); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(12, 118, __pyx_L1_error)
  __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_value_c, 0, __pyx_t_3, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 118, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_value = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "amplpy/objective.pxi":119
 *             PY_AMPL_CALL(errorinfo)
 *         value = str(value_c.decode('utf-8'))
 *         campl.AMPL_StringFree(&value_c)             # <<<<<<<<<<<<<<
 * 
 *         return value
 */
  (void)(AMPL_StringFree((&__pyx_v_value_c)));

  /* "amplpy/objective.pxi":121
 *         campl.AMPL_StringFree(&value_c)
 * 
 *         return value             # <<<<<<<<<<<<<<
 * 
 *     def drop(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_value);
  __pyx_r = __pyx_v_value;
  goto __pyx_L0;

  /* "amplpy/objective.pxi":105
 *         return value
 * 
 *     def result(self):             # <<<<<<<<<<<<<<
 *         """
 *         Result string returned by solver after most recent solve with this
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("_amplpy.Objective.result", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/objective.pxi":123
 *         return value
 * 
 *     def drop(self):             # <<<<<<<<<<<<<<
 *         """
 *         Drop this objective instance.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_9Objective_13drop(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_9Objective_12drop, "Objective.drop(self)\n\n        Drop this objective instance.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_9Objective_13drop = {"drop", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_9Objective_13drop, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_9Objective_12drop};
static PyObject *__pyx_pw_7_amplpy_9Objective_13drop(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("drop (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("drop", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "drop", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_9Objective_12drop(((struct __pyx_obj_7_amplpy_Objective *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_9Objective_12drop(struct __pyx_obj_7_amplpy_Objective *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("drop", 1);

  /* "amplpy/objective.pxi":127
 *         Drop this objective instance.
 *         """
 *         PY_AMPL_CALL(campl.AMPL_EntityDrop(self._c_ampl, self._name))             # <<<<<<<<<<<<<<
 * 
 *     def restore(self):
 */
  __pyx_t_1 = __pyx_f_7_amplpy_PY_AMPL_CALL(AMPL_EntityDrop(__pyx_v_self->__pyx_base._c_ampl, __pyx_v_self->__pyx_base._name)); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 127, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "amplpy/objective.pxi":123
 *         return value
 * 
 *     def drop(self):             # <<<<<<<<<<<<<<
 *         """
 *         Drop this objective instance.
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("_amplpy.Objective.drop", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/objective.pxi":129
 *         PY_AMPL_CALL(campl.AMPL_EntityDrop(self._c_ampl, self._name))
 * 
 *     def restore(self):             # <<<<<<<<<<<<<<
 *         """
 *         Restore this objective (if it had been dropped, no effect otherwise).
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_9Objective_15restore(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_9Objective_14restore, "Objective.restore(self)\n\n        Restore this objective (if it had been dropped, no effect otherwise).\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_9Objective_15restore = {"restore", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_9Objective_15restore, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_9Objective_14restore};
static PyObject *__pyx_pw_7_amplpy_9Objective_15restore(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("restore (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("restore", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "restore", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_9Objective_14restore(((struct __pyx_obj_7_amplpy_Objective *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_9Objective_14restore(struct __pyx_obj_7_amplpy_Objective *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("restore", 1);

  /* "amplpy/objective.pxi":133
 *         Restore this objective (if it had been dropped, no effect otherwise).
 *         """
 *         PY_AMPL_CALL(campl.AMPL_EntityRestore(self._c_ampl, self._name))             # <<<<<<<<<<<<<<
 * 
 *     def minimization(self):
 */
  __pyx_t_1 = __pyx_f_7_amplpy_PY_AMPL_CALL(AMPL_EntityRestore(__pyx_v_self->__pyx_base._c_ampl, __pyx_v_self->__pyx_base._name)); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 133, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "amplpy/objective.pxi":129
 *         PY_AMPL_CALL(campl.AMPL_EntityDrop(self._c_ampl, self._name))
 * 
 *     def restore(self):             # <<<<<<<<<<<<<<
 *         """
 *         Restore this objective (if it had been dropped, no effect otherwise).
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("_amplpy.Objective.restore", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/objective.pxi":135
 *         PY_AMPL_CALL(campl.AMPL_EntityRestore(self._c_ampl, self._name))
 * 
 *     def minimization(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the sense of this objective. Returns True if minimize,
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_9Objective_17minimization(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_9Objective_16minimization, "Objective.minimization(self)\n\n        Get the sense of this objective. Returns True if minimize,\n        False if maximize.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_9Objective_17minimization = {"minimization", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_9Objective_17minimization, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_9Objective_16minimization};
static PyObject *__pyx_pw_7_amplpy_9Objective_17minimization(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("minimization (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("minimization", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "minimization", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_9Objective_16minimization(((struct __pyx_obj_7_amplpy_Objective *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_9Objective_16minimization(struct __pyx_obj_7_amplpy_Objective *__pyx_v_self) {
  AMPL_ERRORINFO *__pyx_v_errorinfo;
  AMPL_RETCODE __pyx_v_rc;
  char *__pyx_v_value_c;
  PyObject *__pyx_v_value = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("minimization", 1);

  /* "amplpy/objective.pxi":143
 *         cdef campl.AMPL_RETCODE rc
 *         cdef char* value_c
 *         errorinfo = campl.AMPL_InstanceGetStringSuffix(self._c_ampl, self._name, NULL, campl.AMPL_STRINGSUFFIX.AMPL_SENSE, &value_c)             # <<<<<<<<<<<<<<
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:
 */
  __pyx_v_errorinfo = AMPL_InstanceGetStringSuffix(__pyx_v_self->__pyx_base._c_ampl, __pyx_v_self->__pyx_base._name, NULL, AMPL_SENSE, (&__pyx_v_value_c));

  /* "amplpy/objective.pxi":144
 *         cdef char* value_c
 *         errorinfo = campl.AMPL_InstanceGetStringSuffix(self._c_ampl, self._name, NULL, campl.AMPL_STRINGSUFFIX.AMPL_SENSE, &value_c)
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)             # <<<<<<<<<<<<<<
 *         if rc != campl.AMPL_OK:
 *             campl.AMPL_StringFree(&value_c)
 */
  __pyx_v_rc = AMPL_ErrorInfoGetError(__pyx_v_errorinfo);

  /* "amplpy/objective.pxi":145
 *         errorinfo = campl.AMPL_InstanceGetStringSuffix(self._c_ampl, self._name, NULL, campl.AMPL_STRINGSUFFIX.AMPL_SENSE, &value_c)
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:             # <<<<<<<<<<<<<<
 *             campl.AMPL_StringFree(&value_c)
 *             PY_AMPL_CALL(errorinfo)
 */
  __pyx_t_1 = (__pyx_v_rc != AMPL_OK);
  if (__pyx_t_1) {

    /* "amplpy/objective.pxi":146
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:
 *             campl.AMPL_StringFree(&value_c)             # <<<<<<<<<<<<<<
 *             PY_AMPL_CALL(errorinfo)
 *         value = str(value_c.decode('utf-8'))
 */
    (void)(AMPL_StringFree((&__pyx_v_value_c)));

    /* "amplpy/objective.pxi":147
 *         if rc != campl.AMPL_OK:
 *             campl.AMPL_StringFree(&value_c)
 *             PY_AMPL_CALL(errorinfo)             # <<<<<<<<<<<<<<
 *         value = str(value_c.decode('utf-8'))
 *         campl.AMPL_StringFree(&value_c)
 */
    __pyx_t_2 = __pyx_f_7_amplpy_PY_AMPL_CALL(__pyx_v_errorinfo); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 147, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "amplpy/objective.pxi":145
 *         errorinfo = campl.AMPL_InstanceGetStringSuffix(self._c_ampl, self._name, NULL, campl.AMPL_STRINGSUFFIX.AMPL_SENSE, &value_c)
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:             # <<<<<<<<<<<<<<
 *             campl.AMPL_StringFree(&value_c)
 *             PY_AMPL_CALL(errorinfo)
 */
  }

  /* "amplpy/objective.pxi":148
 *             campl.AMPL_StringFree(&value_c)
 *             PY_AMPL_CALL(errorinfo)
 *         value = str(value_c.decode('utf-8'))             # <<<<<<<<<<<<<<
 *         campl.AMPL_StringFree(&value_c)
 * 
 */
  __pyx_t_3 = __Pyx_ssize_strlen(__pyx_v_value_c); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(12, 148, __pyx_L1_error)
  __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_value_c, 0, __pyx_t_3, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_value = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "amplpy/objective.pxi":149
 *             PY_AMPL_CALL(errorinfo)
 *         value = str(value_c.decode('utf-8'))
 *         campl.AMPL_StringFree(&value_c)             # <<<<<<<<<<<<<<
 * 
 *         if value == 'minimize':
 */
  (void)(AMPL_StringFree((&__pyx_v_value_c)));

  /* "amplpy/objective.pxi":151
 *         campl.AMPL_StringFree(&value_c)
 * 
 *         if value == 'minimize':             # <<<<<<<<<<<<<<
 *             return True
 *         else:
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_value, __pyx_n_u_minimize, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(12, 151, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "amplpy/objective.pxi":152
 * 
 *         if value == 'minimize':
 *             return True             # <<<<<<<<<<<<<<
 *         else:
 *             return False
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_True);
    __pyx_r = Py_True;
    goto __pyx_L0;

    /* "amplpy/objective.pxi":151
 *         campl.AMPL_StringFree(&value_c)
 * 
 *         if value == 'minimize':             # <<<<<<<<<<<<<<
 *             return True
 *         else:
 */
  }

  /* "amplpy/objective.pxi":154
 *             return True
 *         else:
 *             return False             # <<<<<<<<<<<<<<
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    goto __pyx_L0;
  }

  /* "amplpy/objective.pxi":135
 *         PY_AMPL_CALL(campl.AMPL_EntityRestore(self._c_ampl, self._name))
 * 
 *     def minimization(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the sense of this objective. Returns True if minimize,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("_amplpy.Objective.minimization", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._c_ampl,self._index cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_9Objective_19__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_9Objective_18__reduce_cython__, "Objective.__reduce_cython__(self)");
static PyMethodDef __pyx_mdef_7_amplpy_9Objective_19__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_9Objective_19__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_9Objective_18__reduce_cython__};
static PyObject *__pyx_pw_7_amplpy_9Objective_19__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_9Objective_18__reduce_cython__(((struct __pyx_obj_7_amplpy_Objective *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_9Objective_18__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7_amplpy_Objective *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 1);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "self._c_ampl,self._index cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self._c_ampl,self._index cannot be converted to a Python object for pickling"
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_self__c_ampl_self__index_cannot, 0, 0);
  __PYX_ERR(8, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._c_ampl,self._index cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 */

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

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._c_ampl,self._index cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._c_ampl,self._index cannot be converted to a Python object for pickling"
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_9Objective_21__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_9Objective_20__setstate_cython__, "Objective.__setstate_cython__(self, __pyx_state)");
static PyMethodDef __pyx_mdef_7_amplpy_9Objective_21__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_9Objective_21__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_9Objective_20__setstate_cython__};
static PyObject *__pyx_pw_7_amplpy_9Objective_21__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 3, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(8, 3, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(8, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.Objective.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_9Objective_20__setstate_cython__(((struct __pyx_obj_7_amplpy_Objective *)__pyx_v_self), __pyx_v___pyx_state);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_9Objective_20__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7_amplpy_Objective *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 1);

  /* "(tree fragment)":4
 *     raise TypeError, "self._c_ampl,self._index cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self._c_ampl,self._index cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_self__c_ampl_self__index_cannot, 0, 0);
  __PYX_ERR(8, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._c_ampl,self._index cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._c_ampl,self._index cannot be converted to a Python object for pickling"
 */

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

/* "amplpy/outputhandler.pxi":20
 *     """
 * 
 *     def output(self, kind, msg):             # <<<<<<<<<<<<<<
 *         """
 *         This method is called when AMPL sends some output derived from
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_13OutputHandler_1output(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_13OutputHandler_output, "OutputHandler.output(self, kind, msg)\n\n        This method is called when AMPL sends some output derived from\n        executing a statement.\n\n        Args:\n           kind: kind of the output of the AMPL interpreter.\n\n           msg: text of the output by the AMPL interpreter.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_13OutputHandler_1output = {"output", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_13OutputHandler_1output, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_13OutputHandler_output};
static PyObject *__pyx_pw_7_amplpy_13OutputHandler_1output(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v_kind = 0;
  PyObject *__pyx_v_msg = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("output (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_kind,&__pyx_n_s_msg,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_kind)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 20, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_msg)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 20, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("output", 1, 2, 2, 1); __PYX_ERR(2, 20, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "output") < 0)) __PYX_ERR(2, 20, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_kind = values[0];
    __pyx_v_msg = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("output", 1, 2, 2, __pyx_nargs); __PYX_ERR(2, 20, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.OutputHandler.output", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_13OutputHandler_output(((struct __pyx_obj_7_amplpy_OutputHandler *)__pyx_v_self), __pyx_v_kind, __pyx_v_msg);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_13OutputHandler_output(CYTHON_UNUSED struct __pyx_obj_7_amplpy_OutputHandler *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_kind, PyObject *__pyx_v_msg) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("output", 1);

  /* "amplpy/outputhandler.pxi":30
 *            msg: text of the output by the AMPL interpreter.
 *         """
 *         print(msg, end="", flush=True)             # <<<<<<<<<<<<<<
 * 
 * cdef void PyOutput(campl.AMPL_OUTPUTKIND kind, const char* msg, void* usrdata) except * with gil:
 */
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_msg);
  __Pyx_GIVEREF(__pyx_v_msg);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_msg)) __PYX_ERR(2, 30, __pyx_L1_error);
  __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_end, __pyx_kp_u__22) < 0) __PYX_ERR(2, 30, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_flush, Py_True) < 0) __PYX_ERR(2, 30, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 30, __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;

  /* "amplpy/outputhandler.pxi":20
 *     """
 * 
 *     def output(self, kind, msg):             # <<<<<<<<<<<<<<
 *         """
 *         This method is called when AMPL sends some output derived from
 */

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

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_13OutputHandler_3__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_13OutputHandler_2__reduce_cython__, "OutputHandler.__reduce_cython__(self)");
static PyMethodDef __pyx_mdef_7_amplpy_13OutputHandler_3__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_13OutputHandler_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_13OutputHandler_2__reduce_cython__};
static PyObject *__pyx_pw_7_amplpy_13OutputHandler_3__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_13OutputHandler_2__reduce_cython__(((struct __pyx_obj_7_amplpy_OutputHandler *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_13OutputHandler_2__reduce_cython__(struct __pyx_obj_7_amplpy_OutputHandler *__pyx_v_self) {
  PyObject *__pyx_v_state = 0;
  PyObject *__pyx_v__dict = 0;
  int __pyx_v_use_setstate;
  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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 1);

  /* "(tree fragment)":5
 *     cdef object _dict
 *     cdef bint use_setstate
 *     state = ()             # <<<<<<<<<<<<<<
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 */
  __Pyx_INCREF(__pyx_empty_tuple);
  __pyx_v_state = __pyx_empty_tuple;

  /* "(tree fragment)":6
 *     cdef bint use_setstate
 *     state = ()
 *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
 *     if _dict is not None:
 *         state += (_dict,)
 */
  __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v__dict = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "(tree fragment)":7
 *     state = ()
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
 */
  __pyx_t_2 = (__pyx_v__dict != Py_None);
  if (__pyx_t_2) {

    /* "(tree fragment)":8
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 *         state += (_dict,)             # <<<<<<<<<<<<<<
 *         use_setstate = True
 *     else:
 */
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v__dict);
    __Pyx_GIVEREF(__pyx_v__dict);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict)) __PYX_ERR(8, 8, __pyx_L1_error);
    __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "(tree fragment)":9
 *     if _dict is not None:
 *         state += (_dict,)
 *         use_setstate = True             # <<<<<<<<<<<<<<
 *     else:
 *         use_setstate = False
 */
    __pyx_v_use_setstate = 1;

    /* "(tree fragment)":7
 *     state = ()
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
 */
    goto __pyx_L3;
  }

  /* "(tree fragment)":11
 *         use_setstate = True
 *     else:
 *         use_setstate = False             # <<<<<<<<<<<<<<
 *     if use_setstate:
 *         return __pyx_unpickle_OutputHandler, (type(self), 0xe3b0c44, None), state
 */
  /*else*/ {
    __pyx_v_use_setstate = 0;
  }
  __pyx_L3:;

  /* "(tree fragment)":12
 *     else:
 *         use_setstate = False
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_OutputHandler, (type(self), 0xe3b0c44, None), state
 *     else:
 */
  if (__pyx_v_use_setstate) {

    /* "(tree fragment)":13
 *         use_setstate = False
 *     if use_setstate:
 *         return __pyx_unpickle_OutputHandler, (type(self), 0xe3b0c44, None), state             # <<<<<<<<<<<<<<
 *     else:
 *         return __pyx_unpickle_OutputHandler, (type(self), 0xe3b0c44, state)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pyx_unpickle_OutputHandler); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))))) __PYX_ERR(8, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_int_238750788);
    __Pyx_GIVEREF(__pyx_int_238750788);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_238750788)) __PYX_ERR(8, 13, __pyx_L1_error);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None)) __PYX_ERR(8, 13, __pyx_L1_error);
    __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_3);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3)) __PYX_ERR(8, 13, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1)) __PYX_ERR(8, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_state)) __PYX_ERR(8, 13, __pyx_L1_error);
    __pyx_t_3 = 0;
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "(tree fragment)":12
 *     else:
 *         use_setstate = False
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_OutputHandler, (type(self), 0xe3b0c44, None), state
 *     else:
 */
  }

  /* "(tree fragment)":15
 *         return __pyx_unpickle_OutputHandler, (type(self), 0xe3b0c44, None), state
 *     else:
 *         return __pyx_unpickle_OutputHandler, (type(self), 0xe3b0c44, state)             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_OutputHandler__set_state(self, __pyx_state)
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_OutputHandler); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))))) __PYX_ERR(8, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_int_238750788);
    __Pyx_GIVEREF(__pyx_int_238750788);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_238750788)) __PYX_ERR(8, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state)) __PYX_ERR(8, 15, __pyx_L1_error);
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_4);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4)) __PYX_ERR(8, 15, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1)) __PYX_ERR(8, 15, __pyx_L1_error);
    __pyx_t_4 = 0;
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
  }

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("_amplpy.OutputHandler.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_state);
  __Pyx_XDECREF(__pyx_v__dict);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_OutputHandler, (type(self), 0xe3b0c44, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_OutputHandler__set_state(self, __pyx_state)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_13OutputHandler_5__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_13OutputHandler_4__setstate_cython__, "OutputHandler.__setstate_cython__(self, __pyx_state)");
static PyMethodDef __pyx_mdef_7_amplpy_13OutputHandler_5__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_13OutputHandler_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_13OutputHandler_4__setstate_cython__};
static PyObject *__pyx_pw_7_amplpy_13OutputHandler_5__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 16, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(8, 16, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(8, 16, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.OutputHandler.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_13OutputHandler_4__setstate_cython__(((struct __pyx_obj_7_amplpy_OutputHandler *)__pyx_v_self), __pyx_v___pyx_state);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_13OutputHandler_4__setstate_cython__(struct __pyx_obj_7_amplpy_OutputHandler *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 1);

  /* "(tree fragment)":17
 *         return __pyx_unpickle_OutputHandler, (type(self), 0xe3b0c44, state)
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_OutputHandler__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
 */
  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(8, 17, __pyx_L1_error)
  __pyx_t_1 = __pyx_f_7_amplpy___pyx_unpickle_OutputHandler__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_OutputHandler, (type(self), 0xe3b0c44, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_OutputHandler__set_state(self, __pyx_state)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("_amplpy.OutputHandler.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/outputhandler.pxi":32
 *         print(msg, end="", flush=True)
 * 
 * cdef void PyOutput(campl.AMPL_OUTPUTKIND kind, const char* msg, void* usrdata) except * with gil:             # <<<<<<<<<<<<<<
 *     PyOutputHandler = <OutputHandler>usrdata
 *     PyOutputHandler.output(kind, msg.decode('utf-8'))
 */

static void __pyx_f_7_amplpy_PyOutput(AMPL_OUTPUTKIND __pyx_v_kind, char const *__pyx_v_msg, void *__pyx_v_usrdata) {
  struct __pyx_obj_7_amplpy_OutputHandler *__pyx_v_PyOutputHandler = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  unsigned int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("PyOutput", 0);

  /* "amplpy/outputhandler.pxi":33
 * 
 * cdef void PyOutput(campl.AMPL_OUTPUTKIND kind, const char* msg, void* usrdata) except * with gil:
 *     PyOutputHandler = <OutputHandler>usrdata             # <<<<<<<<<<<<<<
 *     PyOutputHandler.output(kind, msg.decode('utf-8'))
 * 
 */
  __pyx_t_1 = ((PyObject *)__pyx_v_usrdata);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_PyOutputHandler = ((struct __pyx_obj_7_amplpy_OutputHandler *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "amplpy/outputhandler.pxi":34
 * cdef void PyOutput(campl.AMPL_OUTPUTKIND kind, const char* msg, void* usrdata) except * with gil:
 *     PyOutputHandler = <OutputHandler>usrdata
 *     PyOutputHandler.output(kind, msg.decode('utf-8'))             # <<<<<<<<<<<<<<
 * 
 * class Kind(object):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_PyOutputHandler), __pyx_n_s_output); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_From_AMPL_OUTPUTKIND(__pyx_v_kind); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_ssize_strlen(__pyx_v_msg); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(2, 34, __pyx_L1_error)
  __pyx_t_5 = __Pyx_decode_c_string(__pyx_v_msg, 0, __pyx_t_4, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = NULL;
  __pyx_t_7 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_7 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_t_3, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 34, __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;

  /* "amplpy/outputhandler.pxi":32
 *         print(msg, end="", flush=True)
 * 
 * cdef void PyOutput(campl.AMPL_OUTPUTKIND kind, const char* msg, void* usrdata) except * with gil:             # <<<<<<<<<<<<<<
 *     PyOutputHandler = <OutputHandler>usrdata
 *     PyOutputHandler.output(kind, msg.decode('utf-8'))
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("_amplpy.PyOutput", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_PyOutputHandler);
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
}

/* "amplpy/parameter.pxi":32
 *     """
 *     @staticmethod
 *     cdef create(campl.AMPL* ampl_c, char* name, campl.AMPL_TUPLE* index, parent):             # <<<<<<<<<<<<<<
 *         entity = Parameter()
 *         entity._c_ampl = ampl_c
 */

static PyObject *__pyx_f_7_amplpy_9Parameter_create(AMPL *__pyx_v_ampl_c, char *__pyx_v_name, AMPL_TUPLE *__pyx_v_index, PyObject *__pyx_v_parent) {
  struct __pyx_obj_7_amplpy_Parameter *__pyx_v_entity = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("create", 1);

  /* "amplpy/parameter.pxi":33
 *     @staticmethod
 *     cdef create(campl.AMPL* ampl_c, char* name, campl.AMPL_TUPLE* index, parent):
 *         entity = Parameter()             # <<<<<<<<<<<<<<
 *         entity._c_ampl = ampl_c
 *         entity._name = name
 */
  __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_7_amplpy_Parameter)); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 33, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_entity = ((struct __pyx_obj_7_amplpy_Parameter *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "amplpy/parameter.pxi":34
 *     cdef create(campl.AMPL* ampl_c, char* name, campl.AMPL_TUPLE* index, parent):
 *         entity = Parameter()
 *         entity._c_ampl = ampl_c             # <<<<<<<<<<<<<<
 *         entity._name = name
 *         entity._index = index
 */
  __pyx_v_entity->__pyx_base._c_ampl = __pyx_v_ampl_c;

  /* "amplpy/parameter.pxi":35
 *         entity = Parameter()
 *         entity._c_ampl = ampl_c
 *         entity._name = name             # <<<<<<<<<<<<<<
 *         entity._index = index
 *         entity.wrap_function = campl.AMPL_PARAMETER
 */
  __pyx_v_entity->__pyx_base._name = __pyx_v_name;

  /* "amplpy/parameter.pxi":36
 *         entity._c_ampl = ampl_c
 *         entity._name = name
 *         entity._index = index             # <<<<<<<<<<<<<<
 *         entity.wrap_function = campl.AMPL_PARAMETER
 *         entity._entity = parent
 */
  __pyx_v_entity->__pyx_base._index = __pyx_v_index;

  /* "amplpy/parameter.pxi":37
 *         entity._name = name
 *         entity._index = index
 *         entity.wrap_function = campl.AMPL_PARAMETER             # <<<<<<<<<<<<<<
 *         entity._entity = parent
 *         if entity._entity is not None:
 */
  __pyx_v_entity->__pyx_base.wrap_function = AMPL_PARAMETER;

  /* "amplpy/parameter.pxi":38
 *         entity._index = index
 *         entity.wrap_function = campl.AMPL_PARAMETER
 *         entity._entity = parent             # <<<<<<<<<<<<<<
 *         if entity._entity is not None:
 *             Py_INCREF(entity._entity)
 */
  __Pyx_INCREF(__pyx_v_parent);
  __Pyx_GIVEREF(__pyx_v_parent);
  __Pyx_GOTREF(__pyx_v_entity->__pyx_base._entity);
  __Pyx_DECREF(__pyx_v_entity->__pyx_base._entity);
  __pyx_v_entity->__pyx_base._entity = __pyx_v_parent;

  /* "amplpy/parameter.pxi":39
 *         entity.wrap_function = campl.AMPL_PARAMETER
 *         entity._entity = parent
 *         if entity._entity is not None:             # <<<<<<<<<<<<<<
 *             Py_INCREF(entity._entity)
 *         return entity
 */
  __pyx_t_2 = (__pyx_v_entity->__pyx_base._entity != Py_None);
  if (__pyx_t_2) {

    /* "amplpy/parameter.pxi":40
 *         entity._entity = parent
 *         if entity._entity is not None:
 *             Py_INCREF(entity._entity)             # <<<<<<<<<<<<<<
 *         return entity
 * 
 */
    __pyx_t_1 = __pyx_v_entity->__pyx_base._entity;
    __Pyx_INCREF(__pyx_t_1);
    Py_INCREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "amplpy/parameter.pxi":39
 *         entity.wrap_function = campl.AMPL_PARAMETER
 *         entity._entity = parent
 *         if entity._entity is not None:             # <<<<<<<<<<<<<<
 *             Py_INCREF(entity._entity)
 *         return entity
 */
  }

  /* "amplpy/parameter.pxi":41
 *         if entity._entity is not None:
 *             Py_INCREF(entity._entity)
 *         return entity             # <<<<<<<<<<<<<<
 * 
 *     def __setitem__(self, index, value):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_entity);
  __pyx_r = ((PyObject *)__pyx_v_entity);
  goto __pyx_L0;

  /* "amplpy/parameter.pxi":32
 *     """
 *     @staticmethod
 *     cdef create(campl.AMPL* ampl_c, char* name, campl.AMPL_TUPLE* index, parent):             # <<<<<<<<<<<<<<
 *         entity = Parameter()
 *         entity._c_ampl = ampl_c
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("_amplpy.Parameter.create", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_entity);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/parameter.pxi":43
 *         return entity
 * 
 *     def __setitem__(self, index, value):             # <<<<<<<<<<<<<<
 *         self.set(index, value)
 * 
 */

/* Python wrapper */
static int __pyx_pw_7_amplpy_9Parameter_1__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_7_amplpy_9Parameter_1__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7_amplpy_9Parameter___setitem__(((struct __pyx_obj_7_amplpy_Parameter *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_7_amplpy_9Parameter___setitem__(struct __pyx_obj_7_amplpy_Parameter *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setitem__", 1);

  /* "amplpy/parameter.pxi":44
 * 
 *     def __setitem__(self, index, value):
 *         self.set(index, value)             # <<<<<<<<<<<<<<
 * 
 *     def is_symbolic(self):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 44, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_index, __pyx_v_value};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 44, __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;

  /* "amplpy/parameter.pxi":43
 *         return entity
 * 
 *     def __setitem__(self, index, value):             # <<<<<<<<<<<<<<
 *         self.set(index, value)
 * 
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("_amplpy.Parameter.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/parameter.pxi":46
 *         self.set(index, value)
 * 
 *     def is_symbolic(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns True if the parameter is declared as symbolic (can store both
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_9Parameter_3is_symbolic(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_9Parameter_2is_symbolic, "Parameter.is_symbolic(self)\n\n        Returns True if the parameter is declared as symbolic (can store both\n        numerical and string values).\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_9Parameter_3is_symbolic = {"is_symbolic", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_9Parameter_3is_symbolic, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_9Parameter_2is_symbolic};
static PyObject *__pyx_pw_7_amplpy_9Parameter_3is_symbolic(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_symbolic (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("is_symbolic", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "is_symbolic", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_9Parameter_2is_symbolic(((struct __pyx_obj_7_amplpy_Parameter *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_9Parameter_2is_symbolic(struct __pyx_obj_7_amplpy_Parameter *__pyx_v_self) {
  bool __pyx_v_value;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("is_symbolic", 1);

  /* "amplpy/parameter.pxi":52
 *         """
 *         cdef bool_c value
 *         campl.AMPL_ParameterIsSymbolic(self._c_ampl, self._name, &value)             # <<<<<<<<<<<<<<
 *         return value
 * 
 */
  (void)(AMPL_ParameterIsSymbolic(__pyx_v_self->__pyx_base._c_ampl, __pyx_v_self->__pyx_base._name, (&__pyx_v_value)));

  /* "amplpy/parameter.pxi":53
 *         cdef bool_c value
 *         campl.AMPL_ParameterIsSymbolic(self._c_ampl, self._name, &value)
 *         return value             # <<<<<<<<<<<<<<
 * 
 *     def has_default(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 53, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "amplpy/parameter.pxi":46
 *         self.set(index, value)
 * 
 *     def is_symbolic(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns True if the parameter is declared as symbolic (can store both
 */

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

/* "amplpy/parameter.pxi":55
 *         return value
 * 
 *     def has_default(self):             # <<<<<<<<<<<<<<
 *         """
 *         Check if the parameter has a default initial value. In case of the
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_9Parameter_5has_default(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_9Parameter_4has_default, "Parameter.has_default(self)\n\n        Check if the parameter has a default initial value. In case of the\n        following AMPL code:\n\n        .. code-block:: ampl\n\n            param a;\n            param b default a;\n\n        the function will return true for parameter ``b``.\n\n        Returns:\n            True if the parameter has a default initial value. Please note\n            that if the parameter has a default expression which refers to\n            another parameter which value is not defined, this will return\n            True.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_9Parameter_5has_default = {"has_default", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_9Parameter_5has_default, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_9Parameter_4has_default};
static PyObject *__pyx_pw_7_amplpy_9Parameter_5has_default(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("has_default (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("has_default", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "has_default", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_9Parameter_4has_default(((struct __pyx_obj_7_amplpy_Parameter *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_9Parameter_4has_default(struct __pyx_obj_7_amplpy_Parameter *__pyx_v_self) {
  bool __pyx_v_value;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("has_default", 1);

  /* "amplpy/parameter.pxi":74
 *         """
 *         cdef bool_c value
 *         campl.AMPL_ParameterHasDefault(self._c_ampl, self._name, &value)             # <<<<<<<<<<<<<<
 *         return value
 * 
 */
  (void)(AMPL_ParameterHasDefault(__pyx_v_self->__pyx_base._c_ampl, __pyx_v_self->__pyx_base._name, (&__pyx_v_value)));

  /* "amplpy/parameter.pxi":75
 *         cdef bool_c value
 *         campl.AMPL_ParameterHasDefault(self._c_ampl, self._name, &value)
 *         return value             # <<<<<<<<<<<<<<
 * 
 *     def __getitem__(self, index):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 75, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "amplpy/parameter.pxi":55
 *         return value
 * 
 *     def has_default(self):             # <<<<<<<<<<<<<<
 *         """
 *         Check if the parameter has a default initial value. In case of the
 */

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

/* "amplpy/parameter.pxi":77
 *         return value
 * 
 *     def __getitem__(self, index):             # <<<<<<<<<<<<<<
 *         if not isinstance(index, (tuple, list)):
 *             index = [index]
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_9Parameter_7__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/
static PyObject *__pyx_pw_7_amplpy_9Parameter_7__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7_amplpy_9Parameter_6__getitem__(((struct __pyx_obj_7_amplpy_Parameter *)__pyx_v_self), ((PyObject *)__pyx_v_index));

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

static PyObject *__pyx_pf_7_amplpy_9Parameter_6__getitem__(struct __pyx_obj_7_amplpy_Parameter *__pyx_v_self, PyObject *__pyx_v_index) {
  AMPL_TUPLE *__pyx_v_tuple_c;
  char *__pyx_v_expression;
  AMPL_VARIANT *__pyx_v_v;
  PyObject *__pyx_v_py_variant = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  AMPL_TUPLE *__pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getitem__", 0);
  __Pyx_INCREF(__pyx_v_index);

  /* "amplpy/parameter.pxi":78
 * 
 *     def __getitem__(self, index):
 *         if not isinstance(index, (tuple, list)):             # <<<<<<<<<<<<<<
 *             index = [index]
 *         cdef campl.AMPL_TUPLE* tuple_c =  to_c_tuple(index)
 */
  __pyx_t_2 = PyTuple_Check(__pyx_v_index); 
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = PyList_Check(__pyx_v_index); 
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  __pyx_t_2 = (!__pyx_t_1);
  if (__pyx_t_2) {

    /* "amplpy/parameter.pxi":79
 *     def __getitem__(self, index):
 *         if not isinstance(index, (tuple, list)):
 *             index = [index]             # <<<<<<<<<<<<<<
 *         cdef campl.AMPL_TUPLE* tuple_c =  to_c_tuple(index)
 *         cdef char* expression
 */
    __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 79, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_index);
    __Pyx_GIVEREF(__pyx_v_index);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_v_index)) __PYX_ERR(13, 79, __pyx_L1_error);
    __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "amplpy/parameter.pxi":78
 * 
 *     def __getitem__(self, index):
 *         if not isinstance(index, (tuple, list)):             # <<<<<<<<<<<<<<
 *             index = [index]
 *         cdef campl.AMPL_TUPLE* tuple_c =  to_c_tuple(index)
 */
  }

  /* "amplpy/parameter.pxi":80
 *         if not isinstance(index, (tuple, list)):
 *             index = [index]
 *         cdef campl.AMPL_TUPLE* tuple_c =  to_c_tuple(index)             # <<<<<<<<<<<<<<
 *         cdef char* expression
 *         cdef campl.AMPL_VARIANT* v
 */
  __pyx_t_4 = __pyx_f_7_amplpy_to_c_tuple(__pyx_v_index); if (unlikely(__pyx_t_4 == ((AMPL_TUPLE *)NULL) && PyErr_Occurred())) __PYX_ERR(13, 80, __pyx_L1_error)
  __pyx_v_tuple_c = __pyx_t_4;

  /* "amplpy/parameter.pxi":83
 *         cdef char* expression
 *         cdef campl.AMPL_VARIANT* v
 *         campl.AMPL_InstanceGetName(self._c_ampl, self._name, tuple_c, &expression)             # <<<<<<<<<<<<<<
 *         campl.AMPL_TupleFree(&tuple_c)
 *         campl.AMPL_GetValue(self._c_ampl, expression, &v)
 */
  (void)(AMPL_InstanceGetName(__pyx_v_self->__pyx_base._c_ampl, __pyx_v_self->__pyx_base._name, __pyx_v_tuple_c, (&__pyx_v_expression)));

  /* "amplpy/parameter.pxi":84
 *         cdef campl.AMPL_VARIANT* v
 *         campl.AMPL_InstanceGetName(self._c_ampl, self._name, tuple_c, &expression)
 *         campl.AMPL_TupleFree(&tuple_c)             # <<<<<<<<<<<<<<
 *         campl.AMPL_GetValue(self._c_ampl, expression, &v)
 *         campl.AMPL_StringFree(&expression)
 */
  (void)(AMPL_TupleFree((&__pyx_v_tuple_c)));

  /* "amplpy/parameter.pxi":85
 *         campl.AMPL_InstanceGetName(self._c_ampl, self._name, tuple_c, &expression)
 *         campl.AMPL_TupleFree(&tuple_c)
 *         campl.AMPL_GetValue(self._c_ampl, expression, &v)             # <<<<<<<<<<<<<<
 *         campl.AMPL_StringFree(&expression)
 *         py_variant = to_py_variant(v)
 */
  (void)(AMPL_GetValue(__pyx_v_self->__pyx_base._c_ampl, __pyx_v_expression, (&__pyx_v_v)));

  /* "amplpy/parameter.pxi":86
 *         campl.AMPL_TupleFree(&tuple_c)
 *         campl.AMPL_GetValue(self._c_ampl, expression, &v)
 *         campl.AMPL_StringFree(&expression)             # <<<<<<<<<<<<<<
 *         py_variant = to_py_variant(v)
 *         campl.AMPL_VariantFree(&v)
 */
  (void)(AMPL_StringFree((&__pyx_v_expression)));

  /* "amplpy/parameter.pxi":87
 *         campl.AMPL_GetValue(self._c_ampl, expression, &v)
 *         campl.AMPL_StringFree(&expression)
 *         py_variant = to_py_variant(v)             # <<<<<<<<<<<<<<
 *         campl.AMPL_VariantFree(&v)
 *         return py_variant
 */
  __pyx_t_3 = __pyx_f_7_amplpy_to_py_variant(__pyx_v_v); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 87, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_py_variant = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "amplpy/parameter.pxi":88
 *         campl.AMPL_StringFree(&expression)
 *         py_variant = to_py_variant(v)
 *         campl.AMPL_VariantFree(&v)             # <<<<<<<<<<<<<<
 *         return py_variant
 * 
 */
  (void)(AMPL_VariantFree((&__pyx_v_v)));

  /* "amplpy/parameter.pxi":89
 *         py_variant = to_py_variant(v)
 *         campl.AMPL_VariantFree(&v)
 *         return py_variant             # <<<<<<<<<<<<<<
 * 
 *     def value(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_py_variant);
  __pyx_r = __pyx_v_py_variant;
  goto __pyx_L0;

  /* "amplpy/parameter.pxi":77
 *         return value
 * 
 *     def __getitem__(self, index):             # <<<<<<<<<<<<<<
 *         if not isinstance(index, (tuple, list)):
 *             index = [index]
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("_amplpy.Parameter.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_py_variant);
  __Pyx_XDECREF(__pyx_v_index);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/parameter.pxi":91
 *         return py_variant
 * 
 *     def value(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the value of this parameter. Valid only for non-indexed parameters.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_9Parameter_9value(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_9Parameter_8value, "Parameter.value(self)\n\n        Get the value of this parameter. Valid only for non-indexed parameters.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_9Parameter_9value = {"value", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_9Parameter_9value, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_9Parameter_8value};
static PyObject *__pyx_pw_7_amplpy_9Parameter_9value(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("value (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("value", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "value", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_9Parameter_8value(((struct __pyx_obj_7_amplpy_Parameter *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_9Parameter_8value(struct __pyx_obj_7_amplpy_Parameter *__pyx_v_self) {
  AMPL_VARIANT *__pyx_v_v;
  PyObject *__pyx_v_py_variant = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("value", 1);

  /* "amplpy/parameter.pxi":96
 *         """
 *         cdef campl.AMPL_VARIANT* v
 *         campl.AMPL_GetValue(self._c_ampl, self._name, &v)             # <<<<<<<<<<<<<<
 *         py_variant = to_py_variant(v)
 *         campl.AMPL_VariantFree(&v)
 */
  (void)(AMPL_GetValue(__pyx_v_self->__pyx_base._c_ampl, __pyx_v_self->__pyx_base._name, (&__pyx_v_v)));

  /* "amplpy/parameter.pxi":97
 *         cdef campl.AMPL_VARIANT* v
 *         campl.AMPL_GetValue(self._c_ampl, self._name, &v)
 *         py_variant = to_py_variant(v)             # <<<<<<<<<<<<<<
 *         campl.AMPL_VariantFree(&v)
 *         return py_variant
 */
  __pyx_t_1 = __pyx_f_7_amplpy_to_py_variant(__pyx_v_v); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 97, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_py_variant = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "amplpy/parameter.pxi":98
 *         campl.AMPL_GetValue(self._c_ampl, self._name, &v)
 *         py_variant = to_py_variant(v)
 *         campl.AMPL_VariantFree(&v)             # <<<<<<<<<<<<<<
 *         return py_variant
 * 
 */
  (void)(AMPL_VariantFree((&__pyx_v_v)));

  /* "amplpy/parameter.pxi":99
 *         py_variant = to_py_variant(v)
 *         campl.AMPL_VariantFree(&v)
 *         return py_variant             # <<<<<<<<<<<<<<
 * 
 *     def set(self, *args):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_py_variant);
  __pyx_r = __pyx_v_py_variant;
  goto __pyx_L0;

  /* "amplpy/parameter.pxi":91
 *         return py_variant
 * 
 *     def value(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the value of this parameter. Valid only for non-indexed parameters.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("_amplpy.Parameter.value", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_py_variant);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/parameter.pxi":101
 *         return py_variant
 * 
 *     def set(self, *args):             # <<<<<<<<<<<<<<
 *         """
 *         Set the value of a single instance of this parameter.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_9Parameter_11set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_9Parameter_10set, "Parameter.set(self, *args)\n\n        Set the value of a single instance of this parameter.\n\n        Args:\n            args: value if the parameter is scalar, index and value\n            otherwise.\n\n        Raises:\n            RuntimeError: If the entity has been deleted in the underlying\n            AMPL.\n\n            TypeError: If the parameter is not scalar and the index is not\n            provided.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_9Parameter_11set = {"set", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7_amplpy_9Parameter_11set, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7_amplpy_9Parameter_10set};
static PyObject *__pyx_pw_7_amplpy_9Parameter_11set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_args = 0;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "set", 0))) return NULL;
  __Pyx_INCREF(__pyx_args);
  __pyx_v_args = __pyx_args;
  __pyx_r = __pyx_pf_7_amplpy_9Parameter_10set(((struct __pyx_obj_7_amplpy_Parameter *)__pyx_v_self), __pyx_v_args);

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

static PyObject *__pyx_pf_7_amplpy_9Parameter_10set(struct __pyx_obj_7_amplpy_Parameter *__pyx_v_self, PyObject *__pyx_v_args) {
  AMPL_TUPLE *__pyx_v_index_c;
  PyObject *__pyx_v_value = NULL;
  PyObject *__pyx_v_index = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  double __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  unsigned int __pyx_t_8;
  char const *__pyx_t_9;
  AMPL_TUPLE *__pyx_t_10;
  char const *__pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set", 1);

  /* "amplpy/parameter.pxi":116
 *             provided.
 *         """
 *         assert len(args) in (1, 2)             # <<<<<<<<<<<<<<
 *         cdef campl.AMPL_TUPLE* index_c
 *         if len(args) == 1:
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = __Pyx_PyTuple_GET_SIZE(__pyx_v_args); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(13, 116, __pyx_L1_error)
    __pyx_t_3 = (__pyx_t_1 == 1);
    if (!__pyx_t_3) {
    } else {
      __pyx_t_2 = __pyx_t_3;
      goto __pyx_L3_bool_binop_done;
    }
    __pyx_t_3 = (__pyx_t_1 == 2);
    __pyx_t_2 = __pyx_t_3;
    __pyx_L3_bool_binop_done:;
    __pyx_t_3 = __pyx_t_2;
    if (unlikely(!__pyx_t_3)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(13, 116, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(13, 116, __pyx_L1_error)
  #endif

  /* "amplpy/parameter.pxi":118
 *         assert len(args) in (1, 2)
 *         cdef campl.AMPL_TUPLE* index_c
 *         if len(args) == 1:             # <<<<<<<<<<<<<<
 *             value = args[0]
 * 
 */
  __pyx_t_1 = __Pyx_PyTuple_GET_SIZE(__pyx_v_args); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(13, 118, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_1 == 1);
  if (__pyx_t_3) {

    /* "amplpy/parameter.pxi":119
 *         cdef campl.AMPL_TUPLE* index_c
 *         if len(args) == 1:
 *             value = args[0]             # <<<<<<<<<<<<<<
 * 
 *             if isinstance(value, Real):
 */
    __pyx_t_4 = PyTuple_GET_ITEM(__pyx_v_args, 0);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_v_value = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "amplpy/parameter.pxi":121
 *             value = args[0]
 * 
 *             if isinstance(value, Real):             # <<<<<<<<<<<<<<
 *                 campl.AMPL_ParameterSetNumeric(self._c_ampl, self._name, float(value))
 *             elif isinstance(value, str):
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Real); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 121, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = PyObject_IsInstance(__pyx_v_value, __pyx_t_4); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(13, 121, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_3) {

      /* "amplpy/parameter.pxi":122
 * 
 *             if isinstance(value, Real):
 *                 campl.AMPL_ParameterSetNumeric(self._c_ampl, self._name, float(value))             # <<<<<<<<<<<<<<
 *             elif isinstance(value, str):
 *                 campl.AMPL_ParameterSetString(self._c_ampl, self._name, value.encode('utf-8'))
 */
      __pyx_t_5 = __Pyx_PyObject_AsDouble(__pyx_v_value); if (unlikely(__pyx_t_5 == ((double)((double)-1)) && PyErr_Occurred())) __PYX_ERR(13, 122, __pyx_L1_error)
      (void)(AMPL_ParameterSetNumeric(__pyx_v_self->__pyx_base._c_ampl, __pyx_v_self->__pyx_base._name, __pyx_t_5));

      /* "amplpy/parameter.pxi":121
 *             value = args[0]
 * 
 *             if isinstance(value, Real):             # <<<<<<<<<<<<<<
 *                 campl.AMPL_ParameterSetNumeric(self._c_ampl, self._name, float(value))
 *             elif isinstance(value, str):
 */
      goto __pyx_L6;
    }

    /* "amplpy/parameter.pxi":123
 *             if isinstance(value, Real):
 *                 campl.AMPL_ParameterSetNumeric(self._c_ampl, self._name, float(value))
 *             elif isinstance(value, str):             # <<<<<<<<<<<<<<
 *                 campl.AMPL_ParameterSetString(self._c_ampl, self._name, value.encode('utf-8'))
 *             else:
 */
    __pyx_t_3 = PyUnicode_Check(__pyx_v_value); 
    if (likely(__pyx_t_3)) {

      /* "amplpy/parameter.pxi":124
 *                 campl.AMPL_ParameterSetNumeric(self._c_ampl, self._name, float(value))
 *             elif isinstance(value, str):
 *                 campl.AMPL_ParameterSetString(self._c_ampl, self._name, value.encode('utf-8'))             # <<<<<<<<<<<<<<
 *             else:
 *                 raise TypeError
 */
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_n_s_encode); if (unlikely(!__pyx_t_6)) __PYX_ERR(13, 124, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = NULL;
      __pyx_t_8 = 0;
      #if CYTHON_UNPACK_METHODS
      if (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);
          __pyx_t_8 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_kp_u_utf_8};
        __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 124, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __pyx_t_9 = __Pyx_PyObject_AsString(__pyx_t_4); if (unlikely((!__pyx_t_9) && PyErr_Occurred())) __PYX_ERR(13, 124, __pyx_L1_error)
      (void)(AMPL_ParameterSetString(__pyx_v_self->__pyx_base._c_ampl, __pyx_v_self->__pyx_base._name, __pyx_t_9));
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "amplpy/parameter.pxi":123
 *             if isinstance(value, Real):
 *                 campl.AMPL_ParameterSetNumeric(self._c_ampl, self._name, float(value))
 *             elif isinstance(value, str):             # <<<<<<<<<<<<<<
 *                 campl.AMPL_ParameterSetString(self._c_ampl, self._name, value.encode('utf-8'))
 *             else:
 */
      goto __pyx_L6;
    }

    /* "amplpy/parameter.pxi":126
 *                 campl.AMPL_ParameterSetString(self._c_ampl, self._name, value.encode('utf-8'))
 *             else:
 *                 raise TypeError             # <<<<<<<<<<<<<<
 *         else:
 *             index, value = args
 */
    /*else*/ {
      __Pyx_Raise(__pyx_builtin_TypeError, 0, 0, 0);
      __PYX_ERR(13, 126, __pyx_L1_error)
    }
    __pyx_L6:;

    /* "amplpy/parameter.pxi":118
 *         assert len(args) in (1, 2)
 *         cdef campl.AMPL_TUPLE* index_c
 *         if len(args) == 1:             # <<<<<<<<<<<<<<
 *             value = args[0]
 * 
 */
    goto __pyx_L5;
  }

  /* "amplpy/parameter.pxi":128
 *                 raise TypeError
 *         else:
 *             index, value = args             # <<<<<<<<<<<<<<
 *             if not isinstance(index, (tuple, list)):
 *                 index = [index]
 */
  /*else*/ {
    if (1) {
      PyObject* sequence = __pyx_v_args;
      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(13, 128, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); 
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_6);
      #else
      __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 128, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(13, 128, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      #endif
    }
    __pyx_v_index = __pyx_t_4;
    __pyx_t_4 = 0;
    __pyx_v_value = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "amplpy/parameter.pxi":129
 *         else:
 *             index, value = args
 *             if not isinstance(index, (tuple, list)):             # <<<<<<<<<<<<<<
 *                 index = [index]
 *             index_c = to_c_tuple(index)
 */
    __pyx_t_2 = PyTuple_Check(__pyx_v_index); 
    if (!__pyx_t_2) {
    } else {
      __pyx_t_3 = __pyx_t_2;
      goto __pyx_L8_bool_binop_done;
    }
    __pyx_t_2 = PyList_Check(__pyx_v_index); 
    __pyx_t_3 = __pyx_t_2;
    __pyx_L8_bool_binop_done:;
    __pyx_t_2 = (!__pyx_t_3);
    if (__pyx_t_2) {

      /* "amplpy/parameter.pxi":130
 *             index, value = args
 *             if not isinstance(index, (tuple, list)):
 *                 index = [index]             # <<<<<<<<<<<<<<
 *             index_c = to_c_tuple(index)
 *             if isinstance(value, Real):
 */
      __pyx_t_6 = PyList_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(13, 130, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_v_index);
      __Pyx_GIVEREF(__pyx_v_index);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 0, __pyx_v_index)) __PYX_ERR(13, 130, __pyx_L1_error);
      __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "amplpy/parameter.pxi":129
 *         else:
 *             index, value = args
 *             if not isinstance(index, (tuple, list)):             # <<<<<<<<<<<<<<
 *                 index = [index]
 *             index_c = to_c_tuple(index)
 */
    }

    /* "amplpy/parameter.pxi":131
 *             if not isinstance(index, (tuple, list)):
 *                 index = [index]
 *             index_c = to_c_tuple(index)             # <<<<<<<<<<<<<<
 *             if isinstance(value, Real):
 *                 campl.AMPL_ParameterInstanceSetNumericValue(self._c_ampl, self._name, index_c, float(value))
 */
    __pyx_t_10 = __pyx_f_7_amplpy_to_c_tuple(__pyx_v_index); if (unlikely(__pyx_t_10 == ((AMPL_TUPLE *)NULL) && PyErr_Occurred())) __PYX_ERR(13, 131, __pyx_L1_error)
    __pyx_v_index_c = __pyx_t_10;

    /* "amplpy/parameter.pxi":132
 *                 index = [index]
 *             index_c = to_c_tuple(index)
 *             if isinstance(value, Real):             # <<<<<<<<<<<<<<
 *                 campl.AMPL_ParameterInstanceSetNumericValue(self._c_ampl, self._name, index_c, float(value))
 *                 campl.AMPL_TupleFree(&index_c)
 */
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_Real); if (unlikely(!__pyx_t_6)) __PYX_ERR(13, 132, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_2 = PyObject_IsInstance(__pyx_v_value, __pyx_t_6); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(13, 132, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (__pyx_t_2) {

      /* "amplpy/parameter.pxi":133
 *             index_c = to_c_tuple(index)
 *             if isinstance(value, Real):
 *                 campl.AMPL_ParameterInstanceSetNumericValue(self._c_ampl, self._name, index_c, float(value))             # <<<<<<<<<<<<<<
 *                 campl.AMPL_TupleFree(&index_c)
 *             elif isinstance(value, str):
 */
      __pyx_t_5 = __Pyx_PyObject_AsDouble(__pyx_v_value); if (unlikely(__pyx_t_5 == ((double)((double)-1)) && PyErr_Occurred())) __PYX_ERR(13, 133, __pyx_L1_error)
      (void)(AMPL_ParameterInstanceSetNumericValue(__pyx_v_self->__pyx_base._c_ampl, __pyx_v_self->__pyx_base._name, __pyx_v_index_c, __pyx_t_5));

      /* "amplpy/parameter.pxi":134
 *             if isinstance(value, Real):
 *                 campl.AMPL_ParameterInstanceSetNumericValue(self._c_ampl, self._name, index_c, float(value))
 *                 campl.AMPL_TupleFree(&index_c)             # <<<<<<<<<<<<<<
 *             elif isinstance(value, str):
 *                 campl.AMPL_ParameterInstanceSetStringValue(self._c_ampl, self._name, index_c, value.encode('utf-8'))
 */
      (void)(AMPL_TupleFree((&__pyx_v_index_c)));

      /* "amplpy/parameter.pxi":132
 *                 index = [index]
 *             index_c = to_c_tuple(index)
 *             if isinstance(value, Real):             # <<<<<<<<<<<<<<
 *                 campl.AMPL_ParameterInstanceSetNumericValue(self._c_ampl, self._name, index_c, float(value))
 *                 campl.AMPL_TupleFree(&index_c)
 */
      goto __pyx_L10;
    }

    /* "amplpy/parameter.pxi":135
 *                 campl.AMPL_ParameterInstanceSetNumericValue(self._c_ampl, self._name, index_c, float(value))
 *                 campl.AMPL_TupleFree(&index_c)
 *             elif isinstance(value, str):             # <<<<<<<<<<<<<<
 *                 campl.AMPL_ParameterInstanceSetStringValue(self._c_ampl, self._name, index_c, value.encode('utf-8'))
 *                 campl.AMPL_TupleFree(&index_c)
 */
    __pyx_t_2 = PyUnicode_Check(__pyx_v_value); 
    if (likely(__pyx_t_2)) {

      /* "amplpy/parameter.pxi":136
 *                 campl.AMPL_TupleFree(&index_c)
 *             elif isinstance(value, str):
 *                 campl.AMPL_ParameterInstanceSetStringValue(self._c_ampl, self._name, index_c, value.encode('utf-8'))             # <<<<<<<<<<<<<<
 *                 campl.AMPL_TupleFree(&index_c)
 *             else:
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 136, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_7 = NULL;
      __pyx_t_8 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
          __pyx_t_8 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_kp_u_utf_8};
        __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(!__pyx_t_6)) __PYX_ERR(13, 136, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }
      __pyx_t_11 = __Pyx_PyObject_AsString(__pyx_t_6); if (unlikely((!__pyx_t_11) && PyErr_Occurred())) __PYX_ERR(13, 136, __pyx_L1_error)
      (void)(AMPL_ParameterInstanceSetStringValue(__pyx_v_self->__pyx_base._c_ampl, __pyx_v_self->__pyx_base._name, __pyx_v_index_c, __pyx_t_11));
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "amplpy/parameter.pxi":137
 *             elif isinstance(value, str):
 *                 campl.AMPL_ParameterInstanceSetStringValue(self._c_ampl, self._name, index_c, value.encode('utf-8'))
 *                 campl.AMPL_TupleFree(&index_c)             # <<<<<<<<<<<<<<
 *             else:
 *                 campl.AMPL_TupleFree(&index_c)
 */
      (void)(AMPL_TupleFree((&__pyx_v_index_c)));

      /* "amplpy/parameter.pxi":135
 *                 campl.AMPL_ParameterInstanceSetNumericValue(self._c_ampl, self._name, index_c, float(value))
 *                 campl.AMPL_TupleFree(&index_c)
 *             elif isinstance(value, str):             # <<<<<<<<<<<<<<
 *                 campl.AMPL_ParameterInstanceSetStringValue(self._c_ampl, self._name, index_c, value.encode('utf-8'))
 *                 campl.AMPL_TupleFree(&index_c)
 */
      goto __pyx_L10;
    }

    /* "amplpy/parameter.pxi":139
 *                 campl.AMPL_TupleFree(&index_c)
 *             else:
 *                 campl.AMPL_TupleFree(&index_c)             # <<<<<<<<<<<<<<
 *                 raise TypeError
 * 
 */
    /*else*/ {
      (void)(AMPL_TupleFree((&__pyx_v_index_c)));

      /* "amplpy/parameter.pxi":140
 *             else:
 *                 campl.AMPL_TupleFree(&index_c)
 *                 raise TypeError             # <<<<<<<<<<<<<<
 * 
 *     def set_values(self, values):
 */
      __Pyx_Raise(__pyx_builtin_TypeError, 0, 0, 0);
      __PYX_ERR(13, 140, __pyx_L1_error)
    }
    __pyx_L10:;
  }
  __pyx_L5:;

  /* "amplpy/parameter.pxi":101
 *         return py_variant
 * 
 *     def set(self, *args):             # <<<<<<<<<<<<<<
 *         """
 *         Set the value of a single instance of this parameter.
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("_amplpy.Parameter.set", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XDECREF(__pyx_v_index);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/parameter.pxi":142
 *                 raise TypeError
 * 
 *     def set_values(self, values):             # <<<<<<<<<<<<<<
 *         """
 *         Assign the values (string or float) to the parameter instances with the
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_9Parameter_13set_values(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_9Parameter_12set_values, "Parameter.set_values(self, values)\n\n        Assign the values (string or float) to the parameter instances with the\n        specified indices, equivalent to the AMPL code:\n\n        .. code-block:: ampl\n\n            let {i in indices} par[i] := values[i];\n\n        Args:\n            values: list, dictionary or :class:`~amplpy.DataFrame` with the\n            indices and the values to be set.\n\n        Raises:\n            TypeError: If called on a scalar parameter.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_9Parameter_13set_values = {"set_values", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_9Parameter_13set_values, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_9Parameter_12set_values};
static PyObject *__pyx_pw_7_amplpy_9Parameter_13set_values(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_values = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_values (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_values)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(13, 142, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_values") < 0)) __PYX_ERR(13, 142, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_values = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_values", 1, 1, 1, __pyx_nargs); __PYX_ERR(13, 142, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.Parameter.set_values", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_9Parameter_12set_values(((struct __pyx_obj_7_amplpy_Parameter *)__pyx_v_self), __pyx_v_values);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7_amplpy_9Parameter_10set_values_2generator6(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "amplpy/parameter.pxi":172
 *                 self.set_values(tuple(itertools.chain(*values.tolist())))
 *         elif isinstance(values, Iterable):
 *             if all(isinstance(value, str) for value in values):             # <<<<<<<<<<<<<<
 *                 if not isinstance(values, (list, tuple)):
 *                     values = list(values)
 */

static PyObject *__pyx_pf_7_amplpy_9Parameter_10set_values_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) {
  struct __pyx_obj_7_amplpy___pyx_scope_struct_9_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_7_amplpy___pyx_scope_struct_9_genexpr *)__pyx_tp_new_7_amplpy___pyx_scope_struct_9_genexpr(__pyx_ptype_7_amplpy___pyx_scope_struct_9_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7_amplpy___pyx_scope_struct_9_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(13, 172, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7_amplpy_9Parameter_10set_values_2generator6, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_set_values_locals_genexpr, __pyx_n_s_amplpy); if (unlikely(!gen)) __PYX_ERR(13, 172, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("_amplpy.Parameter.set_values.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_7_amplpy_9Parameter_10set_values_2generator6(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7_amplpy___pyx_scope_struct_9_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7_amplpy___pyx_scope_struct_9_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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __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(13, 172, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(13, 172, __pyx_L1_error) }
  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) {
    __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __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_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 172, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 172, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(13, 172, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) 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(13, 172, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 172, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(13, 172, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) 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(13, 172, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 172, __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(13, 172, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_value);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_value, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_5 = PyUnicode_Check(__pyx_cur_scope->__pyx_v_value); 
    __pyx_t_6 = (!__pyx_t_5);
    if (__pyx_t_6) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_False);
      __pyx_r = Py_False;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_True);
    __pyx_r = Py_True;
    goto __pyx_L0;
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_Generator_Replace_StopIteration(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);
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7_amplpy_9Parameter_10set_values_5generator7(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "amplpy/parameter.pxi":176
 *                     values = list(values)
 *                 setValuesParamStr(self._c_ampl, self._name, values)
 *             elif all(isinstance(value, Real) for value in values):             # <<<<<<<<<<<<<<
 *                 values = list(map(float, values))
 *                 setValuesParamNum(self._c_ampl, self._name, values)
 */

static PyObject *__pyx_pf_7_amplpy_9Parameter_10set_values_3genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) {
  struct __pyx_obj_7_amplpy___pyx_scope_struct_10_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_7_amplpy___pyx_scope_struct_10_genexpr *)__pyx_tp_new_7_amplpy___pyx_scope_struct_10_genexpr(__pyx_ptype_7_amplpy___pyx_scope_struct_10_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7_amplpy___pyx_scope_struct_10_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(13, 176, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7_amplpy_9Parameter_10set_values_5generator7, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_set_values_locals_genexpr, __pyx_n_s_amplpy); if (unlikely(!gen)) __PYX_ERR(13, 176, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("_amplpy.Parameter.set_values.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_7_amplpy_9Parameter_10set_values_5generator7(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7_amplpy___pyx_scope_struct_10_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7_amplpy___pyx_scope_struct_10_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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __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(13, 176, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(13, 176, __pyx_L1_error) }
  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) {
    __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __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_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 176, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 176, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(13, 176, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) 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(13, 176, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 176, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(13, 176, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) 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(13, 176, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 176, __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(13, 176, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_value);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_value, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Real); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 176, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyObject_IsInstance(__pyx_cur_scope->__pyx_v_value, __pyx_t_4); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(13, 176, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_6 = (!__pyx_t_5);
    if (__pyx_t_6) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_False);
      __pyx_r = Py_False;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_True);
    __pyx_r = Py_True;
    goto __pyx_L0;
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_Generator_Replace_StopIteration(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);
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/parameter.pxi":142
 *                 raise TypeError
 * 
 *     def set_values(self, values):             # <<<<<<<<<<<<<<
 *         """
 *         Assign the values (string or float) to the parameter instances with the
 */

static PyObject *__pyx_pf_7_amplpy_9Parameter_12set_values(struct __pyx_obj_7_amplpy_Parameter *__pyx_v_self, PyObject *__pyx_v_values) {
  PyObject *__pyx_gb_7_amplpy_9Parameter_10set_values_2generator6 = 0;
  PyObject *__pyx_gb_7_amplpy_9Parameter_10set_values_5generator7 = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  unsigned int __pyx_t_6;
  int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_values", 0);
  __Pyx_INCREF(__pyx_v_values);

  /* "amplpy/parameter.pxi":158
 *             TypeError: If called on a scalar parameter.
 *         """
 *         if isinstance(values, dict):             # <<<<<<<<<<<<<<
 *             if not values:
 *                 return
 */
  __pyx_t_1 = PyDict_Check(__pyx_v_values); 
  if (__pyx_t_1) {

    /* "amplpy/parameter.pxi":159
 *         """
 *         if isinstance(values, dict):
 *             if not values:             # <<<<<<<<<<<<<<
 *                 return
 *             setValuesPyDict(self._c_ampl, self._name, values)
 */
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_values); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(13, 159, __pyx_L1_error)
    __pyx_t_2 = (!__pyx_t_1);
    if (__pyx_t_2) {

      /* "amplpy/parameter.pxi":160
 *         if isinstance(values, dict):
 *             if not values:
 *                 return             # <<<<<<<<<<<<<<
 *             setValuesPyDict(self._c_ampl, self._name, values)
 *         elif isinstance(values, DataFrame):
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      goto __pyx_L0;

      /* "amplpy/parameter.pxi":159
 *         """
 *         if isinstance(values, dict):
 *             if not values:             # <<<<<<<<<<<<<<
 *                 return
 *             setValuesPyDict(self._c_ampl, self._name, values)
 */
    }

    /* "amplpy/parameter.pxi":161
 *             if not values:
 *                 return
 *             setValuesPyDict(self._c_ampl, self._name, values)             # <<<<<<<<<<<<<<
 *         elif isinstance(values, DataFrame):
 *             Entity.set_values(self, values)
 */
    if (!(likely(PyDict_CheckExact(__pyx_v_values))||((__pyx_v_values) == Py_None) || __Pyx_RaiseUnexpectedTypeError("dict", __pyx_v_values))) __PYX_ERR(13, 161, __pyx_L1_error)
    __pyx_f_7_amplpy_setValuesPyDict(__pyx_v_self->__pyx_base._c_ampl, __pyx_v_self->__pyx_base._name, ((PyObject*)__pyx_v_values)); if (unlikely(PyErr_Occurred())) __PYX_ERR(13, 161, __pyx_L1_error)

    /* "amplpy/parameter.pxi":158
 *             TypeError: If called on a scalar parameter.
 *         """
 *         if isinstance(values, dict):             # <<<<<<<<<<<<<<
 *             if not values:
 *                 return
 */
    goto __pyx_L3;
  }

  /* "amplpy/parameter.pxi":162
 *                 return
 *             setValuesPyDict(self._c_ampl, self._name, values)
 *         elif isinstance(values, DataFrame):             # <<<<<<<<<<<<<<
 *             Entity.set_values(self, values)
 *         elif pd is not None and isinstance(values, (pd.DataFrame, pd.Series)):
 */
  __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_values, __pyx_ptype_7_amplpy_DataFrame); 
  if (__pyx_t_2) {

    /* "amplpy/parameter.pxi":163
 *             setValuesPyDict(self._c_ampl, self._name, values)
 *         elif isinstance(values, DataFrame):
 *             Entity.set_values(self, values)             # <<<<<<<<<<<<<<
 *         elif pd is not None and isinstance(values, (pd.DataFrame, pd.Series)):
 *             Entity.set_values(self, values)
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7_amplpy_Entity), __pyx_n_s_set_values); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 163, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_6 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_v_values};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 163, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "amplpy/parameter.pxi":162
 *                 return
 *             setValuesPyDict(self._c_ampl, self._name, values)
 *         elif isinstance(values, DataFrame):             # <<<<<<<<<<<<<<
 *             Entity.set_values(self, values)
 *         elif pd is not None and isinstance(values, (pd.DataFrame, pd.Series)):
 */
    goto __pyx_L3;
  }

  /* "amplpy/parameter.pxi":164
 *         elif isinstance(values, DataFrame):
 *             Entity.set_values(self, values)
 *         elif pd is not None and isinstance(values, (pd.DataFrame, pd.Series)):             # <<<<<<<<<<<<<<
 *             Entity.set_values(self, values)
 *         elif np is not None and isinstance(values, np.ndarray):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pd); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 164, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = (__pyx_t_3 != Py_None);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_1) {
  } else {
    __pyx_t_2 = __pyx_t_1;
    goto __pyx_L5_bool_binop_done;
  }
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pd); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 164, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_DataFrame); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 164, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pd); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 164, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Series); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 164, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_7 = PyObject_IsInstance(__pyx_v_values, __pyx_t_4); 
  if (!__pyx_t_7) {
  } else {
    __pyx_t_1 = __pyx_t_7;
    goto __pyx_L7_bool_binop_done;
  }
  __pyx_t_7 = PyObject_IsInstance(__pyx_v_values, __pyx_t_5); 
  __pyx_t_1 = __pyx_t_7;
  __pyx_L7_bool_binop_done:;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_2 = __pyx_t_1;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_2) {

    /* "amplpy/parameter.pxi":165
 *             Entity.set_values(self, values)
 *         elif pd is not None and isinstance(values, (pd.DataFrame, pd.Series)):
 *             Entity.set_values(self, values)             # <<<<<<<<<<<<<<
 *         elif np is not None and isinstance(values, np.ndarray):
 *             if len(values.shape) <= 1:
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7_amplpy_Entity), __pyx_n_s_set_values); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 165, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (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);
        __pyx_t_6 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_values};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 165, __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;

    /* "amplpy/parameter.pxi":164
 *         elif isinstance(values, DataFrame):
 *             Entity.set_values(self, values)
 *         elif pd is not None and isinstance(values, (pd.DataFrame, pd.Series)):             # <<<<<<<<<<<<<<
 *             Entity.set_values(self, values)
 *         elif np is not None and isinstance(values, np.ndarray):
 */
    goto __pyx_L3;
  }

  /* "amplpy/parameter.pxi":166
 *         elif pd is not None and isinstance(values, (pd.DataFrame, pd.Series)):
 *             Entity.set_values(self, values)
 *         elif np is not None and isinstance(values, np.ndarray):             # <<<<<<<<<<<<<<
 *             if len(values.shape) <= 1:
 *                 self.set_values(values.tolist())
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 166, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = (__pyx_t_4 != Py_None);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_1) {
  } else {
    __pyx_t_2 = __pyx_t_1;
    goto __pyx_L9_bool_binop_done;
  }
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 166, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_ndarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 166, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_1 = PyObject_IsInstance(__pyx_v_values, __pyx_t_5); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(13, 166, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_2 = __pyx_t_1;
  __pyx_L9_bool_binop_done:;
  if (__pyx_t_2) {

    /* "amplpy/parameter.pxi":167
 *             Entity.set_values(self, values)
 *         elif np is not None and isinstance(values, np.ndarray):
 *             if len(values.shape) <= 1:             # <<<<<<<<<<<<<<
 *                 self.set_values(values.tolist())
 *             else:
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_values, __pyx_n_s_shape); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 167, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_8 = PyObject_Length(__pyx_t_5); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(13, 167, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_2 = (__pyx_t_8 <= 1);
    if (__pyx_t_2) {

      /* "amplpy/parameter.pxi":168
 *         elif np is not None and isinstance(values, np.ndarray):
 *             if len(values.shape) <= 1:
 *                 self.set_values(values.tolist())             # <<<<<<<<<<<<<<
 *             else:
 *                 self.set_values(tuple(itertools.chain(*values.tolist())))
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_values); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 168, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_values, __pyx_n_s_tolist); if (unlikely(!__pyx_t_9)) __PYX_ERR(13, 168, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_10 = NULL;
      __pyx_t_6 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_9))) {
        __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
        if (likely(__pyx_t_10)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
          __Pyx_INCREF(__pyx_t_10);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_9, function);
          __pyx_t_6 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_10, NULL};
        __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6);
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 168, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }
      __pyx_t_9 = NULL;
      __pyx_t_6 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_9)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_9);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
          __pyx_t_6 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_3};
        __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 168, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "amplpy/parameter.pxi":167
 *             Entity.set_values(self, values)
 *         elif np is not None and isinstance(values, np.ndarray):
 *             if len(values.shape) <= 1:             # <<<<<<<<<<<<<<
 *                 self.set_values(values.tolist())
 *             else:
 */
      goto __pyx_L11;
    }

    /* "amplpy/parameter.pxi":170
 *                 self.set_values(values.tolist())
 *             else:
 *                 self.set_values(tuple(itertools.chain(*values.tolist())))             # <<<<<<<<<<<<<<
 *         elif isinstance(values, Iterable):
 *             if all(isinstance(value, str) for value in values):
 */
    /*else*/ {
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_values); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 170, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_itertools); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 170, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_chain); if (unlikely(!__pyx_t_9)) __PYX_ERR(13, 170, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_values, __pyx_n_s_tolist); if (unlikely(!__pyx_t_10)) __PYX_ERR(13, 170, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_11 = NULL;
      __pyx_t_6 = 0;
      #if CYTHON_UNPACK_METHODS
      if (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);
          __pyx_t_6 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_11, NULL};
        __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6);
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 170, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      }
      __pyx_t_10 = __Pyx_PySequence_Tuple(__pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(13, 170, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 170, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = __Pyx_PySequence_Tuple(__pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(13, 170, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = NULL;
      __pyx_t_6 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
          __pyx_t_6 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_10};
        __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 170, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __pyx_L11:;

    /* "amplpy/parameter.pxi":166
 *         elif pd is not None and isinstance(values, (pd.DataFrame, pd.Series)):
 *             Entity.set_values(self, values)
 *         elif np is not None and isinstance(values, np.ndarray):             # <<<<<<<<<<<<<<
 *             if len(values.shape) <= 1:
 *                 self.set_values(values.tolist())
 */
    goto __pyx_L3;
  }

  /* "amplpy/parameter.pxi":171
 *             else:
 *                 self.set_values(tuple(itertools.chain(*values.tolist())))
 *         elif isinstance(values, Iterable):             # <<<<<<<<<<<<<<
 *             if all(isinstance(value, str) for value in values):
 *                 if not isinstance(values, (list, tuple)):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Iterable); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 171, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = PyObject_IsInstance(__pyx_v_values, __pyx_t_5); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(13, 171, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_2) {

    /* "amplpy/parameter.pxi":172
 *                 self.set_values(tuple(itertools.chain(*values.tolist())))
 *         elif isinstance(values, Iterable):
 *             if all(isinstance(value, str) for value in values):             # <<<<<<<<<<<<<<
 *                 if not isinstance(values, (list, tuple)):
 *                     values = list(values)
 */
    __pyx_t_5 = __pyx_pf_7_amplpy_9Parameter_10set_values_genexpr(NULL, __pyx_v_values); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 172, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __Pyx_Generator_Next(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 172, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(13, 172, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_2) {

      /* "amplpy/parameter.pxi":173
 *         elif isinstance(values, Iterable):
 *             if all(isinstance(value, str) for value in values):
 *                 if not isinstance(values, (list, tuple)):             # <<<<<<<<<<<<<<
 *                     values = list(values)
 *                 setValuesParamStr(self._c_ampl, self._name, values)
 */
      __pyx_t_1 = PyList_Check(__pyx_v_values); 
      if (!__pyx_t_1) {
      } else {
        __pyx_t_2 = __pyx_t_1;
        goto __pyx_L14_bool_binop_done;
      }
      __pyx_t_1 = PyTuple_Check(__pyx_v_values); 
      __pyx_t_2 = __pyx_t_1;
      __pyx_L14_bool_binop_done:;
      __pyx_t_1 = (!__pyx_t_2);
      if (__pyx_t_1) {

        /* "amplpy/parameter.pxi":174
 *             if all(isinstance(value, str) for value in values):
 *                 if not isinstance(values, (list, tuple)):
 *                     values = list(values)             # <<<<<<<<<<<<<<
 *                 setValuesParamStr(self._c_ampl, self._name, values)
 *             elif all(isinstance(value, Real) for value in values):
 */
        __pyx_t_4 = PySequence_List(__pyx_v_values); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 174, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF_SET(__pyx_v_values, __pyx_t_4);
        __pyx_t_4 = 0;

        /* "amplpy/parameter.pxi":173
 *         elif isinstance(values, Iterable):
 *             if all(isinstance(value, str) for value in values):
 *                 if not isinstance(values, (list, tuple)):             # <<<<<<<<<<<<<<
 *                     values = list(values)
 *                 setValuesParamStr(self._c_ampl, self._name, values)
 */
      }

      /* "amplpy/parameter.pxi":175
 *                 if not isinstance(values, (list, tuple)):
 *                     values = list(values)
 *                 setValuesParamStr(self._c_ampl, self._name, values)             # <<<<<<<<<<<<<<
 *             elif all(isinstance(value, Real) for value in values):
 *                 values = list(map(float, values))
 */
      __pyx_f_7_amplpy_setValuesParamStr(__pyx_v_self->__pyx_base._c_ampl, __pyx_v_self->__pyx_base._name, __pyx_v_values); if (unlikely(PyErr_Occurred())) __PYX_ERR(13, 175, __pyx_L1_error)

      /* "amplpy/parameter.pxi":172
 *                 self.set_values(tuple(itertools.chain(*values.tolist())))
 *         elif isinstance(values, Iterable):
 *             if all(isinstance(value, str) for value in values):             # <<<<<<<<<<<<<<
 *                 if not isinstance(values, (list, tuple)):
 *                     values = list(values)
 */
      goto __pyx_L12;
    }

    /* "amplpy/parameter.pxi":176
 *                     values = list(values)
 *                 setValuesParamStr(self._c_ampl, self._name, values)
 *             elif all(isinstance(value, Real) for value in values):             # <<<<<<<<<<<<<<
 *                 values = list(map(float, values))
 *                 setValuesParamNum(self._c_ampl, self._name, values)
 */
    __pyx_t_4 = __pyx_pf_7_amplpy_9Parameter_10set_values_3genexpr(NULL, __pyx_v_values); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 176, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_Generator_Next(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 176, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(13, 176, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_1) {

      /* "amplpy/parameter.pxi":177
 *                 setValuesParamStr(self._c_ampl, self._name, values)
 *             elif all(isinstance(value, Real) for value in values):
 *                 values = list(map(float, values))             # <<<<<<<<<<<<<<
 *                 setValuesParamNum(self._c_ampl, self._name, values)
 *             else:
 */
      __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 177, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_INCREF((PyObject *)(&PyFloat_Type));
      __Pyx_GIVEREF((PyObject *)(&PyFloat_Type));
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)(&PyFloat_Type)))) __PYX_ERR(13, 177, __pyx_L1_error);
      __Pyx_INCREF(__pyx_v_values);
      __Pyx_GIVEREF(__pyx_v_values);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_values)) __PYX_ERR(13, 177, __pyx_L1_error);
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 177, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = __Pyx_PySequence_ListKeepNew(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 177, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF_SET(__pyx_v_values, __pyx_t_5);
      __pyx_t_5 = 0;

      /* "amplpy/parameter.pxi":178
 *             elif all(isinstance(value, Real) for value in values):
 *                 values = list(map(float, values))
 *                 setValuesParamNum(self._c_ampl, self._name, values)             # <<<<<<<<<<<<<<
 *             else:
 *                 Entity.set_values(self, values)
 */
      __pyx_f_7_amplpy_setValuesParamNum(__pyx_v_self->__pyx_base._c_ampl, __pyx_v_self->__pyx_base._name, __pyx_v_values); if (unlikely(PyErr_Occurred())) __PYX_ERR(13, 178, __pyx_L1_error)

      /* "amplpy/parameter.pxi":176
 *                     values = list(values)
 *                 setValuesParamStr(self._c_ampl, self._name, values)
 *             elif all(isinstance(value, Real) for value in values):             # <<<<<<<<<<<<<<
 *                 values = list(map(float, values))
 *                 setValuesParamNum(self._c_ampl, self._name, values)
 */
      goto __pyx_L12;
    }

    /* "amplpy/parameter.pxi":180
 *                 setValuesParamNum(self._c_ampl, self._name, values)
 *             else:
 *                 Entity.set_values(self, values)             # <<<<<<<<<<<<<<
 *         else:
 *             Entity.set_values(self, values)
 */
    /*else*/ {
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7_amplpy_Entity), __pyx_n_s_set_values); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 180, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_10 = NULL;
      __pyx_t_6 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_10)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_10);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
          __pyx_t_6 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_10, ((PyObject *)__pyx_v_self), __pyx_v_values};
        __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6);
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 180, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __pyx_L12:;

    /* "amplpy/parameter.pxi":171
 *             else:
 *                 self.set_values(tuple(itertools.chain(*values.tolist())))
 *         elif isinstance(values, Iterable):             # <<<<<<<<<<<<<<
 *             if all(isinstance(value, str) for value in values):
 *                 if not isinstance(values, (list, tuple)):
 */
    goto __pyx_L3;
  }

  /* "amplpy/parameter.pxi":182
 *                 Entity.set_values(self, values)
 *         else:
 *             Entity.set_values(self, values)             # <<<<<<<<<<<<<<
 * 
 *     # Aliases
 */
  /*else*/ {
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7_amplpy_Entity), __pyx_n_s_set_values); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 182, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_10 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_10)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_6 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_10, ((PyObject *)__pyx_v_self), __pyx_v_values};
      __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 182, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __pyx_L3:;

  /* "amplpy/parameter.pxi":142
 *                 raise TypeError
 * 
 *     def set_values(self, values):             # <<<<<<<<<<<<<<
 *         """
 *         Assign the values (string or float) to the parameter instances with the
 */

  /* 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_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("_amplpy.Parameter.set_values", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_gb_7_amplpy_9Parameter_10set_values_2generator6);
  __Pyx_XDECREF(__pyx_gb_7_amplpy_9Parameter_10set_values_5generator7);
  __Pyx_XDECREF(__pyx_v_values);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._c_ampl,self._index cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_9Parameter_15__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_9Parameter_14__reduce_cython__, "Parameter.__reduce_cython__(self)");
static PyMethodDef __pyx_mdef_7_amplpy_9Parameter_15__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_9Parameter_15__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_9Parameter_14__reduce_cython__};
static PyObject *__pyx_pw_7_amplpy_9Parameter_15__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_9Parameter_14__reduce_cython__(((struct __pyx_obj_7_amplpy_Parameter *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_9Parameter_14__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7_amplpy_Parameter *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 1);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "self._c_ampl,self._index cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self._c_ampl,self._index cannot be converted to a Python object for pickling"
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_self__c_ampl_self__index_cannot, 0, 0);
  __PYX_ERR(8, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._c_ampl,self._index cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 */

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

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._c_ampl,self._index cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._c_ampl,self._index cannot be converted to a Python object for pickling"
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_9Parameter_17__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_9Parameter_16__setstate_cython__, "Parameter.__setstate_cython__(self, __pyx_state)");
static PyMethodDef __pyx_mdef_7_amplpy_9Parameter_17__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_9Parameter_17__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_9Parameter_16__setstate_cython__};
static PyObject *__pyx_pw_7_amplpy_9Parameter_17__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 3, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(8, 3, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(8, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.Parameter.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_9Parameter_16__setstate_cython__(((struct __pyx_obj_7_amplpy_Parameter *)__pyx_v_self), __pyx_v___pyx_state);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_9Parameter_16__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7_amplpy_Parameter *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 1);

  /* "(tree fragment)":4
 *     raise TypeError, "self._c_ampl,self._index cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self._c_ampl,self._index cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_self__c_ampl_self__index_cannot, 0, 0);
  __PYX_ERR(8, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._c_ampl,self._index cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._c_ampl,self._index cannot be converted to a Python object for pickling"
 */

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

/* "amplpy/set.pxi":32
 *     """
 *     @staticmethod
 *     cdef create(campl.AMPL* ampl_c, char* name, campl.AMPL_TUPLE* index, parent):             # <<<<<<<<<<<<<<
 *         entity = Set()
 *         entity._c_ampl = ampl_c
 */

static PyObject *__pyx_f_7_amplpy_3Set_create(AMPL *__pyx_v_ampl_c, char *__pyx_v_name, AMPL_TUPLE *__pyx_v_index, PyObject *__pyx_v_parent) {
  struct __pyx_obj_7_amplpy_Set *__pyx_v_entity = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("create", 1);

  /* "amplpy/set.pxi":33
 *     @staticmethod
 *     cdef create(campl.AMPL* ampl_c, char* name, campl.AMPL_TUPLE* index, parent):
 *         entity = Set()             # <<<<<<<<<<<<<<
 *         entity._c_ampl = ampl_c
 *         entity._name = name
 */
  __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_7_amplpy_Set)); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 33, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_entity = ((struct __pyx_obj_7_amplpy_Set *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "amplpy/set.pxi":34
 *     cdef create(campl.AMPL* ampl_c, char* name, campl.AMPL_TUPLE* index, parent):
 *         entity = Set()
 *         entity._c_ampl = ampl_c             # <<<<<<<<<<<<<<
 *         entity._name = name
 *         entity._index = index
 */
  __pyx_v_entity->__pyx_base._c_ampl = __pyx_v_ampl_c;

  /* "amplpy/set.pxi":35
 *         entity = Set()
 *         entity._c_ampl = ampl_c
 *         entity._name = name             # <<<<<<<<<<<<<<
 *         entity._index = index
 *         entity.wrap_function = campl.AMPL_SET
 */
  __pyx_v_entity->__pyx_base._name = __pyx_v_name;

  /* "amplpy/set.pxi":36
 *         entity._c_ampl = ampl_c
 *         entity._name = name
 *         entity._index = index             # <<<<<<<<<<<<<<
 *         entity.wrap_function = campl.AMPL_SET
 *         entity._entity = parent
 */
  __pyx_v_entity->__pyx_base._index = __pyx_v_index;

  /* "amplpy/set.pxi":37
 *         entity._name = name
 *         entity._index = index
 *         entity.wrap_function = campl.AMPL_SET             # <<<<<<<<<<<<<<
 *         entity._entity = parent
 *         if entity._entity is not None:
 */
  __pyx_v_entity->__pyx_base.wrap_function = AMPL_SET;

  /* "amplpy/set.pxi":38
 *         entity._index = index
 *         entity.wrap_function = campl.AMPL_SET
 *         entity._entity = parent             # <<<<<<<<<<<<<<
 *         if entity._entity is not None:
 *             Py_INCREF(entity._entity)
 */
  __Pyx_INCREF(__pyx_v_parent);
  __Pyx_GIVEREF(__pyx_v_parent);
  __Pyx_GOTREF(__pyx_v_entity->__pyx_base._entity);
  __Pyx_DECREF(__pyx_v_entity->__pyx_base._entity);
  __pyx_v_entity->__pyx_base._entity = __pyx_v_parent;

  /* "amplpy/set.pxi":39
 *         entity.wrap_function = campl.AMPL_SET
 *         entity._entity = parent
 *         if entity._entity is not None:             # <<<<<<<<<<<<<<
 *             Py_INCREF(entity._entity)
 *         return entity
 */
  __pyx_t_2 = (__pyx_v_entity->__pyx_base._entity != Py_None);
  if (__pyx_t_2) {

    /* "amplpy/set.pxi":40
 *         entity._entity = parent
 *         if entity._entity is not None:
 *             Py_INCREF(entity._entity)             # <<<<<<<<<<<<<<
 *         return entity
 * 
 */
    __pyx_t_1 = __pyx_v_entity->__pyx_base._entity;
    __Pyx_INCREF(__pyx_t_1);
    Py_INCREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "amplpy/set.pxi":39
 *         entity.wrap_function = campl.AMPL_SET
 *         entity._entity = parent
 *         if entity._entity is not None:             # <<<<<<<<<<<<<<
 *             Py_INCREF(entity._entity)
 *         return entity
 */
  }

  /* "amplpy/set.pxi":41
 *         if entity._entity is not None:
 *             Py_INCREF(entity._entity)
 *         return entity             # <<<<<<<<<<<<<<
 * 
 *     def __setitem__(self, index, value):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_entity);
  __pyx_r = ((PyObject *)__pyx_v_entity);
  goto __pyx_L0;

  /* "amplpy/set.pxi":32
 *     """
 *     @staticmethod
 *     cdef create(campl.AMPL* ampl_c, char* name, campl.AMPL_TUPLE* index, parent):             # <<<<<<<<<<<<<<
 *         entity = Set()
 *         entity._c_ampl = ampl_c
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("_amplpy.Set.create", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_entity);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/set.pxi":43
 *         return entity
 * 
 *     def __setitem__(self, index, value):             # <<<<<<<<<<<<<<
 *         self.__getitem__(index).set_values(value)
 * 
 */

/* Python wrapper */
static int __pyx_pw_7_amplpy_3Set_1__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_7_amplpy_3Set_1__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7_amplpy_3Set___setitem__(((struct __pyx_obj_7_amplpy_Set *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_7_amplpy_3Set___setitem__(struct __pyx_obj_7_amplpy_Set *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  unsigned int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setitem__", 1);

  /* "amplpy/set.pxi":44
 * 
 *     def __setitem__(self, index, value):
 *         self.__getitem__(index).set_values(value)             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getitem); if (unlikely(!__pyx_t_3)) __PYX_ERR(14, 44, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_index};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 44, __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_set_values); if (unlikely(!__pyx_t_3)) __PYX_ERR(14, 44, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_value};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 44, __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;

  /* "amplpy/set.pxi":43
 *         return entity
 * 
 *     def __setitem__(self, index, value):             # <<<<<<<<<<<<<<
 *         self.__getitem__(index).set_values(value)
 * 
 */

  /* function exit code */
  __pyx_r = 0;
  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("_amplpy.Set.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/set.pxi":46
 *         self.__getitem__(index).set_values(value)
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         if self.is_scalar():
 *             return self.members()
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_3Set_3__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7_amplpy_3Set_3__iter__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7_amplpy_3Set_2__iter__(((struct __pyx_obj_7_amplpy_Set *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_3Set_2__iter__(struct __pyx_obj_7_amplpy_Set *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__iter__", 1);

  /* "amplpy/set.pxi":47
 * 
 *     def __iter__(self):
 *         if self.is_scalar():             # <<<<<<<<<<<<<<
 *             return self.members()
 *         else:
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_is_scalar); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 47, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 47, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(14, 47, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_5) {

    /* "amplpy/set.pxi":48
 *     def __iter__(self):
 *         if self.is_scalar():
 *             return self.members()             # <<<<<<<<<<<<<<
 *         else:
 *             return self.instances()
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_members); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 48, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    __pyx_t_4 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_4 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 48, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "amplpy/set.pxi":47
 * 
 *     def __iter__(self):
 *         if self.is_scalar():             # <<<<<<<<<<<<<<
 *             return self.members()
 *         else:
 */
  }

  /* "amplpy/set.pxi":50
 *             return self.members()
 *         else:
 *             return self.instances()             # <<<<<<<<<<<<<<
 * 
 *     def instances(self):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_instances); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 50, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    __pyx_t_4 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_4 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 50, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
  }

  /* "amplpy/set.pxi":46
 *         self.__getitem__(index).set_values(value)
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         if self.is_scalar():
 *             return self.members()
 */

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

/* "amplpy/set.pxi":52
 *             return self.instances()
 * 
 *     def instances(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get an iterator to iterate over all the instances in a Set.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_3Set_5instances(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_3Set_4instances, "Set.instances(self)\n\n        Get an iterator to iterate over all the instances in a Set.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_3Set_5instances = {"instances", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_3Set_5instances, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_3Set_4instances};
static PyObject *__pyx_pw_7_amplpy_3Set_5instances(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("instances (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("instances", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "instances", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_3Set_4instances(((struct __pyx_obj_7_amplpy_Set *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_3Set_4instances(struct __pyx_obj_7_amplpy_Set *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("instances", 1);

  /* "amplpy/set.pxi":56
 *         Get an iterator to iterate over all the instances in a Set.
 *         """
 *         return Entity.instances(self)             # <<<<<<<<<<<<<<
 * 
 *     def arity(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7_amplpy_Entity), __pyx_n_s_instances); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 56, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, ((PyObject *)__pyx_v_self)};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 56, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "amplpy/set.pxi":52
 *             return self.instances()
 * 
 *     def instances(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get an iterator to iterate over all the instances in a Set.
 */

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

/* "amplpy/set.pxi":58
 *         return Entity.instances(self)
 * 
 *     def arity(self):             # <<<<<<<<<<<<<<
 *         """
 *         The arity of the set, or number of components in each member of this
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_3Set_7arity(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_3Set_6arity, "Set.arity(self)\n\n        The arity of the set, or number of components in each member of this\n        set.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_3Set_7arity = {"arity", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_3Set_7arity, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_3Set_6arity};
static PyObject *__pyx_pw_7_amplpy_3Set_7arity(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("arity (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("arity", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "arity", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_3Set_6arity(((struct __pyx_obj_7_amplpy_Set *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_3Set_6arity(struct __pyx_obj_7_amplpy_Set *__pyx_v_self) {
  size_t __pyx_v_arity;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("arity", 1);

  /* "amplpy/set.pxi":64
 *         """
 *         cdef size_t arity
 *         PY_AMPL_CALL(campl.AMPL_SetGetArity(self._c_ampl, self._name, &arity))             # <<<<<<<<<<<<<<
 *         return int(arity)
 * 
 */
  __pyx_t_1 = __pyx_f_7_amplpy_PY_AMPL_CALL(AMPL_SetGetArity(__pyx_v_self->__pyx_base._c_ampl, __pyx_v_self->__pyx_base._name, (&__pyx_v_arity))); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 64, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "amplpy/set.pxi":65
 *         cdef size_t arity
 *         PY_AMPL_CALL(campl.AMPL_SetGetArity(self._c_ampl, self._name, &arity))
 *         return int(arity)             # <<<<<<<<<<<<<<
 * 
 *     def get_values(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_arity); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 65, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyInt_Type)), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 65, __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;

  /* "amplpy/set.pxi":58
 *         return Entity.instances(self)
 * 
 *     def arity(self):             # <<<<<<<<<<<<<<
 *         """
 *         The arity of the set, or number of components in each member of this
 */

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

/* "amplpy/set.pxi":67
 *         return int(arity)
 * 
 *     def get_values(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get values of this set in a DataFrame. Valid only for non-indexed sets.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_3Set_9get_values(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_3Set_8get_values, "Set.get_values(self)\n\n        Get values of this set in a DataFrame. Valid only for non-indexed sets.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_3Set_9get_values = {"get_values", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_3Set_9get_values, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_3Set_8get_values};
static PyObject *__pyx_pw_7_amplpy_3Set_9get_values(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_values (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("get_values", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_values", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_3Set_8get_values(((struct __pyx_obj_7_amplpy_Set *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_3Set_8get_values(struct __pyx_obj_7_amplpy_Set *__pyx_v_self) {
  AMPL_DATAFRAME *__pyx_v_df_c;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_values", 1);

  /* "amplpy/set.pxi":72
 *         """
 *         cdef campl.AMPL_DATAFRAME* df_c
 *         campl.AMPL_SetInstanceGetValuesDataframe(self._c_ampl, self._name, self._index, &df_c)             # <<<<<<<<<<<<<<
 *         return DataFrame.create(df_c)
 * 
 */
  (void)(AMPL_SetInstanceGetValuesDataframe(__pyx_v_self->__pyx_base._c_ampl, __pyx_v_self->__pyx_base._name, __pyx_v_self->__pyx_base._index, (&__pyx_v_df_c)));

  /* "amplpy/set.pxi":73
 *         cdef campl.AMPL_DATAFRAME* df_c
 *         campl.AMPL_SetInstanceGetValuesDataframe(self._c_ampl, self._name, self._index, &df_c)
 *         return DataFrame.create(df_c)             # <<<<<<<<<<<<<<
 * 
 *     def members(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7_amplpy_9DataFrame_create(__pyx_v_df_c); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 73, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "amplpy/set.pxi":67
 *         return int(arity)
 * 
 *     def get_values(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get values of this set in a DataFrame. Valid only for non-indexed sets.
 */

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

/* "amplpy/set.pxi":75
 *         return DataFrame.create(df_c)
 * 
 *     def members(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get members (tuples) of this Set. Valid only for non-indexed sets.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_3Set_11members(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_3Set_10members, "Set.members(self)\n\n        Get members (tuples) of this Set. Valid only for non-indexed sets.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_3Set_11members = {"members", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_3Set_11members, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_3Set_10members};
static PyObject *__pyx_pw_7_amplpy_3Set_11members(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("members (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("members", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "members", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_3Set_10members(((struct __pyx_obj_7_amplpy_Set *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_3Set_10members(struct __pyx_obj_7_amplpy_Set *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("members", 1);

  /* "amplpy/set.pxi":79
 *         Get members (tuples) of this Set. Valid only for non-indexed sets.
 *         """
 *         return MemberRangeIterator.create(self._c_ampl, self._name, self._index, self)             # <<<<<<<<<<<<<<
 * 
 *     def size(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7_amplpy_19MemberRangeIterator_create(__pyx_v_self->__pyx_base._c_ampl, __pyx_v_self->__pyx_base._name, __pyx_v_self->__pyx_base._index, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 79, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "amplpy/set.pxi":75
 *         return DataFrame.create(df_c)
 * 
 *     def members(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get members (tuples) of this Set. Valid only for non-indexed sets.
 */

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

/* "amplpy/set.pxi":81
 *         return MemberRangeIterator.create(self._c_ampl, self._name, self._index, self)
 * 
 *     def size(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the number of tuples in this set. Valid only for non-indexed sets.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_3Set_13size(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_3Set_12size, "Set.size(self)\n\n        Get the number of tuples in this set. Valid only for non-indexed sets.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_3Set_13size = {"size", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_3Set_13size, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_3Set_12size};
static PyObject *__pyx_pw_7_amplpy_3Set_13size(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("size (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("size", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "size", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_3Set_12size(((struct __pyx_obj_7_amplpy_Set *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_3Set_12size(struct __pyx_obj_7_amplpy_Set *__pyx_v_self) {
  size_t __pyx_v_size;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("size", 1);

  /* "amplpy/set.pxi":86
 *         """
 *         cdef size_t size
 *         PY_AMPL_CALL(campl.AMPL_SetInstanceGetSize(self._c_ampl, self._name, self._index, &size))             # <<<<<<<<<<<<<<
 *         return int(size)
 * 
 */
  __pyx_t_1 = __pyx_f_7_amplpy_PY_AMPL_CALL(AMPL_SetInstanceGetSize(__pyx_v_self->__pyx_base._c_ampl, __pyx_v_self->__pyx_base._name, __pyx_v_self->__pyx_base._index, (&__pyx_v_size))); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 86, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "amplpy/set.pxi":87
 *         cdef size_t size
 *         PY_AMPL_CALL(campl.AMPL_SetInstanceGetSize(self._c_ampl, self._name, self._index, &size))
 *         return int(size)             # <<<<<<<<<<<<<<
 * 
 *     def contains(self, t):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 87, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyInt_Type)), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 87, __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;

  /* "amplpy/set.pxi":81
 *         return MemberRangeIterator.create(self._c_ampl, self._name, self._index, self)
 * 
 *     def size(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the number of tuples in this set. Valid only for non-indexed sets.
 */

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

/* "amplpy/set.pxi":89
 *         return int(size)
 * 
 *     def contains(self, t):             # <<<<<<<<<<<<<<
 *         """
 *         Check wether this set instance contains the specified Tuple.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_3Set_15contains(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_3Set_14contains, "Set.contains(self, t)\n\n        Check wether this set instance contains the specified Tuple.\n        Valid only for non-indexed sets.\n\n        Args:\n            t: Tuple to be found.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_3Set_15contains = {"contains", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_3Set_15contains, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_3Set_14contains};
static PyObject *__pyx_pw_7_amplpy_3Set_15contains(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_t = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("contains (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_t)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(14, 89, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "contains") < 0)) __PYX_ERR(14, 89, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_t = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("contains", 1, 1, 1, __pyx_nargs); __PYX_ERR(14, 89, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.Set.contains", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_3Set_14contains(((struct __pyx_obj_7_amplpy_Set *)__pyx_v_self), __pyx_v_t);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_3Set_14contains(struct __pyx_obj_7_amplpy_Set *__pyx_v_self, PyObject *__pyx_v_t) {
  bool __pyx_v_contains_c;
  AMPL_TUPLE *__pyx_v_t_c;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  AMPL_TUPLE *__pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("contains", 1);

  /* "amplpy/set.pxi":98
 *         """
 *         cdef bool_c contains_c
 *         cdef campl.AMPL_TUPLE* t_c = to_c_tuple(t)             # <<<<<<<<<<<<<<
 *         campl.AMPL_SetInstanceContains(self._c_ampl, self._name, NULL, t_c, &contains_c)
 *         campl.AMPL_TupleFree(&t_c)
 */
  __pyx_t_1 = __pyx_f_7_amplpy_to_c_tuple(__pyx_v_t); if (unlikely(__pyx_t_1 == ((AMPL_TUPLE *)NULL) && PyErr_Occurred())) __PYX_ERR(14, 98, __pyx_L1_error)
  __pyx_v_t_c = __pyx_t_1;

  /* "amplpy/set.pxi":99
 *         cdef bool_c contains_c
 *         cdef campl.AMPL_TUPLE* t_c = to_c_tuple(t)
 *         campl.AMPL_SetInstanceContains(self._c_ampl, self._name, NULL, t_c, &contains_c)             # <<<<<<<<<<<<<<
 *         campl.AMPL_TupleFree(&t_c)
 *         return contains_c
 */
  (void)(AMPL_SetInstanceContains(__pyx_v_self->__pyx_base._c_ampl, __pyx_v_self->__pyx_base._name, NULL, __pyx_v_t_c, (&__pyx_v_contains_c)));

  /* "amplpy/set.pxi":100
 *         cdef campl.AMPL_TUPLE* t_c = to_c_tuple(t)
 *         campl.AMPL_SetInstanceContains(self._c_ampl, self._name, NULL, t_c, &contains_c)
 *         campl.AMPL_TupleFree(&t_c)             # <<<<<<<<<<<<<<
 *         return contains_c
 * 
 */
  (void)(AMPL_TupleFree((&__pyx_v_t_c)));

  /* "amplpy/set.pxi":101
 *         campl.AMPL_SetInstanceContains(self._c_ampl, self._name, NULL, t_c, &contains_c)
 *         campl.AMPL_TupleFree(&t_c)
 *         return contains_c             # <<<<<<<<<<<<<<
 * 
 *     def set_values(self, values):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_contains_c); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 101, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "amplpy/set.pxi":89
 *         return int(size)
 * 
 *     def contains(self, t):             # <<<<<<<<<<<<<<
 *         """
 *         Check wether this set instance contains the specified Tuple.
 */

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

/* "amplpy/set.pxi":103
 *         return contains_c
 * 
 *     def set_values(self, values):             # <<<<<<<<<<<<<<
 *         """
 *         Set the tuples in this set. Valid only for non-indexed sets.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_3Set_17set_values(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_3Set_16set_values, "Set.set_values(self, values)\n\n        Set the tuples in this set. Valid only for non-indexed sets.\n\n        Args:\n            values: A list of tuples or a :class:`~amplpy.DataFrame`.\n\n        In the case of a :class:`~amplpy.DataFrame`, the number of indexing\n        columns of the must be equal to the arity of the set. In the case of\n        a list of tuples, the arity of each tuple must be equal to the arity\n        of the set.\n\n        For example, considering the following AMPL entities and corresponding\n        Python objects:\n\n        .. code-block:: ampl\n\n            set A := 1..2;\n            param p{i in A} := i+10;\n            set AA;\n\n        The following is valid:\n\n        .. code-block:: python\n\n            A, AA = ampl.get_set('A'), ampl.get_set('AA')\n            AA.set_values(A.get_values())  # AA has now the members {1, 2}\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_3Set_17set_values = {"set_values", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_3Set_17set_values, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_3Set_16set_values};
static PyObject *__pyx_pw_7_amplpy_3Set_17set_values(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_values = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_values (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_values)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(14, 103, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_values") < 0)) __PYX_ERR(14, 103, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_values = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_values", 1, 1, 1, __pyx_nargs); __PYX_ERR(14, 103, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.Set.set_values", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_3Set_16set_values(((struct __pyx_obj_7_amplpy_Set *)__pyx_v_self), __pyx_v_values);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/set.pxi":151
 *             else:
 * 
 *                 def cast_value(value):             # <<<<<<<<<<<<<<
 *                     if isinstance(value, str):
 *                         return value
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_3Set_10set_values_1cast_value(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7_amplpy_3Set_10set_values_1cast_value = {"cast_value", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_3Set_10set_values_1cast_value, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7_amplpy_3Set_10set_values_1cast_value(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_value = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cast_value (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_value,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_value)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(14, 151, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "cast_value") < 0)) __PYX_ERR(14, 151, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_value = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("cast_value", 1, 1, 1, __pyx_nargs); __PYX_ERR(14, 151, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.Set.set_values.cast_value", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_3Set_10set_values_cast_value(__pyx_self, __pyx_v_value);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_3Set_10set_values_cast_value(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_value) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("cast_value", 1);

  /* "amplpy/set.pxi":152
 * 
 *                 def cast_value(value):
 *                     if isinstance(value, str):             # <<<<<<<<<<<<<<
 *                         return value
 *                     elif isinstance(value, Real):
 */
  __pyx_t_1 = PyUnicode_Check(__pyx_v_value); 
  if (__pyx_t_1) {

    /* "amplpy/set.pxi":153
 *                 def cast_value(value):
 *                     if isinstance(value, str):
 *                         return value             # <<<<<<<<<<<<<<
 *                     elif isinstance(value, Real):
 *                         return float(value)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_value);
    __pyx_r = __pyx_v_value;
    goto __pyx_L0;

    /* "amplpy/set.pxi":152
 * 
 *                 def cast_value(value):
 *                     if isinstance(value, str):             # <<<<<<<<<<<<<<
 *                         return value
 *                     elif isinstance(value, Real):
 */
  }

  /* "amplpy/set.pxi":154
 *                     if isinstance(value, str):
 *                         return value
 *                     elif isinstance(value, Real):             # <<<<<<<<<<<<<<
 *                         return float(value)
 *                     else:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Real); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 154, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_IsInstance(__pyx_v_value, __pyx_t_2); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(14, 154, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (likely(__pyx_t_1)) {

    /* "amplpy/set.pxi":155
 *                         return value
 *                     elif isinstance(value, Real):
 *                         return float(value)             # <<<<<<<<<<<<<<
 *                     else:
 *                         raise TypeError("Excepted string or real.")
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyNumber_Float(__pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 155, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "amplpy/set.pxi":154
 *                     if isinstance(value, str):
 *                         return value
 *                     elif isinstance(value, Real):             # <<<<<<<<<<<<<<
 *                         return float(value)
 *                     else:
 */
  }

  /* "amplpy/set.pxi":157
 *                         return float(value)
 *                     else:
 *                         raise TypeError("Excepted string or real.")             # <<<<<<<<<<<<<<
 * 
 *                 def cast_row(row):
 */
  /*else*/ {
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 157, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(14, 157, __pyx_L1_error)
  }

  /* "amplpy/set.pxi":151
 *             else:
 * 
 *                 def cast_value(value):             # <<<<<<<<<<<<<<
 *                     if isinstance(value, str):
 *                         return value
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("_amplpy.Set.set_values.cast_value", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/set.pxi":159
 *                         raise TypeError("Excepted string or real.")
 * 
 *                 def cast_row(row):             # <<<<<<<<<<<<<<
 *                     if isinstance(row, str):
 *                         return row
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_3Set_10set_values_3cast_row(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7_amplpy_3Set_10set_values_3cast_row = {"cast_row", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_3Set_10set_values_3cast_row, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7_amplpy_3Set_10set_values_3cast_row(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_row = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cast_row (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_row,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_row)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(14, 159, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "cast_row") < 0)) __PYX_ERR(14, 159, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_row = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("cast_row", 1, 1, 1, __pyx_nargs); __PYX_ERR(14, 159, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.Set.set_values.cast_row", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_3Set_10set_values_2cast_row(__pyx_self, __pyx_v_row);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_3Set_10set_values_2cast_row(PyObject *__pyx_self, PyObject *__pyx_v_row) {
  struct __pyx_obj_7_amplpy___pyx_scope_struct_11_set_values *__pyx_cur_scope;
  struct __pyx_obj_7_amplpy___pyx_scope_struct_11_set_values *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  Py_UCS4 __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("cast_row", 1);
  __pyx_outer_scope = (struct __pyx_obj_7_amplpy___pyx_scope_struct_11_set_values *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "amplpy/set.pxi":160
 * 
 *                 def cast_row(row):
 *                     if isinstance(row, str):             # <<<<<<<<<<<<<<
 *                         return row
 *                     elif isinstance(row, Real):
 */
  __pyx_t_1 = PyUnicode_Check(__pyx_v_row); 
  if (__pyx_t_1) {

    /* "amplpy/set.pxi":161
 *                 def cast_row(row):
 *                     if isinstance(row, str):
 *                         return row             # <<<<<<<<<<<<<<
 *                     elif isinstance(row, Real):
 *                         return float(row)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_row);
    __pyx_r = __pyx_v_row;
    goto __pyx_L0;

    /* "amplpy/set.pxi":160
 * 
 *                 def cast_row(row):
 *                     if isinstance(row, str):             # <<<<<<<<<<<<<<
 *                         return row
 *                     elif isinstance(row, Real):
 */
  }

  /* "amplpy/set.pxi":162
 *                     if isinstance(row, str):
 *                         return row
 *                     elif isinstance(row, Real):             # <<<<<<<<<<<<<<
 *                         return float(row)
 *                     elif isinstance(row, Iterable):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Real); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 162, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_IsInstance(__pyx_v_row, __pyx_t_2); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(14, 162, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_1) {

    /* "amplpy/set.pxi":163
 *                         return row
 *                     elif isinstance(row, Real):
 *                         return float(row)             # <<<<<<<<<<<<<<
 *                     elif isinstance(row, Iterable):
 *                         return tuple(map(cast_value, row))
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyNumber_Float(__pyx_v_row); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 163, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "amplpy/set.pxi":162
 *                     if isinstance(row, str):
 *                         return row
 *                     elif isinstance(row, Real):             # <<<<<<<<<<<<<<
 *                         return float(row)
 *                     elif isinstance(row, Iterable):
 */
  }

  /* "amplpy/set.pxi":164
 *                     elif isinstance(row, Real):
 *                         return float(row)
 *                     elif isinstance(row, Iterable):             # <<<<<<<<<<<<<<
 *                         return tuple(map(cast_value, row))
 *                     else:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Iterable); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 164, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_IsInstance(__pyx_v_row, __pyx_t_2); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(14, 164, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_1) {

    /* "amplpy/set.pxi":165
 *                         return float(row)
 *                     elif isinstance(row, Iterable):
 *                         return tuple(map(cast_value, row))             # <<<<<<<<<<<<<<
 *                     else:
 *                         if dimen == 1:
 */
    __Pyx_XDECREF(__pyx_r);
    if (unlikely(!__pyx_cur_scope->__pyx_v_cast_value)) { __Pyx_RaiseClosureNameError("cast_value"); __PYX_ERR(14, 165, __pyx_L1_error) }
    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 165, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_cast_value);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_cast_value);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_cast_value)) __PYX_ERR(14, 165, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_row);
    __Pyx_GIVEREF(__pyx_v_row);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_row)) __PYX_ERR(14, 165, __pyx_L1_error);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(14, 165, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 165, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "amplpy/set.pxi":164
 *                     elif isinstance(row, Real):
 *                         return float(row)
 *                     elif isinstance(row, Iterable):             # <<<<<<<<<<<<<<
 *                         return tuple(map(cast_value, row))
 *                     else:
 */
  }

  /* "amplpy/set.pxi":167
 *                         return tuple(map(cast_value, row))
 *                     else:
 *                         if dimen == 1:             # <<<<<<<<<<<<<<
 *                             raise TypeError("Excepted string or real.")
 *                         else:
 */
  /*else*/ {
    if (unlikely(!__pyx_cur_scope->__pyx_v_dimen)) { __Pyx_RaiseClosureNameError("dimen"); __PYX_ERR(14, 167, __pyx_L1_error) }
    __pyx_t_1 = (__Pyx_PyInt_BoolEqObjC(__pyx_cur_scope->__pyx_v_dimen, __pyx_int_1, 1, 0)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(14, 167, __pyx_L1_error)
    if (unlikely(__pyx_t_1)) {

      /* "amplpy/set.pxi":168
 *                     else:
 *                         if dimen == 1:
 *                             raise TypeError("Excepted string or real.")             # <<<<<<<<<<<<<<
 *                         else:
 *                             raise ValueError(f"Excepted tuple of arity {dimen}.")
 */
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 168, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __PYX_ERR(14, 168, __pyx_L1_error)

      /* "amplpy/set.pxi":167
 *                         return tuple(map(cast_value, row))
 *                     else:
 *                         if dimen == 1:             # <<<<<<<<<<<<<<
 *                             raise TypeError("Excepted string or real.")
 *                         else:
 */
    }

    /* "amplpy/set.pxi":170
 *                             raise TypeError("Excepted string or real.")
 *                         else:
 *                             raise ValueError(f"Excepted tuple of arity {dimen}.")             # <<<<<<<<<<<<<<
 * 
 *                 values = [cast_row(row) for row in values]
 */
    /*else*/ {
      __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 170, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = 0;
      __pyx_t_5 = 127;
      __Pyx_INCREF(__pyx_kp_u_Excepted_tuple_of_arity);
      __pyx_t_4 += 24;
      __Pyx_GIVEREF(__pyx_kp_u_Excepted_tuple_of_arity);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_u_Excepted_tuple_of_arity);
      if (unlikely(!__pyx_cur_scope->__pyx_v_dimen)) { __Pyx_RaiseClosureNameError("dimen"); __PYX_ERR(14, 170, __pyx_L1_error) }
      __pyx_t_3 = __Pyx_PyObject_FormatSimple(__pyx_cur_scope->__pyx_v_dimen, __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(14, 170, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) > __pyx_t_5) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) : __pyx_t_5;
      __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_INCREF(__pyx_kp_u__21);
      __pyx_t_4 += 1;
      __Pyx_GIVEREF(__pyx_kp_u__21);
      PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_kp_u__21);
      __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_2, 3, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(14, 170, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 170, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __PYX_ERR(14, 170, __pyx_L1_error)
    }
  }

  /* "amplpy/set.pxi":159
 *                         raise TypeError("Excepted string or real.")
 * 
 *                 def cast_row(row):             # <<<<<<<<<<<<<<
 *                     if isinstance(row, str):
 *                         return row
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("_amplpy.Set.set_values.cast_row", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7_amplpy_3Set_10set_values_6generator8(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "amplpy/set.pxi":142
 *         elif isinstance(values, Iterable):
 *             dimen = self.arity()
 *             if dimen == 1 and all(isinstance(value, str) for value in values):             # <<<<<<<<<<<<<<
 *                 if not isinstance(values, (list, tuple)):
 *                     values = list(values)
 */

static PyObject *__pyx_pf_7_amplpy_3Set_10set_values_4genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) {
  struct __pyx_obj_7_amplpy___pyx_scope_struct_12_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_7_amplpy___pyx_scope_struct_12_genexpr *)__pyx_tp_new_7_amplpy___pyx_scope_struct_12_genexpr(__pyx_ptype_7_amplpy___pyx_scope_struct_12_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7_amplpy___pyx_scope_struct_12_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(14, 142, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7_amplpy_3Set_10set_values_6generator8, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_set_values_locals_genexpr, __pyx_n_s_amplpy); if (unlikely(!gen)) __PYX_ERR(14, 142, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("_amplpy.Set.set_values.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_7_amplpy_3Set_10set_values_6generator8(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7_amplpy___pyx_scope_struct_12_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7_amplpy___pyx_scope_struct_12_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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __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(14, 142, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(14, 142, __pyx_L1_error) }
  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) {
    __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __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_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 142, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(14, 142, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(14, 142, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) 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(14, 142, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(14, 142, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(14, 142, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) 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(14, 142, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(14, 142, __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(14, 142, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_value);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_value, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_5 = PyUnicode_Check(__pyx_cur_scope->__pyx_v_value); 
    __pyx_t_6 = (!__pyx_t_5);
    if (__pyx_t_6) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_False);
      __pyx_r = Py_False;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_True);
    __pyx_r = Py_True;
    goto __pyx_L0;
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_Generator_Replace_StopIteration(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);
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7_amplpy_3Set_10set_values_9generator9(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "amplpy/set.pxi":146
 *                     values = list(values)
 *                 setValues(self._c_ampl, self._name, self._index, values, len(values))
 *             elif dimen == 1 and all(isinstance(value, Real) for value in values):             # <<<<<<<<<<<<<<
 *                 values = list(map(float, values))
 *                 setValues(self._c_ampl, self._name, self._index, values, len(values))
 */

static PyObject *__pyx_pf_7_amplpy_3Set_10set_values_7genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) {
  struct __pyx_obj_7_amplpy___pyx_scope_struct_13_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_7_amplpy___pyx_scope_struct_13_genexpr *)__pyx_tp_new_7_amplpy___pyx_scope_struct_13_genexpr(__pyx_ptype_7_amplpy___pyx_scope_struct_13_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7_amplpy___pyx_scope_struct_13_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(14, 146, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7_amplpy_3Set_10set_values_9generator9, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_set_values_locals_genexpr, __pyx_n_s_amplpy); if (unlikely(!gen)) __PYX_ERR(14, 146, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("_amplpy.Set.set_values.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_7_amplpy_3Set_10set_values_9generator9(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7_amplpy___pyx_scope_struct_13_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7_amplpy___pyx_scope_struct_13_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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __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(14, 146, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(14, 146, __pyx_L1_error) }
  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) {
    __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __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_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 146, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(14, 146, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(14, 146, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) 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(14, 146, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(14, 146, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(14, 146, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) 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(14, 146, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(14, 146, __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(14, 146, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_value);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_value, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Real); if (unlikely(!__pyx_t_4)) __PYX_ERR(14, 146, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyObject_IsInstance(__pyx_cur_scope->__pyx_v_value, __pyx_t_4); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(14, 146, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_6 = (!__pyx_t_5);
    if (__pyx_t_6) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_False);
      __pyx_r = Py_False;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_True);
    __pyx_r = Py_True;
    goto __pyx_L0;
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_Generator_Replace_StopIteration(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);
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7_amplpy_3Set_10set_values_12generator10(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "amplpy/set.pxi":174
 *                 values = [cast_row(row) for row in values]
 *                 if dimen == 1:
 *                     if any(isinstance(row, tuple) for row in values):             # <<<<<<<<<<<<<<
 *                         raise ValueError(
 *                             f"Trying to assign tuples to set of arity {dimen}."
 */

static PyObject *__pyx_pf_7_amplpy_3Set_10set_values_10genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) {
  struct __pyx_obj_7_amplpy___pyx_scope_struct_14_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_7_amplpy___pyx_scope_struct_14_genexpr *)__pyx_tp_new_7_amplpy___pyx_scope_struct_14_genexpr(__pyx_ptype_7_amplpy___pyx_scope_struct_14_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7_amplpy___pyx_scope_struct_14_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(14, 174, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7_amplpy_3Set_10set_values_12generator10, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_set_values_locals_genexpr, __pyx_n_s_amplpy); if (unlikely(!gen)) __PYX_ERR(14, 174, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("_amplpy.Set.set_values.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_7_amplpy_3Set_10set_values_12generator10(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7_amplpy___pyx_scope_struct_14_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7_amplpy___pyx_scope_struct_14_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_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __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(14, 174, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(14, 174, __pyx_L1_error) }
  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) {
    __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __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_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 174, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(14, 174, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(14, 174, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) 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(14, 174, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(14, 174, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(14, 174, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) 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(14, 174, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(14, 174, __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(14, 174, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_row);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_row, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_5 = PyTuple_Check(__pyx_cur_scope->__pyx_v_row); 
    if (__pyx_t_5) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_True);
      __pyx_r = Py_True;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    goto __pyx_L0;
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_Generator_Replace_StopIteration(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);
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7_amplpy_3Set_10set_values_15generator11(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "amplpy/set.pxi":180
 *                 else:
 *                     if any(
 *                         not isinstance(row, tuple) or len(row) != dimen             # <<<<<<<<<<<<<<
 *                         for row in values
 *                     ):
 */

static PyObject *__pyx_pf_7_amplpy_3Set_10set_values_13genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) {
  struct __pyx_obj_7_amplpy___pyx_scope_struct_15_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_7_amplpy___pyx_scope_struct_15_genexpr *)__pyx_tp_new_7_amplpy___pyx_scope_struct_15_genexpr(__pyx_ptype_7_amplpy___pyx_scope_struct_15_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7_amplpy___pyx_scope_struct_15_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(14, 180, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7_amplpy___pyx_scope_struct_11_set_values *) __pyx_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope);
  __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7_amplpy_3Set_10set_values_15generator11, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_set_values_locals_genexpr, __pyx_n_s_amplpy); if (unlikely(!gen)) __PYX_ERR(14, 180, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("_amplpy.Set.set_values.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_7_amplpy_3Set_10set_values_15generator11(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7_amplpy___pyx_scope_struct_15_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7_amplpy___pyx_scope_struct_15_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;
  int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __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(14, 180, __pyx_L1_error)

  /* "amplpy/set.pxi":181
 *                     if any(
 *                         not isinstance(row, tuple) or len(row) != dimen
 *                         for row in values             # <<<<<<<<<<<<<<
 *                     ):
 *                         raise ValueError(f"Expected tuples of arity {dimen}.")
 */
  if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(14, 181, __pyx_L1_error) }
  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) {
    __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __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_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 181, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(14, 181, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(14, 181, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) 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(14, 181, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(14, 181, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(14, 181, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) 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(14, 181, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(14, 181, __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(14, 181, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_row);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_row, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;

    /* "amplpy/set.pxi":180
 *                 else:
 *                     if any(
 *                         not isinstance(row, tuple) or len(row) != dimen             # <<<<<<<<<<<<<<
 *                         for row in values
 *                     ):
 */
    __pyx_t_6 = PyTuple_Check(__pyx_cur_scope->__pyx_v_row); 
    __pyx_t_7 = (!__pyx_t_6);
    if (!__pyx_t_7) {
    } else {
      __pyx_t_5 = __pyx_t_7;
      goto __pyx_L7_bool_binop_done;
    }
    __pyx_t_8 = PyObject_Length(__pyx_cur_scope->__pyx_v_row); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(14, 180, __pyx_L1_error)
    __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(14, 180, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_dimen)) { __Pyx_RaiseClosureNameError("dimen"); __PYX_ERR(14, 180, __pyx_L1_error) }
    __pyx_t_9 = PyObject_RichCompare(__pyx_t_4, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_dimen, Py_NE); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(14, 180, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(14, 180, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_5 = __pyx_t_7;
    __pyx_L7_bool_binop_done:;
    if (__pyx_t_5) {

      /* "amplpy/set.pxi":179
 *                         )
 *                 else:
 *                     if any(             # <<<<<<<<<<<<<<
 *                         not isinstance(row, tuple) or len(row) != dimen
 *                         for row in values
 */
      __Pyx_XDECREF(__pyx_r);

      /* "amplpy/set.pxi":180
 *                 else:
 *                     if any(
 *                         not isinstance(row, tuple) or len(row) != dimen             # <<<<<<<<<<<<<<
 *                         for row in values
 *                     ):
 */
      __Pyx_INCREF(Py_True);
      __pyx_r = Py_True;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }

    /* "amplpy/set.pxi":181
 *                     if any(
 *                         not isinstance(row, tuple) or len(row) != dimen
 *                         for row in values             # <<<<<<<<<<<<<<
 *                     ):
 *                         raise ValueError(f"Expected tuples of arity {dimen}.")
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  /*else*/ {

    /* "amplpy/set.pxi":179
 *                         )
 *                 else:
 *                     if any(             # <<<<<<<<<<<<<<
 *                         not isinstance(row, tuple) or len(row) != dimen
 *                         for row in values
 */
    __Pyx_XDECREF(__pyx_r);

    /* "amplpy/set.pxi":180
 *                 else:
 *                     if any(
 *                         not isinstance(row, tuple) or len(row) != dimen             # <<<<<<<<<<<<<<
 *                         for row in values
 *                     ):
 */
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    goto __pyx_L0;
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

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

/* "amplpy/set.pxi":103
 *         return contains_c
 * 
 *     def set_values(self, values):             # <<<<<<<<<<<<<<
 *         """
 *         Set the tuples in this set. Valid only for non-indexed sets.
 */

static PyObject *__pyx_pf_7_amplpy_3Set_16set_values(struct __pyx_obj_7_amplpy_Set *__pyx_v_self, PyObject *__pyx_v_values) {
  struct __pyx_obj_7_amplpy___pyx_scope_struct_11_set_values *__pyx_cur_scope;
  struct __pyx_obj_7_amplpy_DataFrame *__pyx_v_df = 0;
  PyObject *__pyx_v_index = NULL;
  PyObject *__pyx_v_members = NULL;
  PyObject *__pyx_v_cast_row = 0;
  PyObject *__pyx_gb_7_amplpy_3Set_10set_values_6generator8 = 0;
  PyObject *__pyx_gb_7_amplpy_3Set_10set_values_9generator9 = 0;
  PyObject *__pyx_9genexpr29__pyx_v_row = NULL;
  PyObject *__pyx_gb_7_amplpy_3Set_10set_values_12generator10 = 0;
  PyObject *__pyx_gb_7_amplpy_3Set_10set_values_15generator11 = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  AMPL_DATAFRAME *__pyx_t_12;
  PyObject *(*__pyx_t_13)(PyObject *);
  Py_UCS4 __pyx_t_14;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_values", 0);
  __pyx_cur_scope = (struct __pyx_obj_7_amplpy___pyx_scope_struct_11_set_values *)__pyx_tp_new_7_amplpy___pyx_scope_struct_11_set_values(__pyx_ptype_7_amplpy___pyx_scope_struct_11_set_values, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7_amplpy___pyx_scope_struct_11_set_values *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(14, 103, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __Pyx_INCREF(__pyx_v_values);

  /* "amplpy/set.pxi":131
 *             AA.set_values(A.get_values())  # AA has now the members {1, 2}
 *         """
 *         cdef DataFrame df = None             # <<<<<<<<<<<<<<
 *         if not self.is_scalar():
 *             if not isinstance(values, dict):
 */
  __Pyx_INCREF(Py_None);
  __pyx_v_df = ((struct __pyx_obj_7_amplpy_DataFrame *)Py_None);

  /* "amplpy/set.pxi":132
 *         """
 *         cdef DataFrame df = None
 *         if not self.is_scalar():             # <<<<<<<<<<<<<<
 *             if not isinstance(values, dict):
 *                 raise TypeError("Excepted dictionary of set members for each index.")
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_is_scalar); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 132, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 132, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(14, 132, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = (!__pyx_t_5);
  if (__pyx_t_6) {

    /* "amplpy/set.pxi":133
 *         cdef DataFrame df = None
 *         if not self.is_scalar():
 *             if not isinstance(values, dict):             # <<<<<<<<<<<<<<
 *                 raise TypeError("Excepted dictionary of set members for each index.")
 *             for index, members in values.items():
 */
    __pyx_t_6 = PyDict_Check(__pyx_v_values); 
    __pyx_t_5 = (!__pyx_t_6);
    if (unlikely(__pyx_t_5)) {

      /* "amplpy/set.pxi":134
 *         if not self.is_scalar():
 *             if not isinstance(values, dict):
 *                 raise TypeError("Excepted dictionary of set members for each index.")             # <<<<<<<<<<<<<<
 *             for index, members in values.items():
 *                 self[index].set_values(members)
 */
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 134, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_Raise(__pyx_t_1, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __PYX_ERR(14, 134, __pyx_L1_error)

      /* "amplpy/set.pxi":133
 *         cdef DataFrame df = None
 *         if not self.is_scalar():
 *             if not isinstance(values, dict):             # <<<<<<<<<<<<<<
 *                 raise TypeError("Excepted dictionary of set members for each index.")
 *             for index, members in values.items():
 */
    }

    /* "amplpy/set.pxi":135
 *             if not isinstance(values, dict):
 *                 raise TypeError("Excepted dictionary of set members for each index.")
 *             for index, members in values.items():             # <<<<<<<<<<<<<<
 *                 self[index].set_values(members)
 *         elif isinstance(values, DataFrame):
 */
    __pyx_t_7 = 0;
    if (unlikely(__pyx_v_values == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items");
      __PYX_ERR(14, 135, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_dict_iterator(__pyx_v_values, 0, __pyx_n_s_items, (&__pyx_t_8), (&__pyx_t_9)); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 135, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
    while (1) {
      __pyx_t_10 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_8, &__pyx_t_7, &__pyx_t_2, &__pyx_t_3, NULL, __pyx_t_9);
      if (unlikely(__pyx_t_10 == 0)) break;
      if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(14, 135, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_XDECREF_SET(__pyx_v_members, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "amplpy/set.pxi":136
 *                 raise TypeError("Excepted dictionary of set members for each index.")
 *             for index, members in values.items():
 *                 self[index].set_values(members)             # <<<<<<<<<<<<<<
 *         elif isinstance(values, DataFrame):
 *             df = values
 */
      __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 136, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_set_values); if (unlikely(!__pyx_t_11)) __PYX_ERR(14, 136, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = NULL;
      __pyx_t_4 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_11))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_11);
        if (likely(__pyx_t_2)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_11, function);
          __pyx_t_4 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_members};
        __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(14, 136, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "amplpy/set.pxi":132
 *         """
 *         cdef DataFrame df = None
 *         if not self.is_scalar():             # <<<<<<<<<<<<<<
 *             if not isinstance(values, dict):
 *                 raise TypeError("Excepted dictionary of set members for each index.")
 */
    goto __pyx_L3;
  }

  /* "amplpy/set.pxi":137
 *             for index, members in values.items():
 *                 self[index].set_values(members)
 *         elif isinstance(values, DataFrame):             # <<<<<<<<<<<<<<
 *             df = values
 *             PY_AMPL_CALL(campl.AMPL_SetInstanceSetValuesDataframe(self._c_ampl, self._name, self._index, df.get_ptr()))
 */
  __pyx_t_5 = __Pyx_TypeCheck(__pyx_v_values, __pyx_ptype_7_amplpy_DataFrame); 
  if (__pyx_t_5) {

    /* "amplpy/set.pxi":138
 *                 self[index].set_values(members)
 *         elif isinstance(values, DataFrame):
 *             df = values             # <<<<<<<<<<<<<<
 *             PY_AMPL_CALL(campl.AMPL_SetInstanceSetValuesDataframe(self._c_ampl, self._name, self._index, df.get_ptr()))
 *         elif isinstance(values, Iterable):
 */
    if (!(likely(((__pyx_v_values) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_values, __pyx_ptype_7_amplpy_DataFrame))))) __PYX_ERR(14, 138, __pyx_L1_error)
    __pyx_t_1 = __pyx_v_values;
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_DECREF_SET(__pyx_v_df, ((struct __pyx_obj_7_amplpy_DataFrame *)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "amplpy/set.pxi":139
 *         elif isinstance(values, DataFrame):
 *             df = values
 *             PY_AMPL_CALL(campl.AMPL_SetInstanceSetValuesDataframe(self._c_ampl, self._name, self._index, df.get_ptr()))             # <<<<<<<<<<<<<<
 *         elif isinstance(values, Iterable):
 *             dimen = self.arity()
 */
    __pyx_t_12 = ((struct __pyx_vtabstruct_7_amplpy_DataFrame *)__pyx_v_df->__pyx_vtab)->get_ptr(__pyx_v_df); if (unlikely(PyErr_Occurred())) __PYX_ERR(14, 139, __pyx_L1_error)
    __pyx_t_1 = __pyx_f_7_amplpy_PY_AMPL_CALL(AMPL_SetInstanceSetValuesDataframe(__pyx_v_self->__pyx_base._c_ampl, __pyx_v_self->__pyx_base._name, __pyx_v_self->__pyx_base._index, __pyx_t_12)); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 139, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "amplpy/set.pxi":137
 *             for index, members in values.items():
 *                 self[index].set_values(members)
 *         elif isinstance(values, DataFrame):             # <<<<<<<<<<<<<<
 *             df = values
 *             PY_AMPL_CALL(campl.AMPL_SetInstanceSetValuesDataframe(self._c_ampl, self._name, self._index, df.get_ptr()))
 */
    goto __pyx_L3;
  }

  /* "amplpy/set.pxi":140
 *             df = values
 *             PY_AMPL_CALL(campl.AMPL_SetInstanceSetValuesDataframe(self._c_ampl, self._name, self._index, df.get_ptr()))
 *         elif isinstance(values, Iterable):             # <<<<<<<<<<<<<<
 *             dimen = self.arity()
 *             if dimen == 1 and all(isinstance(value, str) for value in values):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Iterable); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 140, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = PyObject_IsInstance(__pyx_v_values, __pyx_t_1); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(14, 140, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_5) {

    /* "amplpy/set.pxi":141
 *             PY_AMPL_CALL(campl.AMPL_SetInstanceSetValuesDataframe(self._c_ampl, self._name, self._index, df.get_ptr()))
 *         elif isinstance(values, Iterable):
 *             dimen = self.arity()             # <<<<<<<<<<<<<<
 *             if dimen == 1 and all(isinstance(value, str) for value in values):
 *                 if not isinstance(values, (list, tuple)):
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_arity); if (unlikely(!__pyx_t_3)) __PYX_ERR(14, 141, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_11 = NULL;
    __pyx_t_4 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_11)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_11);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_4 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_11, NULL};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 141, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_cur_scope->__pyx_v_dimen = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "amplpy/set.pxi":142
 *         elif isinstance(values, Iterable):
 *             dimen = self.arity()
 *             if dimen == 1 and all(isinstance(value, str) for value in values):             # <<<<<<<<<<<<<<
 *                 if not isinstance(values, (list, tuple)):
 *                     values = list(values)
 */
    __pyx_t_6 = (__Pyx_PyInt_BoolEqObjC(__pyx_cur_scope->__pyx_v_dimen, __pyx_int_1, 1, 0)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(14, 142, __pyx_L1_error)
    if (__pyx_t_6) {
    } else {
      __pyx_t_5 = __pyx_t_6;
      goto __pyx_L8_bool_binop_done;
    }
    __pyx_t_1 = __pyx_pf_7_amplpy_3Set_10set_values_4genexpr(NULL, __pyx_v_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 142, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_Generator_Next(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(14, 142, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(14, 142, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_5 = __pyx_t_6;
    __pyx_L8_bool_binop_done:;
    if (__pyx_t_5) {

      /* "amplpy/set.pxi":143
 *             dimen = self.arity()
 *             if dimen == 1 and all(isinstance(value, str) for value in values):
 *                 if not isinstance(values, (list, tuple)):             # <<<<<<<<<<<<<<
 *                     values = list(values)
 *                 setValues(self._c_ampl, self._name, self._index, values, len(values))
 */
      __pyx_t_6 = PyList_Check(__pyx_v_values); 
      if (!__pyx_t_6) {
      } else {
        __pyx_t_5 = __pyx_t_6;
        goto __pyx_L11_bool_binop_done;
      }
      __pyx_t_6 = PyTuple_Check(__pyx_v_values); 
      __pyx_t_5 = __pyx_t_6;
      __pyx_L11_bool_binop_done:;
      __pyx_t_6 = (!__pyx_t_5);
      if (__pyx_t_6) {

        /* "amplpy/set.pxi":144
 *             if dimen == 1 and all(isinstance(value, str) for value in values):
 *                 if not isinstance(values, (list, tuple)):
 *                     values = list(values)             # <<<<<<<<<<<<<<
 *                 setValues(self._c_ampl, self._name, self._index, values, len(values))
 *             elif dimen == 1 and all(isinstance(value, Real) for value in values):
 */
        __pyx_t_3 = PySequence_List(__pyx_v_values); if (unlikely(!__pyx_t_3)) __PYX_ERR(14, 144, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF_SET(__pyx_v_values, __pyx_t_3);
        __pyx_t_3 = 0;

        /* "amplpy/set.pxi":143
 *             dimen = self.arity()
 *             if dimen == 1 and all(isinstance(value, str) for value in values):
 *                 if not isinstance(values, (list, tuple)):             # <<<<<<<<<<<<<<
 *                     values = list(values)
 *                 setValues(self._c_ampl, self._name, self._index, values, len(values))
 */
      }

      /* "amplpy/set.pxi":145
 *                 if not isinstance(values, (list, tuple)):
 *                     values = list(values)
 *                 setValues(self._c_ampl, self._name, self._index, values, len(values))             # <<<<<<<<<<<<<<
 *             elif dimen == 1 and all(isinstance(value, Real) for value in values):
 *                 values = list(map(float, values))
 */
      __pyx_t_8 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(14, 145, __pyx_L1_error)
      __pyx_f_7_amplpy_setValues(__pyx_v_self->__pyx_base._c_ampl, __pyx_v_self->__pyx_base._name, __pyx_v_self->__pyx_base._index, __pyx_v_values, __pyx_t_8); if (unlikely(PyErr_Occurred())) __PYX_ERR(14, 145, __pyx_L1_error)

      /* "amplpy/set.pxi":142
 *         elif isinstance(values, Iterable):
 *             dimen = self.arity()
 *             if dimen == 1 and all(isinstance(value, str) for value in values):             # <<<<<<<<<<<<<<
 *                 if not isinstance(values, (list, tuple)):
 *                     values = list(values)
 */
      goto __pyx_L7;
    }

    /* "amplpy/set.pxi":146
 *                     values = list(values)
 *                 setValues(self._c_ampl, self._name, self._index, values, len(values))
 *             elif dimen == 1 and all(isinstance(value, Real) for value in values):             # <<<<<<<<<<<<<<
 *                 values = list(map(float, values))
 *                 setValues(self._c_ampl, self._name, self._index, values, len(values))
 */
    __pyx_t_5 = (__Pyx_PyInt_BoolEqObjC(__pyx_cur_scope->__pyx_v_dimen, __pyx_int_1, 1, 0)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(14, 146, __pyx_L1_error)
    if (__pyx_t_5) {
    } else {
      __pyx_t_6 = __pyx_t_5;
      goto __pyx_L13_bool_binop_done;
    }
    __pyx_t_3 = __pyx_pf_7_amplpy_3Set_10set_values_7genexpr(NULL, __pyx_v_values); if (unlikely(!__pyx_t_3)) __PYX_ERR(14, 146, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_Generator_Next(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 146, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(14, 146, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_6 = __pyx_t_5;
    __pyx_L13_bool_binop_done:;
    if (__pyx_t_6) {

      /* "amplpy/set.pxi":147
 *                 setValues(self._c_ampl, self._name, self._index, values, len(values))
 *             elif dimen == 1 and all(isinstance(value, Real) for value in values):
 *                 values = list(map(float, values))             # <<<<<<<<<<<<<<
 *                 setValues(self._c_ampl, self._name, self._index, values, len(values))
 *             else:
 */
      __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 147, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF((PyObject *)(&PyFloat_Type));
      __Pyx_GIVEREF((PyObject *)(&PyFloat_Type));
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)(&PyFloat_Type)))) __PYX_ERR(14, 147, __pyx_L1_error);
      __Pyx_INCREF(__pyx_v_values);
      __Pyx_GIVEREF(__pyx_v_values);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_values)) __PYX_ERR(14, 147, __pyx_L1_error);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(14, 147, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PySequence_ListKeepNew(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 147, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF_SET(__pyx_v_values, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "amplpy/set.pxi":148
 *             elif dimen == 1 and all(isinstance(value, Real) for value in values):
 *                 values = list(map(float, values))
 *                 setValues(self._c_ampl, self._name, self._index, values, len(values))             # <<<<<<<<<<<<<<
 *             else:
 * 
 */
      __pyx_t_8 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(14, 148, __pyx_L1_error)
      __pyx_f_7_amplpy_setValues(__pyx_v_self->__pyx_base._c_ampl, __pyx_v_self->__pyx_base._name, __pyx_v_self->__pyx_base._index, __pyx_v_values, __pyx_t_8); if (unlikely(PyErr_Occurred())) __PYX_ERR(14, 148, __pyx_L1_error)

      /* "amplpy/set.pxi":146
 *                     values = list(values)
 *                 setValues(self._c_ampl, self._name, self._index, values, len(values))
 *             elif dimen == 1 and all(isinstance(value, Real) for value in values):             # <<<<<<<<<<<<<<
 *                 values = list(map(float, values))
 *                 setValues(self._c_ampl, self._name, self._index, values, len(values))
 */
      goto __pyx_L7;
    }

    /* "amplpy/set.pxi":151
 *             else:
 * 
 *                 def cast_value(value):             # <<<<<<<<<<<<<<
 *                     if isinstance(value, str):
 *                         return value
 */
    /*else*/ {
      __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_3Set_10set_values_1cast_value, 0, __pyx_n_s_set_values_locals_cast_value, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__30)); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 151, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      __pyx_cur_scope->__pyx_v_cast_value = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "amplpy/set.pxi":159
 *                         raise TypeError("Excepted string or real.")
 * 
 *                 def cast_row(row):             # <<<<<<<<<<<<<<
 *                     if isinstance(row, str):
 *                         return row
 */
      __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_3Set_10set_values_3cast_row, 0, __pyx_n_s_set_values_locals_cast_row, ((PyObject*)__pyx_cur_scope), __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__32)); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 159, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_v_cast_row = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "amplpy/set.pxi":172
 *                             raise ValueError(f"Excepted tuple of arity {dimen}.")
 * 
 *                 values = [cast_row(row) for row in values]             # <<<<<<<<<<<<<<
 *                 if dimen == 1:
 *                     if any(isinstance(row, tuple) for row in values):
 */
      { /* enter inner scope */
        __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 172, __pyx_L17_error)
        __Pyx_GOTREF(__pyx_t_1);
        if (likely(PyList_CheckExact(__pyx_v_values)) || PyTuple_CheckExact(__pyx_v_values)) {
          __pyx_t_3 = __pyx_v_values; __Pyx_INCREF(__pyx_t_3);
          __pyx_t_8 = 0;
          __pyx_t_13 = NULL;
        } else {
          __pyx_t_8 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_values); if (unlikely(!__pyx_t_3)) __PYX_ERR(14, 172, __pyx_L17_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_13 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_13)) __PYX_ERR(14, 172, __pyx_L17_error)
        }
        for (;;) {
          if (likely(!__pyx_t_13)) {
            if (likely(PyList_CheckExact(__pyx_t_3))) {
              {
                Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3);
                #if !CYTHON_ASSUME_SAFE_MACROS
                if (unlikely((__pyx_temp < 0))) __PYX_ERR(14, 172, __pyx_L17_error)
                #endif
                if (__pyx_t_8 >= __pyx_temp) break;
              }
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_11 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_8); __Pyx_INCREF(__pyx_t_11); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(14, 172, __pyx_L17_error)
              #else
              __pyx_t_11 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_11)) __PYX_ERR(14, 172, __pyx_L17_error)
              __Pyx_GOTREF(__pyx_t_11);
              #endif
            } else {
              {
                Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3);
                #if !CYTHON_ASSUME_SAFE_MACROS
                if (unlikely((__pyx_temp < 0))) __PYX_ERR(14, 172, __pyx_L17_error)
                #endif
                if (__pyx_t_8 >= __pyx_temp) break;
              }
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_11 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_8); __Pyx_INCREF(__pyx_t_11); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(14, 172, __pyx_L17_error)
              #else
              __pyx_t_11 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_11)) __PYX_ERR(14, 172, __pyx_L17_error)
              __Pyx_GOTREF(__pyx_t_11);
              #endif
            }
          } else {
            __pyx_t_11 = __pyx_t_13(__pyx_t_3);
            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(14, 172, __pyx_L17_error)
              }
              break;
            }
            __Pyx_GOTREF(__pyx_t_11);
          }
          __Pyx_XDECREF_SET(__pyx_9genexpr29__pyx_v_row, __pyx_t_11);
          __pyx_t_11 = 0;
          __pyx_t_11 = __pyx_pf_7_amplpy_3Set_10set_values_2cast_row(__pyx_v_cast_row, __pyx_9genexpr29__pyx_v_row); if (unlikely(!__pyx_t_11)) __PYX_ERR(14, 172, __pyx_L17_error)
          __Pyx_GOTREF(__pyx_t_11);
          if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_11))) __PYX_ERR(14, 172, __pyx_L17_error)
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        }
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_9genexpr29__pyx_v_row); __pyx_9genexpr29__pyx_v_row = 0;
        goto __pyx_L21_exit_scope;
        __pyx_L17_error:;
        __Pyx_XDECREF(__pyx_9genexpr29__pyx_v_row); __pyx_9genexpr29__pyx_v_row = 0;
        goto __pyx_L1_error;
        __pyx_L21_exit_scope:;
      } /* exit inner scope */
      __Pyx_DECREF_SET(__pyx_v_values, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "amplpy/set.pxi":173
 * 
 *                 values = [cast_row(row) for row in values]
 *                 if dimen == 1:             # <<<<<<<<<<<<<<
 *                     if any(isinstance(row, tuple) for row in values):
 *                         raise ValueError(
 */
      __pyx_t_6 = (__Pyx_PyInt_BoolEqObjC(__pyx_cur_scope->__pyx_v_dimen, __pyx_int_1, 1, 0)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(14, 173, __pyx_L1_error)
      if (__pyx_t_6) {

        /* "amplpy/set.pxi":174
 *                 values = [cast_row(row) for row in values]
 *                 if dimen == 1:
 *                     if any(isinstance(row, tuple) for row in values):             # <<<<<<<<<<<<<<
 *                         raise ValueError(
 *                             f"Trying to assign tuples to set of arity {dimen}."
 */
        __pyx_t_1 = __pyx_pf_7_amplpy_3Set_10set_values_10genexpr(NULL, __pyx_v_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 174, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_3 = __Pyx_Generator_Next(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(14, 174, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(14, 174, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(__pyx_t_6)) {

          /* "amplpy/set.pxi":176
 *                     if any(isinstance(row, tuple) for row in values):
 *                         raise ValueError(
 *                             f"Trying to assign tuples to set of arity {dimen}."             # <<<<<<<<<<<<<<
 *                         )
 *                 else:
 */
          __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(14, 176, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_8 = 0;
          __pyx_t_14 = 127;
          __Pyx_INCREF(__pyx_kp_u_Trying_to_assign_tuples_to_set_o);
          __pyx_t_8 += 40;
          __Pyx_GIVEREF(__pyx_kp_u_Trying_to_assign_tuples_to_set_o);
          PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u_Trying_to_assign_tuples_to_set_o);
          __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_cur_scope->__pyx_v_dimen, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 176, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_14 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_14) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_14;
          __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
          __Pyx_GIVEREF(__pyx_t_1);
          PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
          __pyx_t_1 = 0;
          __Pyx_INCREF(__pyx_kp_u__21);
          __pyx_t_8 += 1;
          __Pyx_GIVEREF(__pyx_kp_u__21);
          PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u__21);
          __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_3, 3, __pyx_t_8, __pyx_t_14); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 176, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

          /* "amplpy/set.pxi":175
 *                 if dimen == 1:
 *                     if any(isinstance(row, tuple) for row in values):
 *                         raise ValueError(             # <<<<<<<<<<<<<<
 *                             f"Trying to assign tuples to set of arity {dimen}."
 *                         )
 */
          __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(14, 175, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_Raise(__pyx_t_3, 0, 0, 0);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __PYX_ERR(14, 175, __pyx_L1_error)

          /* "amplpy/set.pxi":174
 *                 values = [cast_row(row) for row in values]
 *                 if dimen == 1:
 *                     if any(isinstance(row, tuple) for row in values):             # <<<<<<<<<<<<<<
 *                         raise ValueError(
 *                             f"Trying to assign tuples to set of arity {dimen}."
 */
        }

        /* "amplpy/set.pxi":173
 * 
 *                 values = [cast_row(row) for row in values]
 *                 if dimen == 1:             # <<<<<<<<<<<<<<
 *                     if any(isinstance(row, tuple) for row in values):
 *                         raise ValueError(
 */
        goto __pyx_L22;
      }

      /* "amplpy/set.pxi":179
 *                         )
 *                 else:
 *                     if any(             # <<<<<<<<<<<<<<
 *                         not isinstance(row, tuple) or len(row) != dimen
 *                         for row in values
 */
      /*else*/ {

        /* "amplpy/set.pxi":180
 *                 else:
 *                     if any(
 *                         not isinstance(row, tuple) or len(row) != dimen             # <<<<<<<<<<<<<<
 *                         for row in values
 *                     ):
 */
        __pyx_t_3 = __pyx_pf_7_amplpy_3Set_10set_values_13genexpr(((PyObject*)__pyx_cur_scope), __pyx_v_values); if (unlikely(!__pyx_t_3)) __PYX_ERR(14, 180, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_1 = __Pyx_Generator_Next(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 180, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(14, 180, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "amplpy/set.pxi":179
 *                         )
 *                 else:
 *                     if any(             # <<<<<<<<<<<<<<
 *                         not isinstance(row, tuple) or len(row) != dimen
 *                         for row in values
 */
        if (unlikely(__pyx_t_6)) {

          /* "amplpy/set.pxi":183
 *                         for row in values
 *                     ):
 *                         raise ValueError(f"Expected tuples of arity {dimen}.")             # <<<<<<<<<<<<<<
 *                 setValues(self._c_ampl, self._name, self._index, values, len(values))
 *         else:
 */
          __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 183, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_8 = 0;
          __pyx_t_14 = 127;
          __Pyx_INCREF(__pyx_kp_u_Expected_tuples_of_arity);
          __pyx_t_8 += 25;
          __Pyx_GIVEREF(__pyx_kp_u_Expected_tuples_of_arity);
          PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_Expected_tuples_of_arity);
          __pyx_t_3 = __Pyx_PyObject_FormatSimple(__pyx_cur_scope->__pyx_v_dimen, __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(14, 183, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_14 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) > __pyx_t_14) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) : __pyx_t_14;
          __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
          __Pyx_GIVEREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
          __pyx_t_3 = 0;
          __Pyx_INCREF(__pyx_kp_u__21);
          __pyx_t_8 += 1;
          __Pyx_GIVEREF(__pyx_kp_u__21);
          PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u__21);
          __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_1, 3, __pyx_t_8, __pyx_t_14); if (unlikely(!__pyx_t_3)) __PYX_ERR(14, 183, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 183, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_Raise(__pyx_t_1, 0, 0, 0);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __PYX_ERR(14, 183, __pyx_L1_error)

          /* "amplpy/set.pxi":179
 *                         )
 *                 else:
 *                     if any(             # <<<<<<<<<<<<<<
 *                         not isinstance(row, tuple) or len(row) != dimen
 *                         for row in values
 */
        }
      }
      __pyx_L22:;

      /* "amplpy/set.pxi":184
 *                     ):
 *                         raise ValueError(f"Expected tuples of arity {dimen}.")
 *                 setValues(self._c_ampl, self._name, self._index, values, len(values))             # <<<<<<<<<<<<<<
 *         else:
 *             Entity.set_values(self, values)
 */
      __pyx_t_8 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(14, 184, __pyx_L1_error)
      __pyx_f_7_amplpy_setValues(__pyx_v_self->__pyx_base._c_ampl, __pyx_v_self->__pyx_base._name, __pyx_v_self->__pyx_base._index, __pyx_v_values, __pyx_t_8); if (unlikely(PyErr_Occurred())) __PYX_ERR(14, 184, __pyx_L1_error)
    }
    __pyx_L7:;

    /* "amplpy/set.pxi":140
 *             df = values
 *             PY_AMPL_CALL(campl.AMPL_SetInstanceSetValuesDataframe(self._c_ampl, self._name, self._index, df.get_ptr()))
 *         elif isinstance(values, Iterable):             # <<<<<<<<<<<<<<
 *             dimen = self.arity()
 *             if dimen == 1 and all(isinstance(value, str) for value in values):
 */
    goto __pyx_L3;
  }

  /* "amplpy/set.pxi":186
 *                 setValues(self._c_ampl, self._name, self._index, values, len(values))
 *         else:
 *             Entity.set_values(self, values)             # <<<<<<<<<<<<<<
 * 
 *     # Aliases
 */
  /*else*/ {
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7_amplpy_Entity), __pyx_n_s_set_values); if (unlikely(!__pyx_t_3)) __PYX_ERR(14, 186, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_11 = NULL;
    __pyx_t_4 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_11)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_11);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_4 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_11, ((PyObject *)__pyx_v_self), __pyx_v_values};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 186, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_L3:;

  /* "amplpy/set.pxi":103
 *         return contains_c
 * 
 *     def set_values(self, values):             # <<<<<<<<<<<<<<
 *         """
 *         Set the tuples in this set. Valid only for non-indexed sets.
 */

  /* 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_11);
  __Pyx_AddTraceback("_amplpy.Set.set_values", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_df);
  __Pyx_XDECREF(__pyx_v_index);
  __Pyx_XDECREF(__pyx_v_members);
  __Pyx_XDECREF(__pyx_v_cast_row);
  __Pyx_XDECREF(__pyx_gb_7_amplpy_3Set_10set_values_6generator8);
  __Pyx_XDECREF(__pyx_gb_7_amplpy_3Set_10set_values_9generator9);
  __Pyx_XDECREF(__pyx_9genexpr29__pyx_v_row);
  __Pyx_XDECREF(__pyx_gb_7_amplpy_3Set_10set_values_12generator10);
  __Pyx_XDECREF(__pyx_gb_7_amplpy_3Set_10set_values_15generator11);
  __Pyx_XDECREF(__pyx_v_values);
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._c_ampl,self._index cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_3Set_19__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_3Set_18__reduce_cython__, "Set.__reduce_cython__(self)");
static PyMethodDef __pyx_mdef_7_amplpy_3Set_19__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_3Set_19__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_3Set_18__reduce_cython__};
static PyObject *__pyx_pw_7_amplpy_3Set_19__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_3Set_18__reduce_cython__(((struct __pyx_obj_7_amplpy_Set *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_3Set_18__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7_amplpy_Set *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 1);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "self._c_ampl,self._index cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self._c_ampl,self._index cannot be converted to a Python object for pickling"
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_self__c_ampl_self__index_cannot, 0, 0);
  __PYX_ERR(8, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._c_ampl,self._index cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 */

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

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._c_ampl,self._index cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._c_ampl,self._index cannot be converted to a Python object for pickling"
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_3Set_21__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_3Set_20__setstate_cython__, "Set.__setstate_cython__(self, __pyx_state)");
static PyMethodDef __pyx_mdef_7_amplpy_3Set_21__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_3Set_21__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_3Set_20__setstate_cython__};
static PyObject *__pyx_pw_7_amplpy_3Set_21__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 3, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(8, 3, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(8, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.Set.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_3Set_20__setstate_cython__(((struct __pyx_obj_7_amplpy_Set *)__pyx_v_self), __pyx_v___pyx_state);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_3Set_20__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7_amplpy_Set *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 1);

  /* "(tree fragment)":4
 *     raise TypeError, "self._c_ampl,self._index cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self._c_ampl,self._index cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_self__c_ampl_self__index_cannot, 0, 0);
  __PYX_ERR(8, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._c_ampl,self._index cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._c_ampl,self._index cannot be converted to a Python object for pickling"
 */

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

/* "amplpy/variable.pxi":24
 *     """
 *     @staticmethod
 *     cdef create(campl.AMPL* ampl_c, char *name, campl.AMPL_TUPLE* index, parent):             # <<<<<<<<<<<<<<
 *         entity = Variable()
 *         entity._c_ampl = ampl_c
 */

static PyObject *__pyx_f_7_amplpy_8Variable_create(AMPL *__pyx_v_ampl_c, char *__pyx_v_name, AMPL_TUPLE *__pyx_v_index, PyObject *__pyx_v_parent) {
  struct __pyx_obj_7_amplpy_Variable *__pyx_v_entity = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("create", 1);

  /* "amplpy/variable.pxi":25
 *     @staticmethod
 *     cdef create(campl.AMPL* ampl_c, char *name, campl.AMPL_TUPLE* index, parent):
 *         entity = Variable()             # <<<<<<<<<<<<<<
 *         entity._c_ampl = ampl_c
 *         entity._name = name
 */
  __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_7_amplpy_Variable)); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_entity = ((struct __pyx_obj_7_amplpy_Variable *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "amplpy/variable.pxi":26
 *     cdef create(campl.AMPL* ampl_c, char *name, campl.AMPL_TUPLE* index, parent):
 *         entity = Variable()
 *         entity._c_ampl = ampl_c             # <<<<<<<<<<<<<<
 *         entity._name = name
 *         entity._index = index
 */
  __pyx_v_entity->__pyx_base._c_ampl = __pyx_v_ampl_c;

  /* "amplpy/variable.pxi":27
 *         entity = Variable()
 *         entity._c_ampl = ampl_c
 *         entity._name = name             # <<<<<<<<<<<<<<
 *         entity._index = index
 *         entity.wrap_function = campl.AMPL_VARIABLE
 */
  __pyx_v_entity->__pyx_base._name = __pyx_v_name;

  /* "amplpy/variable.pxi":28
 *         entity._c_ampl = ampl_c
 *         entity._name = name
 *         entity._index = index             # <<<<<<<<<<<<<<
 *         entity.wrap_function = campl.AMPL_VARIABLE
 *         entity._entity = parent
 */
  __pyx_v_entity->__pyx_base._index = __pyx_v_index;

  /* "amplpy/variable.pxi":29
 *         entity._name = name
 *         entity._index = index
 *         entity.wrap_function = campl.AMPL_VARIABLE             # <<<<<<<<<<<<<<
 *         entity._entity = parent
 *         if entity._entity is not None:
 */
  __pyx_v_entity->__pyx_base.wrap_function = AMPL_VARIABLE;

  /* "amplpy/variable.pxi":30
 *         entity._index = index
 *         entity.wrap_function = campl.AMPL_VARIABLE
 *         entity._entity = parent             # <<<<<<<<<<<<<<
 *         if entity._entity is not None:
 *             Py_INCREF(entity._entity)
 */
  __Pyx_INCREF(__pyx_v_parent);
  __Pyx_GIVEREF(__pyx_v_parent);
  __Pyx_GOTREF(__pyx_v_entity->__pyx_base._entity);
  __Pyx_DECREF(__pyx_v_entity->__pyx_base._entity);
  __pyx_v_entity->__pyx_base._entity = __pyx_v_parent;

  /* "amplpy/variable.pxi":31
 *         entity.wrap_function = campl.AMPL_VARIABLE
 *         entity._entity = parent
 *         if entity._entity is not None:             # <<<<<<<<<<<<<<
 *             Py_INCREF(entity._entity)
 *         return entity
 */
  __pyx_t_2 = (__pyx_v_entity->__pyx_base._entity != Py_None);
  if (__pyx_t_2) {

    /* "amplpy/variable.pxi":32
 *         entity._entity = parent
 *         if entity._entity is not None:
 *             Py_INCREF(entity._entity)             # <<<<<<<<<<<<<<
 *         return entity
 * 
 */
    __pyx_t_1 = __pyx_v_entity->__pyx_base._entity;
    __Pyx_INCREF(__pyx_t_1);
    Py_INCREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "amplpy/variable.pxi":31
 *         entity.wrap_function = campl.AMPL_VARIABLE
 *         entity._entity = parent
 *         if entity._entity is not None:             # <<<<<<<<<<<<<<
 *             Py_INCREF(entity._entity)
 *         return entity
 */
  }

  /* "amplpy/variable.pxi":33
 *         if entity._entity is not None:
 *             Py_INCREF(entity._entity)
 *         return entity             # <<<<<<<<<<<<<<
 * 
 *     def __setitem__(self, index, value):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_entity);
  __pyx_r = ((PyObject *)__pyx_v_entity);
  goto __pyx_L0;

  /* "amplpy/variable.pxi":24
 *     """
 *     @staticmethod
 *     cdef create(campl.AMPL* ampl_c, char *name, campl.AMPL_TUPLE* index, parent):             # <<<<<<<<<<<<<<
 *         entity = Variable()
 *         entity._c_ampl = ampl_c
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("_amplpy.Variable.create", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_entity);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/variable.pxi":35
 *         return entity
 * 
 *     def __setitem__(self, index, value):             # <<<<<<<<<<<<<<
 *         self.__getitem__(index).set_value(value)
 * 
 */

/* Python wrapper */
static int __pyx_pw_7_amplpy_8Variable_1__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_7_amplpy_8Variable_1__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7_amplpy_8Variable___setitem__(((struct __pyx_obj_7_amplpy_Variable *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_7_amplpy_8Variable___setitem__(struct __pyx_obj_7_amplpy_Variable *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  unsigned int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setitem__", 1);

  /* "amplpy/variable.pxi":36
 * 
 *     def __setitem__(self, index, value):
 *         self.__getitem__(index).set_value(value)             # <<<<<<<<<<<<<<
 * 
 *     def value(self):
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getitem); if (unlikely(!__pyx_t_3)) __PYX_ERR(15, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_index};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 36, __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_set_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(15, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_value};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 36, __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;

  /* "amplpy/variable.pxi":35
 *         return entity
 * 
 *     def __setitem__(self, index, value):             # <<<<<<<<<<<<<<
 *         self.__getitem__(index).set_value(value)
 * 
 */

  /* function exit code */
  __pyx_r = 0;
  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("_amplpy.Variable.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/variable.pxi":38
 *         self.__getitem__(index).set_value(value)
 * 
 *     def value(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the current value of this variable.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_8Variable_3value(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_8Variable_2value, "Variable.value(self)\n\n        Get the current value of this variable.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_8Variable_3value = {"value", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_8Variable_3value, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_8Variable_2value};
static PyObject *__pyx_pw_7_amplpy_8Variable_3value(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("value (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("value", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "value", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_8Variable_2value(((struct __pyx_obj_7_amplpy_Variable *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_8Variable_2value(struct __pyx_obj_7_amplpy_Variable *__pyx_v_self) {
  double __pyx_v_value;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("value", 1);

  /* "amplpy/variable.pxi":43
 *         """
 *         cdef double value
 *         PY_AMPL_CALL(campl.AMPL_InstanceGetDoubleSuffix(self._c_ampl, self._name, self._index, campl.AMPL_NUMERICSUFFIX.AMPL_VALUE, &value))             # <<<<<<<<<<<<<<
 *         return value
 * 
 */
  __pyx_t_1 = __pyx_f_7_amplpy_PY_AMPL_CALL(AMPL_InstanceGetDoubleSuffix(__pyx_v_self->__pyx_base._c_ampl, __pyx_v_self->__pyx_base._name, __pyx_v_self->__pyx_base._index, AMPL_VALUE, (&__pyx_v_value))); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 43, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "amplpy/variable.pxi":44
 *         cdef double value
 *         PY_AMPL_CALL(campl.AMPL_InstanceGetDoubleSuffix(self._c_ampl, self._name, self._index, campl.AMPL_NUMERICSUFFIX.AMPL_VALUE, &value))
 *         return value             # <<<<<<<<<<<<<<
 * 
 *     def fix(self, value=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 44, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "amplpy/variable.pxi":38
 *         self.__getitem__(index).set_value(value)
 * 
 *     def value(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the current value of this variable.
 */

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

/* "amplpy/variable.pxi":46
 *         return value
 * 
 *     def fix(self, value=None):             # <<<<<<<<<<<<<<
 *         """
 *         Fix all instances of this variable to a value if provided or to
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_8Variable_5fix(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_8Variable_4fix, "Variable.fix(self, value=None)\n\n        Fix all instances of this variable to a value if provided or to\n        their current value otherwise.\n\n        Args:\n            value: value to be set.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_8Variable_5fix = {"fix", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_8Variable_5fix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_8Variable_4fix};
static PyObject *__pyx_pw_7_amplpy_8Variable_5fix(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_value = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("fix (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_value,0};
    values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_value);
          if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(15, 46, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "fix") < 0)) __PYX_ERR(15, 46, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_value = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("fix", 0, 0, 1, __pyx_nargs); __PYX_ERR(15, 46, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.Variable.fix", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_8Variable_4fix(((struct __pyx_obj_7_amplpy_Variable *)__pyx_v_self), __pyx_v_value);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_8Variable_4fix(struct __pyx_obj_7_amplpy_Variable *__pyx_v_self, PyObject *__pyx_v_value) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  double __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("fix", 1);

  /* "amplpy/variable.pxi":54
 *             value: value to be set.
 *         """
 *         if value is None:             # <<<<<<<<<<<<<<
 *             PY_AMPL_CALL(campl.AMPL_VariableInstanceFix(self._c_ampl, self._name, self._index))
 *         else:
 */
  __pyx_t_1 = (__pyx_v_value == Py_None);
  if (__pyx_t_1) {

    /* "amplpy/variable.pxi":55
 *         """
 *         if value is None:
 *             PY_AMPL_CALL(campl.AMPL_VariableInstanceFix(self._c_ampl, self._name, self._index))             # <<<<<<<<<<<<<<
 *         else:
 *             PY_AMPL_CALL(campl.AMPL_VariableInstanceFixToValue(self._c_ampl, self._name, self._index, value))
 */
    __pyx_t_2 = __pyx_f_7_amplpy_PY_AMPL_CALL(AMPL_VariableInstanceFix(__pyx_v_self->__pyx_base._c_ampl, __pyx_v_self->__pyx_base._name, __pyx_v_self->__pyx_base._index)); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 55, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "amplpy/variable.pxi":54
 *             value: value to be set.
 *         """
 *         if value is None:             # <<<<<<<<<<<<<<
 *             PY_AMPL_CALL(campl.AMPL_VariableInstanceFix(self._c_ampl, self._name, self._index))
 *         else:
 */
    goto __pyx_L3;
  }

  /* "amplpy/variable.pxi":57
 *             PY_AMPL_CALL(campl.AMPL_VariableInstanceFix(self._c_ampl, self._name, self._index))
 *         else:
 *             PY_AMPL_CALL(campl.AMPL_VariableInstanceFixToValue(self._c_ampl, self._name, self._index, value))             # <<<<<<<<<<<<<<
 * 
 *     def unfix(self):
 */
  /*else*/ {
    __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(15, 57, __pyx_L1_error)
    __pyx_t_2 = __pyx_f_7_amplpy_PY_AMPL_CALL(AMPL_VariableInstanceFixToValue(__pyx_v_self->__pyx_base._c_ampl, __pyx_v_self->__pyx_base._name, __pyx_v_self->__pyx_base._index, __pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 57, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_L3:;

  /* "amplpy/variable.pxi":46
 *         return value
 * 
 *     def fix(self, value=None):             # <<<<<<<<<<<<<<
 *         """
 *         Fix all instances of this variable to a value if provided or to
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("_amplpy.Variable.fix", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/variable.pxi":59
 *             PY_AMPL_CALL(campl.AMPL_VariableInstanceFixToValue(self._c_ampl, self._name, self._index, value))
 * 
 *     def unfix(self):             # <<<<<<<<<<<<<<
 *         """
 *         Unfix all instances of this variable.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_8Variable_7unfix(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_8Variable_6unfix, "Variable.unfix(self)\n\n        Unfix all instances of this variable.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_8Variable_7unfix = {"unfix", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_8Variable_7unfix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_8Variable_6unfix};
static PyObject *__pyx_pw_7_amplpy_8Variable_7unfix(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("unfix (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("unfix", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "unfix", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_8Variable_6unfix(((struct __pyx_obj_7_amplpy_Variable *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_8Variable_6unfix(struct __pyx_obj_7_amplpy_Variable *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("unfix", 1);

  /* "amplpy/variable.pxi":63
 *         Unfix all instances of this variable.
 *         """
 *         PY_AMPL_CALL(campl.AMPL_VariableInstanceUnfix(self._c_ampl, self._name, self._index))             # <<<<<<<<<<<<<<
 * 
 *     def set_value(self, value):
 */
  __pyx_t_1 = __pyx_f_7_amplpy_PY_AMPL_CALL(AMPL_VariableInstanceUnfix(__pyx_v_self->__pyx_base._c_ampl, __pyx_v_self->__pyx_base._name, __pyx_v_self->__pyx_base._index)); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 63, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "amplpy/variable.pxi":59
 *             PY_AMPL_CALL(campl.AMPL_VariableInstanceFixToValue(self._c_ampl, self._name, self._index, value))
 * 
 *     def unfix(self):             # <<<<<<<<<<<<<<
 *         """
 *         Unfix all instances of this variable.
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("_amplpy.Variable.unfix", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/variable.pxi":65
 *         PY_AMPL_CALL(campl.AMPL_VariableInstanceUnfix(self._c_ampl, self._name, self._index))
 * 
 *     def set_value(self, value):             # <<<<<<<<<<<<<<
 *         """
 *         Set the current value of this variable (does not fix it),
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_8Variable_9set_value(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_8Variable_8set_value, "Variable.set_value(self, value)\n\n        Set the current value of this variable (does not fix it),\n        equivalent to the AMPL command `let`.\n\n        Args:\n            value: value to be set.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_8Variable_9set_value = {"set_value", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_8Variable_9set_value, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_8Variable_8set_value};
static PyObject *__pyx_pw_7_amplpy_8Variable_9set_value(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_value = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_value (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_value,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_value)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(15, 65, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_value") < 0)) __PYX_ERR(15, 65, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_value = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_value", 1, 1, 1, __pyx_nargs); __PYX_ERR(15, 65, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.Variable.set_value", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_8Variable_8set_value(((struct __pyx_obj_7_amplpy_Variable *)__pyx_v_self), __pyx_v_value);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_8Variable_8set_value(struct __pyx_obj_7_amplpy_Variable *__pyx_v_self, PyObject *__pyx_v_value) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  unsigned int __pyx_t_5;
  double __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_value", 1);

  /* "amplpy/variable.pxi":73
 *             value: value to be set.
 *         """
 *         if isinstance(value, Parameter):             # <<<<<<<<<<<<<<
 *             PY_AMPL_CALL(campl.AMPL_VariableInstanceSetValue(self._c_ampl, self._name, self._index, value.value()))
 *         else:
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_value, __pyx_ptype_7_amplpy_Parameter); 
  if (__pyx_t_1) {

    /* "amplpy/variable.pxi":74
 *         """
 *         if isinstance(value, Parameter):
 *             PY_AMPL_CALL(campl.AMPL_VariableInstanceSetValue(self._c_ampl, self._name, self._index, value.value()))             # <<<<<<<<<<<<<<
 *         else:
 *             PY_AMPL_CALL(campl.AMPL_VariableInstanceSetValue(self._c_ampl, self._name, self._index, float(value)))
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_n_s_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(15, 74, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 74, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(15, 74, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __pyx_f_7_amplpy_PY_AMPL_CALL(AMPL_VariableInstanceSetValue(__pyx_v_self->__pyx_base._c_ampl, __pyx_v_self->__pyx_base._name, __pyx_v_self->__pyx_base._index, __pyx_t_6)); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 74, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "amplpy/variable.pxi":73
 *             value: value to be set.
 *         """
 *         if isinstance(value, Parameter):             # <<<<<<<<<<<<<<
 *             PY_AMPL_CALL(campl.AMPL_VariableInstanceSetValue(self._c_ampl, self._name, self._index, value.value()))
 *         else:
 */
    goto __pyx_L3;
  }

  /* "amplpy/variable.pxi":76
 *             PY_AMPL_CALL(campl.AMPL_VariableInstanceSetValue(self._c_ampl, self._name, self._index, value.value()))
 *         else:
 *             PY_AMPL_CALL(campl.AMPL_VariableInstanceSetValue(self._c_ampl, self._name, self._index, float(value)))             # <<<<<<<<<<<<<<
 * 
 *     def astatus(self):
 */
  /*else*/ {
    __pyx_t_6 = __Pyx_PyObject_AsDouble(__pyx_v_value); if (unlikely(__pyx_t_6 == ((double)((double)-1)) && PyErr_Occurred())) __PYX_ERR(15, 76, __pyx_L1_error)
    __pyx_t_2 = __pyx_f_7_amplpy_PY_AMPL_CALL(AMPL_VariableInstanceSetValue(__pyx_v_self->__pyx_base._c_ampl, __pyx_v_self->__pyx_base._name, __pyx_v_self->__pyx_base._index, __pyx_t_6)); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 76, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_L3:;

  /* "amplpy/variable.pxi":65
 *         PY_AMPL_CALL(campl.AMPL_VariableInstanceUnfix(self._c_ampl, self._name, self._index))
 * 
 *     def set_value(self, value):             # <<<<<<<<<<<<<<
 *         """
 *         Set the current value of this variable (does not fix it),
 */

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

/* "amplpy/variable.pxi":78
 *             PY_AMPL_CALL(campl.AMPL_VariableInstanceSetValue(self._c_ampl, self._name, self._index, float(value)))
 * 
 *     def astatus(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the AMPL status (fixed, presolved, or substituted out).
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_8Variable_11astatus(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_8Variable_10astatus, "Variable.astatus(self)\n\n        Get the AMPL status (fixed, presolved, or substituted out).\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_8Variable_11astatus = {"astatus", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_8Variable_11astatus, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_8Variable_10astatus};
static PyObject *__pyx_pw_7_amplpy_8Variable_11astatus(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("astatus (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("astatus", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "astatus", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_8Variable_10astatus(((struct __pyx_obj_7_amplpy_Variable *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_8Variable_10astatus(struct __pyx_obj_7_amplpy_Variable *__pyx_v_self) {
  AMPL_ERRORINFO *__pyx_v_errorinfo;
  AMPL_RETCODE __pyx_v_rc;
  char *__pyx_v_value_c;
  PyObject *__pyx_v_value = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("astatus", 1);

  /* "amplpy/variable.pxi":85
 *         cdef campl.AMPL_RETCODE rc
 *         cdef char* value_c
 *         errorinfo = campl.AMPL_InstanceGetStringSuffix(self._c_ampl, self._name, self._index, campl.AMPL_STRINGSUFFIX.AMPL_ASTATUS, &value_c)             # <<<<<<<<<<<<<<
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:
 */
  __pyx_v_errorinfo = AMPL_InstanceGetStringSuffix(__pyx_v_self->__pyx_base._c_ampl, __pyx_v_self->__pyx_base._name, __pyx_v_self->__pyx_base._index, AMPL_ASTATUS, (&__pyx_v_value_c));

  /* "amplpy/variable.pxi":86
 *         cdef char* value_c
 *         errorinfo = campl.AMPL_InstanceGetStringSuffix(self._c_ampl, self._name, self._index, campl.AMPL_STRINGSUFFIX.AMPL_ASTATUS, &value_c)
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)             # <<<<<<<<<<<<<<
 *         if rc != campl.AMPL_OK:
 *             campl.AMPL_StringFree(&value_c)
 */
  __pyx_v_rc = AMPL_ErrorInfoGetError(__pyx_v_errorinfo);

  /* "amplpy/variable.pxi":87
 *         errorinfo = campl.AMPL_InstanceGetStringSuffix(self._c_ampl, self._name, self._index, campl.AMPL_STRINGSUFFIX.AMPL_ASTATUS, &value_c)
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:             # <<<<<<<<<<<<<<
 *             campl.AMPL_StringFree(&value_c)
 *             PY_AMPL_CALL(errorinfo)
 */
  __pyx_t_1 = (__pyx_v_rc != AMPL_OK);
  if (__pyx_t_1) {

    /* "amplpy/variable.pxi":88
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:
 *             campl.AMPL_StringFree(&value_c)             # <<<<<<<<<<<<<<
 *             PY_AMPL_CALL(errorinfo)
 *         value = str(value_c.decode('utf-8'))
 */
    (void)(AMPL_StringFree((&__pyx_v_value_c)));

    /* "amplpy/variable.pxi":89
 *         if rc != campl.AMPL_OK:
 *             campl.AMPL_StringFree(&value_c)
 *             PY_AMPL_CALL(errorinfo)             # <<<<<<<<<<<<<<
 *         value = str(value_c.decode('utf-8'))
 *         campl.AMPL_StringFree(&value_c)
 */
    __pyx_t_2 = __pyx_f_7_amplpy_PY_AMPL_CALL(__pyx_v_errorinfo); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 89, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "amplpy/variable.pxi":87
 *         errorinfo = campl.AMPL_InstanceGetStringSuffix(self._c_ampl, self._name, self._index, campl.AMPL_STRINGSUFFIX.AMPL_ASTATUS, &value_c)
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:             # <<<<<<<<<<<<<<
 *             campl.AMPL_StringFree(&value_c)
 *             PY_AMPL_CALL(errorinfo)
 */
  }

  /* "amplpy/variable.pxi":90
 *             campl.AMPL_StringFree(&value_c)
 *             PY_AMPL_CALL(errorinfo)
 *         value = str(value_c.decode('utf-8'))             # <<<<<<<<<<<<<<
 *         campl.AMPL_StringFree(&value_c)
 * 
 */
  __pyx_t_3 = __Pyx_ssize_strlen(__pyx_v_value_c); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(15, 90, __pyx_L1_error)
  __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_value_c, 0, __pyx_t_3, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 90, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_value = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "amplpy/variable.pxi":91
 *             PY_AMPL_CALL(errorinfo)
 *         value = str(value_c.decode('utf-8'))
 *         campl.AMPL_StringFree(&value_c)             # <<<<<<<<<<<<<<
 * 
 *         return value
 */
  (void)(AMPL_StringFree((&__pyx_v_value_c)));

  /* "amplpy/variable.pxi":93
 *         campl.AMPL_StringFree(&value_c)
 * 
 *         return value             # <<<<<<<<<<<<<<
 * 
 *     def defeqn(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_value);
  __pyx_r = __pyx_v_value;
  goto __pyx_L0;

  /* "amplpy/variable.pxi":78
 *             PY_AMPL_CALL(campl.AMPL_VariableInstanceSetValue(self._c_ampl, self._name, self._index, float(value)))
 * 
 *     def astatus(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the AMPL status (fixed, presolved, or substituted out).
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("_amplpy.Variable.astatus", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/variable.pxi":95
 *         return value
 * 
 *     def defeqn(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the index in `_con` of "defining constraint" used to substitute
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_8Variable_13defeqn(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_8Variable_12defeqn, "Variable.defeqn(self)\n\n        Get the index in `_con` of \"defining constraint\" used to substitute\n        variable out.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_8Variable_13defeqn = {"defeqn", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_8Variable_13defeqn, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_8Variable_12defeqn};
static PyObject *__pyx_pw_7_amplpy_8Variable_13defeqn(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("defeqn (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("defeqn", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "defeqn", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_8Variable_12defeqn(((struct __pyx_obj_7_amplpy_Variable *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_8Variable_12defeqn(struct __pyx_obj_7_amplpy_Variable *__pyx_v_self) {
  int __pyx_v_value;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("defeqn", 1);

  /* "amplpy/variable.pxi":101
 *         """
 *         cdef int value
 *         PY_AMPL_CALL(campl.AMPL_InstanceGetIntSuffix(self._c_ampl, self._name, self._index, campl.AMPL_NUMERICSUFFIX.AMPL_DEFEQN, &value))             # <<<<<<<<<<<<<<
 *         return value
 * 
 */
  __pyx_t_1 = __pyx_f_7_amplpy_PY_AMPL_CALL(AMPL_InstanceGetIntSuffix(__pyx_v_self->__pyx_base._c_ampl, __pyx_v_self->__pyx_base._name, __pyx_v_self->__pyx_base._index, AMPL_DEFEQN, (&__pyx_v_value))); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 101, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "amplpy/variable.pxi":102
 *         cdef int value
 *         PY_AMPL_CALL(campl.AMPL_InstanceGetIntSuffix(self._c_ampl, self._name, self._index, campl.AMPL_NUMERICSUFFIX.AMPL_DEFEQN, &value))
 *         return value             # <<<<<<<<<<<<<<
 * 
 *     def dual(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 102, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "amplpy/variable.pxi":95
 *         return value
 * 
 *     def defeqn(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the index in `_con` of "defining constraint" used to substitute
 */

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

/* "amplpy/variable.pxi":104
 *         return value
 * 
 *     def dual(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the dual value on defining constraint of variable substituted out.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_8Variable_15dual(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_8Variable_14dual, "Variable.dual(self)\n\n        Get the dual value on defining constraint of variable substituted out.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_8Variable_15dual = {"dual", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_8Variable_15dual, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_8Variable_14dual};
static PyObject *__pyx_pw_7_amplpy_8Variable_15dual(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dual (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("dual", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "dual", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_8Variable_14dual(((struct __pyx_obj_7_amplpy_Variable *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_8Variable_14dual(struct __pyx_obj_7_amplpy_Variable *__pyx_v_self) {
  double __pyx_v_value;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dual", 1);

  /* "amplpy/variable.pxi":109
 *         """
 *         cdef double value
 *         PY_AMPL_CALL(campl.AMPL_InstanceGetDoubleSuffix(self._c_ampl, self._name, self._index, campl.AMPL_NUMERICSUFFIX.AMPL_DUAL, &value))             # <<<<<<<<<<<<<<
 *         return value
 * 
 */
  __pyx_t_1 = __pyx_f_7_amplpy_PY_AMPL_CALL(AMPL_InstanceGetDoubleSuffix(__pyx_v_self->__pyx_base._c_ampl, __pyx_v_self->__pyx_base._name, __pyx_v_self->__pyx_base._index, AMPL_DUAL, (&__pyx_v_value))); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 109, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "amplpy/variable.pxi":110
 *         cdef double value
 *         PY_AMPL_CALL(campl.AMPL_InstanceGetDoubleSuffix(self._c_ampl, self._name, self._index, campl.AMPL_NUMERICSUFFIX.AMPL_DUAL, &value))
 *         return value             # <<<<<<<<<<<<<<
 * 
 *     def init(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 110, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "amplpy/variable.pxi":104
 *         return value
 * 
 *     def dual(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the dual value on defining constraint of variable substituted out.
 */

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

/* "amplpy/variable.pxi":112
 *         return value
 * 
 *     def init(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the current initial guess.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_8Variable_17init(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_8Variable_16init, "Variable.init(self)\n\n        Get the current initial guess.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_8Variable_17init = {"init", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_8Variable_17init, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_8Variable_16init};
static PyObject *__pyx_pw_7_amplpy_8Variable_17init(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("init (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("init", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "init", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_8Variable_16init(((struct __pyx_obj_7_amplpy_Variable *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_8Variable_16init(struct __pyx_obj_7_amplpy_Variable *__pyx_v_self) {
  double __pyx_v_value;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("init", 1);

  /* "amplpy/variable.pxi":117
 *         """
 *         cdef double value
 *         PY_AMPL_CALL(campl.AMPL_InstanceGetDoubleSuffix(self._c_ampl, self._name, self._index, campl.AMPL_NUMERICSUFFIX.AMPL_INIT, &value))             # <<<<<<<<<<<<<<
 *         return value
 * 
 */
  __pyx_t_1 = __pyx_f_7_amplpy_PY_AMPL_CALL(AMPL_InstanceGetDoubleSuffix(__pyx_v_self->__pyx_base._c_ampl, __pyx_v_self->__pyx_base._name, __pyx_v_self->__pyx_base._index, AMPL_INIT, (&__pyx_v_value))); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "amplpy/variable.pxi":118
 *         cdef double value
 *         PY_AMPL_CALL(campl.AMPL_InstanceGetDoubleSuffix(self._c_ampl, self._name, self._index, campl.AMPL_NUMERICSUFFIX.AMPL_INIT, &value))
 *         return value             # <<<<<<<<<<<<<<
 * 
 *     def init0(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 118, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "amplpy/variable.pxi":112
 *         return value
 * 
 *     def init(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the current initial guess.
 */

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

/* "amplpy/variable.pxi":120
 *         return value
 * 
 *     def init0(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the original initial guess (set by `:=` or`default` or by a data
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_8Variable_19init0(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_8Variable_18init0, "Variable.init0(self)\n\n        Get the original initial guess (set by `:=` or`default` or by a data\n        statement).\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_8Variable_19init0 = {"init0", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_8Variable_19init0, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_8Variable_18init0};
static PyObject *__pyx_pw_7_amplpy_8Variable_19init0(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("init0 (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("init0", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "init0", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_8Variable_18init0(((struct __pyx_obj_7_amplpy_Variable *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_8Variable_18init0(struct __pyx_obj_7_amplpy_Variable *__pyx_v_self) {
  double __pyx_v_value;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("init0", 1);

  /* "amplpy/variable.pxi":126
 *         """
 *         cdef double value
 *         PY_AMPL_CALL(campl.AMPL_InstanceGetDoubleSuffix(self._c_ampl, self._name, self._index, campl.AMPL_NUMERICSUFFIX.AMPL_INIT0, &value))             # <<<<<<<<<<<<<<
 *         return value
 * 
 */
  __pyx_t_1 = __pyx_f_7_amplpy_PY_AMPL_CALL(AMPL_InstanceGetDoubleSuffix(__pyx_v_self->__pyx_base._c_ampl, __pyx_v_self->__pyx_base._name, __pyx_v_self->__pyx_base._index, AMPL_INIT0, (&__pyx_v_value))); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 126, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "amplpy/variable.pxi":127
 *         cdef double value
 *         PY_AMPL_CALL(campl.AMPL_InstanceGetDoubleSuffix(self._c_ampl, self._name, self._index, campl.AMPL_NUMERICSUFFIX.AMPL_INIT0, &value))
 *         return value             # <<<<<<<<<<<<<<
 * 
 *     def lb(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 127, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "amplpy/variable.pxi":120
 *         return value
 * 
 *     def init0(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the original initial guess (set by `:=` or`default` or by a data
 */

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

/* "amplpy/variable.pxi":129
 *         return value
 * 
 *     def lb(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the current lower bound.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_8Variable_21lb(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_8Variable_20lb, "Variable.lb(self)\n\n        Returns the current lower bound.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_8Variable_21lb = {"lb", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_8Variable_21lb, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_8Variable_20lb};
static PyObject *__pyx_pw_7_amplpy_8Variable_21lb(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lb (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("lb", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "lb", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_8Variable_20lb(((struct __pyx_obj_7_amplpy_Variable *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_8Variable_20lb(struct __pyx_obj_7_amplpy_Variable *__pyx_v_self) {
  double __pyx_v_value;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("lb", 1);

  /* "amplpy/variable.pxi":134
 *         """
 *         cdef double value
 *         PY_AMPL_CALL(campl.AMPL_InstanceGetDoubleSuffix(self._c_ampl, self._name, self._index, campl.AMPL_NUMERICSUFFIX.AMPL_LB, &value))             # <<<<<<<<<<<<<<
 *         return value
 * 
 */
  __pyx_t_1 = __pyx_f_7_amplpy_PY_AMPL_CALL(AMPL_InstanceGetDoubleSuffix(__pyx_v_self->__pyx_base._c_ampl, __pyx_v_self->__pyx_base._name, __pyx_v_self->__pyx_base._index, AMPL_LB, (&__pyx_v_value))); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 134, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "amplpy/variable.pxi":135
 *         cdef double value
 *         PY_AMPL_CALL(campl.AMPL_InstanceGetDoubleSuffix(self._c_ampl, self._name, self._index, campl.AMPL_NUMERICSUFFIX.AMPL_LB, &value))
 *         return value             # <<<<<<<<<<<<<<
 * 
 *     def ub(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 135, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "amplpy/variable.pxi":129
 *         return value
 * 
 *     def lb(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the current lower bound.
 */

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

/* "amplpy/variable.pxi":137
 *         return value
 * 
 *     def ub(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the current upper bound.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_8Variable_23ub(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_8Variable_22ub, "Variable.ub(self)\n\n        Returns the current upper bound.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_8Variable_23ub = {"ub", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_8Variable_23ub, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_8Variable_22ub};
static PyObject *__pyx_pw_7_amplpy_8Variable_23ub(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ub (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("ub", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "ub", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_8Variable_22ub(((struct __pyx_obj_7_amplpy_Variable *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_8Variable_22ub(struct __pyx_obj_7_amplpy_Variable *__pyx_v_self) {
  double __pyx_v_value;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ub", 1);

  /* "amplpy/variable.pxi":142
 *         """
 *         cdef double value
 *         PY_AMPL_CALL(campl.AMPL_InstanceGetDoubleSuffix(self._c_ampl, self._name, self._index, campl.AMPL_NUMERICSUFFIX.AMPL_UB, &value))             # <<<<<<<<<<<<<<
 *         return value
 * 
 */
  __pyx_t_1 = __pyx_f_7_amplpy_PY_AMPL_CALL(AMPL_InstanceGetDoubleSuffix(__pyx_v_self->__pyx_base._c_ampl, __pyx_v_self->__pyx_base._name, __pyx_v_self->__pyx_base._index, AMPL_UB, (&__pyx_v_value))); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 142, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "amplpy/variable.pxi":143
 *         cdef double value
 *         PY_AMPL_CALL(campl.AMPL_InstanceGetDoubleSuffix(self._c_ampl, self._name, self._index, campl.AMPL_NUMERICSUFFIX.AMPL_UB, &value))
 *         return value             # <<<<<<<<<<<<<<
 * 
 *     def lb0(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 143, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "amplpy/variable.pxi":137
 *         return value
 * 
 *     def ub(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the current upper bound.
 */

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

/* "amplpy/variable.pxi":145
 *         return value
 * 
 *     def lb0(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the initial lower bounds, from the var declaration.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_8Variable_25lb0(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_8Variable_24lb0, "Variable.lb0(self)\n\n        Returns the initial lower bounds, from the var declaration.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_8Variable_25lb0 = {"lb0", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_8Variable_25lb0, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_8Variable_24lb0};
static PyObject *__pyx_pw_7_amplpy_8Variable_25lb0(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lb0 (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("lb0", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "lb0", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_8Variable_24lb0(((struct __pyx_obj_7_amplpy_Variable *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_8Variable_24lb0(struct __pyx_obj_7_amplpy_Variable *__pyx_v_self) {
  double __pyx_v_value;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("lb0", 1);

  /* "amplpy/variable.pxi":150
 *         """
 *         cdef double value
 *         PY_AMPL_CALL(campl.AMPL_InstanceGetDoubleSuffix(self._c_ampl, self._name, self._index, campl.AMPL_NUMERICSUFFIX.AMPL_LB0, &value))             # <<<<<<<<<<<<<<
 *         return value
 * 
 */
  __pyx_t_1 = __pyx_f_7_amplpy_PY_AMPL_CALL(AMPL_InstanceGetDoubleSuffix(__pyx_v_self->__pyx_base._c_ampl, __pyx_v_self->__pyx_base._name, __pyx_v_self->__pyx_base._index, AMPL_LB0, (&__pyx_v_value))); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 150, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "amplpy/variable.pxi":151
 *         cdef double value
 *         PY_AMPL_CALL(campl.AMPL_InstanceGetDoubleSuffix(self._c_ampl, self._name, self._index, campl.AMPL_NUMERICSUFFIX.AMPL_LB0, &value))
 *         return value             # <<<<<<<<<<<<<<
 * 
 *     def ub0(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 151, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "amplpy/variable.pxi":145
 *         return value
 * 
 *     def lb0(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the initial lower bounds, from the var declaration.
 */

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

/* "amplpy/variable.pxi":153
 *         return value
 * 
 *     def ub0(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the initial upper bound, from the var declaration.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_8Variable_27ub0(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_8Variable_26ub0, "Variable.ub0(self)\n\n        Returns the initial upper bound, from the var declaration.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_8Variable_27ub0 = {"ub0", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_8Variable_27ub0, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_8Variable_26ub0};
static PyObject *__pyx_pw_7_amplpy_8Variable_27ub0(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ub0 (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("ub0", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "ub0", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_8Variable_26ub0(((struct __pyx_obj_7_amplpy_Variable *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_8Variable_26ub0(struct __pyx_obj_7_amplpy_Variable *__pyx_v_self) {
  double __pyx_v_value;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ub0", 1);

  /* "amplpy/variable.pxi":158
 *         """
 *         cdef double value
 *         PY_AMPL_CALL(campl.AMPL_InstanceGetDoubleSuffix(self._c_ampl, self._name, self._index, campl.AMPL_NUMERICSUFFIX.AMPL_UB0, &value))             # <<<<<<<<<<<<<<
 *         return value
 * 
 */
  __pyx_t_1 = __pyx_f_7_amplpy_PY_AMPL_CALL(AMPL_InstanceGetDoubleSuffix(__pyx_v_self->__pyx_base._c_ampl, __pyx_v_self->__pyx_base._name, __pyx_v_self->__pyx_base._index, AMPL_UB0, (&__pyx_v_value))); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 158, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "amplpy/variable.pxi":159
 *         cdef double value
 *         PY_AMPL_CALL(campl.AMPL_InstanceGetDoubleSuffix(self._c_ampl, self._name, self._index, campl.AMPL_NUMERICSUFFIX.AMPL_UB0, &value))
 *         return value             # <<<<<<<<<<<<<<
 * 
 *     def lb1(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 159, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "amplpy/variable.pxi":153
 *         return value
 * 
 *     def ub0(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the initial upper bound, from the var declaration.
 */

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

/* "amplpy/variable.pxi":161
 *         return value
 * 
 *     def lb1(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the weaker lower bound from AMPL's presolve phase.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_8Variable_29lb1(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_8Variable_28lb1, "Variable.lb1(self)\n\n        Returns the weaker lower bound from AMPL's presolve phase.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_8Variable_29lb1 = {"lb1", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_8Variable_29lb1, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_8Variable_28lb1};
static PyObject *__pyx_pw_7_amplpy_8Variable_29lb1(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lb1 (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("lb1", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "lb1", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_8Variable_28lb1(((struct __pyx_obj_7_amplpy_Variable *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_8Variable_28lb1(struct __pyx_obj_7_amplpy_Variable *__pyx_v_self) {
  double __pyx_v_value;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("lb1", 1);

  /* "amplpy/variable.pxi":166
 *         """
 *         cdef double value
 *         PY_AMPL_CALL(campl.AMPL_InstanceGetDoubleSuffix(self._c_ampl, self._name, self._index, campl.AMPL_NUMERICSUFFIX.AMPL_LB1, &value))             # <<<<<<<<<<<<<<
 *         return value
 * 
 */
  __pyx_t_1 = __pyx_f_7_amplpy_PY_AMPL_CALL(AMPL_InstanceGetDoubleSuffix(__pyx_v_self->__pyx_base._c_ampl, __pyx_v_self->__pyx_base._name, __pyx_v_self->__pyx_base._index, AMPL_LB1, (&__pyx_v_value))); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 166, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "amplpy/variable.pxi":167
 *         cdef double value
 *         PY_AMPL_CALL(campl.AMPL_InstanceGetDoubleSuffix(self._c_ampl, self._name, self._index, campl.AMPL_NUMERICSUFFIX.AMPL_LB1, &value))
 *         return value             # <<<<<<<<<<<<<<
 * 
 *     def ub1(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 167, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "amplpy/variable.pxi":161
 *         return value
 * 
 *     def lb1(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the weaker lower bound from AMPL's presolve phase.
 */

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

/* "amplpy/variable.pxi":169
 *         return value
 * 
 *     def ub1(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the weaker upper bound from AMPL's presolve phase.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_8Variable_31ub1(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_8Variable_30ub1, "Variable.ub1(self)\n\n        Returns the weaker upper bound from AMPL's presolve phase.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_8Variable_31ub1 = {"ub1", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_8Variable_31ub1, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_8Variable_30ub1};
static PyObject *__pyx_pw_7_amplpy_8Variable_31ub1(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ub1 (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("ub1", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "ub1", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_8Variable_30ub1(((struct __pyx_obj_7_amplpy_Variable *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_8Variable_30ub1(struct __pyx_obj_7_amplpy_Variable *__pyx_v_self) {
  double __pyx_v_value;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ub1", 1);

  /* "amplpy/variable.pxi":174
 *         """
 *         cdef double value
 *         PY_AMPL_CALL(campl.AMPL_InstanceGetDoubleSuffix(self._c_ampl, self._name, self._index, campl.AMPL_NUMERICSUFFIX.AMPL_UB1, &value))             # <<<<<<<<<<<<<<
 *         return value
 * 
 */
  __pyx_t_1 = __pyx_f_7_amplpy_PY_AMPL_CALL(AMPL_InstanceGetDoubleSuffix(__pyx_v_self->__pyx_base._c_ampl, __pyx_v_self->__pyx_base._name, __pyx_v_self->__pyx_base._index, AMPL_UB1, (&__pyx_v_value))); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 174, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "amplpy/variable.pxi":175
 *         cdef double value
 *         PY_AMPL_CALL(campl.AMPL_InstanceGetDoubleSuffix(self._c_ampl, self._name, self._index, campl.AMPL_NUMERICSUFFIX.AMPL_UB1, &value))
 *         return value             # <<<<<<<<<<<<<<
 * 
 *     def lb2(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 175, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "amplpy/variable.pxi":169
 *         return value
 * 
 *     def ub1(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the weaker upper bound from AMPL's presolve phase.
 */

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

/* "amplpy/variable.pxi":177
 *         return value
 * 
 *     def lb2(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the stronger lower bound from AMPL's presolve phase.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_8Variable_33lb2(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_8Variable_32lb2, "Variable.lb2(self)\n\n        Returns the stronger lower bound from AMPL's presolve phase.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_8Variable_33lb2 = {"lb2", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_8Variable_33lb2, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_8Variable_32lb2};
static PyObject *__pyx_pw_7_amplpy_8Variable_33lb2(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lb2 (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("lb2", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "lb2", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_8Variable_32lb2(((struct __pyx_obj_7_amplpy_Variable *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_8Variable_32lb2(struct __pyx_obj_7_amplpy_Variable *__pyx_v_self) {
  double __pyx_v_value;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("lb2", 1);

  /* "amplpy/variable.pxi":182
 *         """
 *         cdef double value
 *         PY_AMPL_CALL(campl.AMPL_InstanceGetDoubleSuffix(self._c_ampl, self._name, self._index, campl.AMPL_NUMERICSUFFIX.AMPL_LB2, &value))             # <<<<<<<<<<<<<<
 *         return value
 * 
 */
  __pyx_t_1 = __pyx_f_7_amplpy_PY_AMPL_CALL(AMPL_InstanceGetDoubleSuffix(__pyx_v_self->__pyx_base._c_ampl, __pyx_v_self->__pyx_base._name, __pyx_v_self->__pyx_base._index, AMPL_LB2, (&__pyx_v_value))); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 182, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "amplpy/variable.pxi":183
 *         cdef double value
 *         PY_AMPL_CALL(campl.AMPL_InstanceGetDoubleSuffix(self._c_ampl, self._name, self._index, campl.AMPL_NUMERICSUFFIX.AMPL_LB2, &value))
 *         return value             # <<<<<<<<<<<<<<
 * 
 *     def ub2(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 183, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "amplpy/variable.pxi":177
 *         return value
 * 
 *     def lb2(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the stronger lower bound from AMPL's presolve phase.
 */

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

/* "amplpy/variable.pxi":185
 *         return value
 * 
 *     def ub2(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the stronger upper bound from AMPL's presolve phase.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_8Variable_35ub2(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_8Variable_34ub2, "Variable.ub2(self)\n\n        Returns the stronger upper bound from AMPL's presolve phase.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_8Variable_35ub2 = {"ub2", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_8Variable_35ub2, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_8Variable_34ub2};
static PyObject *__pyx_pw_7_amplpy_8Variable_35ub2(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ub2 (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("ub2", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "ub2", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_8Variable_34ub2(((struct __pyx_obj_7_amplpy_Variable *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_8Variable_34ub2(struct __pyx_obj_7_amplpy_Variable *__pyx_v_self) {
  double __pyx_v_value;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ub2", 1);

  /* "amplpy/variable.pxi":190
 *         """
 *         cdef double value
 *         PY_AMPL_CALL(campl.AMPL_InstanceGetDoubleSuffix(self._c_ampl, self._name, self._index, campl.AMPL_NUMERICSUFFIX.AMPL_UB2, &value))             # <<<<<<<<<<<<<<
 *         return value
 * 
 */
  __pyx_t_1 = __pyx_f_7_amplpy_PY_AMPL_CALL(AMPL_InstanceGetDoubleSuffix(__pyx_v_self->__pyx_base._c_ampl, __pyx_v_self->__pyx_base._name, __pyx_v_self->__pyx_base._index, AMPL_UB2, (&__pyx_v_value))); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 190, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "amplpy/variable.pxi":191
 *         cdef double value
 *         PY_AMPL_CALL(campl.AMPL_InstanceGetDoubleSuffix(self._c_ampl, self._name, self._index, campl.AMPL_NUMERICSUFFIX.AMPL_UB2, &value))
 *         return value             # <<<<<<<<<<<<<<
 * 
 *     def lrc(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 191, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "amplpy/variable.pxi":185
 *         return value
 * 
 *     def ub2(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the stronger upper bound from AMPL's presolve phase.
 */

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

/* "amplpy/variable.pxi":193
 *         return value
 * 
 *     def lrc(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the reduced cost at lower bound.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_8Variable_37lrc(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_8Variable_36lrc, "Variable.lrc(self)\n\n        Returns the reduced cost at lower bound.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_8Variable_37lrc = {"lrc", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_8Variable_37lrc, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_8Variable_36lrc};
static PyObject *__pyx_pw_7_amplpy_8Variable_37lrc(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lrc (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("lrc", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "lrc", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_8Variable_36lrc(((struct __pyx_obj_7_amplpy_Variable *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_8Variable_36lrc(struct __pyx_obj_7_amplpy_Variable *__pyx_v_self) {
  double __pyx_v_value;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("lrc", 1);

  /* "amplpy/variable.pxi":198
 *         """
 *         cdef double value
 *         PY_AMPL_CALL(campl.AMPL_InstanceGetDoubleSuffix(self._c_ampl, self._name, self._index, campl.AMPL_NUMERICSUFFIX.AMPL_LRC, &value))             # <<<<<<<<<<<<<<
 *         return value
 * 
 */
  __pyx_t_1 = __pyx_f_7_amplpy_PY_AMPL_CALL(AMPL_InstanceGetDoubleSuffix(__pyx_v_self->__pyx_base._c_ampl, __pyx_v_self->__pyx_base._name, __pyx_v_self->__pyx_base._index, AMPL_LRC, (&__pyx_v_value))); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 198, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "amplpy/variable.pxi":199
 *         cdef double value
 *         PY_AMPL_CALL(campl.AMPL_InstanceGetDoubleSuffix(self._c_ampl, self._name, self._index, campl.AMPL_NUMERICSUFFIX.AMPL_LRC, &value))
 *         return value             # <<<<<<<<<<<<<<
 * 
 *     def urc(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 199, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "amplpy/variable.pxi":193
 *         return value
 * 
 *     def lrc(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the reduced cost at lower bound.
 */

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

/* "amplpy/variable.pxi":201
 *         return value
 * 
 *     def urc(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the reduced cost at upper bound.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_8Variable_39urc(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_8Variable_38urc, "Variable.urc(self)\n\n        Returns the reduced cost at upper bound.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_8Variable_39urc = {"urc", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_8Variable_39urc, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_8Variable_38urc};
static PyObject *__pyx_pw_7_amplpy_8Variable_39urc(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("urc (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("urc", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "urc", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_8Variable_38urc(((struct __pyx_obj_7_amplpy_Variable *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_8Variable_38urc(struct __pyx_obj_7_amplpy_Variable *__pyx_v_self) {
  double __pyx_v_value;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("urc", 1);

  /* "amplpy/variable.pxi":206
 *         """
 *         cdef double value
 *         PY_AMPL_CALL(campl.AMPL_InstanceGetDoubleSuffix(self._c_ampl, self._name, self._index, campl.AMPL_NUMERICSUFFIX.AMPL_URC, &value))             # <<<<<<<<<<<<<<
 *         return value
 * 
 */
  __pyx_t_1 = __pyx_f_7_amplpy_PY_AMPL_CALL(AMPL_InstanceGetDoubleSuffix(__pyx_v_self->__pyx_base._c_ampl, __pyx_v_self->__pyx_base._name, __pyx_v_self->__pyx_base._index, AMPL_URC, (&__pyx_v_value))); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 206, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "amplpy/variable.pxi":207
 *         cdef double value
 *         PY_AMPL_CALL(campl.AMPL_InstanceGetDoubleSuffix(self._c_ampl, self._name, self._index, campl.AMPL_NUMERICSUFFIX.AMPL_URC, &value))
 *         return value             # <<<<<<<<<<<<<<
 * 
 *     def lslack(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "amplpy/variable.pxi":201
 *         return value
 * 
 *     def urc(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the reduced cost at upper bound.
 */

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

/* "amplpy/variable.pxi":209
 *         return value
 * 
 *     def lslack(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the slack at lower bound (``val - lb``).
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_8Variable_41lslack(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_8Variable_40lslack, "Variable.lslack(self)\n\n        Return the slack at lower bound (``val - lb``).\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_8Variable_41lslack = {"lslack", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_8Variable_41lslack, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_8Variable_40lslack};
static PyObject *__pyx_pw_7_amplpy_8Variable_41lslack(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lslack (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("lslack", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "lslack", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_8Variable_40lslack(((struct __pyx_obj_7_amplpy_Variable *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_8Variable_40lslack(struct __pyx_obj_7_amplpy_Variable *__pyx_v_self) {
  double __pyx_v_value;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("lslack", 1);

  /* "amplpy/variable.pxi":214
 *         """
 *         cdef double value
 *         PY_AMPL_CALL(campl.AMPL_InstanceGetDoubleSuffix(self._c_ampl, self._name, self._index, campl.AMPL_NUMERICSUFFIX.AMPL_LSLACK, &value))             # <<<<<<<<<<<<<<
 *         return value
 * 
 */
  __pyx_t_1 = __pyx_f_7_amplpy_PY_AMPL_CALL(AMPL_InstanceGetDoubleSuffix(__pyx_v_self->__pyx_base._c_ampl, __pyx_v_self->__pyx_base._name, __pyx_v_self->__pyx_base._index, AMPL_LSLACK, (&__pyx_v_value))); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 214, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "amplpy/variable.pxi":215
 *         cdef double value
 *         PY_AMPL_CALL(campl.AMPL_InstanceGetDoubleSuffix(self._c_ampl, self._name, self._index, campl.AMPL_NUMERICSUFFIX.AMPL_LSLACK, &value))
 *         return value             # <<<<<<<<<<<<<<
 * 
 *     def uslack(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 215, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "amplpy/variable.pxi":209
 *         return value
 * 
 *     def lslack(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the slack at lower bound (``val - lb``).
 */

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

/* "amplpy/variable.pxi":217
 *         return value
 * 
 *     def uslack(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the slack at upper bound (``ub - val``).
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_8Variable_43uslack(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_8Variable_42uslack, "Variable.uslack(self)\n\n        Return the slack at upper bound (``ub - val``).\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_8Variable_43uslack = {"uslack", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_8Variable_43uslack, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_8Variable_42uslack};
static PyObject *__pyx_pw_7_amplpy_8Variable_43uslack(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("uslack (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("uslack", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "uslack", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_8Variable_42uslack(((struct __pyx_obj_7_amplpy_Variable *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_8Variable_42uslack(struct __pyx_obj_7_amplpy_Variable *__pyx_v_self) {
  double __pyx_v_value;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("uslack", 1);

  /* "amplpy/variable.pxi":222
 *         """
 *         cdef double value
 *         PY_AMPL_CALL(campl.AMPL_InstanceGetDoubleSuffix(self._c_ampl, self._name, self._index, campl.AMPL_NUMERICSUFFIX.AMPL_USLACK, &value))             # <<<<<<<<<<<<<<
 *         return value
 * 
 */
  __pyx_t_1 = __pyx_f_7_amplpy_PY_AMPL_CALL(AMPL_InstanceGetDoubleSuffix(__pyx_v_self->__pyx_base._c_ampl, __pyx_v_self->__pyx_base._name, __pyx_v_self->__pyx_base._index, AMPL_USLACK, (&__pyx_v_value))); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 222, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "amplpy/variable.pxi":223
 *         cdef double value
 *         PY_AMPL_CALL(campl.AMPL_InstanceGetDoubleSuffix(self._c_ampl, self._name, self._index, campl.AMPL_NUMERICSUFFIX.AMPL_USLACK, &value))
 *         return value             # <<<<<<<<<<<<<<
 * 
 *     def rc(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 223, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "amplpy/variable.pxi":217
 *         return value
 * 
 *     def uslack(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the slack at upper bound (``ub - val``).
 */

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

/* "amplpy/variable.pxi":225
 *         return value
 * 
 *     def rc(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the reduced cost (at the nearer bound).
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_8Variable_45rc(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_8Variable_44rc, "Variable.rc(self)\n\n        Get the reduced cost (at the nearer bound).\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_8Variable_45rc = {"rc", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_8Variable_45rc, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_8Variable_44rc};
static PyObject *__pyx_pw_7_amplpy_8Variable_45rc(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("rc (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("rc", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "rc", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_8Variable_44rc(((struct __pyx_obj_7_amplpy_Variable *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_8Variable_44rc(struct __pyx_obj_7_amplpy_Variable *__pyx_v_self) {
  double __pyx_v_value;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("rc", 1);

  /* "amplpy/variable.pxi":230
 *         """
 *         cdef double value
 *         PY_AMPL_CALL(campl.AMPL_InstanceGetDoubleSuffix(self._c_ampl, self._name, self._index, campl.AMPL_NUMERICSUFFIX.AMPL_RC, &value))             # <<<<<<<<<<<<<<
 *         return value
 * 
 */
  __pyx_t_1 = __pyx_f_7_amplpy_PY_AMPL_CALL(AMPL_InstanceGetDoubleSuffix(__pyx_v_self->__pyx_base._c_ampl, __pyx_v_self->__pyx_base._name, __pyx_v_self->__pyx_base._index, AMPL_RC, (&__pyx_v_value))); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "amplpy/variable.pxi":231
 *         cdef double value
 *         PY_AMPL_CALL(campl.AMPL_InstanceGetDoubleSuffix(self._c_ampl, self._name, self._index, campl.AMPL_NUMERICSUFFIX.AMPL_RC, &value))
 *         return value             # <<<<<<<<<<<<<<
 * 
 *     def slack(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 231, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "amplpy/variable.pxi":225
 *         return value
 * 
 *     def rc(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the reduced cost (at the nearer bound).
 */

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

/* "amplpy/variable.pxi":233
 *         return value
 * 
 *     def slack(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the bound slack which is the lesser of
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_8Variable_47slack(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_8Variable_46slack, "Variable.slack(self)\n\n        Returns the bound slack which is the lesser of\n        :func:`~amplpy.Variable.lslack` and :func:`~amplpy.Variable.uslack`.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_8Variable_47slack = {"slack", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_8Variable_47slack, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_8Variable_46slack};
static PyObject *__pyx_pw_7_amplpy_8Variable_47slack(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("slack (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("slack", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "slack", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_8Variable_46slack(((struct __pyx_obj_7_amplpy_Variable *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_8Variable_46slack(struct __pyx_obj_7_amplpy_Variable *__pyx_v_self) {
  double __pyx_v_value;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("slack", 1);

  /* "amplpy/variable.pxi":239
 *         """
 *         cdef double value
 *         PY_AMPL_CALL(campl.AMPL_InstanceGetDoubleSuffix(self._c_ampl, self._name, self._index, campl.AMPL_NUMERICSUFFIX.AMPL_SLACK, &value))             # <<<<<<<<<<<<<<
 *         return value
 * 
 */
  __pyx_t_1 = __pyx_f_7_amplpy_PY_AMPL_CALL(AMPL_InstanceGetDoubleSuffix(__pyx_v_self->__pyx_base._c_ampl, __pyx_v_self->__pyx_base._name, __pyx_v_self->__pyx_base._index, AMPL_SLACK, (&__pyx_v_value))); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 239, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "amplpy/variable.pxi":240
 *         cdef double value
 *         PY_AMPL_CALL(campl.AMPL_InstanceGetDoubleSuffix(self._c_ampl, self._name, self._index, campl.AMPL_NUMERICSUFFIX.AMPL_SLACK, &value))
 *         return value             # <<<<<<<<<<<<<<
 * 
 *     def sstatus(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 240, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "amplpy/variable.pxi":233
 *         return value
 * 
 *     def slack(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the bound slack which is the lesser of
 */

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

/* "amplpy/variable.pxi":242
 *         return value
 * 
 *     def sstatus(self):             # <<<<<<<<<<<<<<
 *         """
 *         Solver status (basis status of variable).
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_8Variable_49sstatus(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_8Variable_48sstatus, "Variable.sstatus(self)\n\n        Solver status (basis status of variable).\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_8Variable_49sstatus = {"sstatus", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_8Variable_49sstatus, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_8Variable_48sstatus};
static PyObject *__pyx_pw_7_amplpy_8Variable_49sstatus(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sstatus (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("sstatus", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "sstatus", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_8Variable_48sstatus(((struct __pyx_obj_7_amplpy_Variable *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_8Variable_48sstatus(struct __pyx_obj_7_amplpy_Variable *__pyx_v_self) {
  AMPL_ERRORINFO *__pyx_v_errorinfo;
  AMPL_RETCODE __pyx_v_rc;
  char *__pyx_v_value_c;
  PyObject *__pyx_v_value = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("sstatus", 1);

  /* "amplpy/variable.pxi":249
 *         cdef campl.AMPL_RETCODE rc
 *         cdef char* value_c
 *         errorinfo = campl.AMPL_InstanceGetStringSuffix(self._c_ampl, self._name, self._index, campl.AMPL_STRINGSUFFIX.AMPL_SSTATUS, &value_c)             # <<<<<<<<<<<<<<
 *         if rc != campl.AMPL_OK:
 *             campl.AMPL_StringFree(&value_c)
 */
  __pyx_v_errorinfo = AMPL_InstanceGetStringSuffix(__pyx_v_self->__pyx_base._c_ampl, __pyx_v_self->__pyx_base._name, __pyx_v_self->__pyx_base._index, AMPL_SSTATUS, (&__pyx_v_value_c));

  /* "amplpy/variable.pxi":250
 *         cdef char* value_c
 *         errorinfo = campl.AMPL_InstanceGetStringSuffix(self._c_ampl, self._name, self._index, campl.AMPL_STRINGSUFFIX.AMPL_SSTATUS, &value_c)
 *         if rc != campl.AMPL_OK:             # <<<<<<<<<<<<<<
 *             campl.AMPL_StringFree(&value_c)
 *             PY_AMPL_CALL(errorinfo)
 */
  __pyx_t_1 = (__pyx_v_rc != AMPL_OK);
  if (__pyx_t_1) {

    /* "amplpy/variable.pxi":251
 *         errorinfo = campl.AMPL_InstanceGetStringSuffix(self._c_ampl, self._name, self._index, campl.AMPL_STRINGSUFFIX.AMPL_SSTATUS, &value_c)
 *         if rc != campl.AMPL_OK:
 *             campl.AMPL_StringFree(&value_c)             # <<<<<<<<<<<<<<
 *             PY_AMPL_CALL(errorinfo)
 *         value = str(value_c.decode('utf-8'))
 */
    (void)(AMPL_StringFree((&__pyx_v_value_c)));

    /* "amplpy/variable.pxi":252
 *         if rc != campl.AMPL_OK:
 *             campl.AMPL_StringFree(&value_c)
 *             PY_AMPL_CALL(errorinfo)             # <<<<<<<<<<<<<<
 *         value = str(value_c.decode('utf-8'))
 *         campl.AMPL_StringFree(&value_c)
 */
    __pyx_t_2 = __pyx_f_7_amplpy_PY_AMPL_CALL(__pyx_v_errorinfo); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 252, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "amplpy/variable.pxi":250
 *         cdef char* value_c
 *         errorinfo = campl.AMPL_InstanceGetStringSuffix(self._c_ampl, self._name, self._index, campl.AMPL_STRINGSUFFIX.AMPL_SSTATUS, &value_c)
 *         if rc != campl.AMPL_OK:             # <<<<<<<<<<<<<<
 *             campl.AMPL_StringFree(&value_c)
 *             PY_AMPL_CALL(errorinfo)
 */
  }

  /* "amplpy/variable.pxi":253
 *             campl.AMPL_StringFree(&value_c)
 *             PY_AMPL_CALL(errorinfo)
 *         value = str(value_c.decode('utf-8'))             # <<<<<<<<<<<<<<
 *         campl.AMPL_StringFree(&value_c)
 * 
 */
  __pyx_t_3 = __Pyx_ssize_strlen(__pyx_v_value_c); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(15, 253, __pyx_L1_error)
  __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_value_c, 0, __pyx_t_3, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 253, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_value = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "amplpy/variable.pxi":254
 *             PY_AMPL_CALL(errorinfo)
 *         value = str(value_c.decode('utf-8'))
 *         campl.AMPL_StringFree(&value_c)             # <<<<<<<<<<<<<<
 * 
 *         return value
 */
  (void)(AMPL_StringFree((&__pyx_v_value_c)));

  /* "amplpy/variable.pxi":256
 *         campl.AMPL_StringFree(&value_c)
 * 
 *         return value             # <<<<<<<<<<<<<<
 * 
 *     def status(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_value);
  __pyx_r = __pyx_v_value;
  goto __pyx_L0;

  /* "amplpy/variable.pxi":242
 *         return value
 * 
 *     def sstatus(self):             # <<<<<<<<<<<<<<
 *         """
 *         Solver status (basis status of variable).
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("_amplpy.Variable.sstatus", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/variable.pxi":258
 *         return value
 * 
 *     def status(self):             # <<<<<<<<<<<<<<
 *         """
 *         AMPL status if not `in`, otherwise solver status.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_8Variable_51status(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_8Variable_50status, "Variable.status(self)\n\n        AMPL status if not `in`, otherwise solver status.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_8Variable_51status = {"status", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_8Variable_51status, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_8Variable_50status};
static PyObject *__pyx_pw_7_amplpy_8Variable_51status(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("status (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("status", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "status", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_8Variable_50status(((struct __pyx_obj_7_amplpy_Variable *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_8Variable_50status(struct __pyx_obj_7_amplpy_Variable *__pyx_v_self) {
  AMPL_ERRORINFO *__pyx_v_errorinfo;
  AMPL_RETCODE __pyx_v_rc;
  char *__pyx_v_value_c;
  PyObject *__pyx_v_value = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("status", 1);

  /* "amplpy/variable.pxi":265
 *         cdef campl.AMPL_RETCODE rc
 *         cdef char* value_c
 *         errorinfo = campl.AMPL_InstanceGetStringSuffix(self._c_ampl, self._name, self._index, campl.AMPL_STRINGSUFFIX.AMPL_STATUS, &value_c)             # <<<<<<<<<<<<<<
 *         if rc != campl.AMPL_OK:
 *             campl.AMPL_StringFree(&value_c)
 */
  __pyx_v_errorinfo = AMPL_InstanceGetStringSuffix(__pyx_v_self->__pyx_base._c_ampl, __pyx_v_self->__pyx_base._name, __pyx_v_self->__pyx_base._index, AMPL_STATUS, (&__pyx_v_value_c));

  /* "amplpy/variable.pxi":266
 *         cdef char* value_c
 *         errorinfo = campl.AMPL_InstanceGetStringSuffix(self._c_ampl, self._name, self._index, campl.AMPL_STRINGSUFFIX.AMPL_STATUS, &value_c)
 *         if rc != campl.AMPL_OK:             # <<<<<<<<<<<<<<
 *             campl.AMPL_StringFree(&value_c)
 *             PY_AMPL_CALL(errorinfo)
 */
  __pyx_t_1 = (__pyx_v_rc != AMPL_OK);
  if (__pyx_t_1) {

    /* "amplpy/variable.pxi":267
 *         errorinfo = campl.AMPL_InstanceGetStringSuffix(self._c_ampl, self._name, self._index, campl.AMPL_STRINGSUFFIX.AMPL_STATUS, &value_c)
 *         if rc != campl.AMPL_OK:
 *             campl.AMPL_StringFree(&value_c)             # <<<<<<<<<<<<<<
 *             PY_AMPL_CALL(errorinfo)
 *         value = str(value_c.decode('utf-8'))
 */
    (void)(AMPL_StringFree((&__pyx_v_value_c)));

    /* "amplpy/variable.pxi":268
 *         if rc != campl.AMPL_OK:
 *             campl.AMPL_StringFree(&value_c)
 *             PY_AMPL_CALL(errorinfo)             # <<<<<<<<<<<<<<
 *         value = str(value_c.decode('utf-8'))
 *         campl.AMPL_StringFree(&value_c)
 */
    __pyx_t_2 = __pyx_f_7_amplpy_PY_AMPL_CALL(__pyx_v_errorinfo); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 268, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "amplpy/variable.pxi":266
 *         cdef char* value_c
 *         errorinfo = campl.AMPL_InstanceGetStringSuffix(self._c_ampl, self._name, self._index, campl.AMPL_STRINGSUFFIX.AMPL_STATUS, &value_c)
 *         if rc != campl.AMPL_OK:             # <<<<<<<<<<<<<<
 *             campl.AMPL_StringFree(&value_c)
 *             PY_AMPL_CALL(errorinfo)
 */
  }

  /* "amplpy/variable.pxi":269
 *             campl.AMPL_StringFree(&value_c)
 *             PY_AMPL_CALL(errorinfo)
 *         value = str(value_c.decode('utf-8'))             # <<<<<<<<<<<<<<
 *         campl.AMPL_StringFree(&value_c)
 * 
 */
  __pyx_t_3 = __Pyx_ssize_strlen(__pyx_v_value_c); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(15, 269, __pyx_L1_error)
  __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_value_c, 0, __pyx_t_3, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 269, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_value = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "amplpy/variable.pxi":270
 *             PY_AMPL_CALL(errorinfo)
 *         value = str(value_c.decode('utf-8'))
 *         campl.AMPL_StringFree(&value_c)             # <<<<<<<<<<<<<<
 * 
 *         return value
 */
  (void)(AMPL_StringFree((&__pyx_v_value_c)));

  /* "amplpy/variable.pxi":272
 *         campl.AMPL_StringFree(&value_c)
 * 
 *         return value             # <<<<<<<<<<<<<<
 * 
 *     # Aliases
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_value);
  __pyx_r = __pyx_v_value;
  goto __pyx_L0;

  /* "amplpy/variable.pxi":258
 *         return value
 * 
 *     def status(self):             # <<<<<<<<<<<<<<
 *         """
 *         AMPL status if not `in`, otherwise solver status.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("_amplpy.Variable.status", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._c_ampl,self._index cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_8Variable_53__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_8Variable_52__reduce_cython__, "Variable.__reduce_cython__(self)");
static PyMethodDef __pyx_mdef_7_amplpy_8Variable_53__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_8Variable_53__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_8Variable_52__reduce_cython__};
static PyObject *__pyx_pw_7_amplpy_8Variable_53__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_8Variable_52__reduce_cython__(((struct __pyx_obj_7_amplpy_Variable *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_8Variable_52__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7_amplpy_Variable *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 1);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "self._c_ampl,self._index cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self._c_ampl,self._index cannot be converted to a Python object for pickling"
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_self__c_ampl_self__index_cannot, 0, 0);
  __PYX_ERR(8, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._c_ampl,self._index cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 */

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

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._c_ampl,self._index cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._c_ampl,self._index cannot be converted to a Python object for pickling"
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_8Variable_55__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_8Variable_54__setstate_cython__, "Variable.__setstate_cython__(self, __pyx_state)");
static PyMethodDef __pyx_mdef_7_amplpy_8Variable_55__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_8Variable_55__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_8Variable_54__setstate_cython__};
static PyObject *__pyx_pw_7_amplpy_8Variable_55__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 3, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(8, 3, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(8, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.Variable.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_8Variable_54__setstate_cython__(((struct __pyx_obj_7_amplpy_Variable *)__pyx_v_self), __pyx_v___pyx_state);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_8Variable_54__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7_amplpy_Variable *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 1);

  /* "(tree fragment)":4
 *     raise TypeError, "self._c_ampl,self._index cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self._c_ampl,self._index cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_self__c_ampl_self__index_cannot, 0, 0);
  __PYX_ERR(8, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._c_ampl,self._index cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._c_ampl,self._index cannot be converted to a Python object for pickling"
 */

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

/* "amplpy/ampl.pyx":31
 * 
 * 
 * def nested_dict_of_suffixes(lst):             # <<<<<<<<<<<<<<
 *     nested = {}
 *     for name, value in lst:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_3nested_dict_of_suffixes(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_2nested_dict_of_suffixes, "nested_dict_of_suffixes(lst)");
static PyMethodDef __pyx_mdef_7_amplpy_3nested_dict_of_suffixes = {"nested_dict_of_suffixes", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_3nested_dict_of_suffixes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_2nested_dict_of_suffixes};
static PyObject *__pyx_pw_7_amplpy_3nested_dict_of_suffixes(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_lst = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("nested_dict_of_suffixes (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_lst,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_lst)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 31, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "nested_dict_of_suffixes") < 0)) __PYX_ERR(3, 31, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_lst = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("nested_dict_of_suffixes", 1, 1, 1, __pyx_nargs); __PYX_ERR(3, 31, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.nested_dict_of_suffixes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_2nested_dict_of_suffixes(__pyx_self, __pyx_v_lst);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_2nested_dict_of_suffixes(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_lst) {
  PyObject *__pyx_v_nested = NULL;
  PyObject *__pyx_v_name = NULL;
  PyObject *__pyx_v_value = NULL;
  PyObject *__pyx_v_p = NULL;
  PyObject *__pyx_v_v = NULL;
  PyObject *__pyx_v_index = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *(*__pyx_t_8)(PyObject *);
  int __pyx_t_9;
  unsigned int __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  Py_UCS4 __pyx_t_12;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("nested_dict_of_suffixes", 1);

  /* "amplpy/ampl.pyx":32
 * 
 * def nested_dict_of_suffixes(lst):
 *     nested = {}             # <<<<<<<<<<<<<<
 *     for name, value in lst:
 *         if "[" not in name:
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_nested = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "amplpy/ampl.pyx":33
 * def nested_dict_of_suffixes(lst):
 *     nested = {}
 *     for name, value in lst:             # <<<<<<<<<<<<<<
 *         if "[" not in name:
 *             nested[name] = value
 */
  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(3, 33, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 33, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(3, 33, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) 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(3, 33, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 33, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(3, 33, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) 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(3, 33, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 33, __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(3, 33, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
      PyObject* sequence = __pyx_t_4;
      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(3, 33, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_5 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_6 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      #else
      __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 33, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 33, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      #endif
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_7 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 33, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7);
      index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_5);
      index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_6);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(3, 33, __pyx_L1_error)
      __pyx_t_8 = NULL;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L6_unpacking_done;
      __pyx_L5_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_8 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(3, 33, __pyx_L1_error)
      __pyx_L6_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "amplpy/ampl.pyx":34
 *     nested = {}
 *     for name, value in lst:
 *         if "[" not in name:             # <<<<<<<<<<<<<<
 *             nested[name] = value
 *         else:
 */
    __pyx_t_9 = (__Pyx_PySequence_ContainsTF(__pyx_kp_u__33, __pyx_v_name, Py_NE)); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(3, 34, __pyx_L1_error)
    if (__pyx_t_9) {

      /* "amplpy/ampl.pyx":35
 *     for name, value in lst:
 *         if "[" not in name:
 *             nested[name] = value             # <<<<<<<<<<<<<<
 *         else:
 *             p = name.find("[")
 */
      if (unlikely((PyDict_SetItem(__pyx_v_nested, __pyx_v_name, __pyx_v_value) < 0))) __PYX_ERR(3, 35, __pyx_L1_error)

      /* "amplpy/ampl.pyx":34
 *     nested = {}
 *     for name, value in lst:
 *         if "[" not in name:             # <<<<<<<<<<<<<<
 *             nested[name] = value
 *         else:
 */
      goto __pyx_L7;
    }

    /* "amplpy/ampl.pyx":37
 *             nested[name] = value
 *         else:
 *             p = name.find("[")             # <<<<<<<<<<<<<<
 *             v, index = name[:p], literal_eval(f"({name[p+1:-1]},)")
 *             if v not in nested:
 */
    /*else*/ {
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_find); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 37, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = NULL;
      __pyx_t_10 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_10 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_kp_u__33};
        __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10);
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 37, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_XDECREF_SET(__pyx_v_p, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "amplpy/ampl.pyx":38
 *         else:
 *             p = name.find("[")
 *             v, index = name[:p], literal_eval(f"({name[p+1:-1]},)")             # <<<<<<<<<<<<<<
 *             if v not in nested:
 *                 nested[v] = {}
 */
      __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_v_name, 0, 0, NULL, &__pyx_v_p, NULL, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 38, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_literal_eval); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 38, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 38, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_11 = 0;
      __pyx_t_12 = 127;
      __Pyx_INCREF(__pyx_kp_u__34);
      __pyx_t_11 += 1;
      __Pyx_GIVEREF(__pyx_kp_u__34);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_kp_u__34);
      __pyx_t_13 = __Pyx_PyInt_AddObjC(__pyx_v_p, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_13)) __PYX_ERR(3, 38, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      __pyx_t_14 = __Pyx_PyObject_GetSlice(__pyx_v_name, 0, -1L, &__pyx_t_13, NULL, NULL, 0, 1, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 38, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __pyx_t_13 = __Pyx_PyObject_FormatSimple(__pyx_t_14, __pyx_empty_unicode); if (unlikely(!__pyx_t_13)) __PYX_ERR(3, 38, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __pyx_t_12 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_13) > __pyx_t_12) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_13) : __pyx_t_12;
      __pyx_t_11 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_13);
      __Pyx_GIVEREF(__pyx_t_13);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_13);
      __pyx_t_13 = 0;
      __Pyx_INCREF(__pyx_kp_u__35);
      __pyx_t_11 += 2;
      __Pyx_GIVEREF(__pyx_kp_u__35);
      PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_kp_u__35);
      __pyx_t_13 = __Pyx_PyUnicode_Join(__pyx_t_7, 3, __pyx_t_11, __pyx_t_12); if (unlikely(!__pyx_t_13)) __PYX_ERR(3, 38, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = NULL;
      __pyx_t_10 = 0;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(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_10 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_13};
        __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10);
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 38, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      }
      __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_4);
      __pyx_t_4 = 0;
      __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "amplpy/ampl.pyx":39
 *             p = name.find("[")
 *             v, index = name[:p], literal_eval(f"({name[p+1:-1]},)")
 *             if v not in nested:             # <<<<<<<<<<<<<<
 *                 nested[v] = {}
 *             if len(index) == 1:
 */
      __pyx_t_9 = (__Pyx_PyDict_ContainsTF(__pyx_v_v, __pyx_v_nested, Py_NE)); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(3, 39, __pyx_L1_error)
      if (__pyx_t_9) {

        /* "amplpy/ampl.pyx":40
 *             v, index = name[:p], literal_eval(f"({name[p+1:-1]},)")
 *             if v not in nested:
 *                 nested[v] = {}             # <<<<<<<<<<<<<<
 *             if len(index) == 1:
 *                 index = index[0]
 */
        __pyx_t_6 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 40, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (unlikely((PyDict_SetItem(__pyx_v_nested, __pyx_v_v, __pyx_t_6) < 0))) __PYX_ERR(3, 40, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

        /* "amplpy/ampl.pyx":39
 *             p = name.find("[")
 *             v, index = name[:p], literal_eval(f"({name[p+1:-1]},)")
 *             if v not in nested:             # <<<<<<<<<<<<<<
 *                 nested[v] = {}
 *             if len(index) == 1:
 */
      }

      /* "amplpy/ampl.pyx":41
 *             if v not in nested:
 *                 nested[v] = {}
 *             if len(index) == 1:             # <<<<<<<<<<<<<<
 *                 index = index[0]
 *             nested[v][index] = value
 */
      __pyx_t_11 = PyObject_Length(__pyx_v_index); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(3, 41, __pyx_L1_error)
      __pyx_t_9 = (__pyx_t_11 == 1);
      if (__pyx_t_9) {

        /* "amplpy/ampl.pyx":42
 *                 nested[v] = {}
 *             if len(index) == 1:
 *                 index = index[0]             # <<<<<<<<<<<<<<
 *             nested[v][index] = value
 *     return nested
 */
        __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_index, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 42, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_6);
        __pyx_t_6 = 0;

        /* "amplpy/ampl.pyx":41
 *             if v not in nested:
 *                 nested[v] = {}
 *             if len(index) == 1:             # <<<<<<<<<<<<<<
 *                 index = index[0]
 *             nested[v][index] = value
 */
      }

      /* "amplpy/ampl.pyx":43
 *             if len(index) == 1:
 *                 index = index[0]
 *             nested[v][index] = value             # <<<<<<<<<<<<<<
 *     return nested
 * 
 */
      __pyx_t_6 = __Pyx_PyDict_GetItem(__pyx_v_nested, __pyx_v_v); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 43, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (unlikely((PyObject_SetItem(__pyx_t_6, __pyx_v_index, __pyx_v_value) < 0))) __PYX_ERR(3, 43, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __pyx_L7:;

    /* "amplpy/ampl.pyx":33
 * def nested_dict_of_suffixes(lst):
 *     nested = {}
 *     for name, value in lst:             # <<<<<<<<<<<<<<
 *         if "[" not in name:
 *             nested[name] = value
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "amplpy/ampl.pyx":44
 *                 index = index[0]
 *             nested[v][index] = value
 *     return nested             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_nested);
  __pyx_r = __pyx_v_nested;
  goto __pyx_L0;

  /* "amplpy/ampl.pyx":31
 * 
 * 
 * def nested_dict_of_suffixes(lst):             # <<<<<<<<<<<<<<
 *     nested = {}
 *     for name, value in lst:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_AddTraceback("_amplpy.nested_dict_of_suffixes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_nested);
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XDECREF(__pyx_v_p);
  __Pyx_XDECREF(__pyx_v_v);
  __Pyx_XDECREF(__pyx_v_index);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/ampl.pyx":108
 *     cdef object _error_handler
 * 
 *     def __init__(self, environment=None):             # <<<<<<<<<<<<<<
 *         """
 *         Constructor:
 */

/* Python wrapper */
static int __pyx_pw_7_amplpy_4AMPL_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_4AMPL___init__, "\n        Constructor:\n        creates a new AMPL instance with the specified environment if provided.\n\n        Args:\n            environment (:class:`~amplpy.Environment`): This allows the user to\n            specify the location of the AMPL binaries to be used and to modify\n            the environment variables in which the AMPL interpreter will run.\n\n        Raises:\n            RuntimeError: If no valid AMPL license has been found or if the\n            translator cannot be started for any other reason.\n        ");
#if CYTHON_UPDATE_DESCRIPTOR_DOC
struct wrapperbase __pyx_wrapperbase_7_amplpy_4AMPL___init__;
#endif
static int __pyx_pw_7_amplpy_4AMPL_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_environment = 0;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_environment,0};
    values[0] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)Py_None));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_environment);
          if (value) { values[0] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 108, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(3, 108, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_environment = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 1, __pyx_nargs); __PYX_ERR(3, 108, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.AMPL.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_4AMPL___init__(((struct __pyx_obj_7_amplpy_AMPL *)__pyx_v_self), __pyx_v_environment);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7_amplpy_4AMPL___init__(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self, PyObject *__pyx_v_environment) {
  struct __pyx_obj_7_amplpy_Environment *__pyx_v_env = 0;
  PyObject *__pyx_v_exp = NULL;
  PyObject *__pyx_v_line = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  AMPL_ENVIRONMENT *__pyx_t_8;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  unsigned int __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  PyObject *(*__pyx_t_16)(PyObject *);
  Py_ssize_t __pyx_t_17;
  Py_UCS4 __pyx_t_18;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  int __pyx_t_21;
  char const *__pyx_t_22;
  PyObject *__pyx_t_23 = NULL;
  PyObject *__pyx_t_24 = NULL;
  PyObject *__pyx_t_25 = NULL;
  PyObject *__pyx_t_26 = NULL;
  PyObject *__pyx_t_27 = NULL;
  PyObject *__pyx_t_28 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);
  __Pyx_INCREF(__pyx_v_environment);

  /* "amplpy/ampl.pyx":123
 *         """
 *         cdef Environment env
 *         try:             # <<<<<<<<<<<<<<
 *             if environment is None and os.name == "nt":
 *                 environment = Environment()
 */
  {
    __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:*/ {

      /* "amplpy/ampl.pyx":124
 *         cdef Environment env
 *         try:
 *             if environment is None and os.name == "nt":             # <<<<<<<<<<<<<<
 *                 environment = Environment()
 *             if environment is None:
 */
      __pyx_t_5 = (__pyx_v_environment == Py_None);
      if (__pyx_t_5) {
      } else {
        __pyx_t_4 = __pyx_t_5;
        goto __pyx_L10_bool_binop_done;
      }
      __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_os); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 124, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_name); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 124, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_7, __pyx_n_u_nt, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(3, 124, __pyx_L3_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_4 = __pyx_t_5;
      __pyx_L10_bool_binop_done:;
      if (__pyx_t_4) {

        /* "amplpy/ampl.pyx":125
 *         try:
 *             if environment is None and os.name == "nt":
 *                 environment = Environment()             # <<<<<<<<<<<<<<
 *             if environment is None:
 *                 PY_AMPL_CALL(campl.AMPL_Create(&self._c_ampl))
 */
        __pyx_t_7 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_7_amplpy_Environment)); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 125, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF_SET(__pyx_v_environment, __pyx_t_7);
        __pyx_t_7 = 0;

        /* "amplpy/ampl.pyx":124
 *         cdef Environment env
 *         try:
 *             if environment is None and os.name == "nt":             # <<<<<<<<<<<<<<
 *                 environment = Environment()
 *             if environment is None:
 */
      }

      /* "amplpy/ampl.pyx":126
 *             if environment is None and os.name == "nt":
 *                 environment = Environment()
 *             if environment is None:             # <<<<<<<<<<<<<<
 *                 PY_AMPL_CALL(campl.AMPL_Create(&self._c_ampl))
 *             else:
 */
      __pyx_t_4 = (__pyx_v_environment == Py_None);
      if (__pyx_t_4) {

        /* "amplpy/ampl.pyx":127
 *                 environment = Environment()
 *             if environment is None:
 *                 PY_AMPL_CALL(campl.AMPL_Create(&self._c_ampl))             # <<<<<<<<<<<<<<
 *             else:
 *                 env = environment
 */
        __pyx_t_7 = __pyx_f_7_amplpy_PY_AMPL_CALL(AMPL_Create((&__pyx_v_self->_c_ampl))); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 127, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "amplpy/ampl.pyx":126
 *             if environment is None and os.name == "nt":
 *                 environment = Environment()
 *             if environment is None:             # <<<<<<<<<<<<<<
 *                 PY_AMPL_CALL(campl.AMPL_Create(&self._c_ampl))
 *             else:
 */
        goto __pyx_L12;
      }

      /* "amplpy/ampl.pyx":129
 *                 PY_AMPL_CALL(campl.AMPL_Create(&self._c_ampl))
 *             else:
 *                 env = environment             # <<<<<<<<<<<<<<
 *                 PY_AMPL_CALL(campl.AMPL_CreateWithEnv(&self._c_ampl, env.get_c_pointer()))
 *         except RuntimeError as exp:
 */
      /*else*/ {
        if (!(likely(((__pyx_v_environment) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_environment, __pyx_ptype_7_amplpy_Environment))))) __PYX_ERR(3, 129, __pyx_L3_error)
        __pyx_t_7 = __pyx_v_environment;
        __Pyx_INCREF(__pyx_t_7);
        __pyx_v_env = ((struct __pyx_obj_7_amplpy_Environment *)__pyx_t_7);
        __pyx_t_7 = 0;

        /* "amplpy/ampl.pyx":130
 *             else:
 *                 env = environment
 *                 PY_AMPL_CALL(campl.AMPL_CreateWithEnv(&self._c_ampl, env.get_c_pointer()))             # <<<<<<<<<<<<<<
 *         except RuntimeError as exp:
 *             if str(exp).startswith("AMPL could not be started"):
 */
        __pyx_t_8 = ((struct __pyx_vtabstruct_7_amplpy_Environment *)__pyx_v_env->__pyx_vtab)->get_c_pointer(__pyx_v_env); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 130, __pyx_L3_error)
        __pyx_t_7 = __pyx_f_7_amplpy_PY_AMPL_CALL(AMPL_CreateWithEnv((&__pyx_v_self->_c_ampl), __pyx_t_8)); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 130, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __pyx_L12:;

      /* "amplpy/ampl.pyx":123
 *         """
 *         cdef Environment env
 *         try:             # <<<<<<<<<<<<<<
 *             if environment is None and os.name == "nt":
 *                 environment = Environment()
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "amplpy/ampl.pyx":131
 *                 env = environment
 *                 PY_AMPL_CALL(campl.AMPL_CreateWithEnv(&self._c_ampl, env.get_c_pointer()))
 *         except RuntimeError as exp:             # <<<<<<<<<<<<<<
 *             if str(exp).startswith("AMPL could not be started"):
 *                 print("*" * 79, file=sys.stderr)
 */
    __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_RuntimeError);
    if (__pyx_t_9) {
      __Pyx_AddTraceback("_amplpy.AMPL.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_6, &__pyx_t_10) < 0) __PYX_ERR(3, 131, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_exp = __pyx_t_6;
      /*try:*/ {

        /* "amplpy/ampl.pyx":132
 *                 PY_AMPL_CALL(campl.AMPL_CreateWithEnv(&self._c_ampl, env.get_c_pointer()))
 *         except RuntimeError as exp:
 *             if str(exp).startswith("AMPL could not be started"):             # <<<<<<<<<<<<<<
 *                 print("*" * 79, file=sys.stderr)
 *                 for line in AMPL_NOT_FOUND_MESSAGE.split("\n"):
 */
        __pyx_t_11 = __Pyx_PyObject_Unicode(__pyx_v_exp); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 132, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_4 = __Pyx_PyUnicode_Tailmatch(__pyx_t_11, __pyx_kp_u_AMPL_could_not_be_started, 0, PY_SSIZE_T_MAX, -1); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(3, 132, __pyx_L18_error)
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        if (__pyx_t_4) {

          /* "amplpy/ampl.pyx":133
 *         except RuntimeError as exp:
 *             if str(exp).startswith("AMPL could not be started"):
 *                 print("*" * 79, file=sys.stderr)             # <<<<<<<<<<<<<<
 *                 for line in AMPL_NOT_FOUND_MESSAGE.split("\n"):
 *                     print(f"* {line:75} *", file=sys.stderr)
 */
          __pyx_t_11 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 133, __pyx_L18_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_sys); if (unlikely(!__pyx_t_12)) __PYX_ERR(3, 133, __pyx_L18_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_stderr); if (unlikely(!__pyx_t_13)) __PYX_ERR(3, 133, __pyx_L18_error)
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_file_2, __pyx_t_13) < 0) __PYX_ERR(3, 133, __pyx_L18_error)
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          __pyx_t_13 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__37, __pyx_t_11); if (unlikely(!__pyx_t_13)) __PYX_ERR(3, 133, __pyx_L18_error)
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

          /* "amplpy/ampl.pyx":134
 *             if str(exp).startswith("AMPL could not be started"):
 *                 print("*" * 79, file=sys.stderr)
 *                 for line in AMPL_NOT_FOUND_MESSAGE.split("\n"):             # <<<<<<<<<<<<<<
 *                     print(f"* {line:75} *", file=sys.stderr)
 *                 print("*" * 79, file=sys.stderr)
 */
          __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_AMPL_NOT_FOUND_MESSAGE); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 134, __pyx_L18_error)
          __Pyx_GOTREF(__pyx_t_11);
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_split); if (unlikely(!__pyx_t_12)) __PYX_ERR(3, 134, __pyx_L18_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __pyx_t_11 = NULL;
          __pyx_t_14 = 0;
          #if CYTHON_UNPACK_METHODS
          if (unlikely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
              __pyx_t_14 = 1;
            }
          }
          #endif
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_kp_u__25};
            __pyx_t_13 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_14, 1+__pyx_t_14);
            __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
            if (unlikely(!__pyx_t_13)) __PYX_ERR(3, 134, __pyx_L18_error)
            __Pyx_GOTREF(__pyx_t_13);
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          }
          if (likely(PyList_CheckExact(__pyx_t_13)) || PyTuple_CheckExact(__pyx_t_13)) {
            __pyx_t_12 = __pyx_t_13; __Pyx_INCREF(__pyx_t_12);
            __pyx_t_15 = 0;
            __pyx_t_16 = NULL;
          } else {
            __pyx_t_15 = -1; __pyx_t_12 = PyObject_GetIter(__pyx_t_13); if (unlikely(!__pyx_t_12)) __PYX_ERR(3, 134, __pyx_L18_error)
            __Pyx_GOTREF(__pyx_t_12);
            __pyx_t_16 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_12); if (unlikely(!__pyx_t_16)) __PYX_ERR(3, 134, __pyx_L18_error)
          }
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          for (;;) {
            if (likely(!__pyx_t_16)) {
              if (likely(PyList_CheckExact(__pyx_t_12))) {
                {
                  Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_12);
                  #if !CYTHON_ASSUME_SAFE_MACROS
                  if (unlikely((__pyx_temp < 0))) __PYX_ERR(3, 134, __pyx_L18_error)
                  #endif
                  if (__pyx_t_15 >= __pyx_temp) break;
                }
                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                __pyx_t_13 = PyList_GET_ITEM(__pyx_t_12, __pyx_t_15); __Pyx_INCREF(__pyx_t_13); __pyx_t_15++; if (unlikely((0 < 0))) __PYX_ERR(3, 134, __pyx_L18_error)
                #else
                __pyx_t_13 = __Pyx_PySequence_ITEM(__pyx_t_12, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_13)) __PYX_ERR(3, 134, __pyx_L18_error)
                __Pyx_GOTREF(__pyx_t_13);
                #endif
              } else {
                {
                  Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_12);
                  #if !CYTHON_ASSUME_SAFE_MACROS
                  if (unlikely((__pyx_temp < 0))) __PYX_ERR(3, 134, __pyx_L18_error)
                  #endif
                  if (__pyx_t_15 >= __pyx_temp) break;
                }
                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                __pyx_t_13 = PyTuple_GET_ITEM(__pyx_t_12, __pyx_t_15); __Pyx_INCREF(__pyx_t_13); __pyx_t_15++; if (unlikely((0 < 0))) __PYX_ERR(3, 134, __pyx_L18_error)
                #else
                __pyx_t_13 = __Pyx_PySequence_ITEM(__pyx_t_12, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_13)) __PYX_ERR(3, 134, __pyx_L18_error)
                __Pyx_GOTREF(__pyx_t_13);
                #endif
              }
            } else {
              __pyx_t_13 = __pyx_t_16(__pyx_t_12);
              if (unlikely(!__pyx_t_13)) {
                PyObject* exc_type = PyErr_Occurred();
                if (exc_type) {
                  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                  else __PYX_ERR(3, 134, __pyx_L18_error)
                }
                break;
              }
              __Pyx_GOTREF(__pyx_t_13);
            }
            __Pyx_XDECREF_SET(__pyx_v_line, __pyx_t_13);
            __pyx_t_13 = 0;

            /* "amplpy/ampl.pyx":135
 *                 print("*" * 79, file=sys.stderr)
 *                 for line in AMPL_NOT_FOUND_MESSAGE.split("\n"):
 *                     print(f"* {line:75} *", file=sys.stderr)             # <<<<<<<<<<<<<<
 *                 print("*" * 79, file=sys.stderr)
 *             raise
 */
            __pyx_t_13 = PyTuple_New(3); if (unlikely(!__pyx_t_13)) __PYX_ERR(3, 135, __pyx_L18_error)
            __Pyx_GOTREF(__pyx_t_13);
            __pyx_t_17 = 0;
            __pyx_t_18 = 127;
            __Pyx_INCREF(__pyx_kp_u__38);
            __pyx_t_17 += 2;
            __Pyx_GIVEREF(__pyx_kp_u__38);
            PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_kp_u__38);
            __pyx_t_11 = __Pyx_PyObject_Format(__pyx_v_line, __pyx_kp_u_75); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 135, __pyx_L18_error)
            __Pyx_GOTREF(__pyx_t_11);
            __pyx_t_18 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11) > __pyx_t_18) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11) : __pyx_t_18;
            __pyx_t_17 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11);
            __Pyx_GIVEREF(__pyx_t_11);
            PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_11);
            __pyx_t_11 = 0;
            __Pyx_INCREF(__pyx_kp_u__39);
            __pyx_t_17 += 2;
            __Pyx_GIVEREF(__pyx_kp_u__39);
            PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_kp_u__39);
            __pyx_t_11 = __Pyx_PyUnicode_Join(__pyx_t_13, 3, __pyx_t_17, __pyx_t_18); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 135, __pyx_L18_error)
            __Pyx_GOTREF(__pyx_t_11);
            __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            __pyx_t_13 = PyTuple_New(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(3, 135, __pyx_L18_error)
            __Pyx_GOTREF(__pyx_t_13);
            __Pyx_GIVEREF(__pyx_t_11);
            if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11)) __PYX_ERR(3, 135, __pyx_L18_error);
            __pyx_t_11 = 0;
            __pyx_t_11 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 135, __pyx_L18_error)
            __Pyx_GOTREF(__pyx_t_11);
            __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_sys); if (unlikely(!__pyx_t_19)) __PYX_ERR(3, 135, __pyx_L18_error)
            __Pyx_GOTREF(__pyx_t_19);
            __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_n_s_stderr); if (unlikely(!__pyx_t_20)) __PYX_ERR(3, 135, __pyx_L18_error)
            __Pyx_GOTREF(__pyx_t_20);
            __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
            if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_file_2, __pyx_t_20) < 0) __PYX_ERR(3, 135, __pyx_L18_error)
            __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
            __pyx_t_20 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_t_13, __pyx_t_11); if (unlikely(!__pyx_t_20)) __PYX_ERR(3, 135, __pyx_L18_error)
            __Pyx_GOTREF(__pyx_t_20);
            __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

            /* "amplpy/ampl.pyx":134
 *             if str(exp).startswith("AMPL could not be started"):
 *                 print("*" * 79, file=sys.stderr)
 *                 for line in AMPL_NOT_FOUND_MESSAGE.split("\n"):             # <<<<<<<<<<<<<<
 *                     print(f"* {line:75} *", file=sys.stderr)
 *                 print("*" * 79, file=sys.stderr)
 */
          }
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

          /* "amplpy/ampl.pyx":136
 *                 for line in AMPL_NOT_FOUND_MESSAGE.split("\n"):
 *                     print(f"* {line:75} *", file=sys.stderr)
 *                 print("*" * 79, file=sys.stderr)             # <<<<<<<<<<<<<<
 *             raise
 *         self._output_handler = None
 */
          __pyx_t_12 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(3, 136, __pyx_L18_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_GetModuleGlobalName(__pyx_t_20, __pyx_n_s_sys); if (unlikely(!__pyx_t_20)) __PYX_ERR(3, 136, __pyx_L18_error)
          __Pyx_GOTREF(__pyx_t_20);
          __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_20, __pyx_n_s_stderr); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 136, __pyx_L18_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
          if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_file_2, __pyx_t_11) < 0) __PYX_ERR(3, 136, __pyx_L18_error)
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __pyx_t_11 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__37, __pyx_t_12); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 136, __pyx_L18_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

          /* "amplpy/ampl.pyx":132
 *                 PY_AMPL_CALL(campl.AMPL_CreateWithEnv(&self._c_ampl, env.get_c_pointer()))
 *         except RuntimeError as exp:
 *             if str(exp).startswith("AMPL could not be started"):             # <<<<<<<<<<<<<<
 *                 print("*" * 79, file=sys.stderr)
 *                 for line in AMPL_NOT_FOUND_MESSAGE.split("\n"):
 */
        }

        /* "amplpy/ampl.pyx":137
 *                     print(f"* {line:75} *", file=sys.stderr)
 *                 print("*" * 79, file=sys.stderr)
 *             raise             # <<<<<<<<<<<<<<
 *         self._output_handler = None
 *         self._error_handler = None
 */
        __Pyx_GIVEREF(__pyx_t_7);
        __Pyx_GIVEREF(__pyx_t_6);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_ErrRestoreWithState(__pyx_t_7, __pyx_t_6, __pyx_t_10);
        __pyx_t_7 = 0; __pyx_t_6 = 0; __pyx_t_10 = 0; 
        __PYX_ERR(3, 137, __pyx_L18_error)
      }

      /* "amplpy/ampl.pyx":131
 *                 env = environment
 *                 PY_AMPL_CALL(campl.AMPL_CreateWithEnv(&self._c_ampl, env.get_c_pointer()))
 *         except RuntimeError as exp:             # <<<<<<<<<<<<<<
 *             if str(exp).startswith("AMPL could not be started"):
 *                 print("*" * 79, file=sys.stderr)
 */
      /*finally:*/ {
        __pyx_L18_error:;
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __pyx_t_23 = 0; __pyx_t_24 = 0; __pyx_t_25 = 0; __pyx_t_26 = 0; __pyx_t_27 = 0; __pyx_t_28 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
          __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_26, &__pyx_t_27, &__pyx_t_28);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_23, &__pyx_t_24, &__pyx_t_25) < 0)) __Pyx_ErrFetch(&__pyx_t_23, &__pyx_t_24, &__pyx_t_25);
          __Pyx_XGOTREF(__pyx_t_23);
          __Pyx_XGOTREF(__pyx_t_24);
          __Pyx_XGOTREF(__pyx_t_25);
          __Pyx_XGOTREF(__pyx_t_26);
          __Pyx_XGOTREF(__pyx_t_27);
          __Pyx_XGOTREF(__pyx_t_28);
          __pyx_t_9 = __pyx_lineno; __pyx_t_21 = __pyx_clineno; __pyx_t_22 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_exp); __pyx_v_exp = 0;
          }
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_26);
            __Pyx_XGIVEREF(__pyx_t_27);
            __Pyx_XGIVEREF(__pyx_t_28);
            __Pyx_ExceptionReset(__pyx_t_26, __pyx_t_27, __pyx_t_28);
          }
          __Pyx_XGIVEREF(__pyx_t_23);
          __Pyx_XGIVEREF(__pyx_t_24);
          __Pyx_XGIVEREF(__pyx_t_25);
          __Pyx_ErrRestore(__pyx_t_23, __pyx_t_24, __pyx_t_25);
          __pyx_t_23 = 0; __pyx_t_24 = 0; __pyx_t_25 = 0; __pyx_t_26 = 0; __pyx_t_27 = 0; __pyx_t_28 = 0;
          __pyx_lineno = __pyx_t_9; __pyx_clineno = __pyx_t_21; __pyx_filename = __pyx_t_22;
          goto __pyx_L5_except_error;
        }
      }
    }
    goto __pyx_L5_except_error;

    /* "amplpy/ampl.pyx":123
 *         """
 *         cdef Environment env
 *         try:             # <<<<<<<<<<<<<<
 *             if environment is None and os.name == "nt":
 *                 environment = Environment()
 */
    __pyx_L5_except_error:;
    __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_L8_try_end:;
  }

  /* "amplpy/ampl.pyx":138
 *                 print("*" * 79, file=sys.stderr)
 *             raise
 *         self._output_handler = None             # <<<<<<<<<<<<<<
 *         self._error_handler = None
 *         self.set_output_handler(OutputHandler())
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->_output_handler);
  __Pyx_DECREF(__pyx_v_self->_output_handler);
  __pyx_v_self->_output_handler = Py_None;

  /* "amplpy/ampl.pyx":139
 *             raise
 *         self._output_handler = None
 *         self._error_handler = None             # <<<<<<<<<<<<<<
 *         self.set_output_handler(OutputHandler())
 *         self.set_error_handler(ErrorHandler())
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->_error_handler);
  __Pyx_DECREF(__pyx_v_self->_error_handler);
  __pyx_v_self->_error_handler = Py_None;

  /* "amplpy/ampl.pyx":140
 *         self._output_handler = None
 *         self._error_handler = None
 *         self.set_output_handler(OutputHandler())             # <<<<<<<<<<<<<<
 *         self.set_error_handler(ErrorHandler())
 * 
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_output_handler); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 140, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_7_amplpy_OutputHandler)); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 140, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_11 = NULL;
  __pyx_t_14 = 0;
  #if CYTHON_UNPACK_METHODS
  if (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);
      __pyx_t_14 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_t_7};
    __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_14, 1+__pyx_t_14);
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_10)) __PYX_ERR(3, 140, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "amplpy/ampl.pyx":141
 *         self._error_handler = None
 *         self.set_output_handler(OutputHandler())
 *         self.set_error_handler(ErrorHandler())             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_error_handler); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 141, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_7_amplpy_ErrorHandler)); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 141, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_11 = NULL;
  __pyx_t_14 = 0;
  #if CYTHON_UNPACK_METHODS
  if (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);
      __pyx_t_14 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_t_7};
    __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_14, 1+__pyx_t_14);
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_10)) __PYX_ERR(3, 141, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "amplpy/ampl.pyx":108
 *     cdef object _error_handler
 * 
 *     def __init__(self, environment=None):             # <<<<<<<<<<<<<<
 *         """
 *         Constructor:
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_19);
  __Pyx_XDECREF(__pyx_t_20);
  __Pyx_AddTraceback("_amplpy.AMPL.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_env);
  __Pyx_XDECREF(__pyx_v_exp);
  __Pyx_XDECREF(__pyx_v_line);
  __Pyx_XDECREF(__pyx_v_environment);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/ampl.pyx":143
 *         self.set_error_handler(ErrorHandler())
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Default destructor:
 */

/* Python wrapper */
static void __pyx_pw_7_amplpy_4AMPL_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_7_amplpy_4AMPL_3__dealloc__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_pf_7_amplpy_4AMPL_2__dealloc__(((struct __pyx_obj_7_amplpy_AMPL *)__pyx_v_self));

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

static void __pyx_pf_7_amplpy_4AMPL_2__dealloc__(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__dealloc__", 1);

  /* "amplpy/ampl.pyx":149
 *         kills the underlying  interpreter).
 *         """
 *         self.close()             # <<<<<<<<<<<<<<
 * 
 *     def get_data(self, *statements):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 149, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 149, __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;

  /* "amplpy/ampl.pyx":143
 *         self.set_error_handler(ErrorHandler())
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Default destructor:
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_WriteUnraisable("_amplpy.AMPL.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "amplpy/ampl.pyx":151
 *         self.close()
 * 
 *     def get_data(self, *statements):             # <<<<<<<<<<<<<<
 *         """
 *         Get the data corresponding to the display statements. The statements
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_4AMPL_5get_data(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_4AMPL_4get_data, "AMPL.get_data(self, *statements)\n\n        Get the data corresponding to the display statements. The statements\n        can be AMPL expressions, or entities. It captures the equivalent of the\n        command:\n\n        .. code-block:: ampl\n\n            display ds1, ..., dsn;\n\n        where ds1, ..., dsn are the ``displayStatements`` with which the\n        function is called.\n\n        As only one DataFrame is returned, the operation will fail if the\n        results of the display statements cannot be indexed over the same set.\n        As a result, any attempt to get data from more than one set, or to get\n        data for multiple parameters with a different number of indexing sets\n        will fail.\n\n        Args:\n            statements: The display statements to be fetched.\n\n        Raises:\n            TypeError: if the AMPL visualization command does not succeed\n            for one of the reasons listed above.\n\n            RuntimeError: if there are issues with the data.\n\n        Returns:\n            DataFrame capturing the output of the display\n            command in tabular form.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_4AMPL_5get_data = {"get_data", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7_amplpy_4AMPL_5get_data, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7_amplpy_4AMPL_4get_data};
static PyObject *__pyx_pw_7_amplpy_4AMPL_5get_data(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_statements = 0;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_data (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_data", 0))) return NULL;
  __Pyx_INCREF(__pyx_args);
  __pyx_v_statements = __pyx_args;
  __pyx_r = __pyx_pf_7_amplpy_4AMPL_4get_data(((struct __pyx_obj_7_amplpy_AMPL *)__pyx_v_self), __pyx_v_statements);

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

static PyObject *__pyx_pf_7_amplpy_4AMPL_4get_data(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self, PyObject *__pyx_v_statements) {
  AMPL_ERRORINFO *__pyx_v_errorinfo;
  AMPL_RETCODE __pyx_v_rc;
  AMPL_DATAFRAME *__pyx_v_data;
  char **__pyx_v_statements_c;
  Py_ssize_t __pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  unsigned int __pyx_t_7;
  char const *__pyx_t_8;
  int __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_data", 1);

  /* "amplpy/ampl.pyx":186
 *         cdef campl.AMPL_RETCODE rc
 *         cdef campl.AMPL_DATAFRAME* data
 *         cdef char** statements_c = <char**> malloc(len(statements) * sizeof(char*))             # <<<<<<<<<<<<<<
 *         for i in range(len(statements)):
 *             statements_c[i] = strdup(statements[i].encode('utf-8'))
 */
  __pyx_t_1 = __Pyx_PyTuple_GET_SIZE(__pyx_v_statements); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(3, 186, __pyx_L1_error)
  __pyx_v_statements_c = ((char **)malloc((__pyx_t_1 * (sizeof(char *)))));

  /* "amplpy/ampl.pyx":187
 *         cdef campl.AMPL_DATAFRAME* data
 *         cdef char** statements_c = <char**> malloc(len(statements) * sizeof(char*))
 *         for i in range(len(statements)):             # <<<<<<<<<<<<<<
 *             statements_c[i] = strdup(statements[i].encode('utf-8'))
 *         errorinfo = campl.AMPL_GetData(self._c_ampl, statements_c, len(statements), &data)
 */
  __pyx_t_1 = __Pyx_PyTuple_GET_SIZE(__pyx_v_statements); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(3, 187, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_1;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "amplpy/ampl.pyx":188
 *         cdef char** statements_c = <char**> malloc(len(statements) * sizeof(char*))
 *         for i in range(len(statements)):
 *             statements_c[i] = strdup(statements[i].encode('utf-8'))             # <<<<<<<<<<<<<<
 *         errorinfo = campl.AMPL_GetData(self._c_ampl, statements_c, len(statements), &data)
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(PyTuple_GET_ITEM(__pyx_v_statements, __pyx_v_i), __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 188, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (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_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_kp_u_utf_8};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 188, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __pyx_t_8 = __Pyx_PyObject_AsString(__pyx_t_4); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(3, 188, __pyx_L1_error)
    (__pyx_v_statements_c[__pyx_v_i]) = strdup(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }

  /* "amplpy/ampl.pyx":189
 *         for i in range(len(statements)):
 *             statements_c[i] = strdup(statements[i].encode('utf-8'))
 *         errorinfo = campl.AMPL_GetData(self._c_ampl, statements_c, len(statements), &data)             # <<<<<<<<<<<<<<
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         for i in range(len(statements)):
 */
  __pyx_t_1 = __Pyx_PyTuple_GET_SIZE(__pyx_v_statements); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(3, 189, __pyx_L1_error)
  __pyx_v_errorinfo = AMPL_GetData(__pyx_v_self->_c_ampl, __pyx_v_statements_c, __pyx_t_1, (&__pyx_v_data));

  /* "amplpy/ampl.pyx":190
 *             statements_c[i] = strdup(statements[i].encode('utf-8'))
 *         errorinfo = campl.AMPL_GetData(self._c_ampl, statements_c, len(statements), &data)
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)             # <<<<<<<<<<<<<<
 *         for i in range(len(statements)):
 *             free(statements_c[i])
 */
  __pyx_v_rc = AMPL_ErrorInfoGetError(__pyx_v_errorinfo);

  /* "amplpy/ampl.pyx":191
 *         errorinfo = campl.AMPL_GetData(self._c_ampl, statements_c, len(statements), &data)
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         for i in range(len(statements)):             # <<<<<<<<<<<<<<
 *             free(statements_c[i])
 *         free(statements_c)
 */
  __pyx_t_1 = __Pyx_PyTuple_GET_SIZE(__pyx_v_statements); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(3, 191, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_1;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "amplpy/ampl.pyx":192
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         for i in range(len(statements)):
 *             free(statements_c[i])             # <<<<<<<<<<<<<<
 *         free(statements_c)
 *         if rc != campl.AMPL_OK:
 */
    free((__pyx_v_statements_c[__pyx_v_i]));
  }

  /* "amplpy/ampl.pyx":193
 *         for i in range(len(statements)):
 *             free(statements_c[i])
 *         free(statements_c)             # <<<<<<<<<<<<<<
 *         if rc != campl.AMPL_OK:
 *             PY_AMPL_CALL(errorinfo)
 */
  free(__pyx_v_statements_c);

  /* "amplpy/ampl.pyx":194
 *             free(statements_c[i])
 *         free(statements_c)
 *         if rc != campl.AMPL_OK:             # <<<<<<<<<<<<<<
 *             PY_AMPL_CALL(errorinfo)
 *         return DataFrame.create(data)
 */
  __pyx_t_9 = (__pyx_v_rc != AMPL_OK);
  if (__pyx_t_9) {

    /* "amplpy/ampl.pyx":195
 *         free(statements_c)
 *         if rc != campl.AMPL_OK:
 *             PY_AMPL_CALL(errorinfo)             # <<<<<<<<<<<<<<
 *         return DataFrame.create(data)
 * 
 */
    __pyx_t_4 = __pyx_f_7_amplpy_PY_AMPL_CALL(__pyx_v_errorinfo); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 195, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "amplpy/ampl.pyx":194
 *             free(statements_c[i])
 *         free(statements_c)
 *         if rc != campl.AMPL_OK:             # <<<<<<<<<<<<<<
 *             PY_AMPL_CALL(errorinfo)
 *         return DataFrame.create(data)
 */
  }

  /* "amplpy/ampl.pyx":196
 *         if rc != campl.AMPL_OK:
 *             PY_AMPL_CALL(errorinfo)
 *         return DataFrame.create(data)             # <<<<<<<<<<<<<<
 * 
 *     def get_entity(self, name):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = __pyx_f_7_amplpy_9DataFrame_create(__pyx_v_data); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 196, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "amplpy/ampl.pyx":151
 *         self.close()
 * 
 *     def get_data(self, *statements):             # <<<<<<<<<<<<<<
 *         """
 *         Get the data corresponding to the display statements. The statements
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("_amplpy.AMPL.get_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/ampl.pyx":198
 *         return DataFrame.create(data)
 * 
 *     def get_entity(self, name):             # <<<<<<<<<<<<<<
 *         """
 *         Get entity corresponding to the specified name (looks for it in all
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_4AMPL_7get_entity(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_4AMPL_6get_entity, "AMPL.get_entity(self, name)\n\n        Get entity corresponding to the specified name (looks for it in all\n        types of entities).\n\n        Args:\n            name: Name of the entity.\n\n        Raises:\n            KeyError: if the specified entity does not exist.\n\n        Returns:\n            The AMPL entity with the specified name.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_4AMPL_7get_entity = {"get_entity", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_7get_entity, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_4AMPL_6get_entity};
static PyObject *__pyx_pw_7_amplpy_4AMPL_7get_entity(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_name = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_entity (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 198, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get_entity") < 0)) __PYX_ERR(3, 198, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_name = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_entity", 1, 1, 1, __pyx_nargs); __PYX_ERR(3, 198, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.AMPL.get_entity", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_4AMPL_6get_entity(((struct __pyx_obj_7_amplpy_AMPL *)__pyx_v_self), __pyx_v_name);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_4AMPL_6get_entity(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self, PyObject *__pyx_v_name) {
  char *__pyx_v_name_c;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  char const *__pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_entity", 1);

  /* "amplpy/ampl.pyx":212
 *             The AMPL entity with the specified name.
 *         """
 *         cdef char* name_c = strdup(name.encode('utf-8'))             # <<<<<<<<<<<<<<
 *         return Entity.create(self._c_ampl, name_c, NULL, None)
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 212, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_u_utf_8};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 212, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_t_5 = __Pyx_PyObject_AsString(__pyx_t_1); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) __PYX_ERR(3, 212, __pyx_L1_error)
  __pyx_v_name_c = strdup(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "amplpy/ampl.pyx":213
 *         """
 *         cdef char* name_c = strdup(name.encode('utf-8'))
 *         return Entity.create(self._c_ampl, name_c, NULL, None)             # <<<<<<<<<<<<<<
 * 
 *     def get_variable(self, name):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7_amplpy_6Entity_create(__pyx_v_self->_c_ampl, __pyx_v_name_c, NULL, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 213, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "amplpy/ampl.pyx":198
 *         return DataFrame.create(data)
 * 
 *     def get_entity(self, name):             # <<<<<<<<<<<<<<
 *         """
 *         Get entity corresponding to the specified name (looks for it in all
 */

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

/* "amplpy/ampl.pyx":215
 *         return Entity.create(self._c_ampl, name_c, NULL, None)
 * 
 *     def get_variable(self, name):             # <<<<<<<<<<<<<<
 *         """
 *         Get the variable with the corresponding name.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_4AMPL_9get_variable(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_4AMPL_8get_variable, "AMPL.get_variable(self, name)\n\n        Get the variable with the corresponding name.\n\n        Args:\n            name: Name of the variable to be found.\n\n        Raises:\n            KeyError: if the specified variable does not exist.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_4AMPL_9get_variable = {"get_variable", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_9get_variable, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_4AMPL_8get_variable};
static PyObject *__pyx_pw_7_amplpy_4AMPL_9get_variable(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_name = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_variable (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 215, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get_variable") < 0)) __PYX_ERR(3, 215, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_name = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_variable", 1, 1, 1, __pyx_nargs); __PYX_ERR(3, 215, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.AMPL.get_variable", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_4AMPL_8get_variable(((struct __pyx_obj_7_amplpy_AMPL *)__pyx_v_self), __pyx_v_name);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_4AMPL_8get_variable(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self, PyObject *__pyx_v_name) {
  AMPL_ERRORINFO *__pyx_v_errorinfo;
  AMPL_RETCODE __pyx_v_rc;
  AMPL_ENTITYTYPE __pyx_v_entitytype;
  char *__pyx_v_name_c;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  char const *__pyx_t_5;
  int __pyx_t_6;
  char *__pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable", 1);

  /* "amplpy/ampl.pyx":228
 *         cdef campl.AMPL_RETCODE rc
 *         cdef campl.AMPL_ENTITYTYPE entitytype
 *         cdef char* name_c = strdup(name.encode('utf-8'))             # <<<<<<<<<<<<<<
 *         errorinfo = campl.AMPL_EntityGetType(self._c_ampl, name_c, &entitytype)
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 228, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_u_utf_8};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 228, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_t_5 = __Pyx_PyObject_AsString(__pyx_t_1); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) __PYX_ERR(3, 228, __pyx_L1_error)
  __pyx_v_name_c = strdup(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "amplpy/ampl.pyx":229
 *         cdef campl.AMPL_ENTITYTYPE entitytype
 *         cdef char* name_c = strdup(name.encode('utf-8'))
 *         errorinfo = campl.AMPL_EntityGetType(self._c_ampl, name_c, &entitytype)             # <<<<<<<<<<<<<<
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:
 */
  __pyx_v_errorinfo = AMPL_EntityGetType(__pyx_v_self->_c_ampl, __pyx_v_name_c, (&__pyx_v_entitytype));

  /* "amplpy/ampl.pyx":230
 *         cdef char* name_c = strdup(name.encode('utf-8'))
 *         errorinfo = campl.AMPL_EntityGetType(self._c_ampl, name_c, &entitytype)
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)             # <<<<<<<<<<<<<<
 *         if rc != campl.AMPL_OK:
 *             free(name_c)
 */
  __pyx_v_rc = AMPL_ErrorInfoGetError(__pyx_v_errorinfo);

  /* "amplpy/ampl.pyx":231
 *         errorinfo = campl.AMPL_EntityGetType(self._c_ampl, name_c, &entitytype)
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:             # <<<<<<<<<<<<<<
 *             free(name_c)
 *             PY_AMPL_CALL(errorinfo)
 */
  __pyx_t_6 = (__pyx_v_rc != AMPL_OK);
  if (__pyx_t_6) {

    /* "amplpy/ampl.pyx":232
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:
 *             free(name_c)             # <<<<<<<<<<<<<<
 *             PY_AMPL_CALL(errorinfo)
 *         if entitytype != campl.AMPL_VARIABLE:
 */
    free(__pyx_v_name_c);

    /* "amplpy/ampl.pyx":233
 *         if rc != campl.AMPL_OK:
 *             free(name_c)
 *             PY_AMPL_CALL(errorinfo)             # <<<<<<<<<<<<<<
 *         if entitytype != campl.AMPL_VARIABLE:
 *             free(name_c)
 */
    __pyx_t_1 = __pyx_f_7_amplpy_PY_AMPL_CALL(__pyx_v_errorinfo); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 233, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "amplpy/ampl.pyx":231
 *         errorinfo = campl.AMPL_EntityGetType(self._c_ampl, name_c, &entitytype)
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:             # <<<<<<<<<<<<<<
 *             free(name_c)
 *             PY_AMPL_CALL(errorinfo)
 */
  }

  /* "amplpy/ampl.pyx":234
 *             free(name_c)
 *             PY_AMPL_CALL(errorinfo)
 *         if entitytype != campl.AMPL_VARIABLE:             # <<<<<<<<<<<<<<
 *             free(name_c)
 *             raiseKeyError(campl.AMPL_VARIABLE, name)
 */
  __pyx_t_6 = (__pyx_v_entitytype != AMPL_VARIABLE);
  if (__pyx_t_6) {

    /* "amplpy/ampl.pyx":235
 *             PY_AMPL_CALL(errorinfo)
 *         if entitytype != campl.AMPL_VARIABLE:
 *             free(name_c)             # <<<<<<<<<<<<<<
 *             raiseKeyError(campl.AMPL_VARIABLE, name)
 *         return Variable.create(self._c_ampl, name_c, NULL, None)
 */
    free(__pyx_v_name_c);

    /* "amplpy/ampl.pyx":236
 *         if entitytype != campl.AMPL_VARIABLE:
 *             free(name_c)
 *             raiseKeyError(campl.AMPL_VARIABLE, name)             # <<<<<<<<<<<<<<
 *         return Variable.create(self._c_ampl, name_c, NULL, None)
 * 
 */
    __pyx_t_7 = __Pyx_PyObject_AsWritableString(__pyx_v_name); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(3, 236, __pyx_L1_error)
    __pyx_t_1 = __pyx_f_7_amplpy_raiseKeyError(AMPL_VARIABLE, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 236, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "amplpy/ampl.pyx":234
 *             free(name_c)
 *             PY_AMPL_CALL(errorinfo)
 *         if entitytype != campl.AMPL_VARIABLE:             # <<<<<<<<<<<<<<
 *             free(name_c)
 *             raiseKeyError(campl.AMPL_VARIABLE, name)
 */
  }

  /* "amplpy/ampl.pyx":237
 *             free(name_c)
 *             raiseKeyError(campl.AMPL_VARIABLE, name)
 *         return Variable.create(self._c_ampl, name_c, NULL, None)             # <<<<<<<<<<<<<<
 * 
 *     def get_constraint(self, name):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7_amplpy_8Variable_create(__pyx_v_self->_c_ampl, __pyx_v_name_c, NULL, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 237, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "amplpy/ampl.pyx":215
 *         return Entity.create(self._c_ampl, name_c, NULL, None)
 * 
 *     def get_variable(self, name):             # <<<<<<<<<<<<<<
 *         """
 *         Get the variable with the corresponding name.
 */

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

/* "amplpy/ampl.pyx":239
 *         return Variable.create(self._c_ampl, name_c, NULL, None)
 * 
 *     def get_constraint(self, name):             # <<<<<<<<<<<<<<
 *         """
 *         Get the constraint with the corresponding name.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_4AMPL_11get_constraint(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_4AMPL_10get_constraint, "AMPL.get_constraint(self, name)\n\n        Get the constraint with the corresponding name.\n\n        Args:\n            name: Name of the constraint to be found.\n\n        Raises:\n            KeyError: if the specified constraint does not exist.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_4AMPL_11get_constraint = {"get_constraint", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_11get_constraint, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_4AMPL_10get_constraint};
static PyObject *__pyx_pw_7_amplpy_4AMPL_11get_constraint(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_name = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_constraint (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 239, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get_constraint") < 0)) __PYX_ERR(3, 239, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_name = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_constraint", 1, 1, 1, __pyx_nargs); __PYX_ERR(3, 239, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.AMPL.get_constraint", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_4AMPL_10get_constraint(((struct __pyx_obj_7_amplpy_AMPL *)__pyx_v_self), __pyx_v_name);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_4AMPL_10get_constraint(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self, PyObject *__pyx_v_name) {
  AMPL_ERRORINFO *__pyx_v_errorinfo;
  AMPL_RETCODE __pyx_v_rc;
  AMPL_ENTITYTYPE __pyx_v_entitytype;
  char *__pyx_v_name_c;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  char const *__pyx_t_5;
  int __pyx_t_6;
  char *__pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_constraint", 1);

  /* "amplpy/ampl.pyx":252
 *         cdef campl.AMPL_RETCODE rc
 *         cdef campl.AMPL_ENTITYTYPE entitytype
 *         cdef char* name_c = strdup(name.encode('utf-8'))             # <<<<<<<<<<<<<<
 *         errorinfo = campl.AMPL_EntityGetType(self._c_ampl, name_c, &entitytype)
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 252, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_u_utf_8};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 252, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_t_5 = __Pyx_PyObject_AsString(__pyx_t_1); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) __PYX_ERR(3, 252, __pyx_L1_error)
  __pyx_v_name_c = strdup(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "amplpy/ampl.pyx":253
 *         cdef campl.AMPL_ENTITYTYPE entitytype
 *         cdef char* name_c = strdup(name.encode('utf-8'))
 *         errorinfo = campl.AMPL_EntityGetType(self._c_ampl, name_c, &entitytype)             # <<<<<<<<<<<<<<
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:
 */
  __pyx_v_errorinfo = AMPL_EntityGetType(__pyx_v_self->_c_ampl, __pyx_v_name_c, (&__pyx_v_entitytype));

  /* "amplpy/ampl.pyx":254
 *         cdef char* name_c = strdup(name.encode('utf-8'))
 *         errorinfo = campl.AMPL_EntityGetType(self._c_ampl, name_c, &entitytype)
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)             # <<<<<<<<<<<<<<
 *         if rc != campl.AMPL_OK:
 *             free(name_c)
 */
  __pyx_v_rc = AMPL_ErrorInfoGetError(__pyx_v_errorinfo);

  /* "amplpy/ampl.pyx":255
 *         errorinfo = campl.AMPL_EntityGetType(self._c_ampl, name_c, &entitytype)
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:             # <<<<<<<<<<<<<<
 *             free(name_c)
 *             PY_AMPL_CALL(errorinfo)
 */
  __pyx_t_6 = (__pyx_v_rc != AMPL_OK);
  if (__pyx_t_6) {

    /* "amplpy/ampl.pyx":256
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:
 *             free(name_c)             # <<<<<<<<<<<<<<
 *             PY_AMPL_CALL(errorinfo)
 *         if entitytype != campl.AMPL_CONSTRAINT:
 */
    free(__pyx_v_name_c);

    /* "amplpy/ampl.pyx":257
 *         if rc != campl.AMPL_OK:
 *             free(name_c)
 *             PY_AMPL_CALL(errorinfo)             # <<<<<<<<<<<<<<
 *         if entitytype != campl.AMPL_CONSTRAINT:
 *             free(name_c)
 */
    __pyx_t_1 = __pyx_f_7_amplpy_PY_AMPL_CALL(__pyx_v_errorinfo); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 257, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "amplpy/ampl.pyx":255
 *         errorinfo = campl.AMPL_EntityGetType(self._c_ampl, name_c, &entitytype)
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:             # <<<<<<<<<<<<<<
 *             free(name_c)
 *             PY_AMPL_CALL(errorinfo)
 */
  }

  /* "amplpy/ampl.pyx":258
 *             free(name_c)
 *             PY_AMPL_CALL(errorinfo)
 *         if entitytype != campl.AMPL_CONSTRAINT:             # <<<<<<<<<<<<<<
 *             free(name_c)
 *             raiseKeyError(campl.AMPL_CONSTRAINT, name)
 */
  __pyx_t_6 = (__pyx_v_entitytype != AMPL_CONSTRAINT);
  if (__pyx_t_6) {

    /* "amplpy/ampl.pyx":259
 *             PY_AMPL_CALL(errorinfo)
 *         if entitytype != campl.AMPL_CONSTRAINT:
 *             free(name_c)             # <<<<<<<<<<<<<<
 *             raiseKeyError(campl.AMPL_CONSTRAINT, name)
 *         return Constraint.create(self._c_ampl, name_c, NULL, None)
 */
    free(__pyx_v_name_c);

    /* "amplpy/ampl.pyx":260
 *         if entitytype != campl.AMPL_CONSTRAINT:
 *             free(name_c)
 *             raiseKeyError(campl.AMPL_CONSTRAINT, name)             # <<<<<<<<<<<<<<
 *         return Constraint.create(self._c_ampl, name_c, NULL, None)
 * 
 */
    __pyx_t_7 = __Pyx_PyObject_AsWritableString(__pyx_v_name); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(3, 260, __pyx_L1_error)
    __pyx_t_1 = __pyx_f_7_amplpy_raiseKeyError(AMPL_CONSTRAINT, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 260, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "amplpy/ampl.pyx":258
 *             free(name_c)
 *             PY_AMPL_CALL(errorinfo)
 *         if entitytype != campl.AMPL_CONSTRAINT:             # <<<<<<<<<<<<<<
 *             free(name_c)
 *             raiseKeyError(campl.AMPL_CONSTRAINT, name)
 */
  }

  /* "amplpy/ampl.pyx":261
 *             free(name_c)
 *             raiseKeyError(campl.AMPL_CONSTRAINT, name)
 *         return Constraint.create(self._c_ampl, name_c, NULL, None)             # <<<<<<<<<<<<<<
 * 
 *     def get_objective(self, name):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7_amplpy_10Constraint_create(__pyx_v_self->_c_ampl, __pyx_v_name_c, NULL, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 261, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "amplpy/ampl.pyx":239
 *         return Variable.create(self._c_ampl, name_c, NULL, None)
 * 
 *     def get_constraint(self, name):             # <<<<<<<<<<<<<<
 *         """
 *         Get the constraint with the corresponding name.
 */

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

/* "amplpy/ampl.pyx":263
 *         return Constraint.create(self._c_ampl, name_c, NULL, None)
 * 
 *     def get_objective(self, name):             # <<<<<<<<<<<<<<
 *         """
 *         Get the objective with the corresponding name.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_4AMPL_13get_objective(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_4AMPL_12get_objective, "AMPL.get_objective(self, name)\n\n        Get the objective with the corresponding name.\n\n        Args:\n            name: Name of the objective to be found.\n\n        Raises:\n            KeyError: if the specified objective does not exist.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_4AMPL_13get_objective = {"get_objective", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_13get_objective, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_4AMPL_12get_objective};
static PyObject *__pyx_pw_7_amplpy_4AMPL_13get_objective(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_name = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_objective (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 263, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get_objective") < 0)) __PYX_ERR(3, 263, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_name = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_objective", 1, 1, 1, __pyx_nargs); __PYX_ERR(3, 263, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.AMPL.get_objective", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_4AMPL_12get_objective(((struct __pyx_obj_7_amplpy_AMPL *)__pyx_v_self), __pyx_v_name);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_4AMPL_12get_objective(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self, PyObject *__pyx_v_name) {
  AMPL_ERRORINFO *__pyx_v_errorinfo;
  AMPL_RETCODE __pyx_v_rc;
  AMPL_ENTITYTYPE __pyx_v_entitytype;
  char *__pyx_v_name_c;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  char const *__pyx_t_5;
  int __pyx_t_6;
  char *__pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_objective", 1);

  /* "amplpy/ampl.pyx":276
 *         cdef campl.AMPL_RETCODE rc
 *         cdef campl.AMPL_ENTITYTYPE entitytype
 *         cdef char* name_c = strdup(name.encode('utf-8'))             # <<<<<<<<<<<<<<
 *         errorinfo = campl.AMPL_EntityGetType(self._c_ampl, name_c, &entitytype)
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 276, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_u_utf_8};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 276, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_t_5 = __Pyx_PyObject_AsString(__pyx_t_1); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) __PYX_ERR(3, 276, __pyx_L1_error)
  __pyx_v_name_c = strdup(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "amplpy/ampl.pyx":277
 *         cdef campl.AMPL_ENTITYTYPE entitytype
 *         cdef char* name_c = strdup(name.encode('utf-8'))
 *         errorinfo = campl.AMPL_EntityGetType(self._c_ampl, name_c, &entitytype)             # <<<<<<<<<<<<<<
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:
 */
  __pyx_v_errorinfo = AMPL_EntityGetType(__pyx_v_self->_c_ampl, __pyx_v_name_c, (&__pyx_v_entitytype));

  /* "amplpy/ampl.pyx":278
 *         cdef char* name_c = strdup(name.encode('utf-8'))
 *         errorinfo = campl.AMPL_EntityGetType(self._c_ampl, name_c, &entitytype)
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)             # <<<<<<<<<<<<<<
 *         if rc != campl.AMPL_OK:
 *             free(name_c)
 */
  __pyx_v_rc = AMPL_ErrorInfoGetError(__pyx_v_errorinfo);

  /* "amplpy/ampl.pyx":279
 *         errorinfo = campl.AMPL_EntityGetType(self._c_ampl, name_c, &entitytype)
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:             # <<<<<<<<<<<<<<
 *             free(name_c)
 *             PY_AMPL_CALL(errorinfo)
 */
  __pyx_t_6 = (__pyx_v_rc != AMPL_OK);
  if (__pyx_t_6) {

    /* "amplpy/ampl.pyx":280
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:
 *             free(name_c)             # <<<<<<<<<<<<<<
 *             PY_AMPL_CALL(errorinfo)
 *         if entitytype != campl.AMPL_OBJECTIVE:
 */
    free(__pyx_v_name_c);

    /* "amplpy/ampl.pyx":281
 *         if rc != campl.AMPL_OK:
 *             free(name_c)
 *             PY_AMPL_CALL(errorinfo)             # <<<<<<<<<<<<<<
 *         if entitytype != campl.AMPL_OBJECTIVE:
 *             free(name_c)
 */
    __pyx_t_1 = __pyx_f_7_amplpy_PY_AMPL_CALL(__pyx_v_errorinfo); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 281, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "amplpy/ampl.pyx":279
 *         errorinfo = campl.AMPL_EntityGetType(self._c_ampl, name_c, &entitytype)
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:             # <<<<<<<<<<<<<<
 *             free(name_c)
 *             PY_AMPL_CALL(errorinfo)
 */
  }

  /* "amplpy/ampl.pyx":282
 *             free(name_c)
 *             PY_AMPL_CALL(errorinfo)
 *         if entitytype != campl.AMPL_OBJECTIVE:             # <<<<<<<<<<<<<<
 *             free(name_c)
 *             raiseKeyError(campl.AMPL_OBJECTIVE, name)
 */
  __pyx_t_6 = (__pyx_v_entitytype != AMPL_OBJECTIVE);
  if (__pyx_t_6) {

    /* "amplpy/ampl.pyx":283
 *             PY_AMPL_CALL(errorinfo)
 *         if entitytype != campl.AMPL_OBJECTIVE:
 *             free(name_c)             # <<<<<<<<<<<<<<
 *             raiseKeyError(campl.AMPL_OBJECTIVE, name)
 *         return Objective.create(self._c_ampl, name_c, NULL, None)
 */
    free(__pyx_v_name_c);

    /* "amplpy/ampl.pyx":284
 *         if entitytype != campl.AMPL_OBJECTIVE:
 *             free(name_c)
 *             raiseKeyError(campl.AMPL_OBJECTIVE, name)             # <<<<<<<<<<<<<<
 *         return Objective.create(self._c_ampl, name_c, NULL, None)
 * 
 */
    __pyx_t_7 = __Pyx_PyObject_AsWritableString(__pyx_v_name); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(3, 284, __pyx_L1_error)
    __pyx_t_1 = __pyx_f_7_amplpy_raiseKeyError(AMPL_OBJECTIVE, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 284, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "amplpy/ampl.pyx":282
 *             free(name_c)
 *             PY_AMPL_CALL(errorinfo)
 *         if entitytype != campl.AMPL_OBJECTIVE:             # <<<<<<<<<<<<<<
 *             free(name_c)
 *             raiseKeyError(campl.AMPL_OBJECTIVE, name)
 */
  }

  /* "amplpy/ampl.pyx":285
 *             free(name_c)
 *             raiseKeyError(campl.AMPL_OBJECTIVE, name)
 *         return Objective.create(self._c_ampl, name_c, NULL, None)             # <<<<<<<<<<<<<<
 * 
 *     def get_set(self, name):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7_amplpy_9Objective_create(__pyx_v_self->_c_ampl, __pyx_v_name_c, NULL, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 285, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "amplpy/ampl.pyx":263
 *         return Constraint.create(self._c_ampl, name_c, NULL, None)
 * 
 *     def get_objective(self, name):             # <<<<<<<<<<<<<<
 *         """
 *         Get the objective with the corresponding name.
 */

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

/* "amplpy/ampl.pyx":287
 *         return Objective.create(self._c_ampl, name_c, NULL, None)
 * 
 *     def get_set(self, name):             # <<<<<<<<<<<<<<
 *         """
 *         Get the set with the corresponding name.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_4AMPL_15get_set(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_4AMPL_14get_set, "AMPL.get_set(self, name)\n\n        Get the set with the corresponding name.\n\n        Args:\n            name: Name of the set to be found.\n\n        Raises:\n            KeyError: if the specified set does not exist.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_4AMPL_15get_set = {"get_set", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_15get_set, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_4AMPL_14get_set};
static PyObject *__pyx_pw_7_amplpy_4AMPL_15get_set(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_name = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_set (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 287, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get_set") < 0)) __PYX_ERR(3, 287, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_name = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_set", 1, 1, 1, __pyx_nargs); __PYX_ERR(3, 287, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.AMPL.get_set", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_4AMPL_14get_set(((struct __pyx_obj_7_amplpy_AMPL *)__pyx_v_self), __pyx_v_name);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_4AMPL_14get_set(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self, PyObject *__pyx_v_name) {
  AMPL_ERRORINFO *__pyx_v_errorinfo;
  AMPL_RETCODE __pyx_v_rc;
  AMPL_ENTITYTYPE __pyx_v_entitytype;
  char *__pyx_v_name_c;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  char const *__pyx_t_5;
  int __pyx_t_6;
  char *__pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_set", 1);

  /* "amplpy/ampl.pyx":300
 *         cdef campl.AMPL_RETCODE rc
 *         cdef campl.AMPL_ENTITYTYPE entitytype
 *         cdef char* name_c = strdup(name.encode('utf-8'))             # <<<<<<<<<<<<<<
 *         errorinfo = campl.AMPL_EntityGetType(self._c_ampl, name_c, &entitytype)
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 300, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_u_utf_8};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 300, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_t_5 = __Pyx_PyObject_AsString(__pyx_t_1); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) __PYX_ERR(3, 300, __pyx_L1_error)
  __pyx_v_name_c = strdup(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "amplpy/ampl.pyx":301
 *         cdef campl.AMPL_ENTITYTYPE entitytype
 *         cdef char* name_c = strdup(name.encode('utf-8'))
 *         errorinfo = campl.AMPL_EntityGetType(self._c_ampl, name_c, &entitytype)             # <<<<<<<<<<<<<<
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:
 */
  __pyx_v_errorinfo = AMPL_EntityGetType(__pyx_v_self->_c_ampl, __pyx_v_name_c, (&__pyx_v_entitytype));

  /* "amplpy/ampl.pyx":302
 *         cdef char* name_c = strdup(name.encode('utf-8'))
 *         errorinfo = campl.AMPL_EntityGetType(self._c_ampl, name_c, &entitytype)
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)             # <<<<<<<<<<<<<<
 *         if rc != campl.AMPL_OK:
 *             free(name_c)
 */
  __pyx_v_rc = AMPL_ErrorInfoGetError(__pyx_v_errorinfo);

  /* "amplpy/ampl.pyx":303
 *         errorinfo = campl.AMPL_EntityGetType(self._c_ampl, name_c, &entitytype)
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:             # <<<<<<<<<<<<<<
 *             free(name_c)
 *             PY_AMPL_CALL(errorinfo)
 */
  __pyx_t_6 = (__pyx_v_rc != AMPL_OK);
  if (__pyx_t_6) {

    /* "amplpy/ampl.pyx":304
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:
 *             free(name_c)             # <<<<<<<<<<<<<<
 *             PY_AMPL_CALL(errorinfo)
 *         if entitytype != campl.AMPL_SET:
 */
    free(__pyx_v_name_c);

    /* "amplpy/ampl.pyx":305
 *         if rc != campl.AMPL_OK:
 *             free(name_c)
 *             PY_AMPL_CALL(errorinfo)             # <<<<<<<<<<<<<<
 *         if entitytype != campl.AMPL_SET:
 *             free(name_c)
 */
    __pyx_t_1 = __pyx_f_7_amplpy_PY_AMPL_CALL(__pyx_v_errorinfo); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 305, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "amplpy/ampl.pyx":303
 *         errorinfo = campl.AMPL_EntityGetType(self._c_ampl, name_c, &entitytype)
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:             # <<<<<<<<<<<<<<
 *             free(name_c)
 *             PY_AMPL_CALL(errorinfo)
 */
  }

  /* "amplpy/ampl.pyx":306
 *             free(name_c)
 *             PY_AMPL_CALL(errorinfo)
 *         if entitytype != campl.AMPL_SET:             # <<<<<<<<<<<<<<
 *             free(name_c)
 *             raiseKeyError(campl.AMPL_SET, name)
 */
  __pyx_t_6 = (__pyx_v_entitytype != AMPL_SET);
  if (__pyx_t_6) {

    /* "amplpy/ampl.pyx":307
 *             PY_AMPL_CALL(errorinfo)
 *         if entitytype != campl.AMPL_SET:
 *             free(name_c)             # <<<<<<<<<<<<<<
 *             raiseKeyError(campl.AMPL_SET, name)
 *         return Set.create(self._c_ampl, name_c, NULL, None)
 */
    free(__pyx_v_name_c);

    /* "amplpy/ampl.pyx":308
 *         if entitytype != campl.AMPL_SET:
 *             free(name_c)
 *             raiseKeyError(campl.AMPL_SET, name)             # <<<<<<<<<<<<<<
 *         return Set.create(self._c_ampl, name_c, NULL, None)
 * 
 */
    __pyx_t_7 = __Pyx_PyObject_AsWritableString(__pyx_v_name); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(3, 308, __pyx_L1_error)
    __pyx_t_1 = __pyx_f_7_amplpy_raiseKeyError(AMPL_SET, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 308, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "amplpy/ampl.pyx":306
 *             free(name_c)
 *             PY_AMPL_CALL(errorinfo)
 *         if entitytype != campl.AMPL_SET:             # <<<<<<<<<<<<<<
 *             free(name_c)
 *             raiseKeyError(campl.AMPL_SET, name)
 */
  }

  /* "amplpy/ampl.pyx":309
 *             free(name_c)
 *             raiseKeyError(campl.AMPL_SET, name)
 *         return Set.create(self._c_ampl, name_c, NULL, None)             # <<<<<<<<<<<<<<
 * 
 *     def get_parameter(self, name):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7_amplpy_3Set_create(__pyx_v_self->_c_ampl, __pyx_v_name_c, NULL, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 309, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "amplpy/ampl.pyx":287
 *         return Objective.create(self._c_ampl, name_c, NULL, None)
 * 
 *     def get_set(self, name):             # <<<<<<<<<<<<<<
 *         """
 *         Get the set with the corresponding name.
 */

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

/* "amplpy/ampl.pyx":311
 *         return Set.create(self._c_ampl, name_c, NULL, None)
 * 
 *     def get_parameter(self, name):             # <<<<<<<<<<<<<<
 *         """
 *         Get the parameter with the corresponding name.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_4AMPL_17get_parameter(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_4AMPL_16get_parameter, "AMPL.get_parameter(self, name)\n\n        Get the parameter with the corresponding name.\n\n        Args:\n            name: Name of the parameter to be found.\n\n        Raises:\n            KeyError: if the specified parameter does not exist.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_4AMPL_17get_parameter = {"get_parameter", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_17get_parameter, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_4AMPL_16get_parameter};
static PyObject *__pyx_pw_7_amplpy_4AMPL_17get_parameter(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_name = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_parameter (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 311, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get_parameter") < 0)) __PYX_ERR(3, 311, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_name = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_parameter", 1, 1, 1, __pyx_nargs); __PYX_ERR(3, 311, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.AMPL.get_parameter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_4AMPL_16get_parameter(((struct __pyx_obj_7_amplpy_AMPL *)__pyx_v_self), __pyx_v_name);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_4AMPL_16get_parameter(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self, PyObject *__pyx_v_name) {
  AMPL_ERRORINFO *__pyx_v_errorinfo;
  AMPL_RETCODE __pyx_v_rc;
  AMPL_ENTITYTYPE __pyx_v_entitytype;
  char *__pyx_v_name_c;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  char const *__pyx_t_5;
  int __pyx_t_6;
  char *__pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_parameter", 1);

  /* "amplpy/ampl.pyx":324
 *         cdef campl.AMPL_RETCODE rc
 *         cdef campl.AMPL_ENTITYTYPE entitytype
 *         cdef char* name_c = strdup(name.encode('utf-8'))             # <<<<<<<<<<<<<<
 *         errorinfo = campl.AMPL_EntityGetType(self._c_ampl, name_c, &entitytype)
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 324, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_u_utf_8};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 324, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_t_5 = __Pyx_PyObject_AsString(__pyx_t_1); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) __PYX_ERR(3, 324, __pyx_L1_error)
  __pyx_v_name_c = strdup(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "amplpy/ampl.pyx":325
 *         cdef campl.AMPL_ENTITYTYPE entitytype
 *         cdef char* name_c = strdup(name.encode('utf-8'))
 *         errorinfo = campl.AMPL_EntityGetType(self._c_ampl, name_c, &entitytype)             # <<<<<<<<<<<<<<
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:
 */
  __pyx_v_errorinfo = AMPL_EntityGetType(__pyx_v_self->_c_ampl, __pyx_v_name_c, (&__pyx_v_entitytype));

  /* "amplpy/ampl.pyx":326
 *         cdef char* name_c = strdup(name.encode('utf-8'))
 *         errorinfo = campl.AMPL_EntityGetType(self._c_ampl, name_c, &entitytype)
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)             # <<<<<<<<<<<<<<
 *         if rc != campl.AMPL_OK:
 *             free(name_c)
 */
  __pyx_v_rc = AMPL_ErrorInfoGetError(__pyx_v_errorinfo);

  /* "amplpy/ampl.pyx":327
 *         errorinfo = campl.AMPL_EntityGetType(self._c_ampl, name_c, &entitytype)
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:             # <<<<<<<<<<<<<<
 *             free(name_c)
 *             PY_AMPL_CALL(errorinfo)
 */
  __pyx_t_6 = (__pyx_v_rc != AMPL_OK);
  if (__pyx_t_6) {

    /* "amplpy/ampl.pyx":328
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:
 *             free(name_c)             # <<<<<<<<<<<<<<
 *             PY_AMPL_CALL(errorinfo)
 *         if entitytype != campl.AMPL_PARAMETER:
 */
    free(__pyx_v_name_c);

    /* "amplpy/ampl.pyx":329
 *         if rc != campl.AMPL_OK:
 *             free(name_c)
 *             PY_AMPL_CALL(errorinfo)             # <<<<<<<<<<<<<<
 *         if entitytype != campl.AMPL_PARAMETER:
 *             free(name_c)
 */
    __pyx_t_1 = __pyx_f_7_amplpy_PY_AMPL_CALL(__pyx_v_errorinfo); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 329, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "amplpy/ampl.pyx":327
 *         errorinfo = campl.AMPL_EntityGetType(self._c_ampl, name_c, &entitytype)
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:             # <<<<<<<<<<<<<<
 *             free(name_c)
 *             PY_AMPL_CALL(errorinfo)
 */
  }

  /* "amplpy/ampl.pyx":330
 *             free(name_c)
 *             PY_AMPL_CALL(errorinfo)
 *         if entitytype != campl.AMPL_PARAMETER:             # <<<<<<<<<<<<<<
 *             free(name_c)
 *             raiseKeyError(campl.AMPL_PARAMETER, name)
 */
  __pyx_t_6 = (__pyx_v_entitytype != AMPL_PARAMETER);
  if (__pyx_t_6) {

    /* "amplpy/ampl.pyx":331
 *             PY_AMPL_CALL(errorinfo)
 *         if entitytype != campl.AMPL_PARAMETER:
 *             free(name_c)             # <<<<<<<<<<<<<<
 *             raiseKeyError(campl.AMPL_PARAMETER, name)
 *         return Parameter.create(self._c_ampl, name_c, NULL, None)
 */
    free(__pyx_v_name_c);

    /* "amplpy/ampl.pyx":332
 *         if entitytype != campl.AMPL_PARAMETER:
 *             free(name_c)
 *             raiseKeyError(campl.AMPL_PARAMETER, name)             # <<<<<<<<<<<<<<
 *         return Parameter.create(self._c_ampl, name_c, NULL, None)
 * 
 */
    __pyx_t_7 = __Pyx_PyObject_AsWritableString(__pyx_v_name); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(3, 332, __pyx_L1_error)
    __pyx_t_1 = __pyx_f_7_amplpy_raiseKeyError(AMPL_PARAMETER, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 332, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "amplpy/ampl.pyx":330
 *             free(name_c)
 *             PY_AMPL_CALL(errorinfo)
 *         if entitytype != campl.AMPL_PARAMETER:             # <<<<<<<<<<<<<<
 *             free(name_c)
 *             raiseKeyError(campl.AMPL_PARAMETER, name)
 */
  }

  /* "amplpy/ampl.pyx":333
 *             free(name_c)
 *             raiseKeyError(campl.AMPL_PARAMETER, name)
 *         return Parameter.create(self._c_ampl, name_c, NULL, None)             # <<<<<<<<<<<<<<
 * 
 *     def eval(self, statements):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7_amplpy_9Parameter_create(__pyx_v_self->_c_ampl, __pyx_v_name_c, NULL, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 333, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "amplpy/ampl.pyx":311
 *         return Set.create(self._c_ampl, name_c, NULL, None)
 * 
 *     def get_parameter(self, name):             # <<<<<<<<<<<<<<
 *         """
 *         Get the parameter with the corresponding name.
 */

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

/* "amplpy/ampl.pyx":335
 *         return Parameter.create(self._c_ampl, name_c, NULL, None)
 * 
 *     def eval(self, statements):             # <<<<<<<<<<<<<<
 *         """
 *         Parses AMPL code and evaluates it as a possibly empty sequence of AMPL
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_4AMPL_19eval(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_4AMPL_18eval, "AMPL.eval(self, statements)\n\n        Parses AMPL code and evaluates it as a possibly empty sequence of AMPL\n        declarations and statements.\n\n        As a side effect, it invalidates all entities (as the passed statements\n        can contain any arbitrary command); the lists of entities will be\n        re-populated lazily (at first access)\n\n        The output of interpreting the statements is passed to the current\n        OutputHandler (see getOutputHandler and\n        setOutputHandler).\n\n        By default, errors and warnings are printed on stdout.\n        This behavior can be changed reassigning an ErrorHandler\n        using setErrorHandler.\n\n        Args:\n          statements: A collection of AMPL statements and declarations to\n          be passed to the interpreter.\n\n        Raises:\n          RuntimeError: if the input is not a complete AMPL statement (e.g.\n          if it does not end with semicolon) or if the underlying\n          interpreter is not running.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_4AMPL_19eval = {"eval", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_19eval, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_4AMPL_18eval};
static PyObject *__pyx_pw_7_amplpy_4AMPL_19eval(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_statements = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("eval (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_statements,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_statements)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 335, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "eval") < 0)) __PYX_ERR(3, 335, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_statements = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("eval", 1, 1, 1, __pyx_nargs); __PYX_ERR(3, 335, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.AMPL.eval", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_4AMPL_18eval(((struct __pyx_obj_7_amplpy_AMPL *)__pyx_v_self), __pyx_v_statements);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_4AMPL_18eval(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self, PyObject *__pyx_v_statements) {
  PyObject *__pyx_v_e = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  char const *__pyx_t_10;
  AMPL_ERRORINFO *__pyx_t_11;
  int __pyx_t_12;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("eval", 0);
  __Pyx_INCREF(__pyx_v_statements);

  /* "amplpy/ampl.pyx":362
 *         """
 *         # Workaround for #56
 *         if not statements.endswith((" ", ";", "\n")):             # <<<<<<<<<<<<<<
 *             statements += "\n"
 *         try:
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_statements, __pyx_n_s_endswith); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 362, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_tuple__42};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 362, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(3, 362, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = (!__pyx_t_5);
  if (__pyx_t_6) {

    /* "amplpy/ampl.pyx":363
 *         # Workaround for #56
 *         if not statements.endswith((" ", ";", "\n")):
 *             statements += "\n"             # <<<<<<<<<<<<<<
 *         try:
 *             PY_AMPL_CALL(campl.AMPL_Eval(self._c_ampl, statements.encode('utf-8')))
 */
    __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_statements, __pyx_kp_u__25); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 363, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF_SET(__pyx_v_statements, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "amplpy/ampl.pyx":362
 *         """
 *         # Workaround for #56
 *         if not statements.endswith((" ", ";", "\n")):             # <<<<<<<<<<<<<<
 *             statements += "\n"
 *         try:
 */
  }

  /* "amplpy/ampl.pyx":364
 *         if not statements.endswith((" ", ";", "\n")):
 *             statements += "\n"
 *         try:             # <<<<<<<<<<<<<<
 *             PY_AMPL_CALL(campl.AMPL_Eval(self._c_ampl, statements.encode('utf-8')))
 *         except SystemError as e:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
    __Pyx_XGOTREF(__pyx_t_7);
    __Pyx_XGOTREF(__pyx_t_8);
    __Pyx_XGOTREF(__pyx_t_9);
    /*try:*/ {

      /* "amplpy/ampl.pyx":365
 *             statements += "\n"
 *         try:
 *             PY_AMPL_CALL(campl.AMPL_Eval(self._c_ampl, statements.encode('utf-8')))             # <<<<<<<<<<<<<<
 *         except SystemError as e:
 *             raise RuntimeError(str(e))
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_statements, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 365, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = NULL;
      __pyx_t_4 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
          __pyx_t_4 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_u_utf_8};
        __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 365, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      }
      __pyx_t_10 = __Pyx_PyObject_AsString(__pyx_t_1); if (unlikely((!__pyx_t_10) && PyErr_Occurred())) __PYX_ERR(3, 365, __pyx_L4_error)
      __pyx_t_11 = AMPL_Eval(__pyx_v_self->_c_ampl, __pyx_t_10); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 365, __pyx_L4_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __pyx_f_7_amplpy_PY_AMPL_CALL(__pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 365, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "amplpy/ampl.pyx":364
 *         if not statements.endswith((" ", ";", "\n")):
 *             statements += "\n"
 *         try:             # <<<<<<<<<<<<<<
 *             PY_AMPL_CALL(campl.AMPL_Eval(self._c_ampl, statements.encode('utf-8')))
 *         except SystemError as e:
 */
    }
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    goto __pyx_L9_try_end;
    __pyx_L4_error:;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "amplpy/ampl.pyx":366
 *         try:
 *             PY_AMPL_CALL(campl.AMPL_Eval(self._c_ampl, statements.encode('utf-8')))
 *         except SystemError as e:             # <<<<<<<<<<<<<<
 *             raise RuntimeError(str(e))
 * 
 */
    __pyx_t_12 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_SystemError);
    if (__pyx_t_12) {
      __Pyx_AddTraceback("_amplpy.AMPL.eval", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3) < 0) __PYX_ERR(3, 366, __pyx_L6_except_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __Pyx_XGOTREF(__pyx_t_2);
      __Pyx_XGOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __pyx_v_e = __pyx_t_2;
      /*try:*/ {

        /* "amplpy/ampl.pyx":367
 *             PY_AMPL_CALL(campl.AMPL_Eval(self._c_ampl, statements.encode('utf-8')))
 *         except SystemError as e:
 *             raise RuntimeError(str(e))             # <<<<<<<<<<<<<<
 * 
 *     def get_output(self, statements):
 */
        __pyx_t_13 = __Pyx_PyObject_Unicode(__pyx_v_e); if (unlikely(!__pyx_t_13)) __PYX_ERR(3, 367, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_13);
        __pyx_t_14 = __Pyx_PyObject_CallOneArg(__pyx_builtin_RuntimeError, __pyx_t_13); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 367, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_14);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_Raise(__pyx_t_14, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        __PYX_ERR(3, 367, __pyx_L15_error)
      }

      /* "amplpy/ampl.pyx":366
 *         try:
 *             PY_AMPL_CALL(campl.AMPL_Eval(self._c_ampl, statements.encode('utf-8')))
 *         except SystemError as e:             # <<<<<<<<<<<<<<
 *             raise RuntimeError(str(e))
 * 
 */
      /*finally:*/ {
        __pyx_L15_error:;
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_12 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0;
          }
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          }
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_12; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L6_except_error;
        }
      }
    }
    goto __pyx_L6_except_error;

    /* "amplpy/ampl.pyx":364
 *         if not statements.endswith((" ", ";", "\n")):
 *             statements += "\n"
 *         try:             # <<<<<<<<<<<<<<
 *             PY_AMPL_CALL(campl.AMPL_Eval(self._c_ampl, statements.encode('utf-8')))
 *         except SystemError as e:
 */
    __pyx_L6_except_error:;
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_XGIVEREF(__pyx_t_9);
    __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
    goto __pyx_L1_error;
    __pyx_L9_try_end:;
  }

  /* "amplpy/ampl.pyx":335
 *         return Parameter.create(self._c_ampl, name_c, NULL, None)
 * 
 *     def eval(self, statements):             # <<<<<<<<<<<<<<
 *         """
 *         Parses AMPL code and evaluates it as a possibly empty sequence of AMPL
 */

  /* 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_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_AddTraceback("_amplpy.AMPL.eval", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_e);
  __Pyx_XDECREF(__pyx_v_statements);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/ampl.pyx":369
 *             raise RuntimeError(str(e))
 * 
 *     def get_output(self, statements):             # <<<<<<<<<<<<<<
 *         """
 *         Equivalent to :func:`~amplpy.AMPL.eval` but returns the output as a
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_4AMPL_21get_output(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_4AMPL_20get_output, "AMPL.get_output(self, statements)\n\n        Equivalent to :func:`~amplpy.AMPL.eval` but returns the output as a\n        string.\n\n        Args:\n          statements: A collection of AMPL statements and declarations to\n          be passed to the interpreter.\n\n        Returns:\n          A string with the output.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_4AMPL_21get_output = {"get_output", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_21get_output, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_4AMPL_20get_output};
static PyObject *__pyx_pw_7_amplpy_4AMPL_21get_output(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_statements = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_output (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_statements,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_statements)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 369, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get_output") < 0)) __PYX_ERR(3, 369, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_statements = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_output", 1, 1, 1, __pyx_nargs); __PYX_ERR(3, 369, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.AMPL.get_output", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_4AMPL_20get_output(((struct __pyx_obj_7_amplpy_AMPL *)__pyx_v_self), __pyx_v_statements);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_4AMPL_20get_output(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self, PyObject *__pyx_v_statements) {
  char *__pyx_v_output_c;
  PyObject *__pyx_v_output = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  char const *__pyx_t_7;
  Py_ssize_t __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_output", 0);
  __Pyx_INCREF(__pyx_v_statements);

  /* "amplpy/ampl.pyx":382
 *         """
 *         # Workaround for #56
 *         if not statements.endswith((" ", ";", "\n")):             # <<<<<<<<<<<<<<
 *             statements += "\n"
 *         cdef char* output_c
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_statements, __pyx_n_s_endswith); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 382, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_tuple__42};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 382, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(3, 382, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = (!__pyx_t_5);
  if (__pyx_t_6) {

    /* "amplpy/ampl.pyx":383
 *         # Workaround for #56
 *         if not statements.endswith((" ", ";", "\n")):
 *             statements += "\n"             # <<<<<<<<<<<<<<
 *         cdef char* output_c
 *         PY_AMPL_CALL(campl.AMPL_GetOutput(self._c_ampl, statements.encode('utf-8'), &output_c))
 */
    __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_statements, __pyx_kp_u__25); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 383, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF_SET(__pyx_v_statements, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "amplpy/ampl.pyx":382
 *         """
 *         # Workaround for #56
 *         if not statements.endswith((" ", ";", "\n")):             # <<<<<<<<<<<<<<
 *             statements += "\n"
 *         cdef char* output_c
 */
  }

  /* "amplpy/ampl.pyx":385
 *             statements += "\n"
 *         cdef char* output_c
 *         PY_AMPL_CALL(campl.AMPL_GetOutput(self._c_ampl, statements.encode('utf-8'), &output_c))             # <<<<<<<<<<<<<<
 *         output = str(output_c.decode('utf-8'))
 *         campl.AMPL_StringFree(&output_c)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_statements, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 385, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_u_utf_8};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 385, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_t_7 = __Pyx_PyObject_AsString(__pyx_t_1); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(3, 385, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_7_amplpy_PY_AMPL_CALL(AMPL_GetOutput(__pyx_v_self->_c_ampl, __pyx_t_7, (&__pyx_v_output_c))); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 385, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "amplpy/ampl.pyx":386
 *         cdef char* output_c
 *         PY_AMPL_CALL(campl.AMPL_GetOutput(self._c_ampl, statements.encode('utf-8'), &output_c))
 *         output = str(output_c.decode('utf-8'))             # <<<<<<<<<<<<<<
 *         campl.AMPL_StringFree(&output_c)
 *         return output
 */
  __pyx_t_8 = __Pyx_ssize_strlen(__pyx_v_output_c); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(3, 386, __pyx_L1_error)
  __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_output_c, 0, __pyx_t_8, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 386, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_output = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "amplpy/ampl.pyx":387
 *         PY_AMPL_CALL(campl.AMPL_GetOutput(self._c_ampl, statements.encode('utf-8'), &output_c))
 *         output = str(output_c.decode('utf-8'))
 *         campl.AMPL_StringFree(&output_c)             # <<<<<<<<<<<<<<
 *         return output
 * 
 */
  (void)(AMPL_StringFree((&__pyx_v_output_c)));

  /* "amplpy/ampl.pyx":388
 *         output = str(output_c.decode('utf-8'))
 *         campl.AMPL_StringFree(&output_c)
 *         return output             # <<<<<<<<<<<<<<
 * 
 *     def reset(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_output);
  __pyx_r = __pyx_v_output;
  goto __pyx_L0;

  /* "amplpy/ampl.pyx":369
 *             raise RuntimeError(str(e))
 * 
 *     def get_output(self, statements):             # <<<<<<<<<<<<<<
 *         """
 *         Equivalent to :func:`~amplpy.AMPL.eval` but returns the output as a
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("_amplpy.AMPL.get_output", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_output);
  __Pyx_XDECREF(__pyx_v_statements);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/ampl.pyx":390
 *         return output
 * 
 *     def reset(self):             # <<<<<<<<<<<<<<
 *         """
 *         Clears all entities in the underlying AMPL interpreter, clears all maps
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_4AMPL_23reset(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_4AMPL_22reset, "AMPL.reset(self)\n\n        Clears all entities in the underlying AMPL interpreter, clears all maps\n        and invalidates all entities.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_4AMPL_23reset = {"reset", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_23reset, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_4AMPL_22reset};
static PyObject *__pyx_pw_7_amplpy_4AMPL_23reset(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("reset (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("reset", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "reset", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_4AMPL_22reset(((struct __pyx_obj_7_amplpy_AMPL *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_4AMPL_22reset(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("reset", 1);

  /* "amplpy/ampl.pyx":395
 *         and invalidates all entities.
 *         """
 *         PY_AMPL_CALL(campl.AMPL_Reset(self._c_ampl))             # <<<<<<<<<<<<<<
 * 
 *     def close(self):
 */
  __pyx_t_1 = __pyx_f_7_amplpy_PY_AMPL_CALL(AMPL_Reset(__pyx_v_self->_c_ampl)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 395, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "amplpy/ampl.pyx":390
 *         return output
 * 
 *     def reset(self):             # <<<<<<<<<<<<<<
 *         """
 *         Clears all entities in the underlying AMPL interpreter, clears all maps
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("_amplpy.AMPL.reset", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/ampl.pyx":397
 *         PY_AMPL_CALL(campl.AMPL_Reset(self._c_ampl))
 * 
 *     def close(self):             # <<<<<<<<<<<<<<
 *         """
 *         Stops the underlying engine, and release all any further attempt to
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_4AMPL_25close(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_4AMPL_24close, "AMPL.close(self)\n\n        Stops the underlying engine, and release all any further attempt to\n        execute optimization commands without restarting it will throw an\n        exception.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_4AMPL_25close = {"close", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_25close, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_4AMPL_24close};
static PyObject *__pyx_pw_7_amplpy_4AMPL_25close(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("close (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("close", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "close", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_4AMPL_24close(((struct __pyx_obj_7_amplpy_AMPL *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_4AMPL_24close(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("close", 1);

  /* "amplpy/ampl.pyx":403
 *         exception.
 *         """
 *         if self._c_ampl is not NULL:             # <<<<<<<<<<<<<<
 *             PY_AMPL_CALL(campl.AMPL_Close(self._c_ampl))
 *             campl.AMPL_Free(&self._c_ampl);
 */
  __pyx_t_1 = (__pyx_v_self->_c_ampl != NULL);
  if (__pyx_t_1) {

    /* "amplpy/ampl.pyx":404
 *         """
 *         if self._c_ampl is not NULL:
 *             PY_AMPL_CALL(campl.AMPL_Close(self._c_ampl))             # <<<<<<<<<<<<<<
 *             campl.AMPL_Free(&self._c_ampl);
 *             self._c_ampl = NULL
 */
    __pyx_t_2 = __pyx_f_7_amplpy_PY_AMPL_CALL(AMPL_Close(__pyx_v_self->_c_ampl)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 404, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "amplpy/ampl.pyx":405
 *         if self._c_ampl is not NULL:
 *             PY_AMPL_CALL(campl.AMPL_Close(self._c_ampl))
 *             campl.AMPL_Free(&self._c_ampl);             # <<<<<<<<<<<<<<
 *             self._c_ampl = NULL
 * 
 */
    AMPL_Free((&__pyx_v_self->_c_ampl));

    /* "amplpy/ampl.pyx":406
 *             PY_AMPL_CALL(campl.AMPL_Close(self._c_ampl))
 *             campl.AMPL_Free(&self._c_ampl);
 *             self._c_ampl = NULL             # <<<<<<<<<<<<<<
 * 
 *     def is_running(self):
 */
    __pyx_v_self->_c_ampl = NULL;

    /* "amplpy/ampl.pyx":403
 *         exception.
 *         """
 *         if self._c_ampl is not NULL:             # <<<<<<<<<<<<<<
 *             PY_AMPL_CALL(campl.AMPL_Close(self._c_ampl))
 *             campl.AMPL_Free(&self._c_ampl);
 */
  }

  /* "amplpy/ampl.pyx":397
 *         PY_AMPL_CALL(campl.AMPL_Reset(self._c_ampl))
 * 
 *     def close(self):             # <<<<<<<<<<<<<<
 *         """
 *         Stops the underlying engine, and release all any further attempt to
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("_amplpy.AMPL.close", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/ampl.pyx":408
 *             self._c_ampl = NULL
 * 
 *     def is_running(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns true if the underlying engine is running.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_4AMPL_27is_running(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_4AMPL_26is_running, "AMPL.is_running(self)\n\n        Returns true if the underlying engine is running.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_4AMPL_27is_running = {"is_running", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_27is_running, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_4AMPL_26is_running};
static PyObject *__pyx_pw_7_amplpy_4AMPL_27is_running(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_running (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("is_running", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "is_running", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_4AMPL_26is_running(((struct __pyx_obj_7_amplpy_AMPL *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_4AMPL_26is_running(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self) {
  bool __pyx_v_isrunning;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("is_running", 1);

  /* "amplpy/ampl.pyx":413
 *         """
 *         cdef bool_c isrunning
 *         PY_AMPL_CALL(campl.AMPL_IsRunning(self._c_ampl, &isrunning))             # <<<<<<<<<<<<<<
 *         return isrunning
 * 
 */
  __pyx_t_1 = __pyx_f_7_amplpy_PY_AMPL_CALL(AMPL_IsRunning(__pyx_v_self->_c_ampl, (&__pyx_v_isrunning))); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 413, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "amplpy/ampl.pyx":414
 *         cdef bool_c isrunning
 *         PY_AMPL_CALL(campl.AMPL_IsRunning(self._c_ampl, &isrunning))
 *         return isrunning             # <<<<<<<<<<<<<<
 * 
 *     def solve(self, problem="", solver="", verbose=True, return_output=False, **kwargs):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_isrunning); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 414, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "amplpy/ampl.pyx":408
 *             self._c_ampl = NULL
 * 
 *     def is_running(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns true if the underlying engine is running.
 */

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

/* "amplpy/ampl.pyx":416
 *         return isrunning
 * 
 *     def solve(self, problem="", solver="", verbose=True, return_output=False, **kwargs):             # <<<<<<<<<<<<<<
 *         """
 *         Solve the current model or the problem specified by ``problem``.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_4AMPL_29solve(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_4AMPL_28solve, "AMPL.solve(self, problem=u'', solver=u'', verbose=True, return_output=False, **kwargs)\n\n        Solve the current model or the problem specified by ``problem``.\n\n        Args:\n            problem: Name of the problem to solve.\n\n            solver: Name of the solver to use.\n\n            verbose: Display verbose output if set to ``True``.\n\n            return_output: Return output as a string if set to ``True``.\n\n            kwargs: Pass ``solvername_options`` as additional arguments.\n\n        Raises:\n            RuntimeError: if the underlying interpreter is not running.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_4AMPL_29solve = {"solve", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_29solve, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_4AMPL_28solve};
static PyObject *__pyx_pw_7_amplpy_4AMPL_29solve(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_problem = 0;
  PyObject *__pyx_v_solver = 0;
  PyObject *__pyx_v_verbose = 0;
  PyObject *__pyx_v_return_output = 0;
  PyObject *__pyx_v_kwargs = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[4] = {0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("solve (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
  __Pyx_GOTREF(__pyx_v_kwargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_problem,&__pyx_n_s_solver,&__pyx_n_s_verbose,&__pyx_n_s_return_output,0};
    values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_kp_u__22));
    values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_kp_u__22));
    values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_True));
    values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_False));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_problem);
          if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 416, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_solver);
          if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 416, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_verbose);
          if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 416, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_return_output);
          if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 416, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, __pyx_v_kwargs, values + 0, kwd_pos_args, "solve") < 0)) __PYX_ERR(3, 416, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_problem = values[0];
    __pyx_v_solver = values[1];
    __pyx_v_verbose = values[2];
    __pyx_v_return_output = values[3];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("solve", 0, 0, 4, __pyx_nargs); __PYX_ERR(3, 416, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
  __Pyx_AddTraceback("_amplpy.AMPL.solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_4AMPL_28solve(((struct __pyx_obj_7_amplpy_AMPL *)__pyx_v_self), __pyx_v_problem, __pyx_v_solver, __pyx_v_verbose, __pyx_v_return_output, __pyx_v_kwargs);

  /* function exit code */
  __Pyx_DECREF(__pyx_v_kwargs);
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_4AMPL_28solve(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self, PyObject *__pyx_v_problem, PyObject *__pyx_v_solver, PyObject *__pyx_v_verbose, PyObject *__pyx_v_return_output, PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_v_option = NULL;
  PyObject *__pyx_v_value = NULL;
  PyObject *__pyx_v_output = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  unsigned int __pyx_t_9;
  int __pyx_t_10;
  int __pyx_t_11;
  int __pyx_t_12;
  Py_UCS4 __pyx_t_13;
  char const *__pyx_t_14;
  char const *__pyx_t_15;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("solve", 1);

  /* "amplpy/ampl.pyx":434
 *             RuntimeError: if the underlying interpreter is not running.
 *         """
 *         for option, value in kwargs.items():             # <<<<<<<<<<<<<<
 *             if option.endswith("_options"):
 *                 self.set_option(option, value)
 */
  __pyx_t_2 = 0;
  __pyx_t_5 = __Pyx_dict_iterator(__pyx_v_kwargs, 1, __pyx_n_s_items, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 434, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_1);
  __pyx_t_1 = __pyx_t_5;
  __pyx_t_5 = 0;
  while (1) {
    __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_3, &__pyx_t_2, &__pyx_t_5, &__pyx_t_6, NULL, __pyx_t_4);
    if (unlikely(__pyx_t_7 == 0)) break;
    if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(3, 434, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_XDECREF_SET(__pyx_v_option, __pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "amplpy/ampl.pyx":435
 *         """
 *         for option, value in kwargs.items():
 *             if option.endswith("_options"):             # <<<<<<<<<<<<<<
 *                 self.set_option(option, value)
 *         if not verbose or return_output:
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_option, __pyx_n_s_endswith); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 435, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_8 = NULL;
    __pyx_t_9 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_9 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_n_u_options};
      __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9);
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 435, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(3, 435, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (__pyx_t_10) {

      /* "amplpy/ampl.pyx":436
 *         for option, value in kwargs.items():
 *             if option.endswith("_options"):
 *                 self.set_option(option, value)             # <<<<<<<<<<<<<<
 *         if not verbose or return_output:
 *             if solver != "":
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_option); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 436, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_8 = NULL;
      __pyx_t_9 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_8)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
          __pyx_t_9 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_v_option, __pyx_v_value};
        __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_9, 2+__pyx_t_9);
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 436, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "amplpy/ampl.pyx":435
 *         """
 *         for option, value in kwargs.items():
 *             if option.endswith("_options"):             # <<<<<<<<<<<<<<
 *                 self.set_option(option, value)
 *         if not verbose or return_output:
 */
    }
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "amplpy/ampl.pyx":437
 *             if option.endswith("_options"):
 *                 self.set_option(option, value)
 *         if not verbose or return_output:             # <<<<<<<<<<<<<<
 *             if solver != "":
 *                 self.set_option("solver", solver)
 */
  __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_v_verbose); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(3, 437, __pyx_L1_error)
  __pyx_t_12 = (!__pyx_t_11);
  if (!__pyx_t_12) {
  } else {
    __pyx_t_10 = __pyx_t_12;
    goto __pyx_L7_bool_binop_done;
  }
  __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_v_return_output); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(3, 437, __pyx_L1_error)
  __pyx_t_10 = __pyx_t_12;
  __pyx_L7_bool_binop_done:;
  if (__pyx_t_10) {

    /* "amplpy/ampl.pyx":438
 *                 self.set_option(option, value)
 *         if not verbose or return_output:
 *             if solver != "":             # <<<<<<<<<<<<<<
 *                 self.set_option("solver", solver)
 *             output = self.get_output(f"solve {problem};")
 */
    __pyx_t_10 = (__Pyx_PyUnicode_Equals(__pyx_v_solver, __pyx_kp_u__22, Py_NE)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(3, 438, __pyx_L1_error)
    if (__pyx_t_10) {

      /* "amplpy/ampl.pyx":439
 *         if not verbose or return_output:
 *             if solver != "":
 *                 self.set_option("solver", solver)             # <<<<<<<<<<<<<<
 *             output = self.get_output(f"solve {problem};")
 *             if return_output:
 */
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_option); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 439, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = NULL;
      __pyx_t_9 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_9 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_n_u_solver, __pyx_v_solver};
        __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_9, 2+__pyx_t_9);
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 439, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "amplpy/ampl.pyx":438
 *                 self.set_option(option, value)
 *         if not verbose or return_output:
 *             if solver != "":             # <<<<<<<<<<<<<<
 *                 self.set_option("solver", solver)
 *             output = self.get_output(f"solve {problem};")
 */
    }

    /* "amplpy/ampl.pyx":440
 *             if solver != "":
 *                 self.set_option("solver", solver)
 *             output = self.get_output(f"solve {problem};")             # <<<<<<<<<<<<<<
 *             if return_output:
 *                 return output
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_output); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 440, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 440, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = 0;
    __pyx_t_13 = 127;
    __Pyx_INCREF(__pyx_kp_u_solve);
    __pyx_t_3 += 6;
    __Pyx_GIVEREF(__pyx_kp_u_solve);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_u_solve);
    __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_v_problem, __pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 440, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_13 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) > __pyx_t_13) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) : __pyx_t_13;
    __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_8);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_8);
    __pyx_t_8 = 0;
    __Pyx_INCREF(__pyx_kp_u__41);
    __pyx_t_3 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__41);
    PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_kp_u__41);
    __pyx_t_8 = __Pyx_PyUnicode_Join(__pyx_t_5, 3, __pyx_t_3, __pyx_t_13); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 440, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    __pyx_t_9 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
        __pyx_t_9 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_8};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 440, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __pyx_v_output = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "amplpy/ampl.pyx":441
 *                 self.set_option("solver", solver)
 *             output = self.get_output(f"solve {problem};")
 *             if return_output:             # <<<<<<<<<<<<<<
 *                 return output
 *         else:
 */
    __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_return_output); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(3, 441, __pyx_L1_error)
    if (__pyx_t_10) {

      /* "amplpy/ampl.pyx":442
 *             output = self.get_output(f"solve {problem};")
 *             if return_output:
 *                 return output             # <<<<<<<<<<<<<<
 *         else:
 *             PY_AMPL_CALL(campl.AMPL_Solve(self._c_ampl, problem.encode('utf-8'), solver.encode('utf-8')))
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_output);
      __pyx_r = __pyx_v_output;
      goto __pyx_L0;

      /* "amplpy/ampl.pyx":441
 *                 self.set_option("solver", solver)
 *             output = self.get_output(f"solve {problem};")
 *             if return_output:             # <<<<<<<<<<<<<<
 *                 return output
 *         else:
 */
    }

    /* "amplpy/ampl.pyx":437
 *             if option.endswith("_options"):
 *                 self.set_option(option, value)
 *         if not verbose or return_output:             # <<<<<<<<<<<<<<
 *             if solver != "":
 *                 self.set_option("solver", solver)
 */
    goto __pyx_L6;
  }

  /* "amplpy/ampl.pyx":444
 *                 return output
 *         else:
 *             PY_AMPL_CALL(campl.AMPL_Solve(self._c_ampl, problem.encode('utf-8'), solver.encode('utf-8')))             # <<<<<<<<<<<<<<
 * 
 *     def cd(self, path=None):
 */
  /*else*/ {
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_problem, __pyx_n_s_encode); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 444, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_8 = NULL;
    __pyx_t_9 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
        __pyx_t_9 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_kp_u_utf_8};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9);
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 444, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __pyx_t_14 = __Pyx_PyObject_AsString(__pyx_t_1); if (unlikely((!__pyx_t_14) && PyErr_Occurred())) __PYX_ERR(3, 444, __pyx_L1_error)
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_solver, __pyx_n_s_encode); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 444, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_5 = NULL;
    __pyx_t_9 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_8);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_8, function);
        __pyx_t_9 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_kp_u_utf_8};
      __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 444, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __pyx_t_15 = __Pyx_PyObject_AsString(__pyx_t_6); if (unlikely((!__pyx_t_15) && PyErr_Occurred())) __PYX_ERR(3, 444, __pyx_L1_error)
    __pyx_t_8 = __pyx_f_7_amplpy_PY_AMPL_CALL(AMPL_Solve(__pyx_v_self->_c_ampl, __pyx_t_14, __pyx_t_15)); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 444, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  }
  __pyx_L6:;

  /* "amplpy/ampl.pyx":416
 *         return isrunning
 * 
 *     def solve(self, problem="", solver="", verbose=True, return_output=False, **kwargs):             # <<<<<<<<<<<<<<
 *         """
 *         Solve the current model or the problem specified by ``problem``.
 */

  /* 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_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("_amplpy.AMPL.solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_option);
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XDECREF(__pyx_v_output);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/ampl.pyx":446
 *             PY_AMPL_CALL(campl.AMPL_Solve(self._c_ampl, problem.encode('utf-8'), solver.encode('utf-8')))
 * 
 *     def cd(self, path=None):             # <<<<<<<<<<<<<<
 *         """
 *         Get or set the current working directory from the underlying
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_4AMPL_31cd(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_4AMPL_30cd, "AMPL.cd(self, path=None)\n\n        Get or set the current working directory from the underlying\n        interpreter (see https://en.wikipedia.org/wiki/Working_directory).\n\n        Args:\n            path: New working directory or None (to display the working\n            directory).\n\n        Returns:\n            Current working directory.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_4AMPL_31cd = {"cd", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_31cd, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_4AMPL_30cd};
static PyObject *__pyx_pw_7_amplpy_4AMPL_31cd(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_path = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cd (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_path,0};
    values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_path);
          if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 446, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "cd") < 0)) __PYX_ERR(3, 446, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_path = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("cd", 0, 0, 1, __pyx_nargs); __PYX_ERR(3, 446, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.AMPL.cd", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_4AMPL_30cd(((struct __pyx_obj_7_amplpy_AMPL *)__pyx_v_self), __pyx_v_path);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_4AMPL_30cd(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self, PyObject *__pyx_v_path) {
  AMPL_ERRORINFO *__pyx_v_errorinfo;
  AMPL_RETCODE __pyx_v_rc;
  char *__pyx_v_workdir_c;
  PyObject *__pyx_v_workdir = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  unsigned int __pyx_t_5;
  char const *__pyx_t_6;
  Py_ssize_t __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("cd", 1);

  /* "amplpy/ampl.pyx":461
 *         cdef campl.AMPL_RETCODE rc
 *         cdef char* workdir_c
 *         if path is None:             # <<<<<<<<<<<<<<
 *             errorinfo = campl.AMPL_Cd(self._c_ampl, &workdir_c)
 *         else:
 */
  __pyx_t_1 = (__pyx_v_path == Py_None);
  if (__pyx_t_1) {

    /* "amplpy/ampl.pyx":462
 *         cdef char* workdir_c
 *         if path is None:
 *             errorinfo = campl.AMPL_Cd(self._c_ampl, &workdir_c)             # <<<<<<<<<<<<<<
 *         else:
 *             errorinfo = campl.AMPL_Cd2(self._c_ampl, path.encode('utf-8'), &workdir_c)
 */
    __pyx_v_errorinfo = AMPL_Cd(__pyx_v_self->_c_ampl, (&__pyx_v_workdir_c));

    /* "amplpy/ampl.pyx":461
 *         cdef campl.AMPL_RETCODE rc
 *         cdef char* workdir_c
 *         if path is None:             # <<<<<<<<<<<<<<
 *             errorinfo = campl.AMPL_Cd(self._c_ampl, &workdir_c)
 *         else:
 */
    goto __pyx_L3;
  }

  /* "amplpy/ampl.pyx":464
 *             errorinfo = campl.AMPL_Cd(self._c_ampl, &workdir_c)
 *         else:
 *             errorinfo = campl.AMPL_Cd2(self._c_ampl, path.encode('utf-8'), &workdir_c)             # <<<<<<<<<<<<<<
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:
 */
  /*else*/ {
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_path, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 464, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_u_utf_8};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 464, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_t_2); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(3, 464, __pyx_L1_error)
    __pyx_v_errorinfo = AMPL_Cd2(__pyx_v_self->_c_ampl, __pyx_t_6, (&__pyx_v_workdir_c));
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_L3:;

  /* "amplpy/ampl.pyx":465
 *         else:
 *             errorinfo = campl.AMPL_Cd2(self._c_ampl, path.encode('utf-8'), &workdir_c)
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)             # <<<<<<<<<<<<<<
 *         if rc != campl.AMPL_OK:
 *             campl.AMPL_StringFree(&workdir_c)
 */
  __pyx_v_rc = AMPL_ErrorInfoGetError(__pyx_v_errorinfo);

  /* "amplpy/ampl.pyx":466
 *             errorinfo = campl.AMPL_Cd2(self._c_ampl, path.encode('utf-8'), &workdir_c)
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:             # <<<<<<<<<<<<<<
 *             campl.AMPL_StringFree(&workdir_c)
 *             PY_AMPL_CALL(errorinfo)
 */
  __pyx_t_1 = (__pyx_v_rc != AMPL_OK);
  if (__pyx_t_1) {

    /* "amplpy/ampl.pyx":467
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:
 *             campl.AMPL_StringFree(&workdir_c)             # <<<<<<<<<<<<<<
 *             PY_AMPL_CALL(errorinfo)
 *         workdir = str(workdir_c.decode('utf-8'))
 */
    (void)(AMPL_StringFree((&__pyx_v_workdir_c)));

    /* "amplpy/ampl.pyx":468
 *         if rc != campl.AMPL_OK:
 *             campl.AMPL_StringFree(&workdir_c)
 *             PY_AMPL_CALL(errorinfo)             # <<<<<<<<<<<<<<
 *         workdir = str(workdir_c.decode('utf-8'))
 *         campl.AMPL_StringFree(&workdir_c)
 */
    __pyx_t_2 = __pyx_f_7_amplpy_PY_AMPL_CALL(__pyx_v_errorinfo); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 468, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "amplpy/ampl.pyx":466
 *             errorinfo = campl.AMPL_Cd2(self._c_ampl, path.encode('utf-8'), &workdir_c)
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:             # <<<<<<<<<<<<<<
 *             campl.AMPL_StringFree(&workdir_c)
 *             PY_AMPL_CALL(errorinfo)
 */
  }

  /* "amplpy/ampl.pyx":469
 *             campl.AMPL_StringFree(&workdir_c)
 *             PY_AMPL_CALL(errorinfo)
 *         workdir = str(workdir_c.decode('utf-8'))             # <<<<<<<<<<<<<<
 *         campl.AMPL_StringFree(&workdir_c)
 * 
 */
  __pyx_t_7 = __Pyx_ssize_strlen(__pyx_v_workdir_c); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(3, 469, __pyx_L1_error)
  __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_workdir_c, 0, __pyx_t_7, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 469, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_workdir = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "amplpy/ampl.pyx":470
 *             PY_AMPL_CALL(errorinfo)
 *         workdir = str(workdir_c.decode('utf-8'))
 *         campl.AMPL_StringFree(&workdir_c)             # <<<<<<<<<<<<<<
 * 
 *         return workdir
 */
  (void)(AMPL_StringFree((&__pyx_v_workdir_c)));

  /* "amplpy/ampl.pyx":472
 *         campl.AMPL_StringFree(&workdir_c)
 * 
 *         return workdir             # <<<<<<<<<<<<<<
 * 
 *     def set_option(self, name, value):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_workdir);
  __pyx_r = __pyx_v_workdir;
  goto __pyx_L0;

  /* "amplpy/ampl.pyx":446
 *             PY_AMPL_CALL(campl.AMPL_Solve(self._c_ampl, problem.encode('utf-8'), solver.encode('utf-8')))
 * 
 *     def cd(self, path=None):             # <<<<<<<<<<<<<<
 *         """
 *         Get or set the current working directory from the underlying
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("_amplpy.AMPL.cd", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_workdir);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/ampl.pyx":474
 *         return workdir
 * 
 *     def set_option(self, name, value):             # <<<<<<<<<<<<<<
 *         """
 *         Set an AMPL option to a specified value.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_4AMPL_33set_option(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_4AMPL_32set_option, "AMPL.set_option(self, name, value)\n\n        Set an AMPL option to a specified value.\n\n        Args:\n            name: Name of the option to be set (alphanumeric without spaces).\n\n            value: The value the option must be set to.\n\n        Raises:\n            InvalidArgumet: if the option name is not valid.\n\n            TypeError: if the value has an invalid type.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_4AMPL_33set_option = {"set_option", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_33set_option, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_4AMPL_32set_option};
static PyObject *__pyx_pw_7_amplpy_4AMPL_33set_option(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_value = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_option (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_value,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 474, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_value)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 474, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("set_option", 1, 2, 2, 1); __PYX_ERR(3, 474, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_option") < 0)) __PYX_ERR(3, 474, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_name = values[0];
    __pyx_v_value = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_option", 1, 2, 2, __pyx_nargs); __PYX_ERR(3, 474, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.AMPL.set_option", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_4AMPL_32set_option(((struct __pyx_obj_7_amplpy_AMPL *)__pyx_v_self), __pyx_v_name, __pyx_v_value);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_4AMPL_32set_option(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  unsigned int __pyx_t_5;
  char const *__pyx_t_6;
  bool __pyx_t_7;
  char const *__pyx_t_8;
  double __pyx_t_9;
  char const *__pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  char const *__pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_option", 1);

  /* "amplpy/ampl.pyx":488
 *             TypeError: if the value has an invalid type.
 *         """
 *         if PyBool_Check(value):             # <<<<<<<<<<<<<<
 *             PY_AMPL_CALL(campl.AMPL_SetBoolOption(self._c_ampl, name.encode('utf-8'), value))
 *         elif isinstance(value, int):
 */
  __pyx_t_1 = PyBool_Check(__pyx_v_value);
  if (__pyx_t_1) {

    /* "amplpy/ampl.pyx":489
 *         """
 *         if PyBool_Check(value):
 *             PY_AMPL_CALL(campl.AMPL_SetBoolOption(self._c_ampl, name.encode('utf-8'), value))             # <<<<<<<<<<<<<<
 *         elif isinstance(value, int):
 *             PY_AMPL_CALL(campl.AMPL_SetDblOption(self._c_ampl, name.encode('utf-8'), value))
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 489, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_u_utf_8};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 489, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_t_2); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(3, 489, __pyx_L1_error)
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely((__pyx_t_7 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(3, 489, __pyx_L1_error)
    __pyx_t_3 = __pyx_f_7_amplpy_PY_AMPL_CALL(AMPL_SetBoolOption(__pyx_v_self->_c_ampl, __pyx_t_6, __pyx_t_7)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 489, __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;

    /* "amplpy/ampl.pyx":488
 *             TypeError: if the value has an invalid type.
 *         """
 *         if PyBool_Check(value):             # <<<<<<<<<<<<<<
 *             PY_AMPL_CALL(campl.AMPL_SetBoolOption(self._c_ampl, name.encode('utf-8'), value))
 *         elif isinstance(value, int):
 */
    goto __pyx_L3;
  }

  /* "amplpy/ampl.pyx":490
 *         if PyBool_Check(value):
 *             PY_AMPL_CALL(campl.AMPL_SetBoolOption(self._c_ampl, name.encode('utf-8'), value))
 *         elif isinstance(value, int):             # <<<<<<<<<<<<<<
 *             PY_AMPL_CALL(campl.AMPL_SetDblOption(self._c_ampl, name.encode('utf-8'), value))
 *         elif isinstance(value, float):
 */
  __pyx_t_1 = PyInt_Check(__pyx_v_value); 
  if (__pyx_t_1) {

    /* "amplpy/ampl.pyx":491
 *             PY_AMPL_CALL(campl.AMPL_SetBoolOption(self._c_ampl, name.encode('utf-8'), value))
 *         elif isinstance(value, int):
 *             PY_AMPL_CALL(campl.AMPL_SetDblOption(self._c_ampl, name.encode('utf-8'), value))             # <<<<<<<<<<<<<<
 *         elif isinstance(value, float):
 *             PY_AMPL_CALL(campl.AMPL_SetDblOption(self._c_ampl, name.encode('utf-8'), value))
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 491, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_u_utf_8};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 491, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __pyx_t_8 = __Pyx_PyObject_AsString(__pyx_t_3); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(3, 491, __pyx_L1_error)
    __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(3, 491, __pyx_L1_error)
    __pyx_t_2 = __pyx_f_7_amplpy_PY_AMPL_CALL(AMPL_SetDblOption(__pyx_v_self->_c_ampl, __pyx_t_8, __pyx_t_9)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 491, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "amplpy/ampl.pyx":490
 *         if PyBool_Check(value):
 *             PY_AMPL_CALL(campl.AMPL_SetBoolOption(self._c_ampl, name.encode('utf-8'), value))
 *         elif isinstance(value, int):             # <<<<<<<<<<<<<<
 *             PY_AMPL_CALL(campl.AMPL_SetDblOption(self._c_ampl, name.encode('utf-8'), value))
 *         elif isinstance(value, float):
 */
    goto __pyx_L3;
  }

  /* "amplpy/ampl.pyx":492
 *         elif isinstance(value, int):
 *             PY_AMPL_CALL(campl.AMPL_SetDblOption(self._c_ampl, name.encode('utf-8'), value))
 *         elif isinstance(value, float):             # <<<<<<<<<<<<<<
 *             PY_AMPL_CALL(campl.AMPL_SetDblOption(self._c_ampl, name.encode('utf-8'), value))
 *         elif isinstance(value, str):
 */
  __pyx_t_1 = PyFloat_Check(__pyx_v_value); 
  if (__pyx_t_1) {

    /* "amplpy/ampl.pyx":493
 *             PY_AMPL_CALL(campl.AMPL_SetDblOption(self._c_ampl, name.encode('utf-8'), value))
 *         elif isinstance(value, float):
 *             PY_AMPL_CALL(campl.AMPL_SetDblOption(self._c_ampl, name.encode('utf-8'), value))             # <<<<<<<<<<<<<<
 *         elif isinstance(value, str):
 *             PY_AMPL_CALL(campl.AMPL_SetOption(self._c_ampl, name.encode('utf-8'), value.encode('utf-8')))
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 493, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_u_utf_8};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 493, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __pyx_t_8 = __Pyx_PyObject_AsString(__pyx_t_2); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(3, 493, __pyx_L1_error)
    __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(3, 493, __pyx_L1_error)
    __pyx_t_3 = __pyx_f_7_amplpy_PY_AMPL_CALL(AMPL_SetDblOption(__pyx_v_self->_c_ampl, __pyx_t_8, __pyx_t_9)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 493, __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;

    /* "amplpy/ampl.pyx":492
 *         elif isinstance(value, int):
 *             PY_AMPL_CALL(campl.AMPL_SetDblOption(self._c_ampl, name.encode('utf-8'), value))
 *         elif isinstance(value, float):             # <<<<<<<<<<<<<<
 *             PY_AMPL_CALL(campl.AMPL_SetDblOption(self._c_ampl, name.encode('utf-8'), value))
 *         elif isinstance(value, str):
 */
    goto __pyx_L3;
  }

  /* "amplpy/ampl.pyx":494
 *         elif isinstance(value, float):
 *             PY_AMPL_CALL(campl.AMPL_SetDblOption(self._c_ampl, name.encode('utf-8'), value))
 *         elif isinstance(value, str):             # <<<<<<<<<<<<<<
 *             PY_AMPL_CALL(campl.AMPL_SetOption(self._c_ampl, name.encode('utf-8'), value.encode('utf-8')))
 *         else:
 */
  __pyx_t_1 = PyUnicode_Check(__pyx_v_value); 
  if (likely(__pyx_t_1)) {

    /* "amplpy/ampl.pyx":495
 *             PY_AMPL_CALL(campl.AMPL_SetDblOption(self._c_ampl, name.encode('utf-8'), value))
 *         elif isinstance(value, str):
 *             PY_AMPL_CALL(campl.AMPL_SetOption(self._c_ampl, name.encode('utf-8'), value.encode('utf-8')))             # <<<<<<<<<<<<<<
 *         else:
 *             raise TypeError
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 495, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_u_utf_8};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 495, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __pyx_t_10 = __Pyx_PyObject_AsString(__pyx_t_3); if (unlikely((!__pyx_t_10) && PyErr_Occurred())) __PYX_ERR(3, 495, __pyx_L1_error)
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 495, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_11 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (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);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_kp_u_utf_8};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 495, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __pyx_t_12 = __Pyx_PyObject_AsString(__pyx_t_2); if (unlikely((!__pyx_t_12) && PyErr_Occurred())) __PYX_ERR(3, 495, __pyx_L1_error)
    __pyx_t_4 = __pyx_f_7_amplpy_PY_AMPL_CALL(AMPL_SetOption(__pyx_v_self->_c_ampl, __pyx_t_10, __pyx_t_12)); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 495, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "amplpy/ampl.pyx":494
 *         elif isinstance(value, float):
 *             PY_AMPL_CALL(campl.AMPL_SetDblOption(self._c_ampl, name.encode('utf-8'), value))
 *         elif isinstance(value, str):             # <<<<<<<<<<<<<<
 *             PY_AMPL_CALL(campl.AMPL_SetOption(self._c_ampl, name.encode('utf-8'), value.encode('utf-8')))
 *         else:
 */
    goto __pyx_L3;
  }

  /* "amplpy/ampl.pyx":497
 *             PY_AMPL_CALL(campl.AMPL_SetOption(self._c_ampl, name.encode('utf-8'), value.encode('utf-8')))
 *         else:
 *             raise TypeError             # <<<<<<<<<<<<<<
 * 
 *     def get_option(self, name):
 */
  /*else*/ {
    __Pyx_Raise(__pyx_builtin_TypeError, 0, 0, 0);
    __PYX_ERR(3, 497, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "amplpy/ampl.pyx":474
 *         return workdir
 * 
 *     def set_option(self, name, value):             # <<<<<<<<<<<<<<
 *         """
 *         Set an AMPL option to a specified value.
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("_amplpy.AMPL.set_option", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/ampl.pyx":499
 *             raise TypeError
 * 
 *     def get_option(self, name):             # <<<<<<<<<<<<<<
 *         """
 *         Get the current value of the specified option. If the option does not
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_4AMPL_35get_option(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_4AMPL_34get_option, "AMPL.get_option(self, name)\n\n        Get the current value of the specified option. If the option does not\n        exist, returns None.\n\n        Args:\n            name: Option name.\n\n        Returns:\n            Value of the option.\n\n        Raises:\n            InvalidArgumet: if the option name is not valid.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_4AMPL_35get_option = {"get_option", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_35get_option, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_4AMPL_34get_option};
static PyObject *__pyx_pw_7_amplpy_4AMPL_35get_option(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_name = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_option (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 499, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get_option") < 0)) __PYX_ERR(3, 499, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_name = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_option", 1, 1, 1, __pyx_nargs); __PYX_ERR(3, 499, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.AMPL.get_option", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_4AMPL_34get_option(((struct __pyx_obj_7_amplpy_AMPL *)__pyx_v_self), __pyx_v_name);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_4AMPL_34get_option(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self, PyObject *__pyx_v_name) {
  AMPL_ERRORINFO *__pyx_v_errorinfo;
  AMPL_RETCODE __pyx_v_rc;
  bool __pyx_v_exists;
  char *__pyx_v_value_c;
  PyObject *__pyx_v_value = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  char const *__pyx_t_5;
  int __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_option", 1);

  /* "amplpy/ampl.pyx":518
 *         cdef char* value_c
 * 
 *         errorinfo = campl.AMPL_GetOption(self._c_ampl, name.encode('utf-8'), &exists, &value_c)             # <<<<<<<<<<<<<<
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 518, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_u_utf_8};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 518, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_t_5 = __Pyx_PyObject_AsString(__pyx_t_1); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) __PYX_ERR(3, 518, __pyx_L1_error)
  __pyx_v_errorinfo = AMPL_GetOption(__pyx_v_self->_c_ampl, __pyx_t_5, (&__pyx_v_exists), (&__pyx_v_value_c));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "amplpy/ampl.pyx":519
 * 
 *         errorinfo = campl.AMPL_GetOption(self._c_ampl, name.encode('utf-8'), &exists, &value_c)
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)             # <<<<<<<<<<<<<<
 *         if rc != campl.AMPL_OK:
 *             campl.AMPL_StringFree(&value_c)
 */
  __pyx_v_rc = AMPL_ErrorInfoGetError(__pyx_v_errorinfo);

  /* "amplpy/ampl.pyx":520
 *         errorinfo = campl.AMPL_GetOption(self._c_ampl, name.encode('utf-8'), &exists, &value_c)
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:             # <<<<<<<<<<<<<<
 *             campl.AMPL_StringFree(&value_c)
 *             PY_AMPL_CALL(errorinfo)
 */
  __pyx_t_6 = (__pyx_v_rc != AMPL_OK);
  if (__pyx_t_6) {

    /* "amplpy/ampl.pyx":521
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:
 *             campl.AMPL_StringFree(&value_c)             # <<<<<<<<<<<<<<
 *             PY_AMPL_CALL(errorinfo)
 * 
 */
    (void)(AMPL_StringFree((&__pyx_v_value_c)));

    /* "amplpy/ampl.pyx":522
 *         if rc != campl.AMPL_OK:
 *             campl.AMPL_StringFree(&value_c)
 *             PY_AMPL_CALL(errorinfo)             # <<<<<<<<<<<<<<
 * 
 *         value = value_c.decode('utf-8')
 */
    __pyx_t_1 = __pyx_f_7_amplpy_PY_AMPL_CALL(__pyx_v_errorinfo); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 522, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "amplpy/ampl.pyx":520
 *         errorinfo = campl.AMPL_GetOption(self._c_ampl, name.encode('utf-8'), &exists, &value_c)
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:             # <<<<<<<<<<<<<<
 *             campl.AMPL_StringFree(&value_c)
 *             PY_AMPL_CALL(errorinfo)
 */
  }

  /* "amplpy/ampl.pyx":524
 *             PY_AMPL_CALL(errorinfo)
 * 
 *         value = value_c.decode('utf-8')             # <<<<<<<<<<<<<<
 *         campl.AMPL_StringFree(&value_c)
 *         if exists:
 */
  __pyx_t_7 = __Pyx_ssize_strlen(__pyx_v_value_c); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(3, 524, __pyx_L1_error)
  __pyx_t_1 = __Pyx_decode_c_string(__pyx_v_value_c, 0, __pyx_t_7, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 524, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_value = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "amplpy/ampl.pyx":525
 * 
 *         value = value_c.decode('utf-8')
 *         campl.AMPL_StringFree(&value_c)             # <<<<<<<<<<<<<<
 *         if exists:
 *             try:
 */
  (void)(AMPL_StringFree((&__pyx_v_value_c)));

  /* "amplpy/ampl.pyx":526
 *         value = value_c.decode('utf-8')
 *         campl.AMPL_StringFree(&value_c)
 *         if exists:             # <<<<<<<<<<<<<<
 *             try:
 *                 return int(value)
 */
  __pyx_t_6 = (__pyx_v_exists != 0);
  if (__pyx_t_6) {

    /* "amplpy/ampl.pyx":527
 *         campl.AMPL_StringFree(&value_c)
 *         if exists:
 *             try:             # <<<<<<<<<<<<<<
 *                 return int(value)
 *             except ValueError:
 */
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
      __Pyx_XGOTREF(__pyx_t_8);
      __Pyx_XGOTREF(__pyx_t_9);
      __Pyx_XGOTREF(__pyx_t_10);
      /*try:*/ {

        /* "amplpy/ampl.pyx":528
 *         if exists:
 *             try:
 *                 return int(value)             # <<<<<<<<<<<<<<
 *             except ValueError:
 *                 try:
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_1 = __Pyx_PyNumber_Int(__pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 528, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_r = __pyx_t_1;
        __pyx_t_1 = 0;
        goto __pyx_L9_try_return;

        /* "amplpy/ampl.pyx":527
 *         campl.AMPL_StringFree(&value_c)
 *         if exists:
 *             try:             # <<<<<<<<<<<<<<
 *                 return int(value)
 *             except ValueError:
 */
      }
      __pyx_L5_error:;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "amplpy/ampl.pyx":529
 *             try:
 *                 return int(value)
 *             except ValueError:             # <<<<<<<<<<<<<<
 *                 try:
 *                     return float(value)
 */
      __pyx_t_11 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError);
      if (__pyx_t_11) {
        __Pyx_AddTraceback("_amplpy.AMPL.get_option", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3) < 0) __PYX_ERR(3, 529, __pyx_L7_except_error)
        __Pyx_XGOTREF(__pyx_t_1);
        __Pyx_XGOTREF(__pyx_t_2);
        __Pyx_XGOTREF(__pyx_t_3);

        /* "amplpy/ampl.pyx":530
 *                 return int(value)
 *             except ValueError:
 *                 try:             # <<<<<<<<<<<<<<
 *                     return float(value)
 *                 except ValueError:
 */
        {
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __Pyx_ExceptionSave(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
          __Pyx_XGOTREF(__pyx_t_12);
          __Pyx_XGOTREF(__pyx_t_13);
          __Pyx_XGOTREF(__pyx_t_14);
          /*try:*/ {

            /* "amplpy/ampl.pyx":531
 *             except ValueError:
 *                 try:
 *                     return float(value)             # <<<<<<<<<<<<<<
 *                 except ValueError:
 *                     return value
 */
            __Pyx_XDECREF(__pyx_r);
            __pyx_t_15 = __Pyx_PyNumber_Float(__pyx_v_value); if (unlikely(!__pyx_t_15)) __PYX_ERR(3, 531, __pyx_L13_error)
            __Pyx_GOTREF(__pyx_t_15);
            __pyx_r = __pyx_t_15;
            __pyx_t_15 = 0;
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            goto __pyx_L17_try_return;

            /* "amplpy/ampl.pyx":530
 *                 return int(value)
 *             except ValueError:
 *                 try:             # <<<<<<<<<<<<<<
 *                     return float(value)
 *                 except ValueError:
 */
          }
          __pyx_L13_error:;
          __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;

          /* "amplpy/ampl.pyx":532
 *                 try:
 *                     return float(value)
 *                 except ValueError:             # <<<<<<<<<<<<<<
 *                     return value
 * 
 */
          __pyx_t_11 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError);
          if (__pyx_t_11) {
            __Pyx_AddTraceback("_amplpy.AMPL.get_option", __pyx_clineno, __pyx_lineno, __pyx_filename);
            if (__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0) __PYX_ERR(3, 532, __pyx_L15_except_error)
            __Pyx_XGOTREF(__pyx_t_15);
            __Pyx_XGOTREF(__pyx_t_16);
            __Pyx_XGOTREF(__pyx_t_17);

            /* "amplpy/ampl.pyx":533
 *                     return float(value)
 *                 except ValueError:
 *                     return value             # <<<<<<<<<<<<<<
 * 
 *     def read(self, filename):
 */
            __Pyx_XDECREF(__pyx_r);
            __Pyx_INCREF(__pyx_v_value);
            __pyx_r = __pyx_v_value;
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
            __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
            __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
            goto __pyx_L16_except_return;
          }
          goto __pyx_L15_except_error;

          /* "amplpy/ampl.pyx":530
 *                 return int(value)
 *             except ValueError:
 *                 try:             # <<<<<<<<<<<<<<
 *                     return float(value)
 *                 except ValueError:
 */
          __pyx_L15_except_error:;
          __Pyx_XGIVEREF(__pyx_t_12);
          __Pyx_XGIVEREF(__pyx_t_13);
          __Pyx_XGIVEREF(__pyx_t_14);
          __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
          goto __pyx_L7_except_error;
          __pyx_L17_try_return:;
          __Pyx_XGIVEREF(__pyx_t_12);
          __Pyx_XGIVEREF(__pyx_t_13);
          __Pyx_XGIVEREF(__pyx_t_14);
          __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
          goto __pyx_L8_except_return;
          __pyx_L16_except_return:;
          __Pyx_XGIVEREF(__pyx_t_12);
          __Pyx_XGIVEREF(__pyx_t_13);
          __Pyx_XGIVEREF(__pyx_t_14);
          __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
          goto __pyx_L8_except_return;
        }
      }
      goto __pyx_L7_except_error;

      /* "amplpy/ampl.pyx":527
 *         campl.AMPL_StringFree(&value_c)
 *         if exists:
 *             try:             # <<<<<<<<<<<<<<
 *                 return int(value)
 *             except ValueError:
 */
      __pyx_L7_except_error:;
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_XGIVEREF(__pyx_t_9);
      __Pyx_XGIVEREF(__pyx_t_10);
      __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
      goto __pyx_L1_error;
      __pyx_L9_try_return:;
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_XGIVEREF(__pyx_t_9);
      __Pyx_XGIVEREF(__pyx_t_10);
      __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
      goto __pyx_L0;
      __pyx_L8_except_return:;
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_XGIVEREF(__pyx_t_9);
      __Pyx_XGIVEREF(__pyx_t_10);
      __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
      goto __pyx_L0;
    }

    /* "amplpy/ampl.pyx":526
 *         value = value_c.decode('utf-8')
 *         campl.AMPL_StringFree(&value_c)
 *         if exists:             # <<<<<<<<<<<<<<
 *             try:
 *                 return int(value)
 */
  }

  /* "amplpy/ampl.pyx":499
 *             raise TypeError
 * 
 *     def get_option(self, name):             # <<<<<<<<<<<<<<
 *         """
 *         Get the current value of the specified option. If the option does not
 */

  /* 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_15);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_XDECREF(__pyx_t_17);
  __Pyx_AddTraceback("_amplpy.AMPL.get_option", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/ampl.pyx":535
 *                     return value
 * 
 *     def read(self, filename):             # <<<<<<<<<<<<<<
 *         """
 *         Interprets the specified file (script or model or mixed) As a side
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_4AMPL_37read(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_4AMPL_36read, "AMPL.read(self, filename)\n\n        Interprets the specified file (script or model or mixed) As a side\n        effect, it invalidates all entities (as the passed file can contain any\n        arbitrary command); the lists of entities will be re-populated lazily\n        (at first access).\n\n        Args:\n            filename: Full path to the file.\n\n        Raises:\n            RuntimeError: in case the file does not exist.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_4AMPL_37read = {"read", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_37read, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_4AMPL_36read};
static PyObject *__pyx_pw_7_amplpy_4AMPL_37read(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_filename = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("read (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_filename,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_filename)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 535, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "read") < 0)) __PYX_ERR(3, 535, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_filename = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("read", 1, 1, 1, __pyx_nargs); __PYX_ERR(3, 535, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.AMPL.read", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_4AMPL_36read(((struct __pyx_obj_7_amplpy_AMPL *)__pyx_v_self), __pyx_v_filename);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_4AMPL_36read(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self, PyObject *__pyx_v_filename) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  char const *__pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("read", 1);

  /* "amplpy/ampl.pyx":548
 *             RuntimeError: in case the file does not exist.
 *         """
 *         PY_AMPL_CALL(campl.AMPL_Read(self._c_ampl, str(filename).encode('utf-8')))             # <<<<<<<<<<<<<<
 * 
 *     def read_data(self, filename):
 */
  __pyx_t_1 = __Pyx_PyObject_Unicode(__pyx_v_filename); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 548, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyUnicode_AsUTF8String(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 548, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyBytes_AsString(__pyx_t_2); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) __PYX_ERR(3, 548, __pyx_L1_error)
  __pyx_t_1 = __pyx_f_7_amplpy_PY_AMPL_CALL(AMPL_Read(__pyx_v_self->_c_ampl, __pyx_t_3)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 548, __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;

  /* "amplpy/ampl.pyx":535
 *                     return value
 * 
 *     def read(self, filename):             # <<<<<<<<<<<<<<
 *         """
 *         Interprets the specified file (script or model or mixed) As a side
 */

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

/* "amplpy/ampl.pyx":550
 *         PY_AMPL_CALL(campl.AMPL_Read(self._c_ampl, str(filename).encode('utf-8')))
 * 
 *     def read_data(self, filename):             # <<<<<<<<<<<<<<
 *         """
 *         Interprets the specified file as an AMPL data file. As a side effect,
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_4AMPL_39read_data(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_4AMPL_38read_data, "AMPL.read_data(self, filename)\n\n        Interprets the specified file as an AMPL data file. As a side effect,\n        it invalidates all entities (as the passed file can contain any\n        arbitrary command); the lists of entities will be re-populated lazily\n        (at first access). After reading the file, the interpreter is put back\n        to \"model\" mode.\n\n        Args:\n            filename: Full path to the file.\n\n        Raises:\n            RuntimeError: in case the file does not exist.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_4AMPL_39read_data = {"read_data", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_39read_data, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_4AMPL_38read_data};
static PyObject *__pyx_pw_7_amplpy_4AMPL_39read_data(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_filename = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("read_data (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_filename,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_filename)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 550, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "read_data") < 0)) __PYX_ERR(3, 550, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_filename = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("read_data", 1, 1, 1, __pyx_nargs); __PYX_ERR(3, 550, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.AMPL.read_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_4AMPL_38read_data(((struct __pyx_obj_7_amplpy_AMPL *)__pyx_v_self), __pyx_v_filename);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_4AMPL_38read_data(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self, PyObject *__pyx_v_filename) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  char const *__pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("read_data", 1);

  /* "amplpy/ampl.pyx":564
 *             RuntimeError: in case the file does not exist.
 *         """
 *         PY_AMPL_CALL(campl.AMPL_ReadData(self._c_ampl, str(filename).encode('utf-8')))             # <<<<<<<<<<<<<<
 * 
 *     def get_value(self, scalar_expression):
 */
  __pyx_t_1 = __Pyx_PyObject_Unicode(__pyx_v_filename); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 564, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyUnicode_AsUTF8String(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 564, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyBytes_AsString(__pyx_t_2); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) __PYX_ERR(3, 564, __pyx_L1_error)
  __pyx_t_1 = __pyx_f_7_amplpy_PY_AMPL_CALL(AMPL_ReadData(__pyx_v_self->_c_ampl, __pyx_t_3)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 564, __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;

  /* "amplpy/ampl.pyx":550
 *         PY_AMPL_CALL(campl.AMPL_Read(self._c_ampl, str(filename).encode('utf-8')))
 * 
 *     def read_data(self, filename):             # <<<<<<<<<<<<<<
 *         """
 *         Interprets the specified file as an AMPL data file. As a side effect,
 */

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

/* "amplpy/ampl.pyx":566
 *         PY_AMPL_CALL(campl.AMPL_ReadData(self._c_ampl, str(filename).encode('utf-8')))
 * 
 *     def get_value(self, scalar_expression):             # <<<<<<<<<<<<<<
 *         """
 *         Get a scalar value from the underlying AMPL interpreter, as a double or
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_4AMPL_41get_value(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_4AMPL_40get_value, "AMPL.get_value(self, scalar_expression)\n\n        Get a scalar value from the underlying AMPL interpreter, as a double or\n        a string.\n\n        Args:\n            scalar_expression: An AMPL expression which evaluates to a scalar\n            value.\n\n        Returns:\n            The value of the expression.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_4AMPL_41get_value = {"get_value", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_41get_value, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_4AMPL_40get_value};
static PyObject *__pyx_pw_7_amplpy_4AMPL_41get_value(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_scalar_expression = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_value (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_scalar_expression,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_scalar_expression)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 566, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get_value") < 0)) __PYX_ERR(3, 566, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_scalar_expression = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_value", 1, 1, 1, __pyx_nargs); __PYX_ERR(3, 566, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.AMPL.get_value", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_4AMPL_40get_value(((struct __pyx_obj_7_amplpy_AMPL *)__pyx_v_self), __pyx_v_scalar_expression);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_4AMPL_40get_value(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self, PyObject *__pyx_v_scalar_expression) {
  AMPL_ERRORINFO *__pyx_v_errorinfo;
  AMPL_RETCODE __pyx_v_rc;
  AMPL_VARIANT *__pyx_v_v;
  PyObject *__pyx_v_py_variant = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  char const *__pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_value", 1);

  /* "amplpy/ampl.pyx":581
 *         cdef campl.AMPL_RETCODE rc
 *         cdef campl.AMPL_VARIANT* v
 *         errorinfo = campl.AMPL_GetValue(self._c_ampl, scalar_expression.encode('utf-8'), &v)             # <<<<<<<<<<<<<<
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_scalar_expression, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 581, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_u_utf_8};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 581, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_t_5 = __Pyx_PyObject_AsString(__pyx_t_1); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) __PYX_ERR(3, 581, __pyx_L1_error)
  __pyx_v_errorinfo = AMPL_GetValue(__pyx_v_self->_c_ampl, __pyx_t_5, (&__pyx_v_v));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "amplpy/ampl.pyx":582
 *         cdef campl.AMPL_VARIANT* v
 *         errorinfo = campl.AMPL_GetValue(self._c_ampl, scalar_expression.encode('utf-8'), &v)
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)             # <<<<<<<<<<<<<<
 *         if rc != campl.AMPL_OK:
 *             campl.AMPL_VariantFree(&v)
 */
  __pyx_v_rc = AMPL_ErrorInfoGetError(__pyx_v_errorinfo);

  /* "amplpy/ampl.pyx":583
 *         errorinfo = campl.AMPL_GetValue(self._c_ampl, scalar_expression.encode('utf-8'), &v)
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:             # <<<<<<<<<<<<<<
 *             campl.AMPL_VariantFree(&v)
 *             PY_AMPL_CALL(errorinfo)
 */
  __pyx_t_6 = (__pyx_v_rc != AMPL_OK);
  if (__pyx_t_6) {

    /* "amplpy/ampl.pyx":584
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:
 *             campl.AMPL_VariantFree(&v)             # <<<<<<<<<<<<<<
 *             PY_AMPL_CALL(errorinfo)
 * 
 */
    (void)(AMPL_VariantFree((&__pyx_v_v)));

    /* "amplpy/ampl.pyx":585
 *         if rc != campl.AMPL_OK:
 *             campl.AMPL_VariantFree(&v)
 *             PY_AMPL_CALL(errorinfo)             # <<<<<<<<<<<<<<
 * 
 *         py_variant = to_py_variant(v)
 */
    __pyx_t_1 = __pyx_f_7_amplpy_PY_AMPL_CALL(__pyx_v_errorinfo); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 585, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "amplpy/ampl.pyx":583
 *         errorinfo = campl.AMPL_GetValue(self._c_ampl, scalar_expression.encode('utf-8'), &v)
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:             # <<<<<<<<<<<<<<
 *             campl.AMPL_VariantFree(&v)
 *             PY_AMPL_CALL(errorinfo)
 */
  }

  /* "amplpy/ampl.pyx":587
 *             PY_AMPL_CALL(errorinfo)
 * 
 *         py_variant = to_py_variant(v)             # <<<<<<<<<<<<<<
 *         campl.AMPL_VariantFree(&v)
 * 
 */
  __pyx_t_1 = __pyx_f_7_amplpy_to_py_variant(__pyx_v_v); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 587, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_py_variant = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "amplpy/ampl.pyx":588
 * 
 *         py_variant = to_py_variant(v)
 *         campl.AMPL_VariantFree(&v)             # <<<<<<<<<<<<<<
 * 
 *         return py_variant
 */
  (void)(AMPL_VariantFree((&__pyx_v_v)));

  /* "amplpy/ampl.pyx":590
 *         campl.AMPL_VariantFree(&v)
 * 
 *         return py_variant             # <<<<<<<<<<<<<<
 * 
 *     def set_data(self, data, set_name=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_py_variant);
  __pyx_r = __pyx_v_py_variant;
  goto __pyx_L0;

  /* "amplpy/ampl.pyx":566
 *         PY_AMPL_CALL(campl.AMPL_ReadData(self._c_ampl, str(filename).encode('utf-8')))
 * 
 *     def get_value(self, scalar_expression):             # <<<<<<<<<<<<<<
 *         """
 *         Get a scalar value from the underlying AMPL interpreter, as a double or
 */

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

/* "amplpy/ampl.pyx":592
 *         return py_variant
 * 
 *     def set_data(self, data, set_name=None):             # <<<<<<<<<<<<<<
 *         """
 *         Assign the data in the dataframe to the AMPL entities with the names
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_4AMPL_43set_data(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_4AMPL_42set_data, "AMPL.set_data(self, data, set_name=None)\n\n        Assign the data in the dataframe to the AMPL entities with the names\n        corresponding to the column names.\n\n        Args:\n            data: The dataframe containing the data to be assigned.\n\n            set_name: The name of the set to which the indices values of the\n            DataFrame are to be assigned.\n\n        Raises:\n            AMPLException: if the data assignment procedure was not successful.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_4AMPL_43set_data = {"set_data", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_43set_data, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_4AMPL_42set_data};
static PyObject *__pyx_pw_7_amplpy_4AMPL_43set_data(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_data = 0;
  PyObject *__pyx_v_set_name = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_data (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,&__pyx_n_s_set_name,0};
    values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 592, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_set_name);
          if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 592, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_data") < 0)) __PYX_ERR(3, 592, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_data = values[0];
    __pyx_v_set_name = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_data", 0, 1, 2, __pyx_nargs); __PYX_ERR(3, 592, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.AMPL.set_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_4AMPL_42set_data(((struct __pyx_obj_7_amplpy_AMPL *)__pyx_v_self), __pyx_v_data, __pyx_v_set_name);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_4AMPL_42set_data(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self, PyObject *__pyx_v_data, PyObject *__pyx_v_set_name) {
  struct __pyx_obj_7_amplpy_DataFrame *__pyx_v_data_frame = 0;
  AMPL_DATAFRAME *__pyx_v_data_c;
  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;
  int __pyx_t_6;
  unsigned int __pyx_t_7;
  AMPL_DATAFRAME *__pyx_t_8;
  char const *__pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_data", 0);
  __Pyx_INCREF(__pyx_v_data);

  /* "amplpy/ampl.pyx":606
 *             AMPLException: if the data assignment procedure was not successful.
 *         """
 *         if not isinstance(data, DataFrame):             # <<<<<<<<<<<<<<
 *             if pd is not None and isinstance(data, (pd.DataFrame, pd.Series)):
 *                 data = DataFrame.from_pandas(data)
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_data, __pyx_ptype_7_amplpy_DataFrame); 
  __pyx_t_2 = (!__pyx_t_1);
  if (__pyx_t_2) {

    /* "amplpy/ampl.pyx":607
 *         """
 *         if not isinstance(data, DataFrame):
 *             if pd is not None and isinstance(data, (pd.DataFrame, pd.Series)):             # <<<<<<<<<<<<<<
 *                 data = DataFrame.from_pandas(data)
 *         cdef DataFrame data_frame = data
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pd); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 607, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = (__pyx_t_3 != Py_None);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_1) {
    } else {
      __pyx_t_2 = __pyx_t_1;
      goto __pyx_L5_bool_binop_done;
    }
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pd); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 607, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_DataFrame); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 607, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pd); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 607, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Series); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 607, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_6 = PyObject_IsInstance(__pyx_v_data, __pyx_t_4); 
    if (!__pyx_t_6) {
    } else {
      __pyx_t_1 = __pyx_t_6;
      goto __pyx_L7_bool_binop_done;
    }
    __pyx_t_6 = PyObject_IsInstance(__pyx_v_data, __pyx_t_5); 
    __pyx_t_1 = __pyx_t_6;
    __pyx_L7_bool_binop_done:;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_2 = __pyx_t_1;
    __pyx_L5_bool_binop_done:;
    if (__pyx_t_2) {

      /* "amplpy/ampl.pyx":608
 *         if not isinstance(data, DataFrame):
 *             if pd is not None and isinstance(data, (pd.DataFrame, pd.Series)):
 *                 data = DataFrame.from_pandas(data)             # <<<<<<<<<<<<<<
 *         cdef DataFrame data_frame = data
 *         cdef campl.AMPL_DATAFRAME* data_c = data_frame.get_ptr()
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7_amplpy_DataFrame), __pyx_n_s_from_pandas); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 608, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = NULL;
      __pyx_t_7 = 0;
      #if CYTHON_UNPACK_METHODS
      if (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);
          __pyx_t_7 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_data};
        __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 608, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      }
      __Pyx_DECREF_SET(__pyx_v_data, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "amplpy/ampl.pyx":607
 *         """
 *         if not isinstance(data, DataFrame):
 *             if pd is not None and isinstance(data, (pd.DataFrame, pd.Series)):             # <<<<<<<<<<<<<<
 *                 data = DataFrame.from_pandas(data)
 *         cdef DataFrame data_frame = data
 */
    }

    /* "amplpy/ampl.pyx":606
 *             AMPLException: if the data assignment procedure was not successful.
 *         """
 *         if not isinstance(data, DataFrame):             # <<<<<<<<<<<<<<
 *             if pd is not None and isinstance(data, (pd.DataFrame, pd.Series)):
 *                 data = DataFrame.from_pandas(data)
 */
  }

  /* "amplpy/ampl.pyx":609
 *             if pd is not None and isinstance(data, (pd.DataFrame, pd.Series)):
 *                 data = DataFrame.from_pandas(data)
 *         cdef DataFrame data_frame = data             # <<<<<<<<<<<<<<
 *         cdef campl.AMPL_DATAFRAME* data_c = data_frame.get_ptr()
 *         if set_name is None:
 */
  if (!(likely(((__pyx_v_data) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_data, __pyx_ptype_7_amplpy_DataFrame))))) __PYX_ERR(3, 609, __pyx_L1_error)
  __pyx_t_4 = __pyx_v_data;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_v_data_frame = ((struct __pyx_obj_7_amplpy_DataFrame *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "amplpy/ampl.pyx":610
 *                 data = DataFrame.from_pandas(data)
 *         cdef DataFrame data_frame = data
 *         cdef campl.AMPL_DATAFRAME* data_c = data_frame.get_ptr()             # <<<<<<<<<<<<<<
 *         if set_name is None:
 *             PY_AMPL_CALL(campl.AMPL_SetData(self._c_ampl, data_c, ""))
 */
  __pyx_t_8 = ((struct __pyx_vtabstruct_7_amplpy_DataFrame *)__pyx_v_data_frame->__pyx_vtab)->get_ptr(__pyx_v_data_frame); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 610, __pyx_L1_error)
  __pyx_v_data_c = __pyx_t_8;

  /* "amplpy/ampl.pyx":611
 *         cdef DataFrame data_frame = data
 *         cdef campl.AMPL_DATAFRAME* data_c = data_frame.get_ptr()
 *         if set_name is None:             # <<<<<<<<<<<<<<
 *             PY_AMPL_CALL(campl.AMPL_SetData(self._c_ampl, data_c, ""))
 *         else:
 */
  __pyx_t_2 = (__pyx_v_set_name == Py_None);
  if (__pyx_t_2) {

    /* "amplpy/ampl.pyx":612
 *         cdef campl.AMPL_DATAFRAME* data_c = data_frame.get_ptr()
 *         if set_name is None:
 *             PY_AMPL_CALL(campl.AMPL_SetData(self._c_ampl, data_c, ""))             # <<<<<<<<<<<<<<
 *         else:
 *             PY_AMPL_CALL(campl.AMPL_SetData(self._c_ampl, data_c, set_name.encode('utf-8')))
 */
    __pyx_t_4 = __pyx_f_7_amplpy_PY_AMPL_CALL(AMPL_SetData(__pyx_v_self->_c_ampl, __pyx_v_data_c, ((char const *)""))); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 612, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "amplpy/ampl.pyx":611
 *         cdef DataFrame data_frame = data
 *         cdef campl.AMPL_DATAFRAME* data_c = data_frame.get_ptr()
 *         if set_name is None:             # <<<<<<<<<<<<<<
 *             PY_AMPL_CALL(campl.AMPL_SetData(self._c_ampl, data_c, ""))
 *         else:
 */
    goto __pyx_L9;
  }

  /* "amplpy/ampl.pyx":614
 *             PY_AMPL_CALL(campl.AMPL_SetData(self._c_ampl, data_c, ""))
 *         else:
 *             PY_AMPL_CALL(campl.AMPL_SetData(self._c_ampl, data_c, set_name.encode('utf-8')))             # <<<<<<<<<<<<<<
 * 
 *     def read_table(self, table_name):
 */
  /*else*/ {
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_set_name, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 614, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (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);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_u_utf_8};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 614, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __pyx_t_9 = __Pyx_PyObject_AsString(__pyx_t_4); if (unlikely((!__pyx_t_9) && PyErr_Occurred())) __PYX_ERR(3, 614, __pyx_L1_error)
    __pyx_t_5 = __pyx_f_7_amplpy_PY_AMPL_CALL(AMPL_SetData(__pyx_v_self->_c_ampl, __pyx_v_data_c, __pyx_t_9)); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 614, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __pyx_L9:;

  /* "amplpy/ampl.pyx":592
 *         return py_variant
 * 
 *     def set_data(self, data, set_name=None):             # <<<<<<<<<<<<<<
 *         """
 *         Assign the data in the dataframe to the AMPL entities with the names
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("_amplpy.AMPL.set_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_data_frame);
  __Pyx_XDECREF(__pyx_v_data);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/ampl.pyx":616
 *             PY_AMPL_CALL(campl.AMPL_SetData(self._c_ampl, data_c, set_name.encode('utf-8')))
 * 
 *     def read_table(self, table_name):             # <<<<<<<<<<<<<<
 *         """
 *         Read the table corresponding to the specified name, equivalent to the
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_4AMPL_45read_table(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_4AMPL_44read_table, "AMPL.read_table(self, table_name)\n\n        Read the table corresponding to the specified name, equivalent to the\n        AMPL statement:\n\n        .. code-block:: ampl\n\n            read table table_name;\n\n        Args:\n            table_name: Name of the table to be read.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_4AMPL_45read_table = {"read_table", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_45read_table, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_4AMPL_44read_table};
static PyObject *__pyx_pw_7_amplpy_4AMPL_45read_table(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_table_name = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("read_table (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_table_name,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_table_name)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 616, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "read_table") < 0)) __PYX_ERR(3, 616, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_table_name = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("read_table", 1, 1, 1, __pyx_nargs); __PYX_ERR(3, 616, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.AMPL.read_table", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_4AMPL_44read_table(((struct __pyx_obj_7_amplpy_AMPL *)__pyx_v_self), __pyx_v_table_name);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_4AMPL_44read_table(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self, PyObject *__pyx_v_table_name) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  char const *__pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("read_table", 1);

  /* "amplpy/ampl.pyx":628
 *             table_name: Name of the table to be read.
 *         """
 *         PY_AMPL_CALL(campl.AMPL_ReadTable(self._c_ampl, table_name.encode('utf-8')))             # <<<<<<<<<<<<<<
 * 
 *     def write_table(self, table_name):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_table_name, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 628, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_u_utf_8};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 628, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_t_5 = __Pyx_PyObject_AsString(__pyx_t_1); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) __PYX_ERR(3, 628, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_7_amplpy_PY_AMPL_CALL(AMPL_ReadTable(__pyx_v_self->_c_ampl, __pyx_t_5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 628, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "amplpy/ampl.pyx":616
 *             PY_AMPL_CALL(campl.AMPL_SetData(self._c_ampl, data_c, set_name.encode('utf-8')))
 * 
 *     def read_table(self, table_name):             # <<<<<<<<<<<<<<
 *         """
 *         Read the table corresponding to the specified name, equivalent to the
 */

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

/* "amplpy/ampl.pyx":630
 *         PY_AMPL_CALL(campl.AMPL_ReadTable(self._c_ampl, table_name.encode('utf-8')))
 * 
 *     def write_table(self, table_name):             # <<<<<<<<<<<<<<
 *         """
 *         Write the table corresponding to the specified name, equivalent to the
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_4AMPL_47write_table(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_4AMPL_46write_table, "AMPL.write_table(self, table_name)\n\n        Write the table corresponding to the specified name, equivalent to the\n        AMPL statement\n\n        .. code-block:: ampl\n\n            write table table_name;\n\n        Args:\n            table_name: Name of the table to be written.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_4AMPL_47write_table = {"write_table", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_47write_table, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_4AMPL_46write_table};
static PyObject *__pyx_pw_7_amplpy_4AMPL_47write_table(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_table_name = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("write_table (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_table_name,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_table_name)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 630, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "write_table") < 0)) __PYX_ERR(3, 630, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_table_name = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("write_table", 1, 1, 1, __pyx_nargs); __PYX_ERR(3, 630, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.AMPL.write_table", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_4AMPL_46write_table(((struct __pyx_obj_7_amplpy_AMPL *)__pyx_v_self), __pyx_v_table_name);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_4AMPL_46write_table(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self, PyObject *__pyx_v_table_name) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  char const *__pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("write_table", 1);

  /* "amplpy/ampl.pyx":642
 *             table_name: Name of the table to be written.
 *         """
 *         PY_AMPL_CALL(campl.AMPL_WriteTable(self._c_ampl, table_name.encode('utf-8')))             # <<<<<<<<<<<<<<
 * 
 *     def display(self, *ampl_expressions):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_table_name, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 642, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_u_utf_8};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 642, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_t_5 = __Pyx_PyObject_AsString(__pyx_t_1); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) __PYX_ERR(3, 642, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_7_amplpy_PY_AMPL_CALL(AMPL_WriteTable(__pyx_v_self->_c_ampl, __pyx_t_5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 642, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "amplpy/ampl.pyx":630
 *         PY_AMPL_CALL(campl.AMPL_ReadTable(self._c_ampl, table_name.encode('utf-8')))
 * 
 *     def write_table(self, table_name):             # <<<<<<<<<<<<<<
 *         """
 *         Write the table corresponding to the specified name, equivalent to the
 */

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

/* "amplpy/ampl.pyx":644
 *         PY_AMPL_CALL(campl.AMPL_WriteTable(self._c_ampl, table_name.encode('utf-8')))
 * 
 *     def display(self, *ampl_expressions):             # <<<<<<<<<<<<<<
 *         """
 *         Writes on the current OutputHandler the outcome of the AMPL statement.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_4AMPL_49display(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_4AMPL_48display, "AMPL.display(self, *ampl_expressions)\n\n        Writes on the current OutputHandler the outcome of the AMPL statement.\n\n        .. code-block:: ampl\n\n            display e1, e2, .., en;\n\n        where e1, ..., en are the strings passed to the procedure.\n\n        Args:\n            ampl_expressions: Expressions to be evaluated.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_4AMPL_49display = {"display", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7_amplpy_4AMPL_49display, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7_amplpy_4AMPL_48display};
static PyObject *__pyx_pw_7_amplpy_4AMPL_49display(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_ampl_expressions = 0;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("display (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "display", 0))) return NULL;
  __Pyx_INCREF(__pyx_args);
  __pyx_v_ampl_expressions = __pyx_args;
  __pyx_r = __pyx_pf_7_amplpy_4AMPL_48display(((struct __pyx_obj_7_amplpy_AMPL *)__pyx_v_self), __pyx_v_ampl_expressions);

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

static PyObject *__pyx_pf_7_amplpy_4AMPL_48display(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self, PyObject *__pyx_v_ampl_expressions) {
  AMPL_ERRORINFO *__pyx_v_errorinfo;
  AMPL_RETCODE __pyx_v_rc;
  PyObject *__pyx_v_exprs = NULL;
  int __pyx_v_size;
  char const **__pyx_v_array;
  int __pyx_v_i;
  PyObject *__pyx_v_display = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  unsigned int __pyx_t_9;
  char const *__pyx_t_10;
  char const *__pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("display", 1);

  /* "amplpy/ampl.pyx":659
 *         cdef campl.AMPL_ERRORINFO* errorinfo
 *         cdef campl.AMPL_RETCODE rc
 *         exprs = list(map(str, ampl_expressions))             # <<<<<<<<<<<<<<
 *         cdef int size = len(exprs)
 *         cdef const char** array = <const char**>malloc(size * sizeof(const char*))
 */
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 659, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF((PyObject *)(&PyUnicode_Type));
  __Pyx_GIVEREF((PyObject *)(&PyUnicode_Type));
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)(&PyUnicode_Type)))) __PYX_ERR(3, 659, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_ampl_expressions);
  __Pyx_GIVEREF(__pyx_v_ampl_expressions);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_ampl_expressions)) __PYX_ERR(3, 659, __pyx_L1_error);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 659, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PySequence_ListKeepNew(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 659, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_exprs = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "amplpy/ampl.pyx":660
 *         cdef campl.AMPL_RETCODE rc
 *         exprs = list(map(str, ampl_expressions))
 *         cdef int size = len(exprs)             # <<<<<<<<<<<<<<
 *         cdef const char** array = <const char**>malloc(size * sizeof(const char*))
 *         if array == NULL:
 */
  __pyx_t_3 = __Pyx_PyList_GET_SIZE(__pyx_v_exprs); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(3, 660, __pyx_L1_error)
  __pyx_v_size = __pyx_t_3;

  /* "amplpy/ampl.pyx":661
 *         exprs = list(map(str, ampl_expressions))
 *         cdef int size = len(exprs)
 *         cdef const char** array = <const char**>malloc(size * sizeof(const char*))             # <<<<<<<<<<<<<<
 *         if array == NULL:
 *             raise MemoryError("Unable to allocate memory for array of strings")
 */
  __pyx_v_array = ((char const **)malloc((__pyx_v_size * (sizeof(char const *)))));

  /* "amplpy/ampl.pyx":662
 *         cdef int size = len(exprs)
 *         cdef const char** array = <const char**>malloc(size * sizeof(const char*))
 *         if array == NULL:             # <<<<<<<<<<<<<<
 *             raise MemoryError("Unable to allocate memory for array of strings")
 * 
 */
  __pyx_t_4 = (__pyx_v_array == NULL);
  if (unlikely(__pyx_t_4)) {

    /* "amplpy/ampl.pyx":663
 *         cdef const char** array = <const char**>malloc(size * sizeof(const char*))
 *         if array == NULL:
 *             raise MemoryError("Unable to allocate memory for array of strings")             # <<<<<<<<<<<<<<
 * 
 *         for i in range(size):
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__43, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 663, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(3, 663, __pyx_L1_error)

    /* "amplpy/ampl.pyx":662
 *         cdef int size = len(exprs)
 *         cdef const char** array = <const char**>malloc(size * sizeof(const char*))
 *         if array == NULL:             # <<<<<<<<<<<<<<
 *             raise MemoryError("Unable to allocate memory for array of strings")
 * 
 */
  }

  /* "amplpy/ampl.pyx":665
 *             raise MemoryError("Unable to allocate memory for array of strings")
 * 
 *         for i in range(size):             # <<<<<<<<<<<<<<
 *             array[i] = strdup(exprs[i].encode('utf-8'))
 * 
 */
  __pyx_t_5 = __pyx_v_size;
  __pyx_t_6 = __pyx_t_5;
  for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
    __pyx_v_i = __pyx_t_7;

    /* "amplpy/ampl.pyx":666
 * 
 *         for i in range(size):
 *             array[i] = strdup(exprs[i].encode('utf-8'))             # <<<<<<<<<<<<<<
 * 
 *         display = "display"
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(PyList_GET_ITEM(__pyx_v_exprs, __pyx_v_i), __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 666, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_8 = NULL;
    __pyx_t_9 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_9 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_kp_u_utf_8};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9);
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 666, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __pyx_t_10 = __Pyx_PyObject_AsString(__pyx_t_1); if (unlikely((!__pyx_t_10) && PyErr_Occurred())) __PYX_ERR(3, 666, __pyx_L1_error)
    (__pyx_v_array[__pyx_v_i]) = strdup(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "amplpy/ampl.pyx":668
 *             array[i] = strdup(exprs[i].encode('utf-8'))
 * 
 *         display = "display"             # <<<<<<<<<<<<<<
 *         errorinfo = campl.AMPL_CallVisualisationCommandOnNames(self._c_ampl, display.encode('utf-8'), <const char* const*>array, size)
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 */
  __Pyx_INCREF(__pyx_n_u_display);
  __pyx_v_display = __pyx_n_u_display;

  /* "amplpy/ampl.pyx":669
 * 
 *         display = "display"
 *         errorinfo = campl.AMPL_CallVisualisationCommandOnNames(self._c_ampl, display.encode('utf-8'), <const char* const*>array, size)             # <<<<<<<<<<<<<<
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         for i in range(size):
 */
  __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 669, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_11 = __Pyx_PyBytes_AsString(__pyx_t_1); if (unlikely((!__pyx_t_11) && PyErr_Occurred())) __PYX_ERR(3, 669, __pyx_L1_error)
  __pyx_v_errorinfo = AMPL_CallVisualisationCommandOnNames(__pyx_v_self->_c_ampl, __pyx_t_11, ((char const *const *)__pyx_v_array), __pyx_v_size);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "amplpy/ampl.pyx":670
 *         display = "display"
 *         errorinfo = campl.AMPL_CallVisualisationCommandOnNames(self._c_ampl, display.encode('utf-8'), <const char* const*>array, size)
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)             # <<<<<<<<<<<<<<
 *         for i in range(size):
 *             free(array[i])
 */
  __pyx_v_rc = AMPL_ErrorInfoGetError(__pyx_v_errorinfo);

  /* "amplpy/ampl.pyx":671
 *         errorinfo = campl.AMPL_CallVisualisationCommandOnNames(self._c_ampl, display.encode('utf-8'), <const char* const*>array, size)
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         for i in range(size):             # <<<<<<<<<<<<<<
 *             free(array[i])
 *         free(array)
 */
  __pyx_t_5 = __pyx_v_size;
  __pyx_t_6 = __pyx_t_5;
  for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
    __pyx_v_i = __pyx_t_7;

    /* "amplpy/ampl.pyx":672
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         for i in range(size):
 *             free(array[i])             # <<<<<<<<<<<<<<
 *         free(array)
 *         if rc != campl.AMPL_OK:
 */
    free((__pyx_v_array[__pyx_v_i]));
  }

  /* "amplpy/ampl.pyx":673
 *         for i in range(size):
 *             free(array[i])
 *         free(array)             # <<<<<<<<<<<<<<
 *         if rc != campl.AMPL_OK:
 *             PY_AMPL_CALL(errorinfo)
 */
  free(__pyx_v_array);

  /* "amplpy/ampl.pyx":674
 *             free(array[i])
 *         free(array)
 *         if rc != campl.AMPL_OK:             # <<<<<<<<<<<<<<
 *             PY_AMPL_CALL(errorinfo)
 * 
 */
  __pyx_t_4 = (__pyx_v_rc != AMPL_OK);
  if (__pyx_t_4) {

    /* "amplpy/ampl.pyx":675
 *         free(array)
 *         if rc != campl.AMPL_OK:
 *             PY_AMPL_CALL(errorinfo)             # <<<<<<<<<<<<<<
 * 
 *     def set_output_handler(self, output_handler):
 */
    __pyx_t_1 = __pyx_f_7_amplpy_PY_AMPL_CALL(__pyx_v_errorinfo); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 675, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "amplpy/ampl.pyx":674
 *             free(array[i])
 *         free(array)
 *         if rc != campl.AMPL_OK:             # <<<<<<<<<<<<<<
 *             PY_AMPL_CALL(errorinfo)
 * 
 */
  }

  /* "amplpy/ampl.pyx":644
 *         PY_AMPL_CALL(campl.AMPL_WriteTable(self._c_ampl, table_name.encode('utf-8')))
 * 
 *     def display(self, *ampl_expressions):             # <<<<<<<<<<<<<<
 *         """
 *         Writes on the current OutputHandler the outcome of the AMPL statement.
 */

  /* 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_8);
  __Pyx_AddTraceback("_amplpy.AMPL.display", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_exprs);
  __Pyx_XDECREF(__pyx_v_display);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/ampl.pyx":677
 *             PY_AMPL_CALL(errorinfo)
 * 
 *     def set_output_handler(self, output_handler):             # <<<<<<<<<<<<<<
 *         """
 *         Sets a new output handler.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_4AMPL_51set_output_handler(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_4AMPL_50set_output_handler, "AMPL.set_output_handler(self, output_handler)\n\n        Sets a new output handler.\n\n        Args:\n            output_handler: The function handling the AMPL output derived from\n            interpreting user commands.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_4AMPL_51set_output_handler = {"set_output_handler", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_51set_output_handler, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_4AMPL_50set_output_handler};
static PyObject *__pyx_pw_7_amplpy_4AMPL_51set_output_handler(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_output_handler = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_output_handler (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_output_handler,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_output_handler)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 677, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_output_handler") < 0)) __PYX_ERR(3, 677, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_output_handler = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_output_handler", 1, 1, 1, __pyx_nargs); __PYX_ERR(3, 677, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.AMPL.set_output_handler", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_4AMPL_50set_output_handler(((struct __pyx_obj_7_amplpy_AMPL *)__pyx_v_self), __pyx_v_output_handler);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_4AMPL_50set_output_handler(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self, PyObject *__pyx_v_output_handler) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_output_handler", 1);

  /* "amplpy/ampl.pyx":685
 *             interpreting user commands.
 *         """
 *         self._output_handler = output_handler             # <<<<<<<<<<<<<<
 *         PY_AMPL_CALL(campl.AMPL_SetOutputHandler(self._c_ampl, PyOutput, <void*>output_handler))
 * 
 */
  __Pyx_INCREF(__pyx_v_output_handler);
  __Pyx_GIVEREF(__pyx_v_output_handler);
  __Pyx_GOTREF(__pyx_v_self->_output_handler);
  __Pyx_DECREF(__pyx_v_self->_output_handler);
  __pyx_v_self->_output_handler = __pyx_v_output_handler;

  /* "amplpy/ampl.pyx":686
 *         """
 *         self._output_handler = output_handler
 *         PY_AMPL_CALL(campl.AMPL_SetOutputHandler(self._c_ampl, PyOutput, <void*>output_handler))             # <<<<<<<<<<<<<<
 * 
 *     def set_error_handler(self, error_handler):
 */
  __pyx_t_1 = __pyx_f_7_amplpy_PY_AMPL_CALL(AMPL_SetOutputHandler(__pyx_v_self->_c_ampl, __pyx_f_7_amplpy_PyOutput, ((void *)__pyx_v_output_handler))); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 686, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "amplpy/ampl.pyx":677
 *             PY_AMPL_CALL(errorinfo)
 * 
 *     def set_output_handler(self, output_handler):             # <<<<<<<<<<<<<<
 *         """
 *         Sets a new output handler.
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("_amplpy.AMPL.set_output_handler", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/ampl.pyx":688
 *         PY_AMPL_CALL(campl.AMPL_SetOutputHandler(self._c_ampl, PyOutput, <void*>output_handler))
 * 
 *     def set_error_handler(self, error_handler):             # <<<<<<<<<<<<<<
 *         """
 *         Sets a new error handler.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_4AMPL_53set_error_handler(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_4AMPL_52set_error_handler, "AMPL.set_error_handler(self, error_handler)\n\n        Sets a new error handler.\n\n        Args:\n            error_handler: The object handling AMPL errors and warnings.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_4AMPL_53set_error_handler = {"set_error_handler", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_53set_error_handler, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_4AMPL_52set_error_handler};
static PyObject *__pyx_pw_7_amplpy_4AMPL_53set_error_handler(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_error_handler = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_error_handler (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_error_handler,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_error_handler)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 688, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_error_handler") < 0)) __PYX_ERR(3, 688, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_error_handler = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_error_handler", 1, 1, 1, __pyx_nargs); __PYX_ERR(3, 688, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.AMPL.set_error_handler", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_4AMPL_52set_error_handler(((struct __pyx_obj_7_amplpy_AMPL *)__pyx_v_self), __pyx_v_error_handler);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_4AMPL_52set_error_handler(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self, PyObject *__pyx_v_error_handler) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_error_handler", 1);

  /* "amplpy/ampl.pyx":695
 *             error_handler: The object handling AMPL errors and warnings.
 *         """
 *         self._error_handler = error_handler             # <<<<<<<<<<<<<<
 *         PY_AMPL_CALL(campl.AMPL_SetErrorHandler(self._c_ampl, <void*>error_handler, PyError))
 * 
 */
  __Pyx_INCREF(__pyx_v_error_handler);
  __Pyx_GIVEREF(__pyx_v_error_handler);
  __Pyx_GOTREF(__pyx_v_self->_error_handler);
  __Pyx_DECREF(__pyx_v_self->_error_handler);
  __pyx_v_self->_error_handler = __pyx_v_error_handler;

  /* "amplpy/ampl.pyx":696
 *         """
 *         self._error_handler = error_handler
 *         PY_AMPL_CALL(campl.AMPL_SetErrorHandler(self._c_ampl, <void*>error_handler, PyError))             # <<<<<<<<<<<<<<
 * 
 *     def get_output_handler(self):
 */
  __pyx_t_1 = __pyx_f_7_amplpy_PY_AMPL_CALL(AMPL_SetErrorHandler(__pyx_v_self->_c_ampl, ((void *)__pyx_v_error_handler), __pyx_f_7_amplpy_PyError)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 696, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "amplpy/ampl.pyx":688
 *         PY_AMPL_CALL(campl.AMPL_SetOutputHandler(self._c_ampl, PyOutput, <void*>output_handler))
 * 
 *     def set_error_handler(self, error_handler):             # <<<<<<<<<<<<<<
 *         """
 *         Sets a new error handler.
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("_amplpy.AMPL.set_error_handler", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/ampl.pyx":698
 *         PY_AMPL_CALL(campl.AMPL_SetErrorHandler(self._c_ampl, <void*>error_handler, PyError))
 * 
 *     def get_output_handler(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the current output handler.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_4AMPL_55get_output_handler(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_4AMPL_54get_output_handler, "AMPL.get_output_handler(self)\n\n        Get the current output handler.\n\n        Returns:\n            The current output handler.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_4AMPL_55get_output_handler = {"get_output_handler", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_55get_output_handler, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_4AMPL_54get_output_handler};
static PyObject *__pyx_pw_7_amplpy_4AMPL_55get_output_handler(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_output_handler (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("get_output_handler", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_output_handler", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_4AMPL_54get_output_handler(((struct __pyx_obj_7_amplpy_AMPL *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_4AMPL_54get_output_handler(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self) {
  void *__pyx_v_output_handler;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_output_handler", 1);

  /* "amplpy/ampl.pyx":706
 *         """
 *         cdef void* output_handler
 *         output_handler = campl.AMPL_GetOutputHandler(self._c_ampl)             # <<<<<<<<<<<<<<
 *         return <OutputHandler>output_handler
 * 
 */
  __pyx_v_output_handler = AMPL_GetOutputHandler(__pyx_v_self->_c_ampl);

  /* "amplpy/ampl.pyx":707
 *         cdef void* output_handler
 *         output_handler = campl.AMPL_GetOutputHandler(self._c_ampl)
 *         return <OutputHandler>output_handler             # <<<<<<<<<<<<<<
 * 
 *     def get_error_handler(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)((struct __pyx_obj_7_amplpy_OutputHandler *)__pyx_v_output_handler));
  __pyx_r = ((PyObject *)__pyx_v_output_handler);
  goto __pyx_L0;

  /* "amplpy/ampl.pyx":698
 *         PY_AMPL_CALL(campl.AMPL_SetErrorHandler(self._c_ampl, <void*>error_handler, PyError))
 * 
 *     def get_output_handler(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the current output handler.
 */

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

/* "amplpy/ampl.pyx":709
 *         return <OutputHandler>output_handler
 * 
 *     def get_error_handler(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the current error handler.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_4AMPL_57get_error_handler(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_4AMPL_56get_error_handler, "AMPL.get_error_handler(self)\n\n        Get the current error handler.\n\n        Returns:\n            The current error handler.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_4AMPL_57get_error_handler = {"get_error_handler", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_57get_error_handler, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_4AMPL_56get_error_handler};
static PyObject *__pyx_pw_7_amplpy_4AMPL_57get_error_handler(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_error_handler (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("get_error_handler", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_error_handler", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_4AMPL_56get_error_handler(((struct __pyx_obj_7_amplpy_AMPL *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_4AMPL_56get_error_handler(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self) {
  void *__pyx_v_error_handler;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_error_handler", 1);

  /* "amplpy/ampl.pyx":717
 *         """
 *         cdef void* error_handler
 *         error_handler = campl.AMPL_GetErrorHandler(self._c_ampl)             # <<<<<<<<<<<<<<
 *         return <ErrorHandler>error_handler
 * 
 */
  __pyx_v_error_handler = AMPL_GetErrorHandler(__pyx_v_self->_c_ampl);

  /* "amplpy/ampl.pyx":718
 *         cdef void* error_handler
 *         error_handler = campl.AMPL_GetErrorHandler(self._c_ampl)
 *         return <ErrorHandler>error_handler             # <<<<<<<<<<<<<<
 * 
 *     def get_variables(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)((struct __pyx_obj_7_amplpy_ErrorHandler *)__pyx_v_error_handler));
  __pyx_r = ((PyObject *)__pyx_v_error_handler);
  goto __pyx_L0;

  /* "amplpy/ampl.pyx":709
 *         return <OutputHandler>output_handler
 * 
 *     def get_error_handler(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the current error handler.
 */

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

/* "amplpy/ampl.pyx":720
 *         return <ErrorHandler>error_handler
 * 
 *     def get_variables(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get all the variables declared.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_4AMPL_59get_variables(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_4AMPL_58get_variables, "AMPL.get_variables(self)\n\n        Get all the variables declared.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_4AMPL_59get_variables = {"get_variables", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_59get_variables, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_4AMPL_58get_variables};
static PyObject *__pyx_pw_7_amplpy_4AMPL_59get_variables(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_variables (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("get_variables", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_variables", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_4AMPL_58get_variables(((struct __pyx_obj_7_amplpy_AMPL *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_4AMPL_58get_variables(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variables", 1);

  /* "amplpy/ampl.pyx":724
 *         Get all the variables declared.
 *         """
 *         return EntityMap.create(self._c_ampl, campl.AMPL_VARIABLE)             # <<<<<<<<<<<<<<
 * 
 *     def get_constraints(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7_amplpy_9EntityMap_create(__pyx_v_self->_c_ampl, AMPL_VARIABLE); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 724, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "amplpy/ampl.pyx":720
 *         return <ErrorHandler>error_handler
 * 
 *     def get_variables(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get all the variables declared.
 */

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

/* "amplpy/ampl.pyx":726
 *         return EntityMap.create(self._c_ampl, campl.AMPL_VARIABLE)
 * 
 *     def get_constraints(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get all the constraints declared.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_4AMPL_61get_constraints(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_4AMPL_60get_constraints, "AMPL.get_constraints(self)\n\n        Get all the constraints declared.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_4AMPL_61get_constraints = {"get_constraints", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_61get_constraints, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_4AMPL_60get_constraints};
static PyObject *__pyx_pw_7_amplpy_4AMPL_61get_constraints(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_constraints (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("get_constraints", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_constraints", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_4AMPL_60get_constraints(((struct __pyx_obj_7_amplpy_AMPL *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_4AMPL_60get_constraints(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_constraints", 1);

  /* "amplpy/ampl.pyx":730
 *         Get all the constraints declared.
 *         """
 *         return EntityMap.create(self._c_ampl, campl.AMPL_CONSTRAINT)             # <<<<<<<<<<<<<<
 * 
 *     def get_objectives(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7_amplpy_9EntityMap_create(__pyx_v_self->_c_ampl, AMPL_CONSTRAINT); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 730, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "amplpy/ampl.pyx":726
 *         return EntityMap.create(self._c_ampl, campl.AMPL_VARIABLE)
 * 
 *     def get_constraints(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get all the constraints declared.
 */

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

/* "amplpy/ampl.pyx":732
 *         return EntityMap.create(self._c_ampl, campl.AMPL_CONSTRAINT)
 * 
 *     def get_objectives(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get all the objectives declared.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_4AMPL_63get_objectives(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_4AMPL_62get_objectives, "AMPL.get_objectives(self)\n\n        Get all the objectives declared.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_4AMPL_63get_objectives = {"get_objectives", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_63get_objectives, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_4AMPL_62get_objectives};
static PyObject *__pyx_pw_7_amplpy_4AMPL_63get_objectives(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_objectives (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("get_objectives", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_objectives", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_4AMPL_62get_objectives(((struct __pyx_obj_7_amplpy_AMPL *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_4AMPL_62get_objectives(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_objectives", 1);

  /* "amplpy/ampl.pyx":736
 *         Get all the objectives declared.
 *         """
 *         return EntityMap.create(self._c_ampl, campl.AMPL_OBJECTIVE)             # <<<<<<<<<<<<<<
 * 
 *     def get_sets(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7_amplpy_9EntityMap_create(__pyx_v_self->_c_ampl, AMPL_OBJECTIVE); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 736, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "amplpy/ampl.pyx":732
 *         return EntityMap.create(self._c_ampl, campl.AMPL_CONSTRAINT)
 * 
 *     def get_objectives(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get all the objectives declared.
 */

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

/* "amplpy/ampl.pyx":738
 *         return EntityMap.create(self._c_ampl, campl.AMPL_OBJECTIVE)
 * 
 *     def get_sets(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get all the sets declared.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_4AMPL_65get_sets(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_4AMPL_64get_sets, "AMPL.get_sets(self)\n\n        Get all the sets declared.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_4AMPL_65get_sets = {"get_sets", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_65get_sets, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_4AMPL_64get_sets};
static PyObject *__pyx_pw_7_amplpy_4AMPL_65get_sets(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_sets (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("get_sets", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_sets", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_4AMPL_64get_sets(((struct __pyx_obj_7_amplpy_AMPL *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_4AMPL_64get_sets(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_sets", 1);

  /* "amplpy/ampl.pyx":742
 *         Get all the sets declared.
 *         """
 *         return EntityMap.create(self._c_ampl, campl.AMPL_SET)             # <<<<<<<<<<<<<<
 * 
 *     def get_parameters(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7_amplpy_9EntityMap_create(__pyx_v_self->_c_ampl, AMPL_SET); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 742, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "amplpy/ampl.pyx":738
 *         return EntityMap.create(self._c_ampl, campl.AMPL_OBJECTIVE)
 * 
 *     def get_sets(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get all the sets declared.
 */

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

/* "amplpy/ampl.pyx":744
 *         return EntityMap.create(self._c_ampl, campl.AMPL_SET)
 * 
 *     def get_parameters(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get all the parameters declared.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_4AMPL_67get_parameters(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_4AMPL_66get_parameters, "AMPL.get_parameters(self)\n\n        Get all the parameters declared.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_4AMPL_67get_parameters = {"get_parameters", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_67get_parameters, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_4AMPL_66get_parameters};
static PyObject *__pyx_pw_7_amplpy_4AMPL_67get_parameters(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_parameters (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("get_parameters", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_parameters", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_4AMPL_66get_parameters(((struct __pyx_obj_7_amplpy_AMPL *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_4AMPL_66get_parameters(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_parameters", 1);

  /* "amplpy/ampl.pyx":748
 *         Get all the parameters declared.
 *         """
 *         return EntityMap.create(self._c_ampl, campl.AMPL_PARAMETER)             # <<<<<<<<<<<<<<
 * 
 *     def get_current_objective(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7_amplpy_9EntityMap_create(__pyx_v_self->_c_ampl, AMPL_PARAMETER); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 748, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "amplpy/ampl.pyx":744
 *         return EntityMap.create(self._c_ampl, campl.AMPL_SET)
 * 
 *     def get_parameters(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get all the parameters declared.
 */

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

/* "amplpy/ampl.pyx":750
 *         return EntityMap.create(self._c_ampl, campl.AMPL_PARAMETER)
 * 
 *     def get_current_objective(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the the current objective. Returns `None` if no objective is set.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_4AMPL_69get_current_objective(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_4AMPL_68get_current_objective, "AMPL.get_current_objective(self)\n\n        Get the the current objective. Returns `None` if no objective is set.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_4AMPL_69get_current_objective = {"get_current_objective", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_69get_current_objective, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_4AMPL_68get_current_objective};
static PyObject *__pyx_pw_7_amplpy_4AMPL_69get_current_objective(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_current_objective (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("get_current_objective", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_current_objective", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_4AMPL_68get_current_objective(((struct __pyx_obj_7_amplpy_AMPL *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_4AMPL_68get_current_objective(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self) {
  AMPL_ERRORINFO *__pyx_v_errorinfo;
  AMPL_RETCODE __pyx_v_rc;
  char *__pyx_v_objname_c;
  PyObject *__pyx_v_objname = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  unsigned int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_current_objective", 1);

  /* "amplpy/ampl.pyx":757
 *         cdef campl.AMPL_RETCODE rc
 *         cdef char* objname_c
 *         errorinfo = campl.AMPL_GetCurrentObjective(self._c_ampl, &objname_c)             # <<<<<<<<<<<<<<
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:
 */
  __pyx_v_errorinfo = AMPL_GetCurrentObjective(__pyx_v_self->_c_ampl, (&__pyx_v_objname_c));

  /* "amplpy/ampl.pyx":758
 *         cdef char* objname_c
 *         errorinfo = campl.AMPL_GetCurrentObjective(self._c_ampl, &objname_c)
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)             # <<<<<<<<<<<<<<
 *         if rc != campl.AMPL_OK:
 *             campl.AMPL_StringFree(&objname_c)
 */
  __pyx_v_rc = AMPL_ErrorInfoGetError(__pyx_v_errorinfo);

  /* "amplpy/ampl.pyx":759
 *         errorinfo = campl.AMPL_GetCurrentObjective(self._c_ampl, &objname_c)
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:             # <<<<<<<<<<<<<<
 *             campl.AMPL_StringFree(&objname_c)
 *             PY_AMPL_CALL(errorinfo)
 */
  __pyx_t_1 = (__pyx_v_rc != AMPL_OK);
  if (__pyx_t_1) {

    /* "amplpy/ampl.pyx":760
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:
 *             campl.AMPL_StringFree(&objname_c)             # <<<<<<<<<<<<<<
 *             PY_AMPL_CALL(errorinfo)
 *         objname = str(objname_c.decode('utf-8'))
 */
    (void)(AMPL_StringFree((&__pyx_v_objname_c)));

    /* "amplpy/ampl.pyx":761
 *         if rc != campl.AMPL_OK:
 *             campl.AMPL_StringFree(&objname_c)
 *             PY_AMPL_CALL(errorinfo)             # <<<<<<<<<<<<<<
 *         objname = str(objname_c.decode('utf-8'))
 *         campl.AMPL_StringFree(&objname_c)
 */
    __pyx_t_2 = __pyx_f_7_amplpy_PY_AMPL_CALL(__pyx_v_errorinfo); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 761, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "amplpy/ampl.pyx":759
 *         errorinfo = campl.AMPL_GetCurrentObjective(self._c_ampl, &objname_c)
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:             # <<<<<<<<<<<<<<
 *             campl.AMPL_StringFree(&objname_c)
 *             PY_AMPL_CALL(errorinfo)
 */
  }

  /* "amplpy/ampl.pyx":762
 *             campl.AMPL_StringFree(&objname_c)
 *             PY_AMPL_CALL(errorinfo)
 *         objname = str(objname_c.decode('utf-8'))             # <<<<<<<<<<<<<<
 *         campl.AMPL_StringFree(&objname_c)
 *         if objname == "":
 */
  __pyx_t_3 = __Pyx_ssize_strlen(__pyx_v_objname_c); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(3, 762, __pyx_L1_error)
  __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_objname_c, 0, __pyx_t_3, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 762, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_objname = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "amplpy/ampl.pyx":763
 *             PY_AMPL_CALL(errorinfo)
 *         objname = str(objname_c.decode('utf-8'))
 *         campl.AMPL_StringFree(&objname_c)             # <<<<<<<<<<<<<<
 *         if objname == "":
 *             return None
 */
  (void)(AMPL_StringFree((&__pyx_v_objname_c)));

  /* "amplpy/ampl.pyx":764
 *         objname = str(objname_c.decode('utf-8'))
 *         campl.AMPL_StringFree(&objname_c)
 *         if objname == "":             # <<<<<<<<<<<<<<
 *             return None
 *         else:
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_objname, __pyx_kp_u__22, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(3, 764, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "amplpy/ampl.pyx":765
 *         campl.AMPL_StringFree(&objname_c)
 *         if objname == "":
 *             return None             # <<<<<<<<<<<<<<
 *         else:
 *             return self.get_objective(objname)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "amplpy/ampl.pyx":764
 *         objname = str(objname_c.decode('utf-8'))
 *         campl.AMPL_StringFree(&objname_c)
 *         if objname == "":             # <<<<<<<<<<<<<<
 *             return None
 *         else:
 */
  }

  /* "amplpy/ampl.pyx":767
 *             return None
 *         else:
 *             return self.get_objective(objname)             # <<<<<<<<<<<<<<
 * 
 *     def _var(self):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_objective); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 767, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_6 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_objname};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 767, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }

  /* "amplpy/ampl.pyx":750
 *         return EntityMap.create(self._c_ampl, campl.AMPL_PARAMETER)
 * 
 *     def get_current_objective(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the the current objective. Returns `None` if no objective is set.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("_amplpy.AMPL.get_current_objective", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_objname);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/ampl.pyx":769
 *             return self.get_objective(objname)
 * 
 *     def _var(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get/Set a variable.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_4AMPL_71_var(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_4AMPL_70_var, "AMPL._var(self)\n\n        Get/Set a variable.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_4AMPL_71_var = {"_var", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_71_var, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_4AMPL_70_var};
static PyObject *__pyx_pw_7_amplpy_4AMPL_71_var(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_var (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("_var", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "_var", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_4AMPL_70_var(((struct __pyx_obj_7_amplpy_AMPL *)__pyx_v_self));

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

/* "amplpy/ampl.pyx":775
 * 
 *         class Variables(object):
 *             def __init__(self, ampl):             # <<<<<<<<<<<<<<
 *                 self.ampl = ampl
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_4AMPL_4_var_9Variables_1__init__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7_amplpy_4AMPL_4_var_9Variables_1__init__ = {"__init__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_4_var_9Variables_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7_amplpy_4AMPL_4_var_9Variables_1__init__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_ampl = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_ampl,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 775, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ampl)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 775, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(3, 775, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(3, 775, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_ampl = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, __pyx_nargs); __PYX_ERR(3, 775, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.AMPL._var.Variables.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_4AMPL_4_var_9Variables___init__(__pyx_self, __pyx_v_self, __pyx_v_ampl);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_4AMPL_4_var_9Variables___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_ampl) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 1);

  /* "amplpy/ampl.pyx":776
 *         class Variables(object):
 *             def __init__(self, ampl):
 *                 self.ampl = ampl             # <<<<<<<<<<<<<<
 * 
 *             def __getitem__(self, name):
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_ampl, __pyx_v_ampl) < 0) __PYX_ERR(3, 776, __pyx_L1_error)

  /* "amplpy/ampl.pyx":775
 * 
 *         class Variables(object):
 *             def __init__(self, ampl):             # <<<<<<<<<<<<<<
 *                 self.ampl = ampl
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("_amplpy.AMPL._var.Variables.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/ampl.pyx":778
 *                 self.ampl = ampl
 * 
 *             def __getitem__(self, name):             # <<<<<<<<<<<<<<
 *                 return self.ampl.get_variable(name)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_4AMPL_4_var_9Variables_3__getitem__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7_amplpy_4AMPL_4_var_9Variables_3__getitem__ = {"__getitem__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_4_var_9Variables_3__getitem__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7_amplpy_4AMPL_4_var_9Variables_3__getitem__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_name = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_name,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 778, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 778, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, 1); __PYX_ERR(3, 778, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__getitem__") < 0)) __PYX_ERR(3, 778, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_name = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, __pyx_nargs); __PYX_ERR(3, 778, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.AMPL._var.Variables.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_4AMPL_4_var_9Variables_2__getitem__(__pyx_self, __pyx_v_self, __pyx_v_name);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_4AMPL_4_var_9Variables_2__getitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getitem__", 1);

  /* "amplpy/ampl.pyx":779
 * 
 *             def __getitem__(self, name):
 *                 return self.ampl.get_variable(name)             # <<<<<<<<<<<<<<
 * 
 *             def __setitem__(self, name, value):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ampl); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 779, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_get_variable); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 779, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_name};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 779, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "amplpy/ampl.pyx":778
 *                 self.ampl = ampl
 * 
 *             def __getitem__(self, name):             # <<<<<<<<<<<<<<
 *                 return self.ampl.get_variable(name)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("_amplpy.AMPL._var.Variables.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/ampl.pyx":781
 *                 return self.ampl.get_variable(name)
 * 
 *             def __setitem__(self, name, value):             # <<<<<<<<<<<<<<
 *                 if isinstance(value, Real):
 *                     self.ampl.get_variable(name).set_value(value)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_4AMPL_4_var_9Variables_5__setitem__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7_amplpy_4AMPL_4_var_9Variables_5__setitem__ = {"__setitem__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_4_var_9Variables_5__setitem__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7_amplpy_4AMPL_4_var_9Variables_5__setitem__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_value = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_name,&__pyx_n_s_value,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 781, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 781, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, 1); __PYX_ERR(3, 781, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_value)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 781, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, 2); __PYX_ERR(3, 781, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setitem__") < 0)) __PYX_ERR(3, 781, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
      values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
    }
    __pyx_v_self = values[0];
    __pyx_v_name = values[1];
    __pyx_v_value = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, __pyx_nargs); __PYX_ERR(3, 781, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.AMPL._var.Variables.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_4AMPL_4_var_9Variables_4__setitem__(__pyx_self, __pyx_v_self, __pyx_v_name, __pyx_v_value);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_4AMPL_4_var_9Variables_4__setitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value) {
  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;
  unsigned int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setitem__", 1);

  /* "amplpy/ampl.pyx":782
 * 
 *             def __setitem__(self, name, value):
 *                 if isinstance(value, Real):             # <<<<<<<<<<<<<<
 *                     self.ampl.get_variable(name).set_value(value)
 *                 else:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Real); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 782, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_IsInstance(__pyx_v_value, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(3, 782, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "amplpy/ampl.pyx":783
 *             def __setitem__(self, name, value):
 *                 if isinstance(value, Real):
 *                     self.ampl.get_variable(name).set_value(value)             # <<<<<<<<<<<<<<
 *                 else:
 *                     self.ampl.get_variable(name).set_values(value)
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ampl); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 783, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_get_variable); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 783, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_6 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_name};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 783, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_set_value); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 783, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (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);
        __pyx_t_6 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_value};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 783, __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;

    /* "amplpy/ampl.pyx":782
 * 
 *             def __setitem__(self, name, value):
 *                 if isinstance(value, Real):             # <<<<<<<<<<<<<<
 *                     self.ampl.get_variable(name).set_value(value)
 *                 else:
 */
    goto __pyx_L3;
  }

  /* "amplpy/ampl.pyx":785
 *                     self.ampl.get_variable(name).set_value(value)
 *                 else:
 *                     self.ampl.get_variable(name).set_values(value)             # <<<<<<<<<<<<<<
 * 
 *             def __iter__(self):
 */
  /*else*/ {
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ampl); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 785, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_get_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 785, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_6 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_name};
      __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 785, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_set_values); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 785, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_6 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_value};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 785, __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;
  }
  __pyx_L3:;

  /* "amplpy/ampl.pyx":781
 *                 return self.ampl.get_variable(name)
 * 
 *             def __setitem__(self, name, value):             # <<<<<<<<<<<<<<
 *                 if isinstance(value, Real):
 *                     self.ampl.get_variable(name).set_value(value)
 */

  /* 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_AddTraceback("_amplpy.AMPL._var.Variables.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/ampl.pyx":787
 *                     self.ampl.get_variable(name).set_values(value)
 * 
 *             def __iter__(self):             # <<<<<<<<<<<<<<
 *                 return self.ampl.get_variables()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_4AMPL_4_var_9Variables_7__iter__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7_amplpy_4AMPL_4_var_9Variables_7__iter__ = {"__iter__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_4_var_9Variables_7__iter__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7_amplpy_4AMPL_4_var_9Variables_7__iter__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 787, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__iter__") < 0)) __PYX_ERR(3, 787, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__iter__", 1, 1, 1, __pyx_nargs); __PYX_ERR(3, 787, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.AMPL._var.Variables.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_4AMPL_4_var_9Variables_6__iter__(__pyx_self, __pyx_v_self);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_4AMPL_4_var_9Variables_6__iter__(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;
  unsigned int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__iter__", 1);

  /* "amplpy/ampl.pyx":788
 * 
 *             def __iter__(self):
 *                 return self.ampl.get_variables()             # <<<<<<<<<<<<<<
 * 
 *         return Variables(self)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ampl); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 788, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_get_variables); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 788, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 788, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "amplpy/ampl.pyx":787
 *                     self.ampl.get_variable(name).set_values(value)
 * 
 *             def __iter__(self):             # <<<<<<<<<<<<<<
 *                 return self.ampl.get_variables()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("_amplpy.AMPL._var.Variables.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/ampl.pyx":769
 *             return self.get_objective(objname)
 * 
 *     def _var(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get/Set a variable.
 */

static PyObject *__pyx_pf_7_amplpy_4AMPL_70_var(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self) {
  PyObject *__pyx_v_Variables = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_var", 1);

  /* "amplpy/ampl.pyx":774
 *         """
 * 
 *         class Variables(object):             # <<<<<<<<<<<<<<
 *             def __init__(self, ampl):
 *                 self.ampl = ampl
 */
  __pyx_t_1 = __Pyx_PEP560_update_bases(__pyx_tuple__45); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 774, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 774, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_Variables, __pyx_n_s_var_locals_Variables, (PyObject *) NULL, __pyx_n_s_amplpy, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 774, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__pyx_t_1 != __pyx_tuple__45) {
    if (unlikely((PyDict_SetItemString(__pyx_t_3, "__orig_bases__", __pyx_tuple__45) < 0))) __PYX_ERR(3, 774, __pyx_L1_error)
  }

  /* "amplpy/ampl.pyx":775
 * 
 *         class Variables(object):
 *             def __init__(self, ampl):             # <<<<<<<<<<<<<<
 *                 self.ampl = ampl
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_4AMPL_4_var_9Variables_1__init__, 0, __pyx_n_s_var_locals_Variables___init, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__47)); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 775, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_init, __pyx_t_4) < 0) __PYX_ERR(3, 775, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "amplpy/ampl.pyx":778
 *                 self.ampl = ampl
 * 
 *             def __getitem__(self, name):             # <<<<<<<<<<<<<<
 *                 return self.ampl.get_variable(name)
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_4AMPL_4_var_9Variables_3__getitem__, 0, __pyx_n_s_var_locals_Variables___getitem, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__49)); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 778, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_getitem, __pyx_t_4) < 0) __PYX_ERR(3, 778, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "amplpy/ampl.pyx":781
 *                 return self.ampl.get_variable(name)
 * 
 *             def __setitem__(self, name, value):             # <<<<<<<<<<<<<<
 *                 if isinstance(value, Real):
 *                     self.ampl.get_variable(name).set_value(value)
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_4AMPL_4_var_9Variables_5__setitem__, 0, __pyx_n_s_var_locals_Variables___setitem, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__51)); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 781, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_setitem, __pyx_t_4) < 0) __PYX_ERR(3, 781, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "amplpy/ampl.pyx":787
 *                     self.ampl.get_variable(name).set_values(value)
 * 
 *             def __iter__(self):             # <<<<<<<<<<<<<<
 *                 return self.ampl.get_variables()
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_4AMPL_4_var_9Variables_7__iter__, 0, __pyx_n_s_var_locals_Variables___iter, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__53)); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 787, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_iter, __pyx_t_4) < 0) __PYX_ERR(3, 787, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "amplpy/ampl.pyx":774
 *         """
 * 
 *         class Variables(object):             # <<<<<<<<<<<<<<
 *             def __init__(self, ampl):
 *                 self.ampl = ampl
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_Variables, __pyx_t_1, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 774, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_v_Variables = __pyx_t_4;
  __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "amplpy/ampl.pyx":790
 *                 return self.ampl.get_variables()
 * 
 *         return Variables(self)             # <<<<<<<<<<<<<<
 * 
 *     def _con(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_v_Variables, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 790, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "amplpy/ampl.pyx":769
 *             return self.get_objective(objname)
 * 
 *     def _var(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get/Set a variable.
 */

  /* 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("_amplpy.AMPL._var", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_Variables);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/ampl.pyx":792
 *         return Variables(self)
 * 
 *     def _con(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get/Set a constraint.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_4AMPL_73_con(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_4AMPL_72_con, "AMPL._con(self)\n\n        Get/Set a constraint.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_4AMPL_73_con = {"_con", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_73_con, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_4AMPL_72_con};
static PyObject *__pyx_pw_7_amplpy_4AMPL_73_con(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_con (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("_con", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "_con", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_4AMPL_72_con(((struct __pyx_obj_7_amplpy_AMPL *)__pyx_v_self));

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

/* "amplpy/ampl.pyx":798
 * 
 *         class Constraints(object):
 *             def __init__(self, ampl):             # <<<<<<<<<<<<<<
 *                 self.ampl = ampl
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_4AMPL_4_con_11Constraints_1__init__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7_amplpy_4AMPL_4_con_11Constraints_1__init__ = {"__init__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_4_con_11Constraints_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7_amplpy_4AMPL_4_con_11Constraints_1__init__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_ampl = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_ampl,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 798, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ampl)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 798, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(3, 798, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(3, 798, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_ampl = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, __pyx_nargs); __PYX_ERR(3, 798, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.AMPL._con.Constraints.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_4AMPL_4_con_11Constraints___init__(__pyx_self, __pyx_v_self, __pyx_v_ampl);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_4AMPL_4_con_11Constraints___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_ampl) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 1);

  /* "amplpy/ampl.pyx":799
 *         class Constraints(object):
 *             def __init__(self, ampl):
 *                 self.ampl = ampl             # <<<<<<<<<<<<<<
 * 
 *             def __getitem__(self, name):
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_ampl, __pyx_v_ampl) < 0) __PYX_ERR(3, 799, __pyx_L1_error)

  /* "amplpy/ampl.pyx":798
 * 
 *         class Constraints(object):
 *             def __init__(self, ampl):             # <<<<<<<<<<<<<<
 *                 self.ampl = ampl
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("_amplpy.AMPL._con.Constraints.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/ampl.pyx":801
 *                 self.ampl = ampl
 * 
 *             def __getitem__(self, name):             # <<<<<<<<<<<<<<
 *                 return self.ampl.get_constraint(name)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_4AMPL_4_con_11Constraints_3__getitem__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7_amplpy_4AMPL_4_con_11Constraints_3__getitem__ = {"__getitem__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_4_con_11Constraints_3__getitem__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7_amplpy_4AMPL_4_con_11Constraints_3__getitem__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_name = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_name,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 801, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 801, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, 1); __PYX_ERR(3, 801, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__getitem__") < 0)) __PYX_ERR(3, 801, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_name = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, __pyx_nargs); __PYX_ERR(3, 801, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.AMPL._con.Constraints.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_4AMPL_4_con_11Constraints_2__getitem__(__pyx_self, __pyx_v_self, __pyx_v_name);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_4AMPL_4_con_11Constraints_2__getitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getitem__", 1);

  /* "amplpy/ampl.pyx":802
 * 
 *             def __getitem__(self, name):
 *                 return self.ampl.get_constraint(name)             # <<<<<<<<<<<<<<
 * 
 *             def __setitem__(self, name, value):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ampl); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 802, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_get_constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 802, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_name};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 802, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "amplpy/ampl.pyx":801
 *                 self.ampl = ampl
 * 
 *             def __getitem__(self, name):             # <<<<<<<<<<<<<<
 *                 return self.ampl.get_constraint(name)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("_amplpy.AMPL._con.Constraints.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/ampl.pyx":804
 *                 return self.ampl.get_constraint(name)
 * 
 *             def __setitem__(self, name, value):             # <<<<<<<<<<<<<<
 *                 self.ampl.get_constraint(name).set_dual(value)
 *                 if isinstance(value, Real):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_4AMPL_4_con_11Constraints_5__setitem__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7_amplpy_4AMPL_4_con_11Constraints_5__setitem__ = {"__setitem__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_4_con_11Constraints_5__setitem__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7_amplpy_4AMPL_4_con_11Constraints_5__setitem__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_value = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_name,&__pyx_n_s_value,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 804, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 804, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, 1); __PYX_ERR(3, 804, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_value)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 804, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, 2); __PYX_ERR(3, 804, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setitem__") < 0)) __PYX_ERR(3, 804, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
      values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
    }
    __pyx_v_self = values[0];
    __pyx_v_name = values[1];
    __pyx_v_value = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, __pyx_nargs); __PYX_ERR(3, 804, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.AMPL._con.Constraints.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_4AMPL_4_con_11Constraints_4__setitem__(__pyx_self, __pyx_v_self, __pyx_v_name, __pyx_v_value);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_4AMPL_4_con_11Constraints_4__setitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name, 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;
  unsigned int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setitem__", 1);

  /* "amplpy/ampl.pyx":805
 * 
 *             def __setitem__(self, name, value):
 *                 self.ampl.get_constraint(name).set_dual(value)             # <<<<<<<<<<<<<<
 *                 if isinstance(value, Real):
 *                     self.ampl.get_constraint(name).set_dual(value)
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ampl); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 805, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_get_constraint); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 805, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_name};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 805, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_set_dual); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 805, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_value};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 805, __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;

  /* "amplpy/ampl.pyx":806
 *             def __setitem__(self, name, value):
 *                 self.ampl.get_constraint(name).set_dual(value)
 *                 if isinstance(value, Real):             # <<<<<<<<<<<<<<
 *                     self.ampl.get_constraint(name).set_dual(value)
 *                 else:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Real); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 806, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = PyObject_IsInstance(__pyx_v_value, __pyx_t_1); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(3, 806, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_6) {

    /* "amplpy/ampl.pyx":807
 *                 self.ampl.get_constraint(name).set_dual(value)
 *                 if isinstance(value, Real):
 *                     self.ampl.get_constraint(name).set_dual(value)             # <<<<<<<<<<<<<<
 *                 else:
 *                     self.ampl.get_constraint(name).set_values(value)
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ampl); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 807, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_get_constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 807, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_name};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 807, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_set_dual); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 807, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_value};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 807, __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;

    /* "amplpy/ampl.pyx":806
 *             def __setitem__(self, name, value):
 *                 self.ampl.get_constraint(name).set_dual(value)
 *                 if isinstance(value, Real):             # <<<<<<<<<<<<<<
 *                     self.ampl.get_constraint(name).set_dual(value)
 *                 else:
 */
    goto __pyx_L3;
  }

  /* "amplpy/ampl.pyx":809
 *                     self.ampl.get_constraint(name).set_dual(value)
 *                 else:
 *                     self.ampl.get_constraint(name).set_values(value)             # <<<<<<<<<<<<<<
 * 
 *             def __iter__(self):
 */
  /*else*/ {
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ampl); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 809, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_get_constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 809, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_name};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 809, __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_set_values); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 809, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_value};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 809, __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;
  }
  __pyx_L3:;

  /* "amplpy/ampl.pyx":804
 *                 return self.ampl.get_constraint(name)
 * 
 *             def __setitem__(self, name, value):             # <<<<<<<<<<<<<<
 *                 self.ampl.get_constraint(name).set_dual(value)
 *                 if isinstance(value, Real):
 */

  /* 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("_amplpy.AMPL._con.Constraints.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/ampl.pyx":811
 *                     self.ampl.get_constraint(name).set_values(value)
 * 
 *             def __iter__(self):             # <<<<<<<<<<<<<<
 *                 return self.ampl.get_constraints()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_4AMPL_4_con_11Constraints_7__iter__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7_amplpy_4AMPL_4_con_11Constraints_7__iter__ = {"__iter__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_4_con_11Constraints_7__iter__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7_amplpy_4AMPL_4_con_11Constraints_7__iter__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 811, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__iter__") < 0)) __PYX_ERR(3, 811, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__iter__", 1, 1, 1, __pyx_nargs); __PYX_ERR(3, 811, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.AMPL._con.Constraints.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_4AMPL_4_con_11Constraints_6__iter__(__pyx_self, __pyx_v_self);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_4AMPL_4_con_11Constraints_6__iter__(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;
  unsigned int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__iter__", 1);

  /* "amplpy/ampl.pyx":812
 * 
 *             def __iter__(self):
 *                 return self.ampl.get_constraints()             # <<<<<<<<<<<<<<
 * 
 *         return Constraints(self)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ampl); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 812, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_get_constraints); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 812, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 812, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "amplpy/ampl.pyx":811
 *                     self.ampl.get_constraint(name).set_values(value)
 * 
 *             def __iter__(self):             # <<<<<<<<<<<<<<
 *                 return self.ampl.get_constraints()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("_amplpy.AMPL._con.Constraints.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/ampl.pyx":792
 *         return Variables(self)
 * 
 *     def _con(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get/Set a constraint.
 */

static PyObject *__pyx_pf_7_amplpy_4AMPL_72_con(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self) {
  PyObject *__pyx_v_Constraints = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_con", 1);

  /* "amplpy/ampl.pyx":797
 *         """
 * 
 *         class Constraints(object):             # <<<<<<<<<<<<<<
 *             def __init__(self, ampl):
 *                 self.ampl = ampl
 */
  __pyx_t_1 = __Pyx_PEP560_update_bases(__pyx_tuple__55); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 797, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 797, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_Constraints, __pyx_n_s_con_locals_Constraints, (PyObject *) NULL, __pyx_n_s_amplpy, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 797, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__pyx_t_1 != __pyx_tuple__55) {
    if (unlikely((PyDict_SetItemString(__pyx_t_3, "__orig_bases__", __pyx_tuple__55) < 0))) __PYX_ERR(3, 797, __pyx_L1_error)
  }

  /* "amplpy/ampl.pyx":798
 * 
 *         class Constraints(object):
 *             def __init__(self, ampl):             # <<<<<<<<<<<<<<
 *                 self.ampl = ampl
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_4AMPL_4_con_11Constraints_1__init__, 0, __pyx_n_s_con_locals_Constraints___init, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__56)); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 798, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_init, __pyx_t_4) < 0) __PYX_ERR(3, 798, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "amplpy/ampl.pyx":801
 *                 self.ampl = ampl
 * 
 *             def __getitem__(self, name):             # <<<<<<<<<<<<<<
 *                 return self.ampl.get_constraint(name)
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_4AMPL_4_con_11Constraints_3__getitem__, 0, __pyx_n_s_con_locals_Constraints___getite, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__57)); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 801, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_getitem, __pyx_t_4) < 0) __PYX_ERR(3, 801, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "amplpy/ampl.pyx":804
 *                 return self.ampl.get_constraint(name)
 * 
 *             def __setitem__(self, name, value):             # <<<<<<<<<<<<<<
 *                 self.ampl.get_constraint(name).set_dual(value)
 *                 if isinstance(value, Real):
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_4AMPL_4_con_11Constraints_5__setitem__, 0, __pyx_n_s_con_locals_Constraints___setite, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__58)); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 804, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_setitem, __pyx_t_4) < 0) __PYX_ERR(3, 804, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "amplpy/ampl.pyx":811
 *                     self.ampl.get_constraint(name).set_values(value)
 * 
 *             def __iter__(self):             # <<<<<<<<<<<<<<
 *                 return self.ampl.get_constraints()
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_4AMPL_4_con_11Constraints_7__iter__, 0, __pyx_n_s_con_locals_Constraints___iter, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__59)); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 811, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_iter, __pyx_t_4) < 0) __PYX_ERR(3, 811, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "amplpy/ampl.pyx":797
 *         """
 * 
 *         class Constraints(object):             # <<<<<<<<<<<<<<
 *             def __init__(self, ampl):
 *                 self.ampl = ampl
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_Constraints, __pyx_t_1, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 797, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_v_Constraints = __pyx_t_4;
  __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "amplpy/ampl.pyx":814
 *                 return self.ampl.get_constraints()
 * 
 *         return Constraints(self)             # <<<<<<<<<<<<<<
 * 
 *     def _obj(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_v_Constraints, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 814, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "amplpy/ampl.pyx":792
 *         return Variables(self)
 * 
 *     def _con(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get/Set a constraint.
 */

  /* 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("_amplpy.AMPL._con", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_Constraints);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/ampl.pyx":816
 *         return Constraints(self)
 * 
 *     def _obj(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get an objective.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_4AMPL_75_obj(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_4AMPL_74_obj, "AMPL._obj(self)\n\n        Get an objective.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_4AMPL_75_obj = {"_obj", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_75_obj, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_4AMPL_74_obj};
static PyObject *__pyx_pw_7_amplpy_4AMPL_75_obj(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_obj (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("_obj", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "_obj", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_4AMPL_74_obj(((struct __pyx_obj_7_amplpy_AMPL *)__pyx_v_self));

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

/* "amplpy/ampl.pyx":822
 * 
 *         class Objectives(object):
 *             def __init__(self, ampl):             # <<<<<<<<<<<<<<
 *                 self.ampl = ampl
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_4AMPL_4_obj_10Objectives_1__init__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7_amplpy_4AMPL_4_obj_10Objectives_1__init__ = {"__init__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_4_obj_10Objectives_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7_amplpy_4AMPL_4_obj_10Objectives_1__init__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_ampl = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_ampl,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 822, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ampl)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 822, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(3, 822, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(3, 822, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_ampl = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, __pyx_nargs); __PYX_ERR(3, 822, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.AMPL._obj.Objectives.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_4AMPL_4_obj_10Objectives___init__(__pyx_self, __pyx_v_self, __pyx_v_ampl);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_4AMPL_4_obj_10Objectives___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_ampl) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 1);

  /* "amplpy/ampl.pyx":823
 *         class Objectives(object):
 *             def __init__(self, ampl):
 *                 self.ampl = ampl             # <<<<<<<<<<<<<<
 * 
 *             def __getitem__(self, name):
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_ampl, __pyx_v_ampl) < 0) __PYX_ERR(3, 823, __pyx_L1_error)

  /* "amplpy/ampl.pyx":822
 * 
 *         class Objectives(object):
 *             def __init__(self, ampl):             # <<<<<<<<<<<<<<
 *                 self.ampl = ampl
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("_amplpy.AMPL._obj.Objectives.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/ampl.pyx":825
 *                 self.ampl = ampl
 * 
 *             def __getitem__(self, name):             # <<<<<<<<<<<<<<
 *                 return self.ampl.get_objective(name)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_4AMPL_4_obj_10Objectives_3__getitem__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7_amplpy_4AMPL_4_obj_10Objectives_3__getitem__ = {"__getitem__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_4_obj_10Objectives_3__getitem__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7_amplpy_4AMPL_4_obj_10Objectives_3__getitem__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_name = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_name,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 825, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 825, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, 1); __PYX_ERR(3, 825, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__getitem__") < 0)) __PYX_ERR(3, 825, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_name = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, __pyx_nargs); __PYX_ERR(3, 825, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.AMPL._obj.Objectives.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_4AMPL_4_obj_10Objectives_2__getitem__(__pyx_self, __pyx_v_self, __pyx_v_name);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_4AMPL_4_obj_10Objectives_2__getitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getitem__", 1);

  /* "amplpy/ampl.pyx":826
 * 
 *             def __getitem__(self, name):
 *                 return self.ampl.get_objective(name)             # <<<<<<<<<<<<<<
 * 
 *             def __iter__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ampl); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 826, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_get_objective); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 826, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_name};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 826, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "amplpy/ampl.pyx":825
 *                 self.ampl = ampl
 * 
 *             def __getitem__(self, name):             # <<<<<<<<<<<<<<
 *                 return self.ampl.get_objective(name)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("_amplpy.AMPL._obj.Objectives.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/ampl.pyx":828
 *                 return self.ampl.get_objective(name)
 * 
 *             def __iter__(self):             # <<<<<<<<<<<<<<
 *                 return self.ampl.get_objectives()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_4AMPL_4_obj_10Objectives_5__iter__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7_amplpy_4AMPL_4_obj_10Objectives_5__iter__ = {"__iter__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_4_obj_10Objectives_5__iter__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7_amplpy_4AMPL_4_obj_10Objectives_5__iter__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 828, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__iter__") < 0)) __PYX_ERR(3, 828, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__iter__", 1, 1, 1, __pyx_nargs); __PYX_ERR(3, 828, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.AMPL._obj.Objectives.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_4AMPL_4_obj_10Objectives_4__iter__(__pyx_self, __pyx_v_self);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_4AMPL_4_obj_10Objectives_4__iter__(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;
  unsigned int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__iter__", 1);

  /* "amplpy/ampl.pyx":829
 * 
 *             def __iter__(self):
 *                 return self.ampl.get_objectives()             # <<<<<<<<<<<<<<
 * 
 *         return Objectives(self)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ampl); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 829, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_get_objectives); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 829, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 829, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "amplpy/ampl.pyx":828
 *                 return self.ampl.get_objective(name)
 * 
 *             def __iter__(self):             # <<<<<<<<<<<<<<
 *                 return self.ampl.get_objectives()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("_amplpy.AMPL._obj.Objectives.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/ampl.pyx":816
 *         return Constraints(self)
 * 
 *     def _obj(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get an objective.
 */

static PyObject *__pyx_pf_7_amplpy_4AMPL_74_obj(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self) {
  PyObject *__pyx_v_Objectives = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_obj", 1);

  /* "amplpy/ampl.pyx":821
 *         """
 * 
 *         class Objectives(object):             # <<<<<<<<<<<<<<
 *             def __init__(self, ampl):
 *                 self.ampl = ampl
 */
  __pyx_t_1 = __Pyx_PEP560_update_bases(__pyx_tuple__61); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 821, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 821, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_Objectives, __pyx_n_s_obj_locals_Objectives, (PyObject *) NULL, __pyx_n_s_amplpy, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 821, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__pyx_t_1 != __pyx_tuple__61) {
    if (unlikely((PyDict_SetItemString(__pyx_t_3, "__orig_bases__", __pyx_tuple__61) < 0))) __PYX_ERR(3, 821, __pyx_L1_error)
  }

  /* "amplpy/ampl.pyx":822
 * 
 *         class Objectives(object):
 *             def __init__(self, ampl):             # <<<<<<<<<<<<<<
 *                 self.ampl = ampl
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_4AMPL_4_obj_10Objectives_1__init__, 0, __pyx_n_s_obj_locals_Objectives___init, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__62)); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 822, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_init, __pyx_t_4) < 0) __PYX_ERR(3, 822, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "amplpy/ampl.pyx":825
 *                 self.ampl = ampl
 * 
 *             def __getitem__(self, name):             # <<<<<<<<<<<<<<
 *                 return self.ampl.get_objective(name)
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_4AMPL_4_obj_10Objectives_3__getitem__, 0, __pyx_n_s_obj_locals_Objectives___getitem, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__63)); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 825, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_getitem, __pyx_t_4) < 0) __PYX_ERR(3, 825, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "amplpy/ampl.pyx":828
 *                 return self.ampl.get_objective(name)
 * 
 *             def __iter__(self):             # <<<<<<<<<<<<<<
 *                 return self.ampl.get_objectives()
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_4AMPL_4_obj_10Objectives_5__iter__, 0, __pyx_n_s_obj_locals_Objectives___iter, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__64)); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 828, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_iter, __pyx_t_4) < 0) __PYX_ERR(3, 828, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "amplpy/ampl.pyx":821
 *         """
 * 
 *         class Objectives(object):             # <<<<<<<<<<<<<<
 *             def __init__(self, ampl):
 *                 self.ampl = ampl
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_Objectives, __pyx_t_1, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 821, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_v_Objectives = __pyx_t_4;
  __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "amplpy/ampl.pyx":831
 *                 return self.ampl.get_objectives()
 * 
 *         return Objectives(self)             # <<<<<<<<<<<<<<
 * 
 *     def _set(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_v_Objectives, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 831, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "amplpy/ampl.pyx":816
 *         return Constraints(self)
 * 
 *     def _obj(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get an objective.
 */

  /* 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("_amplpy.AMPL._obj", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_Objectives);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/ampl.pyx":833
 *         return Objectives(self)
 * 
 *     def _set(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get/Set a set.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_4AMPL_77_set(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_4AMPL_76_set, "AMPL._set(self)\n\n        Get/Set a set.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_4AMPL_77_set = {"_set", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_77_set, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_4AMPL_76_set};
static PyObject *__pyx_pw_7_amplpy_4AMPL_77_set(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_set (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("_set", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "_set", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_4AMPL_76_set(((struct __pyx_obj_7_amplpy_AMPL *)__pyx_v_self));

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

/* "amplpy/ampl.pyx":839
 * 
 *         class Sets(object):
 *             def __init__(self, ampl):             # <<<<<<<<<<<<<<
 *                 self.ampl = ampl
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_4AMPL_4_set_4Sets_1__init__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7_amplpy_4AMPL_4_set_4Sets_1__init__ = {"__init__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_4_set_4Sets_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7_amplpy_4AMPL_4_set_4Sets_1__init__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_ampl = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_ampl,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 839, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ampl)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 839, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(3, 839, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(3, 839, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_ampl = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, __pyx_nargs); __PYX_ERR(3, 839, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.AMPL._set.Sets.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_4AMPL_4_set_4Sets___init__(__pyx_self, __pyx_v_self, __pyx_v_ampl);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_4AMPL_4_set_4Sets___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_ampl) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 1);

  /* "amplpy/ampl.pyx":840
 *         class Sets(object):
 *             def __init__(self, ampl):
 *                 self.ampl = ampl             # <<<<<<<<<<<<<<
 * 
 *             def __getitem__(self, name):
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_ampl, __pyx_v_ampl) < 0) __PYX_ERR(3, 840, __pyx_L1_error)

  /* "amplpy/ampl.pyx":839
 * 
 *         class Sets(object):
 *             def __init__(self, ampl):             # <<<<<<<<<<<<<<
 *                 self.ampl = ampl
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("_amplpy.AMPL._set.Sets.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/ampl.pyx":842
 *                 self.ampl = ampl
 * 
 *             def __getitem__(self, name):             # <<<<<<<<<<<<<<
 *                 return self.ampl.get_set(name)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_4AMPL_4_set_4Sets_3__getitem__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7_amplpy_4AMPL_4_set_4Sets_3__getitem__ = {"__getitem__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_4_set_4Sets_3__getitem__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7_amplpy_4AMPL_4_set_4Sets_3__getitem__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_name = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_name,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 842, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 842, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, 1); __PYX_ERR(3, 842, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__getitem__") < 0)) __PYX_ERR(3, 842, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_name = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, __pyx_nargs); __PYX_ERR(3, 842, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.AMPL._set.Sets.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_4AMPL_4_set_4Sets_2__getitem__(__pyx_self, __pyx_v_self, __pyx_v_name);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_4AMPL_4_set_4Sets_2__getitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getitem__", 1);

  /* "amplpy/ampl.pyx":843
 * 
 *             def __getitem__(self, name):
 *                 return self.ampl.get_set(name)             # <<<<<<<<<<<<<<
 * 
 *             def __setitem__(self, name, values):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ampl); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 843, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_get_set); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 843, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_name};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 843, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "amplpy/ampl.pyx":842
 *                 self.ampl = ampl
 * 
 *             def __getitem__(self, name):             # <<<<<<<<<<<<<<
 *                 return self.ampl.get_set(name)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("_amplpy.AMPL._set.Sets.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/ampl.pyx":845
 *                 return self.ampl.get_set(name)
 * 
 *             def __setitem__(self, name, values):             # <<<<<<<<<<<<<<
 *                 self.ampl.get_set(name).set_values(values)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_4AMPL_4_set_4Sets_5__setitem__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7_amplpy_4AMPL_4_set_4Sets_5__setitem__ = {"__setitem__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_4_set_4Sets_5__setitem__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7_amplpy_4AMPL_4_set_4Sets_5__setitem__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_values = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_name,&__pyx_n_s_values,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 845, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 845, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, 1); __PYX_ERR(3, 845, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_values)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 845, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, 2); __PYX_ERR(3, 845, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setitem__") < 0)) __PYX_ERR(3, 845, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
      values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
    }
    __pyx_v_self = values[0];
    __pyx_v_name = values[1];
    __pyx_v_values = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, __pyx_nargs); __PYX_ERR(3, 845, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.AMPL._set.Sets.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_4AMPL_4_set_4Sets_4__setitem__(__pyx_self, __pyx_v_self, __pyx_v_name, __pyx_v_values);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_4AMPL_4_set_4Sets_4__setitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_values) {
  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;
  unsigned int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setitem__", 1);

  /* "amplpy/ampl.pyx":846
 * 
 *             def __setitem__(self, name, values):
 *                 self.ampl.get_set(name).set_values(values)             # <<<<<<<<<<<<<<
 * 
 *             def __iter__(self):
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ampl); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 846, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_get_set); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 846, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_name};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 846, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_set_values); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 846, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_values};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 846, __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;

  /* "amplpy/ampl.pyx":845
 *                 return self.ampl.get_set(name)
 * 
 *             def __setitem__(self, name, values):             # <<<<<<<<<<<<<<
 *                 self.ampl.get_set(name).set_values(values)
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("_amplpy.AMPL._set.Sets.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/ampl.pyx":848
 *                 self.ampl.get_set(name).set_values(values)
 * 
 *             def __iter__(self):             # <<<<<<<<<<<<<<
 *                 return self.ampl.get_sets()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_4AMPL_4_set_4Sets_7__iter__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7_amplpy_4AMPL_4_set_4Sets_7__iter__ = {"__iter__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_4_set_4Sets_7__iter__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7_amplpy_4AMPL_4_set_4Sets_7__iter__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 848, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__iter__") < 0)) __PYX_ERR(3, 848, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__iter__", 1, 1, 1, __pyx_nargs); __PYX_ERR(3, 848, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.AMPL._set.Sets.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_4AMPL_4_set_4Sets_6__iter__(__pyx_self, __pyx_v_self);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_4AMPL_4_set_4Sets_6__iter__(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;
  unsigned int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__iter__", 1);

  /* "amplpy/ampl.pyx":849
 * 
 *             def __iter__(self):
 *                 return self.ampl.get_sets()             # <<<<<<<<<<<<<<
 * 
 *         return Sets(self)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ampl); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 849, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_get_sets); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 849, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 849, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "amplpy/ampl.pyx":848
 *                 self.ampl.get_set(name).set_values(values)
 * 
 *             def __iter__(self):             # <<<<<<<<<<<<<<
 *                 return self.ampl.get_sets()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("_amplpy.AMPL._set.Sets.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/ampl.pyx":833
 *         return Objectives(self)
 * 
 *     def _set(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get/Set a set.
 */

static PyObject *__pyx_pf_7_amplpy_4AMPL_76_set(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self) {
  PyObject *__pyx_v_Sets = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_set", 1);

  /* "amplpy/ampl.pyx":838
 *         """
 * 
 *         class Sets(object):             # <<<<<<<<<<<<<<
 *             def __init__(self, ampl):
 *                 self.ampl = ampl
 */
  __pyx_t_1 = __Pyx_PEP560_update_bases(__pyx_tuple__66); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 838, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 838, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_Sets, __pyx_n_s_set_locals_Sets, (PyObject *) NULL, __pyx_n_s_amplpy, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 838, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__pyx_t_1 != __pyx_tuple__66) {
    if (unlikely((PyDict_SetItemString(__pyx_t_3, "__orig_bases__", __pyx_tuple__66) < 0))) __PYX_ERR(3, 838, __pyx_L1_error)
  }

  /* "amplpy/ampl.pyx":839
 * 
 *         class Sets(object):
 *             def __init__(self, ampl):             # <<<<<<<<<<<<<<
 *                 self.ampl = ampl
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_4AMPL_4_set_4Sets_1__init__, 0, __pyx_n_s_set_locals_Sets___init, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__67)); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 839, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_init, __pyx_t_4) < 0) __PYX_ERR(3, 839, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "amplpy/ampl.pyx":842
 *                 self.ampl = ampl
 * 
 *             def __getitem__(self, name):             # <<<<<<<<<<<<<<
 *                 return self.ampl.get_set(name)
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_4AMPL_4_set_4Sets_3__getitem__, 0, __pyx_n_s_set_locals_Sets___getitem, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__68)); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 842, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_getitem, __pyx_t_4) < 0) __PYX_ERR(3, 842, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "amplpy/ampl.pyx":845
 *                 return self.ampl.get_set(name)
 * 
 *             def __setitem__(self, name, values):             # <<<<<<<<<<<<<<
 *                 self.ampl.get_set(name).set_values(values)
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_4AMPL_4_set_4Sets_5__setitem__, 0, __pyx_n_s_set_locals_Sets___setitem, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__70)); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 845, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_setitem, __pyx_t_4) < 0) __PYX_ERR(3, 845, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "amplpy/ampl.pyx":848
 *                 self.ampl.get_set(name).set_values(values)
 * 
 *             def __iter__(self):             # <<<<<<<<<<<<<<
 *                 return self.ampl.get_sets()
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_4AMPL_4_set_4Sets_7__iter__, 0, __pyx_n_s_set_locals_Sets___iter, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__71)); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 848, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_iter, __pyx_t_4) < 0) __PYX_ERR(3, 848, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "amplpy/ampl.pyx":838
 *         """
 * 
 *         class Sets(object):             # <<<<<<<<<<<<<<
 *             def __init__(self, ampl):
 *                 self.ampl = ampl
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_Sets, __pyx_t_1, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 838, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_v_Sets = __pyx_t_4;
  __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "amplpy/ampl.pyx":851
 *                 return self.ampl.get_sets()
 * 
 *         return Sets(self)             # <<<<<<<<<<<<<<
 * 
 *     def _param(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_v_Sets, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 851, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "amplpy/ampl.pyx":833
 *         return Objectives(self)
 * 
 *     def _set(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get/Set a set.
 */

  /* 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("_amplpy.AMPL._set", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_Sets);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/ampl.pyx":853
 *         return Sets(self)
 * 
 *     def _param(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get/Set a parameter.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_4AMPL_79_param(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_4AMPL_78_param, "AMPL._param(self)\n\n        Get/Set a parameter.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_4AMPL_79_param = {"_param", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_79_param, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_4AMPL_78_param};
static PyObject *__pyx_pw_7_amplpy_4AMPL_79_param(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_param (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("_param", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "_param", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_4AMPL_78_param(((struct __pyx_obj_7_amplpy_AMPL *)__pyx_v_self));

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

/* "amplpy/ampl.pyx":859
 * 
 *         class Parameters(object):
 *             def __init__(self, ampl):             # <<<<<<<<<<<<<<
 *                 self.ampl = ampl
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_4AMPL_6_param_10Parameters_1__init__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7_amplpy_4AMPL_6_param_10Parameters_1__init__ = {"__init__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_6_param_10Parameters_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7_amplpy_4AMPL_6_param_10Parameters_1__init__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_ampl = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_ampl,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 859, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ampl)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 859, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(3, 859, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(3, 859, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_ampl = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, __pyx_nargs); __PYX_ERR(3, 859, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.AMPL._param.Parameters.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_4AMPL_6_param_10Parameters___init__(__pyx_self, __pyx_v_self, __pyx_v_ampl);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_4AMPL_6_param_10Parameters___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_ampl) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 1);

  /* "amplpy/ampl.pyx":860
 *         class Parameters(object):
 *             def __init__(self, ampl):
 *                 self.ampl = ampl             # <<<<<<<<<<<<<<
 * 
 *             def __getitem__(self, name):
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_ampl, __pyx_v_ampl) < 0) __PYX_ERR(3, 860, __pyx_L1_error)

  /* "amplpy/ampl.pyx":859
 * 
 *         class Parameters(object):
 *             def __init__(self, ampl):             # <<<<<<<<<<<<<<
 *                 self.ampl = ampl
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("_amplpy.AMPL._param.Parameters.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/ampl.pyx":862
 *                 self.ampl = ampl
 * 
 *             def __getitem__(self, name):             # <<<<<<<<<<<<<<
 *                 return self.ampl.get_parameter(name)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_4AMPL_6_param_10Parameters_3__getitem__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7_amplpy_4AMPL_6_param_10Parameters_3__getitem__ = {"__getitem__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_6_param_10Parameters_3__getitem__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7_amplpy_4AMPL_6_param_10Parameters_3__getitem__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_name = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_name,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 862, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 862, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, 1); __PYX_ERR(3, 862, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__getitem__") < 0)) __PYX_ERR(3, 862, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_name = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, __pyx_nargs); __PYX_ERR(3, 862, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.AMPL._param.Parameters.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_4AMPL_6_param_10Parameters_2__getitem__(__pyx_self, __pyx_v_self, __pyx_v_name);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_4AMPL_6_param_10Parameters_2__getitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getitem__", 1);

  /* "amplpy/ampl.pyx":863
 * 
 *             def __getitem__(self, name):
 *                 return self.ampl.get_parameter(name)             # <<<<<<<<<<<<<<
 * 
 *             def __setitem__(self, name, value):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ampl); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 863, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_get_parameter); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 863, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_name};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 863, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "amplpy/ampl.pyx":862
 *                 self.ampl = ampl
 * 
 *             def __getitem__(self, name):             # <<<<<<<<<<<<<<
 *                 return self.ampl.get_parameter(name)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("_amplpy.AMPL._param.Parameters.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/ampl.pyx":865
 *                 return self.ampl.get_parameter(name)
 * 
 *             def __setitem__(self, name, value):             # <<<<<<<<<<<<<<
 *                 if isinstance(value, (Real, str)):
 *                     self.ampl.get_parameter(name).set(value)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_4AMPL_6_param_10Parameters_5__setitem__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7_amplpy_4AMPL_6_param_10Parameters_5__setitem__ = {"__setitem__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_6_param_10Parameters_5__setitem__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7_amplpy_4AMPL_6_param_10Parameters_5__setitem__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_value = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_name,&__pyx_n_s_value,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 865, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 865, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, 1); __PYX_ERR(3, 865, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_value)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 865, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, 2); __PYX_ERR(3, 865, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setitem__") < 0)) __PYX_ERR(3, 865, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
      values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
    }
    __pyx_v_self = values[0];
    __pyx_v_name = values[1];
    __pyx_v_value = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, __pyx_nargs); __PYX_ERR(3, 865, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.AMPL._param.Parameters.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_4AMPL_6_param_10Parameters_4__setitem__(__pyx_self, __pyx_v_self, __pyx_v_name, __pyx_v_value);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_4AMPL_6_param_10Parameters_4__setitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  unsigned int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setitem__", 1);

  /* "amplpy/ampl.pyx":866
 * 
 *             def __setitem__(self, name, value):
 *                 if isinstance(value, (Real, str)):             # <<<<<<<<<<<<<<
 *                     self.ampl.get_parameter(name).set(value)
 *                 else:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Real); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 866, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyObject_IsInstance(__pyx_v_value, __pyx_t_1); 
  if (!__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = PyUnicode_Check(__pyx_v_value); 
  __pyx_t_2 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "amplpy/ampl.pyx":867
 *             def __setitem__(self, name, value):
 *                 if isinstance(value, (Real, str)):
 *                     self.ampl.get_parameter(name).set(value)             # <<<<<<<<<<<<<<
 *                 else:
 *                     self.ampl.get_parameter(name).set_values(value)
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ampl); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 867, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_get_parameter); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 867, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_name};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 867, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_set); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 867, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_value};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 867, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "amplpy/ampl.pyx":866
 * 
 *             def __setitem__(self, name, value):
 *                 if isinstance(value, (Real, str)):             # <<<<<<<<<<<<<<
 *                     self.ampl.get_parameter(name).set(value)
 *                 else:
 */
    goto __pyx_L3;
  }

  /* "amplpy/ampl.pyx":869
 *                     self.ampl.get_parameter(name).set(value)
 *                 else:
 *                     self.ampl.get_parameter(name).set_values(value)             # <<<<<<<<<<<<<<
 * 
 *             def __iter__(self):
 */
  /*else*/ {
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ampl); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 869, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_get_parameter); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 869, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_name};
      __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 869, __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_set_values); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 869, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (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_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_value};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 869, __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;
  }
  __pyx_L3:;

  /* "amplpy/ampl.pyx":865
 *                 return self.ampl.get_parameter(name)
 * 
 *             def __setitem__(self, name, value):             # <<<<<<<<<<<<<<
 *                 if isinstance(value, (Real, str)):
 *                     self.ampl.get_parameter(name).set(value)
 */

  /* 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_AddTraceback("_amplpy.AMPL._param.Parameters.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/ampl.pyx":871
 *                     self.ampl.get_parameter(name).set_values(value)
 * 
 *             def __iter__(self):             # <<<<<<<<<<<<<<
 *                 return self.ampl.get_parameters()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_4AMPL_6_param_10Parameters_7__iter__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7_amplpy_4AMPL_6_param_10Parameters_7__iter__ = {"__iter__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_6_param_10Parameters_7__iter__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7_amplpy_4AMPL_6_param_10Parameters_7__iter__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 871, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__iter__") < 0)) __PYX_ERR(3, 871, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__iter__", 1, 1, 1, __pyx_nargs); __PYX_ERR(3, 871, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.AMPL._param.Parameters.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_4AMPL_6_param_10Parameters_6__iter__(__pyx_self, __pyx_v_self);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_4AMPL_6_param_10Parameters_6__iter__(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;
  unsigned int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__iter__", 1);

  /* "amplpy/ampl.pyx":872
 * 
 *             def __iter__(self):
 *                 return self.ampl.get_parameters()             # <<<<<<<<<<<<<<
 * 
 *         return Parameters(self)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ampl); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 872, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_get_parameters); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 872, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 872, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "amplpy/ampl.pyx":871
 *                     self.ampl.get_parameter(name).set_values(value)
 * 
 *             def __iter__(self):             # <<<<<<<<<<<<<<
 *                 return self.ampl.get_parameters()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("_amplpy.AMPL._param.Parameters.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/ampl.pyx":853
 *         return Sets(self)
 * 
 *     def _param(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get/Set a parameter.
 */

static PyObject *__pyx_pf_7_amplpy_4AMPL_78_param(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self) {
  PyObject *__pyx_v_Parameters = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_param", 1);

  /* "amplpy/ampl.pyx":858
 *         """
 * 
 *         class Parameters(object):             # <<<<<<<<<<<<<<
 *             def __init__(self, ampl):
 *                 self.ampl = ampl
 */
  __pyx_t_1 = __Pyx_PEP560_update_bases(__pyx_tuple__73); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 858, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 858, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_Parameters, __pyx_n_s_param_locals_Parameters, (PyObject *) NULL, __pyx_n_s_amplpy, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 858, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__pyx_t_1 != __pyx_tuple__73) {
    if (unlikely((PyDict_SetItemString(__pyx_t_3, "__orig_bases__", __pyx_tuple__73) < 0))) __PYX_ERR(3, 858, __pyx_L1_error)
  }

  /* "amplpy/ampl.pyx":859
 * 
 *         class Parameters(object):
 *             def __init__(self, ampl):             # <<<<<<<<<<<<<<
 *                 self.ampl = ampl
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_4AMPL_6_param_10Parameters_1__init__, 0, __pyx_n_s_param_locals_Parameters___init, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__74)); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 859, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_init, __pyx_t_4) < 0) __PYX_ERR(3, 859, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "amplpy/ampl.pyx":862
 *                 self.ampl = ampl
 * 
 *             def __getitem__(self, name):             # <<<<<<<<<<<<<<
 *                 return self.ampl.get_parameter(name)
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_4AMPL_6_param_10Parameters_3__getitem__, 0, __pyx_n_s_param_locals_Parameters___getit, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 862, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_getitem, __pyx_t_4) < 0) __PYX_ERR(3, 862, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "amplpy/ampl.pyx":865
 *                 return self.ampl.get_parameter(name)
 * 
 *             def __setitem__(self, name, value):             # <<<<<<<<<<<<<<
 *                 if isinstance(value, (Real, str)):
 *                     self.ampl.get_parameter(name).set(value)
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_4AMPL_6_param_10Parameters_5__setitem__, 0, __pyx_n_s_param_locals_Parameters___setit, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__76)); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 865, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_setitem, __pyx_t_4) < 0) __PYX_ERR(3, 865, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "amplpy/ampl.pyx":871
 *                     self.ampl.get_parameter(name).set_values(value)
 * 
 *             def __iter__(self):             # <<<<<<<<<<<<<<
 *                 return self.ampl.get_parameters()
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_4AMPL_6_param_10Parameters_7__iter__, 0, __pyx_n_s_param_locals_Parameters___iter, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__77)); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 871, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_iter, __pyx_t_4) < 0) __PYX_ERR(3, 871, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "amplpy/ampl.pyx":858
 *         """
 * 
 *         class Parameters(object):             # <<<<<<<<<<<<<<
 *             def __init__(self, ampl):
 *                 self.ampl = ampl
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_Parameters, __pyx_t_1, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 858, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_v_Parameters = __pyx_t_4;
  __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "amplpy/ampl.pyx":874
 *                 return self.ampl.get_parameters()
 * 
 *         return Parameters(self)             # <<<<<<<<<<<<<<
 * 
 *     def _option(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_v_Parameters, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 874, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "amplpy/ampl.pyx":853
 *         return Sets(self)
 * 
 *     def _param(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get/Set a parameter.
 */

  /* 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("_amplpy.AMPL._param", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_Parameters);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/ampl.pyx":876
 *         return Parameters(self)
 * 
 *     def _option(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get/Set an option.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_4AMPL_81_option(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_4AMPL_80_option, "AMPL._option(self)\n\n        Get/Set an option.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_4AMPL_81_option = {"_option", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_81_option, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_4AMPL_80_option};
static PyObject *__pyx_pw_7_amplpy_4AMPL_81_option(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_option (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("_option", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "_option", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_4AMPL_80_option(((struct __pyx_obj_7_amplpy_AMPL *)__pyx_v_self));

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

/* "amplpy/ampl.pyx":882
 * 
 *         class Options(object):
 *             def __init__(self, ampl):             # <<<<<<<<<<<<<<
 *                 self.ampl = ampl
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_4AMPL_7_option_7Options_1__init__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7_amplpy_4AMPL_7_option_7Options_1__init__ = {"__init__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_7_option_7Options_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7_amplpy_4AMPL_7_option_7Options_1__init__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_ampl = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_ampl,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 882, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ampl)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 882, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(3, 882, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(3, 882, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_ampl = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, __pyx_nargs); __PYX_ERR(3, 882, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.AMPL._option.Options.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_4AMPL_7_option_7Options___init__(__pyx_self, __pyx_v_self, __pyx_v_ampl);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_4AMPL_7_option_7Options___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_ampl) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 1);

  /* "amplpy/ampl.pyx":883
 *         class Options(object):
 *             def __init__(self, ampl):
 *                 self.ampl = ampl             # <<<<<<<<<<<<<<
 * 
 *             def __getitem__(self, name):
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_ampl, __pyx_v_ampl) < 0) __PYX_ERR(3, 883, __pyx_L1_error)

  /* "amplpy/ampl.pyx":882
 * 
 *         class Options(object):
 *             def __init__(self, ampl):             # <<<<<<<<<<<<<<
 *                 self.ampl = ampl
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("_amplpy.AMPL._option.Options.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/ampl.pyx":885
 *                 self.ampl = ampl
 * 
 *             def __getitem__(self, name):             # <<<<<<<<<<<<<<
 *                 return self.ampl.get_option(name)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_4AMPL_7_option_7Options_3__getitem__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7_amplpy_4AMPL_7_option_7Options_3__getitem__ = {"__getitem__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_7_option_7Options_3__getitem__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7_amplpy_4AMPL_7_option_7Options_3__getitem__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_name = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_name,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 885, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 885, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, 1); __PYX_ERR(3, 885, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__getitem__") < 0)) __PYX_ERR(3, 885, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_name = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, __pyx_nargs); __PYX_ERR(3, 885, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.AMPL._option.Options.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_4AMPL_7_option_7Options_2__getitem__(__pyx_self, __pyx_v_self, __pyx_v_name);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_4AMPL_7_option_7Options_2__getitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getitem__", 1);

  /* "amplpy/ampl.pyx":886
 * 
 *             def __getitem__(self, name):
 *                 return self.ampl.get_option(name)             # <<<<<<<<<<<<<<
 * 
 *             def __setitem__(self, name, value):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ampl); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 886, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_get_option); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 886, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_name};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 886, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "amplpy/ampl.pyx":885
 *                 self.ampl = ampl
 * 
 *             def __getitem__(self, name):             # <<<<<<<<<<<<<<
 *                 return self.ampl.get_option(name)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("_amplpy.AMPL._option.Options.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/ampl.pyx":888
 *                 return self.ampl.get_option(name)
 * 
 *             def __setitem__(self, name, value):             # <<<<<<<<<<<<<<
 *                 self.ampl.set_option(name, value)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_4AMPL_7_option_7Options_5__setitem__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7_amplpy_4AMPL_7_option_7Options_5__setitem__ = {"__setitem__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_7_option_7Options_5__setitem__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7_amplpy_4AMPL_7_option_7Options_5__setitem__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_value = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_name,&__pyx_n_s_value,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 888, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 888, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, 1); __PYX_ERR(3, 888, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_value)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 888, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, 2); __PYX_ERR(3, 888, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setitem__") < 0)) __PYX_ERR(3, 888, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
      values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
    }
    __pyx_v_self = values[0];
    __pyx_v_name = values[1];
    __pyx_v_value = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, __pyx_nargs); __PYX_ERR(3, 888, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.AMPL._option.Options.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_4AMPL_7_option_7Options_4__setitem__(__pyx_self, __pyx_v_self, __pyx_v_name, __pyx_v_value);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_4AMPL_7_option_7Options_4__setitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name, 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;
  unsigned int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setitem__", 1);

  /* "amplpy/ampl.pyx":889
 * 
 *             def __setitem__(self, name, value):
 *                 self.ampl.set_option(name, value)             # <<<<<<<<<<<<<<
 * 
 *         return Options(self)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ampl); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 889, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_set_option); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 889, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_name, __pyx_v_value};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 889, __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;

  /* "amplpy/ampl.pyx":888
 *                 return self.ampl.get_option(name)
 * 
 *             def __setitem__(self, name, value):             # <<<<<<<<<<<<<<
 *                 self.ampl.set_option(name, value)
 * 
 */

  /* 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("_amplpy.AMPL._option.Options.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/ampl.pyx":876
 *         return Parameters(self)
 * 
 *     def _option(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get/Set an option.
 */

static PyObject *__pyx_pf_7_amplpy_4AMPL_80_option(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self) {
  PyObject *__pyx_v_Options = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_option", 1);

  /* "amplpy/ampl.pyx":881
 *         """
 * 
 *         class Options(object):             # <<<<<<<<<<<<<<
 *             def __init__(self, ampl):
 *                 self.ampl = ampl
 */
  __pyx_t_1 = __Pyx_PEP560_update_bases(__pyx_tuple__79); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 881, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 881, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_Options, __pyx_n_s_option_locals_Options, (PyObject *) NULL, __pyx_n_s_amplpy, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 881, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__pyx_t_1 != __pyx_tuple__79) {
    if (unlikely((PyDict_SetItemString(__pyx_t_3, "__orig_bases__", __pyx_tuple__79) < 0))) __PYX_ERR(3, 881, __pyx_L1_error)
  }

  /* "amplpy/ampl.pyx":882
 * 
 *         class Options(object):
 *             def __init__(self, ampl):             # <<<<<<<<<<<<<<
 *                 self.ampl = ampl
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_4AMPL_7_option_7Options_1__init__, 0, __pyx_n_s_option_locals_Options___init, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__80)); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 882, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_init, __pyx_t_4) < 0) __PYX_ERR(3, 882, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "amplpy/ampl.pyx":885
 *                 self.ampl = ampl
 * 
 *             def __getitem__(self, name):             # <<<<<<<<<<<<<<
 *                 return self.ampl.get_option(name)
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_4AMPL_7_option_7Options_3__getitem__, 0, __pyx_n_s_option_locals_Options___getitem, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__81)); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 885, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_getitem, __pyx_t_4) < 0) __PYX_ERR(3, 885, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "amplpy/ampl.pyx":888
 *                 return self.ampl.get_option(name)
 * 
 *             def __setitem__(self, name, value):             # <<<<<<<<<<<<<<
 *                 self.ampl.set_option(name, value)
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_4AMPL_7_option_7Options_5__setitem__, 0, __pyx_n_s_option_locals_Options___setitem, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__82)); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 888, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_setitem, __pyx_t_4) < 0) __PYX_ERR(3, 888, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "amplpy/ampl.pyx":881
 *         """
 * 
 *         class Options(object):             # <<<<<<<<<<<<<<
 *             def __init__(self, ampl):
 *                 self.ampl = ampl
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_Options, __pyx_t_1, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 881, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_v_Options = __pyx_t_4;
  __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "amplpy/ampl.pyx":891
 *                 self.ampl.set_option(name, value)
 * 
 *         return Options(self)             # <<<<<<<<<<<<<<
 * 
 *     var = property(_var)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_v_Options, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 891, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "amplpy/ampl.pyx":876
 *         return Parameters(self)
 * 
 *     def _option(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get/Set an option.
 */

  /* 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("_amplpy.AMPL._option", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_Options);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/ampl.pyx":901
 * 
 * 
 *     def export_model(self, filename=""):             # <<<<<<<<<<<<<<
 *         """
 *         Create a .mod file with the model that has been loaded.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_4AMPL_83export_model(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_4AMPL_82export_model, "AMPL.export_model(self, filename=u'')\n\n        Create a .mod file with the model that has been loaded.\n\n        Args:\n            filename: Path to the file (Relative to the current working\n            directory or absolute).\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_4AMPL_83export_model = {"export_model", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_83export_model, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_4AMPL_82export_model};
static PyObject *__pyx_pw_7_amplpy_4AMPL_83export_model(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_filename = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("export_model (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_filename,0};
    values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_kp_u__22));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_filename);
          if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 901, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "export_model") < 0)) __PYX_ERR(3, 901, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_filename = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("export_model", 0, 0, 1, __pyx_nargs); __PYX_ERR(3, 901, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.AMPL.export_model", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_4AMPL_82export_model(((struct __pyx_obj_7_amplpy_AMPL *)__pyx_v_self), __pyx_v_filename);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_4AMPL_82export_model(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self, PyObject *__pyx_v_filename) {
  AMPL_ERRORINFO *__pyx_v_errorinfo;
  AMPL_RETCODE __pyx_v_rc;
  char *__pyx_v_output_c;
  PyObject *__pyx_v_output = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  char const *__pyx_t_5;
  int __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("export_model", 1);

  /* "amplpy/ampl.pyx":912
 *         cdef campl.AMPL_RETCODE rc
 *         cdef char* output_c
 *         errorinfo = campl.AMPL_Snapshot(self._c_ampl, filename.encode('utf-8'), 1, 0, 0, &output_c)             # <<<<<<<<<<<<<<
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_filename, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 912, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_u_utf_8};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 912, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_t_5 = __Pyx_PyObject_AsString(__pyx_t_1); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) __PYX_ERR(3, 912, __pyx_L1_error)
  __pyx_v_errorinfo = AMPL_Snapshot(__pyx_v_self->_c_ampl, __pyx_t_5, 1, 0, 0, (&__pyx_v_output_c));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "amplpy/ampl.pyx":913
 *         cdef char* output_c
 *         errorinfo = campl.AMPL_Snapshot(self._c_ampl, filename.encode('utf-8'), 1, 0, 0, &output_c)
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)             # <<<<<<<<<<<<<<
 *         if rc != campl.AMPL_OK:
 *             campl.AMPL_StringFree(&output_c)
 */
  __pyx_v_rc = AMPL_ErrorInfoGetError(__pyx_v_errorinfo);

  /* "amplpy/ampl.pyx":914
 *         errorinfo = campl.AMPL_Snapshot(self._c_ampl, filename.encode('utf-8'), 1, 0, 0, &output_c)
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:             # <<<<<<<<<<<<<<
 *             campl.AMPL_StringFree(&output_c)
 *             PY_AMPL_CALL(errorinfo)
 */
  __pyx_t_6 = (__pyx_v_rc != AMPL_OK);
  if (__pyx_t_6) {

    /* "amplpy/ampl.pyx":915
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:
 *             campl.AMPL_StringFree(&output_c)             # <<<<<<<<<<<<<<
 *             PY_AMPL_CALL(errorinfo)
 *         output = str(output_c.decode('utf-8'))
 */
    (void)(AMPL_StringFree((&__pyx_v_output_c)));

    /* "amplpy/ampl.pyx":916
 *         if rc != campl.AMPL_OK:
 *             campl.AMPL_StringFree(&output_c)
 *             PY_AMPL_CALL(errorinfo)             # <<<<<<<<<<<<<<
 *         output = str(output_c.decode('utf-8'))
 *         campl.AMPL_StringFree(&output_c)
 */
    __pyx_t_1 = __pyx_f_7_amplpy_PY_AMPL_CALL(__pyx_v_errorinfo); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 916, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "amplpy/ampl.pyx":914
 *         errorinfo = campl.AMPL_Snapshot(self._c_ampl, filename.encode('utf-8'), 1, 0, 0, &output_c)
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:             # <<<<<<<<<<<<<<
 *             campl.AMPL_StringFree(&output_c)
 *             PY_AMPL_CALL(errorinfo)
 */
  }

  /* "amplpy/ampl.pyx":917
 *             campl.AMPL_StringFree(&output_c)
 *             PY_AMPL_CALL(errorinfo)
 *         output = str(output_c.decode('utf-8'))             # <<<<<<<<<<<<<<
 *         campl.AMPL_StringFree(&output_c)
 * 
 */
  __pyx_t_7 = __Pyx_ssize_strlen(__pyx_v_output_c); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(3, 917, __pyx_L1_error)
  __pyx_t_1 = __Pyx_decode_c_string(__pyx_v_output_c, 0, __pyx_t_7, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 917, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_output = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "amplpy/ampl.pyx":918
 *             PY_AMPL_CALL(errorinfo)
 *         output = str(output_c.decode('utf-8'))
 *         campl.AMPL_StringFree(&output_c)             # <<<<<<<<<<<<<<
 * 
 *         return output
 */
  (void)(AMPL_StringFree((&__pyx_v_output_c)));

  /* "amplpy/ampl.pyx":920
 *         campl.AMPL_StringFree(&output_c)
 * 
 *         return output             # <<<<<<<<<<<<<<
 * 
 *     def export_data(self, filename=""):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_output);
  __pyx_r = __pyx_v_output;
  goto __pyx_L0;

  /* "amplpy/ampl.pyx":901
 * 
 * 
 *     def export_model(self, filename=""):             # <<<<<<<<<<<<<<
 *         """
 *         Create a .mod file with the model that has been loaded.
 */

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

/* "amplpy/ampl.pyx":922
 *         return output
 * 
 *     def export_data(self, filename=""):             # <<<<<<<<<<<<<<
 *         """
 *         Create a .dat file with the data that has been loaded.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_4AMPL_85export_data(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_4AMPL_84export_data, "AMPL.export_data(self, filename=u'')\n\n        Create a .dat file with the data that has been loaded.\n\n        Args:\n            filename: Path to the file (Relative to the current working\n            directory or absolute).\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_4AMPL_85export_data = {"export_data", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_85export_data, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_4AMPL_84export_data};
static PyObject *__pyx_pw_7_amplpy_4AMPL_85export_data(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_filename = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("export_data (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_filename,0};
    values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_kp_u__22));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_filename);
          if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 922, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "export_data") < 0)) __PYX_ERR(3, 922, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_filename = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("export_data", 0, 0, 1, __pyx_nargs); __PYX_ERR(3, 922, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.AMPL.export_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_4AMPL_84export_data(((struct __pyx_obj_7_amplpy_AMPL *)__pyx_v_self), __pyx_v_filename);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_4AMPL_84export_data(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self, PyObject *__pyx_v_filename) {
  AMPL_ERRORINFO *__pyx_v_errorinfo;
  AMPL_RETCODE __pyx_v_rc;
  char *__pyx_v_output_c;
  PyObject *__pyx_v_output = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  char const *__pyx_t_5;
  int __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("export_data", 1);

  /* "amplpy/ampl.pyx":933
 *         cdef campl.AMPL_RETCODE rc
 *         cdef char* output_c
 *         errorinfo = campl.AMPL_Snapshot(self._c_ampl, filename.encode('utf-8'), 0, 1, 0, &output_c)             # <<<<<<<<<<<<<<
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_filename, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 933, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_u_utf_8};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 933, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_t_5 = __Pyx_PyObject_AsString(__pyx_t_1); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) __PYX_ERR(3, 933, __pyx_L1_error)
  __pyx_v_errorinfo = AMPL_Snapshot(__pyx_v_self->_c_ampl, __pyx_t_5, 0, 1, 0, (&__pyx_v_output_c));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "amplpy/ampl.pyx":934
 *         cdef char* output_c
 *         errorinfo = campl.AMPL_Snapshot(self._c_ampl, filename.encode('utf-8'), 0, 1, 0, &output_c)
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)             # <<<<<<<<<<<<<<
 *         if rc != campl.AMPL_OK:
 *             campl.AMPL_StringFree(&output_c)
 */
  __pyx_v_rc = AMPL_ErrorInfoGetError(__pyx_v_errorinfo);

  /* "amplpy/ampl.pyx":935
 *         errorinfo = campl.AMPL_Snapshot(self._c_ampl, filename.encode('utf-8'), 0, 1, 0, &output_c)
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:             # <<<<<<<<<<<<<<
 *             campl.AMPL_StringFree(&output_c)
 *             PY_AMPL_CALL(errorinfo)
 */
  __pyx_t_6 = (__pyx_v_rc != AMPL_OK);
  if (__pyx_t_6) {

    /* "amplpy/ampl.pyx":936
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:
 *             campl.AMPL_StringFree(&output_c)             # <<<<<<<<<<<<<<
 *             PY_AMPL_CALL(errorinfo)
 *         output = str(output_c.decode('utf-8'))
 */
    (void)(AMPL_StringFree((&__pyx_v_output_c)));

    /* "amplpy/ampl.pyx":937
 *         if rc != campl.AMPL_OK:
 *             campl.AMPL_StringFree(&output_c)
 *             PY_AMPL_CALL(errorinfo)             # <<<<<<<<<<<<<<
 *         output = str(output_c.decode('utf-8'))
 *         campl.AMPL_StringFree(&output_c)
 */
    __pyx_t_1 = __pyx_f_7_amplpy_PY_AMPL_CALL(__pyx_v_errorinfo); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 937, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "amplpy/ampl.pyx":935
 *         errorinfo = campl.AMPL_Snapshot(self._c_ampl, filename.encode('utf-8'), 0, 1, 0, &output_c)
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:             # <<<<<<<<<<<<<<
 *             campl.AMPL_StringFree(&output_c)
 *             PY_AMPL_CALL(errorinfo)
 */
  }

  /* "amplpy/ampl.pyx":938
 *             campl.AMPL_StringFree(&output_c)
 *             PY_AMPL_CALL(errorinfo)
 *         output = str(output_c.decode('utf-8'))             # <<<<<<<<<<<<<<
 *         campl.AMPL_StringFree(&output_c)
 * 
 */
  __pyx_t_7 = __Pyx_ssize_strlen(__pyx_v_output_c); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(3, 938, __pyx_L1_error)
  __pyx_t_1 = __Pyx_decode_c_string(__pyx_v_output_c, 0, __pyx_t_7, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 938, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_output = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "amplpy/ampl.pyx":939
 *             PY_AMPL_CALL(errorinfo)
 *         output = str(output_c.decode('utf-8'))
 *         campl.AMPL_StringFree(&output_c)             # <<<<<<<<<<<<<<
 * 
 *         return output
 */
  (void)(AMPL_StringFree((&__pyx_v_output_c)));

  /* "amplpy/ampl.pyx":941
 *         campl.AMPL_StringFree(&output_c)
 * 
 *         return output             # <<<<<<<<<<<<<<
 * 
 *     def snapshot(self, filename="", model=True, data=True, options=True):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_output);
  __pyx_r = __pyx_v_output;
  goto __pyx_L0;

  /* "amplpy/ampl.pyx":922
 *         return output
 * 
 *     def export_data(self, filename=""):             # <<<<<<<<<<<<<<
 *         """
 *         Create a .dat file with the data that has been loaded.
 */

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

/* "amplpy/ampl.pyx":943
 *         return output
 * 
 *     def snapshot(self, filename="", model=True, data=True, options=True):             # <<<<<<<<<<<<<<
 *         """
 *         Create a snapshot file that replicates the current session.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_4AMPL_87snapshot(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_4AMPL_86snapshot, "AMPL.snapshot(self, filename=u'', model=True, data=True, options=True)\n\n        Create a snapshot file that replicates the current session.\n\n        Args:\n            filename: Path to the file (Relative to the current working\n            directory or absolute).\n\n            model: include model declaration if set to ``True``.\n\n            data: include data declaration if set to ``True``.\n\n            options: include options if set to ``True``.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_4AMPL_87snapshot = {"snapshot", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_87snapshot, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_4AMPL_86snapshot};
static PyObject *__pyx_pw_7_amplpy_4AMPL_87snapshot(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_filename = 0;
  PyObject *__pyx_v_model = 0;
  PyObject *__pyx_v_data = 0;
  PyObject *__pyx_v_options = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[4] = {0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("snapshot (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_filename,&__pyx_n_s_model,&__pyx_n_s_data,&__pyx_n_s_options_2,0};
    values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_kp_u__22));
    values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_True));
    values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_True));
    values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_True));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_filename);
          if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 943, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_model);
          if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 943, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data);
          if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 943, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_options_2);
          if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 943, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "snapshot") < 0)) __PYX_ERR(3, 943, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_filename = values[0];
    __pyx_v_model = values[1];
    __pyx_v_data = values[2];
    __pyx_v_options = values[3];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("snapshot", 0, 0, 4, __pyx_nargs); __PYX_ERR(3, 943, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.AMPL.snapshot", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_4AMPL_86snapshot(((struct __pyx_obj_7_amplpy_AMPL *)__pyx_v_self), __pyx_v_filename, __pyx_v_model, __pyx_v_data, __pyx_v_options);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_4AMPL_86snapshot(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self, PyObject *__pyx_v_filename, PyObject *__pyx_v_model, PyObject *__pyx_v_data, PyObject *__pyx_v_options) {
  AMPL_ERRORINFO *__pyx_v_errorinfo;
  AMPL_RETCODE __pyx_v_rc;
  int __pyx_v_model_c;
  int __pyx_v_data_c;
  int __pyx_v_options_c;
  char *__pyx_v_output_c;
  PyObject *__pyx_v_output = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  unsigned int __pyx_t_5;
  char const *__pyx_t_6;
  int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("snapshot", 1);

  /* "amplpy/ampl.pyx":959
 *         cdef campl.AMPL_ERRORINFO* errorinfo
 *         cdef campl.AMPL_RETCODE rc
 *         cdef int model_c = model             # <<<<<<<<<<<<<<
 *         cdef int data_c = data
 *         cdef int options_c = options
 */
  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_model); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 959, __pyx_L1_error)
  __pyx_v_model_c = __pyx_t_1;

  /* "amplpy/ampl.pyx":960
 *         cdef campl.AMPL_RETCODE rc
 *         cdef int model_c = model
 *         cdef int data_c = data             # <<<<<<<<<<<<<<
 *         cdef int options_c = options
 *         cdef char* output_c
 */
  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_data); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 960, __pyx_L1_error)
  __pyx_v_data_c = __pyx_t_1;

  /* "amplpy/ampl.pyx":961
 *         cdef int model_c = model
 *         cdef int data_c = data
 *         cdef int options_c = options             # <<<<<<<<<<<<<<
 *         cdef char* output_c
 *         errorinfo = campl.AMPL_Snapshot(self._c_ampl, filename.encode('utf-8'), model_c, data_c, options_c, &output_c)
 */
  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_options); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 961, __pyx_L1_error)
  __pyx_v_options_c = __pyx_t_1;

  /* "amplpy/ampl.pyx":963
 *         cdef int options_c = options
 *         cdef char* output_c
 *         errorinfo = campl.AMPL_Snapshot(self._c_ampl, filename.encode('utf-8'), model_c, data_c, options_c, &output_c)             # <<<<<<<<<<<<<<
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_filename, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 963, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_u_utf_8};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 963, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_t_2); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(3, 963, __pyx_L1_error)
  __pyx_v_errorinfo = AMPL_Snapshot(__pyx_v_self->_c_ampl, __pyx_t_6, __pyx_v_model_c, __pyx_v_data_c, __pyx_v_options_c, (&__pyx_v_output_c));
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "amplpy/ampl.pyx":964
 *         cdef char* output_c
 *         errorinfo = campl.AMPL_Snapshot(self._c_ampl, filename.encode('utf-8'), model_c, data_c, options_c, &output_c)
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)             # <<<<<<<<<<<<<<
 *         if rc != campl.AMPL_OK:
 *             campl.AMPL_StringFree(&output_c)
 */
  __pyx_v_rc = AMPL_ErrorInfoGetError(__pyx_v_errorinfo);

  /* "amplpy/ampl.pyx":965
 *         errorinfo = campl.AMPL_Snapshot(self._c_ampl, filename.encode('utf-8'), model_c, data_c, options_c, &output_c)
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:             # <<<<<<<<<<<<<<
 *             campl.AMPL_StringFree(&output_c)
 *             PY_AMPL_CALL(errorinfo)
 */
  __pyx_t_7 = (__pyx_v_rc != AMPL_OK);
  if (__pyx_t_7) {

    /* "amplpy/ampl.pyx":966
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:
 *             campl.AMPL_StringFree(&output_c)             # <<<<<<<<<<<<<<
 *             PY_AMPL_CALL(errorinfo)
 *         output = str(output_c.decode('utf-8'))
 */
    (void)(AMPL_StringFree((&__pyx_v_output_c)));

    /* "amplpy/ampl.pyx":967
 *         if rc != campl.AMPL_OK:
 *             campl.AMPL_StringFree(&output_c)
 *             PY_AMPL_CALL(errorinfo)             # <<<<<<<<<<<<<<
 *         output = str(output_c.decode('utf-8'))
 *         campl.AMPL_StringFree(&output_c)
 */
    __pyx_t_2 = __pyx_f_7_amplpy_PY_AMPL_CALL(__pyx_v_errorinfo); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 967, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "amplpy/ampl.pyx":965
 *         errorinfo = campl.AMPL_Snapshot(self._c_ampl, filename.encode('utf-8'), model_c, data_c, options_c, &output_c)
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 *         if rc != campl.AMPL_OK:             # <<<<<<<<<<<<<<
 *             campl.AMPL_StringFree(&output_c)
 *             PY_AMPL_CALL(errorinfo)
 */
  }

  /* "amplpy/ampl.pyx":968
 *             campl.AMPL_StringFree(&output_c)
 *             PY_AMPL_CALL(errorinfo)
 *         output = str(output_c.decode('utf-8'))             # <<<<<<<<<<<<<<
 *         campl.AMPL_StringFree(&output_c)
 * 
 */
  __pyx_t_8 = __Pyx_ssize_strlen(__pyx_v_output_c); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(3, 968, __pyx_L1_error)
  __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_output_c, 0, __pyx_t_8, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 968, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_output = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "amplpy/ampl.pyx":969
 *             PY_AMPL_CALL(errorinfo)
 *         output = str(output_c.decode('utf-8'))
 *         campl.AMPL_StringFree(&output_c)             # <<<<<<<<<<<<<<
 * 
 *         return output
 */
  (void)(AMPL_StringFree((&__pyx_v_output_c)));

  /* "amplpy/ampl.pyx":971
 *         campl.AMPL_StringFree(&output_c)
 * 
 *         return output             # <<<<<<<<<<<<<<
 * 
 *     def write(self, filename, auxfiles=""):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_output);
  __pyx_r = __pyx_v_output;
  goto __pyx_L0;

  /* "amplpy/ampl.pyx":943
 *         return output
 * 
 *     def snapshot(self, filename="", model=True, data=True, options=True):             # <<<<<<<<<<<<<<
 *         """
 *         Create a snapshot file that replicates the current session.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("_amplpy.AMPL.snapshot", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_output);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/ampl.pyx":973
 *         return output
 * 
 *     def write(self, filename, auxfiles=""):             # <<<<<<<<<<<<<<
 *         """
 *         Invoke write command with filename as argument and
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_4AMPL_89write(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_4AMPL_88write, "AMPL.write(self, filename, auxfiles=u'')\n\n        Invoke write command with filename as argument and\n        set auxfiles if non-empty.\n\n        Args:\n            filename: outuput filename.\n            auxfiles: auxfiles to export.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_4AMPL_89write = {"write", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_89write, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_4AMPL_88write};
static PyObject *__pyx_pw_7_amplpy_4AMPL_89write(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_filename = 0;
  PyObject *__pyx_v_auxfiles = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("write (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_filename,&__pyx_n_s_auxfiles,0};
    values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_kp_u__22));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_filename)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 973, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_auxfiles);
          if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 973, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "write") < 0)) __PYX_ERR(3, 973, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_filename = values[0];
    __pyx_v_auxfiles = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("write", 0, 1, 2, __pyx_nargs); __PYX_ERR(3, 973, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.AMPL.write", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_4AMPL_88write(((struct __pyx_obj_7_amplpy_AMPL *)__pyx_v_self), __pyx_v_filename, __pyx_v_auxfiles);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_4AMPL_88write(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self, PyObject *__pyx_v_filename, PyObject *__pyx_v_auxfiles) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  char const *__pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  char const *__pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("write", 1);

  /* "amplpy/ampl.pyx":982
 *             auxfiles: auxfiles to export.
 *         """
 *         PY_AMPL_CALL(campl.AMPL_Write(self._c_ampl, filename.encode('utf-8'), auxfiles.encode('utf-8')))             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_filename, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 982, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_u_utf_8};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 982, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_t_5 = __Pyx_PyObject_AsString(__pyx_t_1); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) __PYX_ERR(3, 982, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_auxfiles, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 982, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (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);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_kp_u_utf_8};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 982, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_t_7 = __Pyx_PyObject_AsString(__pyx_t_2); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(3, 982, __pyx_L1_error)
  __pyx_t_3 = __pyx_f_7_amplpy_PY_AMPL_CALL(AMPL_Write(__pyx_v_self->_c_ampl, __pyx_t_5, __pyx_t_7)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 982, __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;

  /* "amplpy/ampl.pyx":973
 *         return output
 * 
 *     def write(self, filename, auxfiles=""):             # <<<<<<<<<<<<<<
 *         """
 *         Invoke write command with filename as argument and
 */

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

/* "amplpy/ampl.pyx":984
 *         PY_AMPL_CALL(campl.AMPL_Write(self._c_ampl, filename.encode('utf-8'), auxfiles.encode('utf-8')))
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def solve_result(self):
 *         """
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_4AMPL_12solve_result_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7_amplpy_4AMPL_12solve_result_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7_amplpy_4AMPL_12solve_result___get__(((struct __pyx_obj_7_amplpy_AMPL *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_4AMPL_12solve_result___get__(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 1);

  /* "amplpy/ampl.pyx":1007
 *         +---------+-----------+---------------------------------------------+
 *         """
 *         return self.get_value("solve_result")             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1007, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_n_u_solve_result};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1007, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "amplpy/ampl.pyx":984
 *         PY_AMPL_CALL(campl.AMPL_Write(self._c_ampl, filename.encode('utf-8'), auxfiles.encode('utf-8')))
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def solve_result(self):
 *         """
 */

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

/* "amplpy/ampl.pyx":1009
 *         return self.get_value("solve_result")
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def solve_result_num(self):
 *         """
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_4AMPL_16solve_result_num_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7_amplpy_4AMPL_16solve_result_num_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7_amplpy_4AMPL_16solve_result_num___get__(((struct __pyx_obj_7_amplpy_AMPL *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_4AMPL_16solve_result_num___get__(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 1);

  /* "amplpy/ampl.pyx":1032
 *         +---------+-----------+---------------------------------------------+
 *         """
 *         return self.get_value("solve_result_num")             # <<<<<<<<<<<<<<
 * 
 *     def get_iis(self, flat=True):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1032, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_n_u_solve_result_num};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1032, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "amplpy/ampl.pyx":1009
 *         return self.get_value("solve_result")
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def solve_result_num(self):
 *         """
 */

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

/* "amplpy/ampl.pyx":1034
 *         return self.get_value("solve_result_num")
 * 
 *     def get_iis(self, flat=True):             # <<<<<<<<<<<<<<
 *         """
 *         Get IIS attributes for all variables and constraints.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_4AMPL_91get_iis(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_4AMPL_90get_iis, "AMPL.get_iis(self, flat=True)\n\n        Get IIS attributes for all variables and constraints.\n\n        Args:\n            flat: Return flat dictionaries if set to True, or nested dictionaries otherwise.\n\n        Returns:\n            Tuple with a dictionary for variables in the IIS and another for the constraints.\n\n        Usage example:\n\n        .. code-block:: python\n\n            from amplpy import AMPL\n            ampl = AMPL()\n            ampl.eval(\n                r\"\"\"\n            var x >= 0;\n            var y >= 0;\n            maximize obj: x+y;\n            s.t. s: x+y <= -5;\n            \"\"\"\n            )\n            ampl.option[\"presolve\"] = 0  # disable AMPL presolve\n            ampl.solve(solver=\"gurobi\", gurobi_options=\"outlev=1 iis=1\")\n            if ampl.solve_result == \"infeasible\":\n                var_iis, con_iis = ampl.get_iis()\n                print(var_iis, con_iis)\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_4AMPL_91get_iis = {"get_iis", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_91get_iis, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_4AMPL_90get_iis};
static PyObject *__pyx_pw_7_amplpy_4AMPL_91get_iis(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_flat = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_iis (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flat,0};
    values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_True));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_flat);
          if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 1034, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get_iis") < 0)) __PYX_ERR(3, 1034, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_flat = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_iis", 0, 0, 1, __pyx_nargs); __PYX_ERR(3, 1034, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.AMPL.get_iis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_4AMPL_90get_iis(((struct __pyx_obj_7_amplpy_AMPL *)__pyx_v_self), __pyx_v_flat);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_4AMPL_90get_iis(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self, PyObject *__pyx_v_flat) {
  PyObject *__pyx_v_iis_var = NULL;
  PyObject *__pyx_v_iis_con = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_iis", 1);

  /* "amplpy/ampl.pyx":1064
 *                 print(var_iis, con_iis)
 *         """
 *         iis_var = self.get_data(             # <<<<<<<<<<<<<<
 *             "{i in 1.._nvars: _var[i].iis != 'non'} (_varname[i], _var[i].iis)"
 *         ).to_list(skip_index=True)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1064, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_u_i_in_1__nvars__var_i_iis_non__v};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1064, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }

  /* "amplpy/ampl.pyx":1066
 *         iis_var = self.get_data(
 *             "{i in 1.._nvars: _var[i].iis != 'non'} (_varname[i], _var[i].iis)"
 *         ).to_list(skip_index=True)             # <<<<<<<<<<<<<<
 *         iis_con = self.get_data(
 *             "{i in 1.._ncons: _con[i].iis != 'non'} (_conname[i], _con[i].iis)"
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_to_list); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1066, __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(3, 1066, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_skip_index, Py_True) < 0) __PYX_ERR(3, 1066, __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(3, 1066, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_iis_var = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "amplpy/ampl.pyx":1067
 *             "{i in 1.._nvars: _var[i].iis != 'non'} (_varname[i], _var[i].iis)"
 *         ).to_list(skip_index=True)
 *         iis_con = self.get_data(             # <<<<<<<<<<<<<<
 *             "{i in 1.._ncons: _con[i].iis != 'non'} (_conname[i], _con[i].iis)"
 *         ).to_list(skip_index=True)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1067, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (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);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_kp_u_i_in_1__ncons__con_i_iis_non__c};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1067, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "amplpy/ampl.pyx":1069
 *         iis_con = self.get_data(
 *             "{i in 1.._ncons: _con[i].iis != 'non'} (_conname[i], _con[i].iis)"
 *         ).to_list(skip_index=True)             # <<<<<<<<<<<<<<
 *         if flat is False:
 *             iis_var = nested_dict_of_suffixes(iis_var)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_to_list); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1069, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1069, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_skip_index, Py_True) < 0) __PYX_ERR(3, 1069, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1069, __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_iis_con = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "amplpy/ampl.pyx":1070
 *             "{i in 1.._ncons: _con[i].iis != 'non'} (_conname[i], _con[i].iis)"
 *         ).to_list(skip_index=True)
 *         if flat is False:             # <<<<<<<<<<<<<<
 *             iis_var = nested_dict_of_suffixes(iis_var)
 *             iis_con = nested_dict_of_suffixes(iis_con)
 */
  __pyx_t_5 = (__pyx_v_flat == Py_False);
  if (__pyx_t_5) {

    /* "amplpy/ampl.pyx":1071
 *         ).to_list(skip_index=True)
 *         if flat is False:
 *             iis_var = nested_dict_of_suffixes(iis_var)             # <<<<<<<<<<<<<<
 *             iis_con = nested_dict_of_suffixes(iis_con)
 *         else:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_nested_dict_of_suffixes); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1071, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = NULL;
    __pyx_t_4 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_4 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_iis_var};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1071, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF_SET(__pyx_v_iis_var, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "amplpy/ampl.pyx":1072
 *         if flat is False:
 *             iis_var = nested_dict_of_suffixes(iis_var)
 *             iis_con = nested_dict_of_suffixes(iis_con)             # <<<<<<<<<<<<<<
 *         else:
 *             iis_var = dict(iis_var)
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_nested_dict_of_suffixes); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1072, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = NULL;
    __pyx_t_4 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_4 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_iis_con};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1072, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF_SET(__pyx_v_iis_con, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "amplpy/ampl.pyx":1070
 *             "{i in 1.._ncons: _con[i].iis != 'non'} (_conname[i], _con[i].iis)"
 *         ).to_list(skip_index=True)
 *         if flat is False:             # <<<<<<<<<<<<<<
 *             iis_var = nested_dict_of_suffixes(iis_var)
 *             iis_con = nested_dict_of_suffixes(iis_con)
 */
    goto __pyx_L3;
  }

  /* "amplpy/ampl.pyx":1074
 *             iis_con = nested_dict_of_suffixes(iis_con)
 *         else:
 *             iis_var = dict(iis_var)             # <<<<<<<<<<<<<<
 *             iis_con = dict(iis_con)
 *         return iis_var, iis_con
 */
  /*else*/ {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyDict_Type)), __pyx_v_iis_var); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1074, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF_SET(__pyx_v_iis_var, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "amplpy/ampl.pyx":1075
 *         else:
 *             iis_var = dict(iis_var)
 *             iis_con = dict(iis_con)             # <<<<<<<<<<<<<<
 *         return iis_var, iis_con
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyDict_Type)), __pyx_v_iis_con); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1075, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF_SET(__pyx_v_iis_con, __pyx_t_2);
    __pyx_t_2 = 0;
  }
  __pyx_L3:;

  /* "amplpy/ampl.pyx":1076
 *             iis_var = dict(iis_var)
 *             iis_con = dict(iis_con)
 *         return iis_var, iis_con             # <<<<<<<<<<<<<<
 * 
 *     def get_solution(self, flat=True, zeros=False):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1076, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_iis_var);
  __Pyx_GIVEREF(__pyx_v_iis_var);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_iis_var)) __PYX_ERR(3, 1076, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_iis_con);
  __Pyx_GIVEREF(__pyx_v_iis_con);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_iis_con)) __PYX_ERR(3, 1076, __pyx_L1_error);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "amplpy/ampl.pyx":1034
 *         return self.get_value("solve_result_num")
 * 
 *     def get_iis(self, flat=True):             # <<<<<<<<<<<<<<
 *         """
 *         Get IIS attributes for all variables and constraints.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("_amplpy.AMPL.get_iis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_iis_var);
  __Pyx_XDECREF(__pyx_v_iis_con);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/ampl.pyx":1078
 *         return iis_var, iis_con
 * 
 *     def get_solution(self, flat=True, zeros=False):             # <<<<<<<<<<<<<<
 *         """
 *         Get solution values for all variables.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_4AMPL_93get_solution(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_4AMPL_92get_solution, "AMPL.get_solution(self, flat=True, zeros=False)\n\n        Get solution values for all variables.\n\n        Args:\n            flat: Return a flat dictionary if set to True, or a nested dictionary otherwise.\n\n            zeros: Include zeros in the solution if set to True.\n\n        Returns:\n            Returns a dictionary with the solution.\n\n        Usage example:\n\n        .. code-block:: python\n\n            ampl.solve(solver=\"gurobi\", gurobi_options=\"outlev=0\")\n            if ampl.solve_result == \"solved\":\n                print(ampl.get_solution())\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_4AMPL_93get_solution = {"get_solution", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_93get_solution, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_4AMPL_92get_solution};
static PyObject *__pyx_pw_7_amplpy_4AMPL_93get_solution(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_flat = 0;
  PyObject *__pyx_v_zeros = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_solution (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flat,&__pyx_n_s_zeros,0};
    values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_True));
    values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_False));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_flat);
          if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 1078, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_zeros);
          if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 1078, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get_solution") < 0)) __PYX_ERR(3, 1078, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_flat = values[0];
    __pyx_v_zeros = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_solution", 0, 0, 2, __pyx_nargs); __PYX_ERR(3, 1078, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.AMPL.get_solution", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_4AMPL_92get_solution(((struct __pyx_obj_7_amplpy_AMPL *)__pyx_v_self), __pyx_v_flat, __pyx_v_zeros);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_4AMPL_92get_solution(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self, PyObject *__pyx_v_flat, PyObject *__pyx_v_zeros) {
  PyObject *__pyx_v_stmt = NULL;
  PyObject *__pyx_v_lst_solution = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  unsigned int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_solution", 1);

  /* "amplpy/ampl.pyx":1098
 *                 print(ampl.get_solution())
 *         """
 *         if zeros:             # <<<<<<<<<<<<<<
 *             stmt = "{i in 1.._nvars} (_varname[i], _var[i].val)"
 *         else:
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_zeros); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(3, 1098, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "amplpy/ampl.pyx":1099
 *         """
 *         if zeros:
 *             stmt = "{i in 1.._nvars} (_varname[i], _var[i].val)"             # <<<<<<<<<<<<<<
 *         else:
 *             stmt = "{i in 1.._nvars: _var[i].val != 0} (_varname[i], _var[i].val)"
 */
    __Pyx_INCREF(__pyx_kp_u_i_in_1__nvars__varname_i__var_i);
    __pyx_v_stmt = __pyx_kp_u_i_in_1__nvars__varname_i__var_i;

    /* "amplpy/ampl.pyx":1098
 *                 print(ampl.get_solution())
 *         """
 *         if zeros:             # <<<<<<<<<<<<<<
 *             stmt = "{i in 1.._nvars} (_varname[i], _var[i].val)"
 *         else:
 */
    goto __pyx_L3;
  }

  /* "amplpy/ampl.pyx":1101
 *             stmt = "{i in 1.._nvars} (_varname[i], _var[i].val)"
 *         else:
 *             stmt = "{i in 1.._nvars: _var[i].val != 0} (_varname[i], _var[i].val)"             # <<<<<<<<<<<<<<
 *         lst_solution = self.get_data(stmt).to_list(skip_index=True)
 *         if flat:
 */
  /*else*/ {
    __Pyx_INCREF(__pyx_kp_u_i_in_1__nvars__var_i_val_0__var);
    __pyx_v_stmt = __pyx_kp_u_i_in_1__nvars__var_i_val_0__var;
  }
  __pyx_L3:;

  /* "amplpy/ampl.pyx":1102
 *         else:
 *             stmt = "{i in 1.._nvars: _var[i].val != 0} (_varname[i], _var[i].val)"
 *         lst_solution = self.get_data(stmt).to_list(skip_index=True)             # <<<<<<<<<<<<<<
 *         if flat:
 *             return dict(lst_solution)
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_data); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1102, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_stmt};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1102, __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_to_list); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1102, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1102, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_skip_index, Py_True) < 0) __PYX_ERR(3, 1102, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1102, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_lst_solution = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "amplpy/ampl.pyx":1103
 *             stmt = "{i in 1.._nvars: _var[i].val != 0} (_varname[i], _var[i].val)"
 *         lst_solution = self.get_data(stmt).to_list(skip_index=True)
 *         if flat:             # <<<<<<<<<<<<<<
 *             return dict(lst_solution)
 *         return nested_dict_of_suffixes(lst_solution)
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_flat); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(3, 1103, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "amplpy/ampl.pyx":1104
 *         lst_solution = self.get_data(stmt).to_list(skip_index=True)
 *         if flat:
 *             return dict(lst_solution)             # <<<<<<<<<<<<<<
 *         return nested_dict_of_suffixes(lst_solution)
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyDict_Type)), __pyx_v_lst_solution); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1104, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "amplpy/ampl.pyx":1103
 *             stmt = "{i in 1.._nvars: _var[i].val != 0} (_varname[i], _var[i].val)"
 *         lst_solution = self.get_data(stmt).to_list(skip_index=True)
 *         if flat:             # <<<<<<<<<<<<<<
 *             return dict(lst_solution)
 *         return nested_dict_of_suffixes(lst_solution)
 */
  }

  /* "amplpy/ampl.pyx":1105
 *         if flat:
 *             return dict(lst_solution)
 *         return nested_dict_of_suffixes(lst_solution)             # <<<<<<<<<<<<<<
 * 
 *     def _start_recording(self, filename):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_nested_dict_of_suffixes); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1105, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_lst_solution};
    __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1105, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "amplpy/ampl.pyx":1078
 *         return iis_var, iis_con
 * 
 *     def get_solution(self, flat=True, zeros=False):             # <<<<<<<<<<<<<<
 *         """
 *         Get solution values for all variables.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("_amplpy.AMPL.get_solution", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_stmt);
  __Pyx_XDECREF(__pyx_v_lst_solution);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/ampl.pyx":1107
 *         return nested_dict_of_suffixes(lst_solution)
 * 
 *     def _start_recording(self, filename):             # <<<<<<<<<<<<<<
 *         """
 *         Start recording the session to a file for debug purposes.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_4AMPL_95_start_recording(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_4AMPL_94_start_recording, "AMPL._start_recording(self, filename)\n\n        Start recording the session to a file for debug purposes.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_4AMPL_95_start_recording = {"_start_recording", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_95_start_recording, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_4AMPL_94_start_recording};
static PyObject *__pyx_pw_7_amplpy_4AMPL_95_start_recording(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_filename = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_start_recording (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_filename,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_filename)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 1107, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_start_recording") < 0)) __PYX_ERR(3, 1107, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_filename = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_start_recording", 1, 1, 1, __pyx_nargs); __PYX_ERR(3, 1107, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.AMPL._start_recording", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_4AMPL_94_start_recording(((struct __pyx_obj_7_amplpy_AMPL *)__pyx_v_self), __pyx_v_filename);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_4AMPL_94_start_recording(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self, PyObject *__pyx_v_filename) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  char const *__pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_start_recording", 0);
  __Pyx_INCREF(__pyx_v_filename);

  /* "amplpy/ampl.pyx":1111
 *         Start recording the session to a file for debug purposes.
 *         """
 *         filename = str(filename)             # <<<<<<<<<<<<<<
 *         PY_AMPL_CALL(campl.AMPL_SetOption(self._c_ampl, "_log_file_name", filename.encode('utf-8')))
 *         PY_AMPL_CALL(campl.AMPL_SetDblOption(self._c_ampl, "_log_input_only", 1))
 */
  __pyx_t_1 = __Pyx_PyObject_Unicode(__pyx_v_filename); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1111, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_filename, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "amplpy/ampl.pyx":1112
 *         """
 *         filename = str(filename)
 *         PY_AMPL_CALL(campl.AMPL_SetOption(self._c_ampl, "_log_file_name", filename.encode('utf-8')))             # <<<<<<<<<<<<<<
 *         PY_AMPL_CALL(campl.AMPL_SetDblOption(self._c_ampl, "_log_input_only", 1))
 *         PY_AMPL_CALL(campl.AMPL_SetDblOption(self._c_ampl, "_log", 1))
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_filename, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1112, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_u_utf_8};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1112, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_t_5 = __Pyx_PyObject_AsString(__pyx_t_1); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) __PYX_ERR(3, 1112, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_7_amplpy_PY_AMPL_CALL(AMPL_SetOption(__pyx_v_self->_c_ampl, ((char const *)"_log_file_name"), __pyx_t_5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1112, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "amplpy/ampl.pyx":1113
 *         filename = str(filename)
 *         PY_AMPL_CALL(campl.AMPL_SetOption(self._c_ampl, "_log_file_name", filename.encode('utf-8')))
 *         PY_AMPL_CALL(campl.AMPL_SetDblOption(self._c_ampl, "_log_input_only", 1))             # <<<<<<<<<<<<<<
 *         PY_AMPL_CALL(campl.AMPL_SetDblOption(self._c_ampl, "_log", 1))
 * 
 */
  __pyx_t_2 = __pyx_f_7_amplpy_PY_AMPL_CALL(AMPL_SetDblOption(__pyx_v_self->_c_ampl, ((char const *)"_log_input_only"), 1.0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1113, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "amplpy/ampl.pyx":1114
 *         PY_AMPL_CALL(campl.AMPL_SetOption(self._c_ampl, "_log_file_name", filename.encode('utf-8')))
 *         PY_AMPL_CALL(campl.AMPL_SetDblOption(self._c_ampl, "_log_input_only", 1))
 *         PY_AMPL_CALL(campl.AMPL_SetDblOption(self._c_ampl, "_log", 1))             # <<<<<<<<<<<<<<
 * 
 *     def _stop_recording(self):
 */
  __pyx_t_2 = __pyx_f_7_amplpy_PY_AMPL_CALL(AMPL_SetDblOption(__pyx_v_self->_c_ampl, ((char const *)"_log"), 1.0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1114, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "amplpy/ampl.pyx":1107
 *         return nested_dict_of_suffixes(lst_solution)
 * 
 *     def _start_recording(self, filename):             # <<<<<<<<<<<<<<
 *         """
 *         Start recording the session to a file for debug purposes.
 */

  /* 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("_amplpy.AMPL._start_recording", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_filename);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/ampl.pyx":1116
 *         PY_AMPL_CALL(campl.AMPL_SetDblOption(self._c_ampl, "_log", 1))
 * 
 *     def _stop_recording(self):             # <<<<<<<<<<<<<<
 *         """
 *         Stop recording the session.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_4AMPL_97_stop_recording(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_4AMPL_96_stop_recording, "AMPL._stop_recording(self)\n\n        Stop recording the session.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_4AMPL_97_stop_recording = {"_stop_recording", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_97_stop_recording, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_4AMPL_96_stop_recording};
static PyObject *__pyx_pw_7_amplpy_4AMPL_97_stop_recording(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_stop_recording (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("_stop_recording", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "_stop_recording", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_4AMPL_96_stop_recording(((struct __pyx_obj_7_amplpy_AMPL *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_4AMPL_96_stop_recording(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_stop_recording", 1);

  /* "amplpy/ampl.pyx":1120
 *         Stop recording the session.
 *         """
 *         PY_AMPL_CALL(campl.AMPL_SetDblOption(self._c_ampl, "_log", 0))             # <<<<<<<<<<<<<<
 * 
 *     def _load_session(self, filename):
 */
  __pyx_t_1 = __pyx_f_7_amplpy_PY_AMPL_CALL(AMPL_SetDblOption(__pyx_v_self->_c_ampl, ((char const *)"_log"), 0.0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1120, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "amplpy/ampl.pyx":1116
 *         PY_AMPL_CALL(campl.AMPL_SetDblOption(self._c_ampl, "_log", 1))
 * 
 *     def _stop_recording(self):             # <<<<<<<<<<<<<<
 *         """
 *         Stop recording the session.
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("_amplpy.AMPL._stop_recording", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "amplpy/ampl.pyx":1122
 *         PY_AMPL_CALL(campl.AMPL_SetDblOption(self._c_ampl, "_log", 0))
 * 
 *     def _load_session(self, filename):             # <<<<<<<<<<<<<<
 *         """
 *         Load a recorded session.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_4AMPL_99_load_session(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_4AMPL_98_load_session, "AMPL._load_session(self, filename)\n\n        Load a recorded session.\n        ");
static PyMethodDef __pyx_mdef_7_amplpy_4AMPL_99_load_session = {"_load_session", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_99_load_session, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_4AMPL_98_load_session};
static PyObject *__pyx_pw_7_amplpy_4AMPL_99_load_session(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_filename = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_load_session (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_filename,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_filename)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 1122, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_load_session") < 0)) __PYX_ERR(3, 1122, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_filename = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_load_session", 1, 1, 1, __pyx_nargs); __PYX_ERR(3, 1122, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.AMPL._load_session", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_4AMPL_98_load_session(((struct __pyx_obj_7_amplpy_AMPL *)__pyx_v_self), __pyx_v_filename);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_4AMPL_98_load_session(struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self, PyObject *__pyx_v_filename) {
  PyObject *__pyx_v_exp = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  unsigned int __pyx_t_9;
  int __pyx_t_10;
  int __pyx_t_11;
  char const *__pyx_t_12;
  PyObject *__pyx_t_13 = NULL;
  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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_load_session", 0);
  __Pyx_INCREF(__pyx_v_filename);

  /* "amplpy/ampl.pyx":1126
 *         Load a recorded session.
 *         """
 *         filename = str(filename)             # <<<<<<<<<<<<<<
 *         try:
 *             self.eval(open(filename).read())
 */
  __pyx_t_1 = __Pyx_PyObject_Unicode(__pyx_v_filename); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1126, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_filename, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "amplpy/ampl.pyx":1127
 *         """
 *         filename = str(filename)
 *         try:             # <<<<<<<<<<<<<<
 *             self.eval(open(filename).read())
 *         except RuntimeError as exp:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    /*try:*/ {

      /* "amplpy/ampl.pyx":1128
 *         filename = str(filename)
 *         try:
 *             self.eval(open(filename).read())             # <<<<<<<<<<<<<<
 *         except RuntimeError as exp:
 *             print(exp)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_eval); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 1128, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_open, __pyx_v_filename); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 1128, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_read); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1128, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = NULL;
      __pyx_t_9 = 0;
      #if CYTHON_UNPACK_METHODS
      if (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);
          __pyx_t_9 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL};
        __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_9, 0+__pyx_t_9);
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 1128, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
      __pyx_t_8 = NULL;
      __pyx_t_9 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_8)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
          __pyx_t_9 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_6};
        __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9);
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1128, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "amplpy/ampl.pyx":1127
 *         """
 *         filename = str(filename)
 *         try:             # <<<<<<<<<<<<<<
 *             self.eval(open(filename).read())
 *         except RuntimeError as exp:
 */
    }
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "amplpy/ampl.pyx":1129
 *         try:
 *             self.eval(open(filename).read())
 *         except RuntimeError as exp:             # <<<<<<<<<<<<<<
 *             print(exp)
 * 
 */
    __pyx_t_10 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_RuntimeError);
    if (__pyx_t_10) {
      __Pyx_AddTraceback("_amplpy.AMPL._load_session", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_5, &__pyx_t_6) < 0) __PYX_ERR(3, 1129, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_5);
      __pyx_v_exp = __pyx_t_5;
      /*try:*/ {

        /* "amplpy/ampl.pyx":1130
 *             self.eval(open(filename).read())
 *         except RuntimeError as exp:
 *             print(exp)             # <<<<<<<<<<<<<<
 * 
 *     # Aliases
 */
        __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_print, __pyx_v_exp); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1130, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }

      /* "amplpy/ampl.pyx":1129
 *         try:
 *             self.eval(open(filename).read())
 *         except RuntimeError as exp:             # <<<<<<<<<<<<<<
 *             print(exp)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_exp); __pyx_v_exp = 0;
          goto __pyx_L15;
        }
        __pyx_L14_error:;
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15) < 0)) __Pyx_ErrFetch(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_13);
          __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_t_10 = __pyx_lineno; __pyx_t_11 = __pyx_clineno; __pyx_t_12 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_exp); __pyx_v_exp = 0;
          }
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_16);
            __Pyx_XGIVEREF(__pyx_t_17);
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_ExceptionReset(__pyx_t_16, __pyx_t_17, __pyx_t_18);
          }
          __Pyx_XGIVEREF(__pyx_t_13);
          __Pyx_XGIVEREF(__pyx_t_14);
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_ErrRestore(__pyx_t_13, __pyx_t_14, __pyx_t_15);
          __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0;
          __pyx_lineno = __pyx_t_10; __pyx_clineno = __pyx_t_11; __pyx_filename = __pyx_t_12;
          goto __pyx_L5_except_error;
        }
        __pyx_L15:;
      }
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;

    /* "amplpy/ampl.pyx":1127
 *         """
 *         filename = str(filename)
 *         try:             # <<<<<<<<<<<<<<
 *             self.eval(open(filename).read())
 *         except RuntimeError as exp:
 */
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
    __pyx_L8_try_end:;
  }

  /* "amplpy/ampl.pyx":1122
 *         PY_AMPL_CALL(campl.AMPL_SetDblOption(self._c_ampl, "_log", 0))
 * 
 *     def _load_session(self, filename):             # <<<<<<<<<<<<<<
 *         """
 *         Load a recorded session.
 */

  /* 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_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("_amplpy.AMPL._load_session", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_exp);
  __Pyx_XDECREF(__pyx_v_filename);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._c_ampl cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_4AMPL_101__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_4AMPL_100__reduce_cython__, "AMPL.__reduce_cython__(self)");
static PyMethodDef __pyx_mdef_7_amplpy_4AMPL_101__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_101__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_4AMPL_100__reduce_cython__};
static PyObject *__pyx_pw_7_amplpy_4AMPL_101__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL;
  __pyx_r = __pyx_pf_7_amplpy_4AMPL_100__reduce_cython__(((struct __pyx_obj_7_amplpy_AMPL *)__pyx_v_self));

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

static PyObject *__pyx_pf_7_amplpy_4AMPL_100__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 1);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "self._c_ampl cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self._c_ampl cannot be converted to a Python object for pickling"
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_self__c_ampl_cannot_be_converted, 0, 0);
  __PYX_ERR(8, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._c_ampl cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 */

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

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._c_ampl cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._c_ampl cannot be converted to a Python object for pickling"
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_4AMPL_103__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_4AMPL_102__setstate_cython__, "AMPL.__setstate_cython__(self, __pyx_state)");
static PyMethodDef __pyx_mdef_7_amplpy_4AMPL_103__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_103__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_4AMPL_102__setstate_cython__};
static PyObject *__pyx_pw_7_amplpy_4AMPL_103__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 3, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(8, 3, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(8, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.AMPL.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_4AMPL_102__setstate_cython__(((struct __pyx_obj_7_amplpy_AMPL *)__pyx_v_self), __pyx_v___pyx_state);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_4AMPL_102__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7_amplpy_AMPL *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 1);

  /* "(tree fragment)":4
 *     raise TypeError, "self._c_ampl cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self._c_ampl cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_self__c_ampl_cannot_be_converted, 0, 0);
  __PYX_ERR(8, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._c_ampl cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._c_ampl cannot be converted to a Python object for pickling"
 */

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

/* "(tree fragment)":1
 * def __pyx_unpickle_ErrorHandler(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_5__pyx_unpickle_ErrorHandler(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_4__pyx_unpickle_ErrorHandler, "__pyx_unpickle_ErrorHandler(__pyx_type, long __pyx_checksum, __pyx_state)");
static PyMethodDef __pyx_mdef_7_amplpy_5__pyx_unpickle_ErrorHandler = {"__pyx_unpickle_ErrorHandler", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_5__pyx_unpickle_ErrorHandler, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_4__pyx_unpickle_ErrorHandler};
static PyObject *__pyx_pw_7_amplpy_5__pyx_unpickle_ErrorHandler(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_type = 0;
  long __pyx_v___pyx_checksum;
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_unpickle_ErrorHandler (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_type)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 1, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_checksum)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 1, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_ErrorHandler", 1, 3, 3, 1); __PYX_ERR(8, 1, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 1, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_ErrorHandler", 1, 3, 3, 2); __PYX_ERR(8, 1, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__pyx_unpickle_ErrorHandler") < 0)) __PYX_ERR(8, 1, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
      values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
    }
    __pyx_v___pyx_type = values[0];
    __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(8, 1, __pyx_L3_error)
    __pyx_v___pyx_state = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_ErrorHandler", 1, 3, 3, __pyx_nargs); __PYX_ERR(8, 1, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.__pyx_unpickle_ErrorHandler", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_4__pyx_unpickle_ErrorHandler(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_4__pyx_unpickle_ErrorHandler(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_v___pyx_PickleError = 0;
  PyObject *__pyx_v___pyx_result = 0;
  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;
  unsigned int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_ErrorHandler", 1);

  /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum not in (0xe3b0c44, 0xda39a3e, 0xd41d8cd):             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe3b0c44, 0xda39a3e, 0xd41d8cd) = ())" % __pyx_checksum
 */
  __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_tuple__83, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(8, 4, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "(tree fragment)":5
 *     cdef object __pyx_result
 *     if __pyx_checksum not in (0xe3b0c44, 0xda39a3e, 0xd41d8cd):
 *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe3b0c44, 0xda39a3e, 0xd41d8cd) = ())" % __pyx_checksum
 *     __pyx_result = ErrorHandler.__new__(__pyx_type)
 */
    __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_n_s_PickleError);
    __Pyx_GIVEREF(__pyx_n_s_PickleError);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_PickleError)) __PYX_ERR(8, 5, __pyx_L1_error);
    __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_1);
    __pyx_v___pyx_PickleError = __pyx_t_1;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "(tree fragment)":6
 *     if __pyx_checksum not in (0xe3b0c44, 0xda39a3e, 0xd41d8cd):
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe3b0c44, 0xda39a3e, 0xd41d8cd) = ())" % __pyx_checksum             # <<<<<<<<<<<<<<
 *     __pyx_result = ErrorHandler.__new__(__pyx_type)
 *     if __pyx_state is not None:
 */
    __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_v___pyx_PickleError, __pyx_t_1, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(8, 6, __pyx_L1_error)

    /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum not in (0xe3b0c44, 0xda39a3e, 0xd41d8cd):             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe3b0c44, 0xda39a3e, 0xd41d8cd) = ())" % __pyx_checksum
 */
  }

  /* "(tree fragment)":7
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe3b0c44, 0xda39a3e, 0xd41d8cd) = ())" % __pyx_checksum
 *     __pyx_result = ErrorHandler.__new__(__pyx_type)             # <<<<<<<<<<<<<<
 *     if __pyx_state is not None:
 *         __pyx_unpickle_ErrorHandler__set_state(<ErrorHandler> __pyx_result, __pyx_state)
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7_amplpy_ErrorHandler), __pyx_n_s_new); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v___pyx_type};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 7, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_v___pyx_result = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "(tree fragment)":8
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe3b0c44, 0xda39a3e, 0xd41d8cd) = ())" % __pyx_checksum
 *     __pyx_result = ErrorHandler.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_ErrorHandler__set_state(<ErrorHandler> __pyx_result, __pyx_state)
 *     return __pyx_result
 */
  __pyx_t_2 = (__pyx_v___pyx_state != Py_None);
  if (__pyx_t_2) {

    /* "(tree fragment)":9
 *     __pyx_result = ErrorHandler.__new__(__pyx_type)
 *     if __pyx_state is not None:
 *         __pyx_unpickle_ErrorHandler__set_state(<ErrorHandler> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
 *     return __pyx_result
 * cdef __pyx_unpickle_ErrorHandler__set_state(ErrorHandler __pyx_result, tuple __pyx_state):
 */
    if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(8, 9, __pyx_L1_error)
    __pyx_t_1 = __pyx_f_7_amplpy___pyx_unpickle_ErrorHandler__set_state(((struct __pyx_obj_7_amplpy_ErrorHandler *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "(tree fragment)":8
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe3b0c44, 0xda39a3e, 0xd41d8cd) = ())" % __pyx_checksum
 *     __pyx_result = ErrorHandler.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_ErrorHandler__set_state(<ErrorHandler> __pyx_result, __pyx_state)
 *     return __pyx_result
 */
  }

  /* "(tree fragment)":10
 *     if __pyx_state is not None:
 *         __pyx_unpickle_ErrorHandler__set_state(<ErrorHandler> __pyx_result, __pyx_state)
 *     return __pyx_result             # <<<<<<<<<<<<<<
 * cdef __pyx_unpickle_ErrorHandler__set_state(ErrorHandler __pyx_result, tuple __pyx_state):
 *     if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v___pyx_result);
  __pyx_r = __pyx_v___pyx_result;
  goto __pyx_L0;

  /* "(tree fragment)":1
 * def __pyx_unpickle_ErrorHandler(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("_amplpy.__pyx_unpickle_ErrorHandler", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v___pyx_PickleError);
  __Pyx_XDECREF(__pyx_v___pyx_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":11
 *         __pyx_unpickle_ErrorHandler__set_state(<ErrorHandler> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_ErrorHandler__set_state(ErrorHandler __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[0])
 */

static PyObject *__pyx_f_7_amplpy___pyx_unpickle_ErrorHandler__set_state(struct __pyx_obj_7_amplpy_ErrorHandler *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  unsigned int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_ErrorHandler__set_state", 1);

  /* "(tree fragment)":12
 *     return __pyx_result
 * cdef __pyx_unpickle_ErrorHandler__set_state(ErrorHandler __pyx_result, tuple __pyx_state):
 *     if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[0])
 */
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(8, 12, __pyx_L1_error)
  }
  __pyx_t_2 = __Pyx_PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(8, 12, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_2 > 0);
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(8, 12, __pyx_L1_error)
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "(tree fragment)":13
 * cdef __pyx_unpickle_ErrorHandler__set_state(ErrorHandler __pyx_result, tuple __pyx_state):
 *     if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[0])             # <<<<<<<<<<<<<<
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_update); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(__pyx_v___pyx_state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(8, 13, __pyx_L1_error)
    }
    __pyx_t_5 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, PyTuple_GET_ITEM(__pyx_v___pyx_state, 0)};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 13, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "(tree fragment)":12
 *     return __pyx_result
 * cdef __pyx_unpickle_ErrorHandler__set_state(ErrorHandler __pyx_result, tuple __pyx_state):
 *     if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[0])
 */
  }

  /* "(tree fragment)":11
 *         __pyx_unpickle_ErrorHandler__set_state(<ErrorHandler> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_ErrorHandler__set_state(ErrorHandler __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[0])
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("_amplpy.__pyx_unpickle_ErrorHandler__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __pyx_unpickle_OutputHandler(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

/* Python wrapper */
static PyObject *__pyx_pw_7_amplpy_7__pyx_unpickle_OutputHandler(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7_amplpy_6__pyx_unpickle_OutputHandler, "__pyx_unpickle_OutputHandler(__pyx_type, long __pyx_checksum, __pyx_state)");
static PyMethodDef __pyx_mdef_7_amplpy_7__pyx_unpickle_OutputHandler = {"__pyx_unpickle_OutputHandler", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_7__pyx_unpickle_OutputHandler, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_6__pyx_unpickle_OutputHandler};
static PyObject *__pyx_pw_7_amplpy_7__pyx_unpickle_OutputHandler(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_type = 0;
  long __pyx_v___pyx_checksum;
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_unpickle_OutputHandler (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_type)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 1, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_checksum)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 1, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_OutputHandler", 1, 3, 3, 1); __PYX_ERR(8, 1, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 1, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_OutputHandler", 1, 3, 3, 2); __PYX_ERR(8, 1, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__pyx_unpickle_OutputHandler") < 0)) __PYX_ERR(8, 1, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
      values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
    }
    __pyx_v___pyx_type = values[0];
    __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(8, 1, __pyx_L3_error)
    __pyx_v___pyx_state = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_OutputHandler", 1, 3, 3, __pyx_nargs); __PYX_ERR(8, 1, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("_amplpy.__pyx_unpickle_OutputHandler", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_amplpy_6__pyx_unpickle_OutputHandler(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7_amplpy_6__pyx_unpickle_OutputHandler(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_v___pyx_PickleError = 0;
  PyObject *__pyx_v___pyx_result = 0;
  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;
  unsigned int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_OutputHandler", 1);

  /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum not in (0xe3b0c44, 0xda39a3e, 0xd41d8cd):             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe3b0c44, 0xda39a3e, 0xd41d8cd) = ())" % __pyx_checksum
 */
  __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_tuple__83, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(8, 4, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "(tree fragment)":5
 *     cdef object __pyx_result
 *     if __pyx_checksum not in (0xe3b0c44, 0xda39a3e, 0xd41d8cd):
 *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe3b0c44, 0xda39a3e, 0xd41d8cd) = ())" % __pyx_checksum
 *     __pyx_result = OutputHandler.__new__(__pyx_type)
 */
    __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_n_s_PickleError);
    __Pyx_GIVEREF(__pyx_n_s_PickleError);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_PickleError)) __PYX_ERR(8, 5, __pyx_L1_error);
    __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_1);
    __pyx_v___pyx_PickleError = __pyx_t_1;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "(tree fragment)":6
 *     if __pyx_checksum not in (0xe3b0c44, 0xda39a3e, 0xd41d8cd):
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe3b0c44, 0xda39a3e, 0xd41d8cd) = ())" % __pyx_checksum             # <<<<<<<<<<<<<<
 *     __pyx_result = OutputHandler.__new__(__pyx_type)
 *     if __pyx_state is not None:
 */
    __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_v___pyx_PickleError, __pyx_t_1, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(8, 6, __pyx_L1_error)

    /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum not in (0xe3b0c44, 0xda39a3e, 0xd41d8cd):             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe3b0c44, 0xda39a3e, 0xd41d8cd) = ())" % __pyx_checksum
 */
  }

  /* "(tree fragment)":7
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe3b0c44, 0xda39a3e, 0xd41d8cd) = ())" % __pyx_checksum
 *     __pyx_result = OutputHandler.__new__(__pyx_type)             # <<<<<<<<<<<<<<
 *     if __pyx_state is not None:
 *         __pyx_unpickle_OutputHandler__set_state(<OutputHandler> __pyx_result, __pyx_state)
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7_amplpy_OutputHandler), __pyx_n_s_new); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v___pyx_type};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 7, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_v___pyx_result = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "(tree fragment)":8
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe3b0c44, 0xda39a3e, 0xd41d8cd) = ())" % __pyx_checksum
 *     __pyx_result = OutputHandler.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_OutputHandler__set_state(<OutputHandler> __pyx_result, __pyx_state)
 *     return __pyx_result
 */
  __pyx_t_2 = (__pyx_v___pyx_state != Py_None);
  if (__pyx_t_2) {

    /* "(tree fragment)":9
 *     __pyx_result = OutputHandler.__new__(__pyx_type)
 *     if __pyx_state is not None:
 *         __pyx_unpickle_OutputHandler__set_state(<OutputHandler> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
 *     return __pyx_result
 * cdef __pyx_unpickle_OutputHandler__set_state(OutputHandler __pyx_result, tuple __pyx_state):
 */
    if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(8, 9, __pyx_L1_error)
    __pyx_t_1 = __pyx_f_7_amplpy___pyx_unpickle_OutputHandler__set_state(((struct __pyx_obj_7_amplpy_OutputHandler *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "(tree fragment)":8
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe3b0c44, 0xda39a3e, 0xd41d8cd) = ())" % __pyx_checksum
 *     __pyx_result = OutputHandler.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_OutputHandler__set_state(<OutputHandler> __pyx_result, __pyx_state)
 *     return __pyx_result
 */
  }

  /* "(tree fragment)":10
 *     if __pyx_state is not None:
 *         __pyx_unpickle_OutputHandler__set_state(<OutputHandler> __pyx_result, __pyx_state)
 *     return __pyx_result             # <<<<<<<<<<<<<<
 * cdef __pyx_unpickle_OutputHandler__set_state(OutputHandler __pyx_result, tuple __pyx_state):
 *     if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v___pyx_result);
  __pyx_r = __pyx_v___pyx_result;
  goto __pyx_L0;

  /* "(tree fragment)":1
 * def __pyx_unpickle_OutputHandler(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("_amplpy.__pyx_unpickle_OutputHandler", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v___pyx_PickleError);
  __Pyx_XDECREF(__pyx_v___pyx_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":11
 *         __pyx_unpickle_OutputHandler__set_state(<OutputHandler> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_OutputHandler__set_state(OutputHandler __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[0])
 */

static PyObject *__pyx_f_7_amplpy___pyx_unpickle_OutputHandler__set_state(struct __pyx_obj_7_amplpy_OutputHandler *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  unsigned int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_OutputHandler__set_state", 1);

  /* "(tree fragment)":12
 *     return __pyx_result
 * cdef __pyx_unpickle_OutputHandler__set_state(OutputHandler __pyx_result, tuple __pyx_state):
 *     if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[0])
 */
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(8, 12, __pyx_L1_error)
  }
  __pyx_t_2 = __Pyx_PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(8, 12, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_2 > 0);
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(8, 12, __pyx_L1_error)
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "(tree fragment)":13
 * cdef __pyx_unpickle_OutputHandler__set_state(OutputHandler __pyx_result, tuple __pyx_state):
 *     if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[0])             # <<<<<<<<<<<<<<
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_update); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(__pyx_v___pyx_state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(8, 13, __pyx_L1_error)
    }
    __pyx_t_5 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, PyTuple_GET_ITEM(__pyx_v___pyx_state, 0)};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 13, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "(tree fragment)":12
 *     return __pyx_result
 * cdef __pyx_unpickle_OutputHandler__set_state(OutputHandler __pyx_result, tuple __pyx_state):
 *     if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[0])
 */
  }

  /* "(tree fragment)":11
 *         __pyx_unpickle_OutputHandler__set_state(<OutputHandler> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_OutputHandler__set_state(OutputHandler __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[0])
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("_amplpy.__pyx_unpickle_OutputHandler__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static struct __pyx_vtabstruct_7_amplpy_Row __pyx_vtable_7_amplpy_Row;

static PyObject *__pyx_tp_new_7_amplpy_Row(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7_amplpy_Row *p;
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  #endif
  p = ((struct __pyx_obj_7_amplpy_Row *)o);
  p->__pyx_vtab = __pyx_vtabptr_7_amplpy_Row;
  return o;
}

static void __pyx_tp_dealloc_7_amplpy_Row(PyObject *o) {
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7_amplpy_Row) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
  (*Py_TYPE(o)->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
}
static PyObject *__pyx_sq_item_7_amplpy_Row(PyObject *o, Py_ssize_t i) {
  PyObject *r;
  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  Py_DECREF(x);
  return r;
}

static PyMethodDef __pyx_methods_7_amplpy_Row[] = {
  {"to_string", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_3Row_7to_string, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_3Row_6to_string},
  {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_3Row_9__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_3Row_8__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_3Row_11__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_3Row_10__setstate_cython__},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7_amplpy_Row_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7_amplpy_Row},
  {Py_sq_item, (void *)__pyx_sq_item_7_amplpy_Row},
  {Py_mp_subscript, (void *)__pyx_pw_7_amplpy_3Row_5__getitem__},
  {Py_tp_str, (void *)__pyx_pw_7_amplpy_3Row_1__str__},
  {Py_tp_doc, (void *)PyDoc_STR("\n    Represents a row in a :class:`~amplpy.DataFrame`.\n    ")},
  {Py_tp_iter, (void *)__pyx_pw_7_amplpy_3Row_3__iter__},
  {Py_tp_methods, (void *)__pyx_methods_7_amplpy_Row},
  {Py_tp_new, (void *)__pyx_tp_new_7_amplpy_Row},
  {0, 0},
};
static PyType_Spec __pyx_type_7_amplpy_Row_spec = {
  "_amplpy.Row",
  sizeof(struct __pyx_obj_7_amplpy_Row),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_7_amplpy_Row_slots,
};
#else

static PySequenceMethods __pyx_tp_as_sequence_Row = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  __pyx_sq_item_7_amplpy_Row, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_Row = {
  0, /*mp_length*/
  __pyx_pw_7_amplpy_3Row_5__getitem__, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyTypeObject __pyx_type_7_amplpy_Row = {
  PyVarObject_HEAD_INIT(0, 0)
  "_amplpy.""Row", /*tp_name*/
  sizeof(struct __pyx_obj_7_amplpy_Row), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7_amplpy_Row, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  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*/
  &__pyx_tp_as_sequence_Row, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_Row, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  __pyx_pw_7_amplpy_3Row_1__str__, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  PyDoc_STR("\n    Represents a row in a :class:`~amplpy.DataFrame`.\n    "), /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_7_amplpy_3Row_3__iter__, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7_amplpy_Row, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7_amplpy_Row, /*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
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_7_amplpy_Column __pyx_vtable_7_amplpy_Column;

static PyObject *__pyx_tp_new_7_amplpy_Column(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7_amplpy_Column *p;
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  #endif
  p = ((struct __pyx_obj_7_amplpy_Column *)o);
  p->__pyx_vtab = __pyx_vtabptr_7_amplpy_Column;
  return o;
}

static void __pyx_tp_dealloc_7_amplpy_Column(PyObject *o) {
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7_amplpy_Column) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
  (*Py_TYPE(o)->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
}

static PyMethodDef __pyx_methods_7_amplpy_Column[] = {
  {"to_string", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_6Column_5to_string, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_6Column_4to_string},
  {"to_list", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_6Column_7to_list, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_6Column_6to_list},
  {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_6Column_9__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_6Column_8__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_6Column_11__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_6Column_10__setstate_cython__},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7_amplpy_Column_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7_amplpy_Column},
  {Py_tp_str, (void *)__pyx_pw_7_amplpy_6Column_1__str__},
  {Py_tp_doc, (void *)PyDoc_STR("\n    Represents a column in a :class:`~amplpy.DataFrame`.\n    ")},
  {Py_tp_iter, (void *)__pyx_pw_7_amplpy_6Column_3__iter__},
  {Py_tp_methods, (void *)__pyx_methods_7_amplpy_Column},
  {Py_tp_new, (void *)__pyx_tp_new_7_amplpy_Column},
  {0, 0},
};
static PyType_Spec __pyx_type_7_amplpy_Column_spec = {
  "_amplpy.Column",
  sizeof(struct __pyx_obj_7_amplpy_Column),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_7_amplpy_Column_slots,
};
#else

static PyTypeObject __pyx_type_7_amplpy_Column = {
  PyVarObject_HEAD_INIT(0, 0)
  "_amplpy.""Column", /*tp_name*/
  sizeof(struct __pyx_obj_7_amplpy_Column), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7_amplpy_Column, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  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*/
  __pyx_pw_7_amplpy_6Column_1__str__, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  PyDoc_STR("\n    Represents a column in a :class:`~amplpy.DataFrame`.\n    "), /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_7_amplpy_6Column_3__iter__, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7_amplpy_Column, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7_amplpy_Column, /*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
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_7_amplpy_DataFrame __pyx_vtable_7_amplpy_DataFrame;

static PyObject *__pyx_tp_new_7_amplpy_DataFrame(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7_amplpy_DataFrame *p;
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  #endif
  p = ((struct __pyx_obj_7_amplpy_DataFrame *)o);
  p->__pyx_vtab = __pyx_vtabptr_7_amplpy_DataFrame;
  if (unlikely(__pyx_pw_7_amplpy_9DataFrame_1__cinit__(o, a, k) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_7_amplpy_DataFrame(PyObject *o) {
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7_amplpy_DataFrame) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
    __pyx_pw_7_amplpy_9DataFrame_3__dealloc__(o);
    __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
    PyErr_Restore(etype, eval, etb);
  }
  #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
  (*Py_TYPE(o)->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
}

static PyMethodDef __pyx_methods_7_amplpy_DataFrame[] = {
  {"to_string", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_9DataFrame_5to_string, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_9DataFrame_4to_string},
  {"_get_num_cols", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_9DataFrame_11_get_num_cols, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_9DataFrame_10_get_num_cols},
  {"_get_num_rows", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_9DataFrame_13_get_num_rows, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_9DataFrame_12_get_num_rows},
  {"_get_num_indices", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_9DataFrame_15_get_num_indices, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_9DataFrame_14_get_num_indices},
  {"_add_row", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7_amplpy_9DataFrame_17_add_row, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7_amplpy_9DataFrame_16_add_row},
  {"_add_column", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_9DataFrame_19_add_column, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_9DataFrame_18_add_column},
  {"_get_column", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_9DataFrame_21_get_column, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_9DataFrame_20_get_column},
  {"_set_column", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_9DataFrame_23_set_column, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_9DataFrame_22_set_column},
  {"_get_row", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_9DataFrame_25_get_row, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_9DataFrame_24_get_row},
  {"_get_row_by_index", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_9DataFrame_27_get_row_by_index, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_9DataFrame_26_get_row_by_index},
  {"_get_headers", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_9DataFrame_29_get_headers, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_9DataFrame_28_get_headers},
  {"_set_values", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_9DataFrame_31_set_values, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_9DataFrame_30_set_values},
  {"to_dict", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_9DataFrame_33to_dict, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_9DataFrame_32to_dict},
  {"to_list", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_9DataFrame_35to_list, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_9DataFrame_34to_list},
  {"to_pandas", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_9DataFrame_37to_pandas, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_9DataFrame_36to_pandas},
  {"from_dict", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_9DataFrame_39from_dict, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_9DataFrame_38from_dict},
  {"from_pandas", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_9DataFrame_41from_pandas, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_9DataFrame_40from_pandas},
  {"from_numpy", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_9DataFrame_43from_numpy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_9DataFrame_42from_numpy},
  {"_from_data_frame_ref", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_9DataFrame_45_from_data_frame_ref, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_9DataFrame_44_from_data_frame_ref},
  {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_9DataFrame_47__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_9DataFrame_46__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_9DataFrame_49__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_9DataFrame_48__setstate_cython__},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7_amplpy_DataFrame_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7_amplpy_DataFrame},
  {Py_tp_str, (void *)__pyx_pw_7_amplpy_9DataFrame_7__str__},
  {Py_tp_doc, (void *)PyDoc_STR("\n    A DataFrame object, used to communicate data to and from the AMPL entities.\n\n    .. warning::\n        DataFrame objects should not be instantiated manually. For best performance\n        using Python native types or Pandas DataFrames. The API takes care of the conversion\n        for you in the most efficient way it finds.\n\n    An object of this class can be used to do the following tasks:\n\n    - Assign values to AMPL entities (once the DataFrame is populated, use\n      :func:`~amplpy.AMPL.set_data` to assign its\n      values to the modelling entities in its columns)\n    - Get values from AMPL, decoupling the values from the AMPL entities they\n      originate via\n      :func:`~amplpy.Entity.get_values`.\n\n    A DataFrame object can be created in various ways:\n\n    - Get values from AMPL, decoupling the values from the AMPL entities they originate from\n      (via :func:`~amplpy.Entity.get_values`)\n    - From Pandas dataframes with :func:`~amplpy.DataFrame.from_pandas`\n    - From Numpy matrices with :func:`~amplpy.DataFrame.from_numpy`\n    - From Python dictionaries with :func:`~amplpy.DataFrame.from_dict`\n\n    and can be converted to various object types:\n\n    - Pandas dataframes with :func:`~amplpy.DataFrame.to_pandas`\n    - Python dictionary with :func:`~amplpy.DataFrame.to_dict`\n    - Python list with :func:`~amplpy.DataFrame.to_list`\n    ")},
  {Py_tp_iter, (void *)__pyx_pw_7_amplpy_9DataFrame_9__iter__},
  {Py_tp_methods, (void *)__pyx_methods_7_amplpy_DataFrame},
  {Py_tp_new, (void *)__pyx_tp_new_7_amplpy_DataFrame},
  {0, 0},
};
static PyType_Spec __pyx_type_7_amplpy_DataFrame_spec = {
  "_amplpy.DataFrame",
  sizeof(struct __pyx_obj_7_amplpy_DataFrame),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_7_amplpy_DataFrame_slots,
};
#else

static PyTypeObject __pyx_type_7_amplpy_DataFrame = {
  PyVarObject_HEAD_INIT(0, 0)
  "_amplpy.""DataFrame", /*tp_name*/
  sizeof(struct __pyx_obj_7_amplpy_DataFrame), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7_amplpy_DataFrame, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  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*/
  __pyx_pw_7_amplpy_9DataFrame_7__str__, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  PyDoc_STR("\n    A DataFrame object, used to communicate data to and from the AMPL entities.\n\n    .. warning::\n        DataFrame objects should not be instantiated manually. For best performance\n        using Python native types or Pandas DataFrames. The API takes care of the conversion\n        for you in the most efficient way it finds.\n\n    An object of this class can be used to do the following tasks:\n\n    - Assign values to AMPL entities (once the DataFrame is populated, use\n      :func:`~amplpy.AMPL.set_data` to assign its\n      values to the modelling entities in its columns)\n    - Get values from AMPL, decoupling the values from the AMPL entities they\n      originate via\n      :func:`~amplpy.Entity.get_values`.\n\n    A DataFrame object can be created in various ways:\n\n    - Get values from AMPL, decoupling the values from the AMPL entities they originate from\n      (via :func:`~amplpy.Entity.get_values`)\n    - From Pandas dataframes with :func:`~amplpy.DataFrame.from_pandas`\n    - From Numpy matrices with :func:`~amplpy.DataFrame.from_numpy`\n    - From Python dictionaries with :func:`~amplpy.DataFrame.from_dict`\n\n    and can be converted to various object types:\n\n    - Pandas dataframes with :func:`~amplpy.DataFrame.to_pandas`\n    - Python dictionary with :func:`~amplpy.DataFrame.to_dict`\n    - Python list with :func:`~amplpy.DataFrame.to_list`\n    "), /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_7_amplpy_9DataFrame_9__iter__, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7_amplpy_DataFrame, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7_amplpy_DataFrame, /*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
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_7_amplpy_Entity __pyx_vtable_7_amplpy_Entity;

static PyObject *__pyx_tp_new_7_amplpy_Entity(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7_amplpy_Entity *p;
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  #endif
  p = ((struct __pyx_obj_7_amplpy_Entity *)o);
  p->__pyx_vtab = __pyx_vtabptr_7_amplpy_Entity;
  p->_entity = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_7_amplpy_Entity(PyObject *o) {
  struct __pyx_obj_7_amplpy_Entity *p = (struct __pyx_obj_7_amplpy_Entity *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7_amplpy_Entity) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
    __pyx_pw_7_amplpy_6Entity_1__dealloc__(o);
    __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
    PyErr_Restore(etype, eval, etb);
  }
  Py_CLEAR(p->_entity);
  #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
  (*Py_TYPE(o)->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
}

static int __pyx_tp_traverse_7_amplpy_Entity(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7_amplpy_Entity *p = (struct __pyx_obj_7_amplpy_Entity *)o;
  if (p->_entity) {
    e = (*v)(p->_entity, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7_amplpy_Entity(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7_amplpy_Entity *p = (struct __pyx_obj_7_amplpy_Entity *)o;
  tmp = ((PyObject*)p->_entity);
  p->_entity = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}
static PyObject *__pyx_sq_item_7_amplpy_Entity(PyObject *o, Py_ssize_t i) {
  PyObject *r;
  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  Py_DECREF(x);
  return r;
}

static PyMethodDef __pyx_methods_7_amplpy_Entity[] = {
  {"to_string", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_6Entity_3to_string, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_6Entity_2to_string},
  {"get", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7_amplpy_6Entity_11get, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7_amplpy_6Entity_10get},
  {"find", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_6Entity_13find, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_6Entity_12find},
  {"instances", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_6Entity_15instances, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_6Entity_14instances},
  {"name", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_6Entity_17name, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_6Entity_16name},
  {"indexarity", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_6Entity_19indexarity, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_6Entity_18indexarity},
  {"is_scalar", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_6Entity_21is_scalar, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_6Entity_20is_scalar},
  {"num_instances", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_6Entity_23num_instances, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_6Entity_22num_instances},
  {"get_indexing_sets", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_6Entity_25get_indexing_sets, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_6Entity_24get_indexing_sets},
  {"xref", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_6Entity_27xref, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_6Entity_26xref},
  {"get_values", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_6Entity_29get_values, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_6Entity_28get_values},
  {"to_pandas", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_6Entity_31to_pandas, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_6Entity_30to_pandas},
  {"to_dict", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_6Entity_33to_dict, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_6Entity_32to_dict},
  {"to_list", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_6Entity_35to_list, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_6Entity_34to_list},
  {"set_values", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_6Entity_37set_values, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_6Entity_36set_values},
  {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_6Entity_39__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_6Entity_38__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_6Entity_41__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_6Entity_40__setstate_cython__},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7_amplpy_Entity_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7_amplpy_Entity},
  {Py_sq_item, (void *)__pyx_sq_item_7_amplpy_Entity},
  {Py_mp_subscript, (void *)__pyx_pw_7_amplpy_6Entity_9__getitem__},
  {Py_tp_str, (void *)__pyx_pw_7_amplpy_6Entity_5__str__},
  {Py_tp_doc, (void *)PyDoc_STR("\n    An AMPL entity such as a parameter or a variable.\n\n    An entity can either represent a single instance of an AMPL algebraic\n    entity or, if the corresponding declaration has an indexing expression, a\n    mapping from keys to instances. In the derived classes, it has methods to\n    access instance-level properties which can be used in case the represented\n    entity is scalar.\n\n    To gain access to all the values in an entity (for all instances and all\n    suffixes for that entities), use the function\n    :func:`~amplpy.Entity.get_values`.\n\n    The algebraic entities which currently have an equivalent class in the API\n    are:\n\n    - Variables (see :class:`~amplpy.Variable`)\n    - Constraints (see :class:`~amplpy.Constraint`)\n    - Objectives (see :class:`~amplpy.Objective`)\n    - Sets (see :class:`~amplpy.Set`)\n    - Parameters (see :class:`~amplpy.Parameter`)\n    ")},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_7_amplpy_Entity},
  {Py_tp_clear, (void *)__pyx_tp_clear_7_amplpy_Entity},
  {Py_tp_iter, (void *)__pyx_pw_7_amplpy_6Entity_7__iter__},
  {Py_tp_methods, (void *)__pyx_methods_7_amplpy_Entity},
  {Py_tp_new, (void *)__pyx_tp_new_7_amplpy_Entity},
  {0, 0},
};
static PyType_Spec __pyx_type_7_amplpy_Entity_spec = {
  "_amplpy.Entity",
  sizeof(struct __pyx_obj_7_amplpy_Entity),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
  __pyx_type_7_amplpy_Entity_slots,
};
#else

static PySequenceMethods __pyx_tp_as_sequence_Entity = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  __pyx_sq_item_7_amplpy_Entity, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_Entity = {
  0, /*mp_length*/
  __pyx_pw_7_amplpy_6Entity_9__getitem__, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyTypeObject __pyx_type_7_amplpy_Entity = {
  PyVarObject_HEAD_INIT(0, 0)
  "_amplpy.""Entity", /*tp_name*/
  sizeof(struct __pyx_obj_7_amplpy_Entity), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7_amplpy_Entity, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  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*/
  &__pyx_tp_as_sequence_Entity, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_Entity, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  __pyx_pw_7_amplpy_6Entity_5__str__, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  PyDoc_STR("\n    An AMPL entity such as a parameter or a variable.\n\n    An entity can either represent a single instance of an AMPL algebraic\n    entity or, if the corresponding declaration has an indexing expression, a\n    mapping from keys to instances. In the derived classes, it has methods to\n    access instance-level properties which can be used in case the represented\n    entity is scalar.\n\n    To gain access to all the values in an entity (for all instances and all\n    suffixes for that entities), use the function\n    :func:`~amplpy.Entity.get_values`.\n\n    The algebraic entities which currently have an equivalent class in the API\n    are:\n\n    - Variables (see :class:`~amplpy.Variable`)\n    - Constraints (see :class:`~amplpy.Constraint`)\n    - Objectives (see :class:`~amplpy.Objective`)\n    - Sets (see :class:`~amplpy.Set`)\n    - Parameters (see :class:`~amplpy.Parameter`)\n    "), /*tp_doc*/
  __pyx_tp_traverse_7_amplpy_Entity, /*tp_traverse*/
  __pyx_tp_clear_7_amplpy_Entity, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_7_amplpy_6Entity_7__iter__, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7_amplpy_Entity, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7_amplpy_Entity, /*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
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_7_amplpy_Constraint __pyx_vtable_7_amplpy_Constraint;

static PyObject *__pyx_tp_new_7_amplpy_Constraint(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7_amplpy_Constraint *p;
  PyObject *o = __pyx_tp_new_7_amplpy_Entity(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7_amplpy_Constraint *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7_amplpy_Entity*)__pyx_vtabptr_7_amplpy_Constraint;
  return o;
}

static int __pyx_mp_ass_subscript_7_amplpy_Constraint(PyObject *o, PyObject *i, PyObject *v) {
  if (v) {
    return __pyx_pw_7_amplpy_10Constraint_1__setitem__(o, i, v);
  }
  else {
    __Pyx_TypeName o_type_name;
    if (__pyx_ptype_7_amplpy_Entity->tp_as_mapping && __pyx_ptype_7_amplpy_Entity->tp_as_mapping->mp_ass_subscript)
      return __pyx_ptype_7_amplpy_Entity->tp_as_mapping->mp_ass_subscript(o, i, v);
    o_type_name = __Pyx_PyType_GetName(Py_TYPE(o));
    PyErr_Format(PyExc_NotImplementedError,
      "Subscript deletion not supported by " __Pyx_FMT_TYPENAME, o_type_name);
    __Pyx_DECREF_TypeName(o_type_name);
    return -1;
  }
}

static PyMethodDef __pyx_methods_7_amplpy_Constraint[] = {
  {"is_logical", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_10Constraint_3is_logical, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_10Constraint_2is_logical},
  {"drop", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_10Constraint_5drop, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_10Constraint_4drop},
  {"restore", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_10Constraint_7restore, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_10Constraint_6restore},
  {"body", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_10Constraint_9body, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_10Constraint_8body},
  {"astatus", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_10Constraint_11astatus, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_10Constraint_10astatus},
  {"defvar", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_10Constraint_13defvar, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_10Constraint_12defvar},
  {"dinit", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_10Constraint_15dinit, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_10Constraint_14dinit},
  {"dinit0", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_10Constraint_17dinit0, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_10Constraint_16dinit0},
  {"dual", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_10Constraint_19dual, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_10Constraint_18dual},
  {"lb", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_10Constraint_21lb, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_10Constraint_20lb},
  {"ub", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_10Constraint_23ub, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_10Constraint_22ub},
  {"lbs", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_10Constraint_25lbs, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_10Constraint_24lbs},
  {"ubs", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_10Constraint_27ubs, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_10Constraint_26ubs},
  {"ldual", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_10Constraint_29ldual, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_10Constraint_28ldual},
  {"udual", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_10Constraint_31udual, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_10Constraint_30udual},
  {"lslack", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_10Constraint_33lslack, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_10Constraint_32lslack},
  {"uslack", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_10Constraint_35uslack, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_10Constraint_34uslack},
  {"slack", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_10Constraint_37slack, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_10Constraint_36slack},
  {"sstatus", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_10Constraint_39sstatus, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_10Constraint_38sstatus},
  {"status", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_10Constraint_41status, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_10Constraint_40status},
  {"set_dual", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_10Constraint_43set_dual, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_10Constraint_42set_dual},
  {"val", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_10Constraint_45val, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_10Constraint_44val},
  {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_10Constraint_47__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_10Constraint_46__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_10Constraint_49__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_10Constraint_48__setstate_cython__},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7_amplpy_Constraint_slots[] = {
  {Py_mp_ass_subscript, (void *)__pyx_mp_ass_subscript_7_amplpy_Constraint},
  {Py_tp_doc, (void *)PyDoc_STR("\n    Bases: :class:`~amplpy.Entity`.\n\n    This class represents an algebraic or logical constraint. In case the\n    constraint is scalar, its values can be accessed via functions like\n    :func:`~amplpy.Constraint.body` and :func:`~amplpy.Constraint.dual`.\n    All the AMPL suffixes for constraints (see\n    http://www.ampl.com/NEW/suffbuiltin.html)\n    are available through methods of this class with the same name (and methods\n    of ConstraintInstance for indexed constraints).\n\n    Note that, since this class represents both algebraic and logical\n    constraints, some suffixes might not be available for every entity.\n\n    An TypeError is thrown if one of such methods is called for\n    a non-scalar constraint and if a method corresponding to a suffix which is\n    not supported by the type of the constraint is called.\n    A runtime error is thrown if any property of an entity which has been\n    deleted from the underlying interpreter is accessed.\n\n    To gain access to all the values in an entity (for all instances and all\n    suffixes for that entities), see\n    :func:`~amplpy.Entity.get_values`\n    and the :class:`~amplpy.DataFrame` class.\n    ")},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_7_amplpy_Entity},
  {Py_tp_clear, (void *)__pyx_tp_clear_7_amplpy_Entity},
  {Py_tp_methods, (void *)__pyx_methods_7_amplpy_Constraint},
  {Py_tp_new, (void *)__pyx_tp_new_7_amplpy_Constraint},
  {0, 0},
};
static PyType_Spec __pyx_type_7_amplpy_Constraint_spec = {
  "_amplpy.Constraint",
  sizeof(struct __pyx_obj_7_amplpy_Constraint),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
  __pyx_type_7_amplpy_Constraint_slots,
};
#else

static PyMappingMethods __pyx_tp_as_mapping_Constraint = {
  0, /*mp_length*/
  #if CYTHON_COMPILING_IN_PYPY || 0
  __pyx_pw_7_amplpy_6Entity_9__getitem__, /*mp_subscript*/
  #else
  0, /*mp_subscript*/
  #endif
  __pyx_mp_ass_subscript_7_amplpy_Constraint, /*mp_ass_subscript*/
};

static PyTypeObject __pyx_type_7_amplpy_Constraint = {
  PyVarObject_HEAD_INIT(0, 0)
  "_amplpy.""Constraint", /*tp_name*/
  sizeof(struct __pyx_obj_7_amplpy_Constraint), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7_amplpy_Entity, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  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*/
  &__pyx_tp_as_mapping_Constraint, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY || 0
  __pyx_pw_7_amplpy_6Entity_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  PyDoc_STR("\n    Bases: :class:`~amplpy.Entity`.\n\n    This class represents an algebraic or logical constraint. In case the\n    constraint is scalar, its values can be accessed via functions like\n    :func:`~amplpy.Constraint.body` and :func:`~amplpy.Constraint.dual`.\n    All the AMPL suffixes for constraints (see\n    http://www.ampl.com/NEW/suffbuiltin.html)\n    are available through methods of this class with the same name (and methods\n    of ConstraintInstance for indexed constraints).\n\n    Note that, since this class represents both algebraic and logical\n    constraints, some suffixes might not be available for every entity.\n\n    An TypeError is thrown if one of such methods is called for\n    a non-scalar constraint and if a method corresponding to a suffix which is\n    not supported by the type of the constraint is called.\n    A runtime error is thrown if any property of an entity which has been\n    deleted from the underlying interpreter is accessed.\n\n    To gain access to all the values in an entity (for all instances and all\n    suffixes for that entities), see\n    :func:`~amplpy.Entity.get_values`\n    and the :class:`~amplpy.DataFrame` class.\n    "), /*tp_doc*/
  __pyx_tp_traverse_7_amplpy_Entity, /*tp_traverse*/
  __pyx_tp_clear_7_amplpy_Entity, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY || 0
  __pyx_pw_7_amplpy_6Entity_7__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  __pyx_methods_7_amplpy_Constraint, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7_amplpy_Constraint, /*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
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_7_amplpy_Environment __pyx_vtable_7_amplpy_Environment;

static PyObject *__pyx_tp_new_7_amplpy_Environment(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7_amplpy_Environment *p;
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  #endif
  p = ((struct __pyx_obj_7_amplpy_Environment *)o);
  p->__pyx_vtab = __pyx_vtabptr_7_amplpy_Environment;
  if (unlikely(__pyx_pw_7_amplpy_11Environment_1__cinit__(o, a, k) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_7_amplpy_Environment(PyObject *o) {
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7_amplpy_Environment) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
    __pyx_pw_7_amplpy_11Environment_3__dealloc__(o);
    __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
    PyErr_Restore(etype, eval, etb);
  }
  #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
  (*Py_TYPE(o)->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
}
static PyObject *__pyx_sq_item_7_amplpy_Environment(PyObject *o, Py_ssize_t i) {
  PyObject *r;
  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  Py_DECREF(x);
  return r;
}

static int __pyx_mp_ass_subscript_7_amplpy_Environment(PyObject *o, PyObject *i, PyObject *v) {
  if (v) {
    return __pyx_pw_7_amplpy_11Environment_9__setitem__(o, i, v);
  }
  else {
    __Pyx_TypeName o_type_name;
    o_type_name = __Pyx_PyType_GetName(Py_TYPE(o));
    PyErr_Format(PyExc_NotImplementedError,
      "Subscript deletion not supported by " __Pyx_FMT_TYPENAME, o_type_name);
    __Pyx_DECREF_TypeName(o_type_name);
    return -1;
  }
}

static PyMethodDef __pyx_methods_7_amplpy_Environment[] = {
  {"to_string", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_11Environment_13to_string, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_11Environment_12to_string},
  {"set_bin_dir", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_11Environment_15set_bin_dir, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_11Environment_14set_bin_dir},
  {"get_bin_dir", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_11Environment_17get_bin_dir, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_11Environment_16get_bin_dir},
  {"set_bin_name", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_11Environment_19set_bin_name, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_11Environment_18set_bin_name},
  {"get_bin_name", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_11Environment_21get_bin_name, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_11Environment_20get_bin_name},
  {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_11Environment_23__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_11Environment_22__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_11Environment_25__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_11Environment_24__setstate_cython__},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7_amplpy_Environment_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7_amplpy_Environment},
  {Py_sq_item, (void *)__pyx_sq_item_7_amplpy_Environment},
  {Py_mp_subscript, (void *)__pyx_pw_7_amplpy_11Environment_11__getitem__},
  {Py_mp_ass_subscript, (void *)__pyx_mp_ass_subscript_7_amplpy_Environment},
  {Py_tp_str, (void *)__pyx_pw_7_amplpy_11Environment_5__str__},
  {Py_tp_doc, (void *)PyDoc_STR("\n    This class provides access to the environment variables and provides\n    facilities to specify where to load the underlying AMPL interpreter.\n    ")},
  {Py_tp_iter, (void *)__pyx_pw_7_amplpy_11Environment_7__iter__},
  {Py_tp_methods, (void *)__pyx_methods_7_amplpy_Environment},
  {Py_tp_new, (void *)__pyx_tp_new_7_amplpy_Environment},
  {0, 0},
};
static PyType_Spec __pyx_type_7_amplpy_Environment_spec = {
  "_amplpy.Environment",
  sizeof(struct __pyx_obj_7_amplpy_Environment),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_7_amplpy_Environment_slots,
};
#else

static PySequenceMethods __pyx_tp_as_sequence_Environment = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  __pyx_sq_item_7_amplpy_Environment, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_Environment = {
  0, /*mp_length*/
  __pyx_pw_7_amplpy_11Environment_11__getitem__, /*mp_subscript*/
  __pyx_mp_ass_subscript_7_amplpy_Environment, /*mp_ass_subscript*/
};

static PyTypeObject __pyx_type_7_amplpy_Environment = {
  PyVarObject_HEAD_INIT(0, 0)
  "_amplpy.""Environment", /*tp_name*/
  sizeof(struct __pyx_obj_7_amplpy_Environment), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7_amplpy_Environment, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  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*/
  &__pyx_tp_as_sequence_Environment, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_Environment, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  __pyx_pw_7_amplpy_11Environment_5__str__, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  PyDoc_STR("\n    This class provides access to the environment variables and provides\n    facilities to specify where to load the underlying AMPL interpreter.\n    "), /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_7_amplpy_11Environment_7__iter__, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7_amplpy_Environment, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7_amplpy_Environment, /*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
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyObject *__pyx_tp_new_7_amplpy_ErrorHandler(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  #endif
  return o;
}

static void __pyx_tp_dealloc_7_amplpy_ErrorHandler(PyObject *o) {
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7_amplpy_ErrorHandler) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
  (*Py_TYPE(o)->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
}

static PyMethodDef __pyx_methods_7_amplpy_ErrorHandler[] = {
  {"error", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_12ErrorHandler_1error, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_12ErrorHandler_error},
  {"warning", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_12ErrorHandler_3warning, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_12ErrorHandler_2warning},
  {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_12ErrorHandler_5__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_12ErrorHandler_4__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_12ErrorHandler_7__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_12ErrorHandler_6__setstate_cython__},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7_amplpy_ErrorHandler_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7_amplpy_ErrorHandler},
  {Py_tp_doc, (void *)PyDoc_STR("\n    A basic interface for AMPL error handlers. If an application needs to\n    implement customized error handling, it must implement this interface and\n    then register an instance with the AMPL API using the\n    :func:`~amplpy.AMPL.set_error_handler` method.\n    The underlying AMPL interpreter will then report all errors and warnings\n    through this interface as :class:`~amplpy.AMPLException` objects.\n    ")},
  {Py_tp_methods, (void *)__pyx_methods_7_amplpy_ErrorHandler},
  {Py_tp_new, (void *)__pyx_tp_new_7_amplpy_ErrorHandler},
  {0, 0},
};
static PyType_Spec __pyx_type_7_amplpy_ErrorHandler_spec = {
  "_amplpy.ErrorHandler",
  sizeof(struct __pyx_obj_7_amplpy_ErrorHandler),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_7_amplpy_ErrorHandler_slots,
};
#else

static PyTypeObject __pyx_type_7_amplpy_ErrorHandler = {
  PyVarObject_HEAD_INIT(0, 0)
  "_amplpy.""ErrorHandler", /*tp_name*/
  sizeof(struct __pyx_obj_7_amplpy_ErrorHandler), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7_amplpy_ErrorHandler, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  PyDoc_STR("\n    A basic interface for AMPL error handlers. If an application needs to\n    implement customized error handling, it must implement this interface and\n    then register an instance with the AMPL API using the\n    :func:`~amplpy.AMPL.set_error_handler` method.\n    The underlying AMPL interpreter will then report all errors and warnings\n    through this interface as :class:`~amplpy.AMPLException` objects.\n    "), /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7_amplpy_ErrorHandler, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7_amplpy_ErrorHandler, /*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
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_7_amplpy_EnvIterator __pyx_vtable_7_amplpy_EnvIterator;

static PyObject *__pyx_tp_new_7_amplpy_EnvIterator(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7_amplpy_EnvIterator *p;
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  #endif
  p = ((struct __pyx_obj_7_amplpy_EnvIterator *)o);
  p->__pyx_vtab = __pyx_vtabptr_7_amplpy_EnvIterator;
  return o;
}

static void __pyx_tp_dealloc_7_amplpy_EnvIterator(PyObject *o) {
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7_amplpy_EnvIterator) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
  (*Py_TYPE(o)->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
}

static PyObject *__pyx_specialmethod___pyx_pw_7_amplpy_11EnvIterator_3__next__(PyObject *self, CYTHON_UNUSED PyObject *arg) {
  PyObject *res = __pyx_pw_7_amplpy_11EnvIterator_3__next__(self);
  if (!res && !PyErr_Occurred()) { PyErr_SetNone(PyExc_StopIteration); }
  return res;
}

static PyMethodDef __pyx_methods_7_amplpy_EnvIterator[] = {
  {"__next__", (PyCFunction)__pyx_specialmethod___pyx_pw_7_amplpy_11EnvIterator_3__next__, METH_NOARGS|METH_COEXIST, 0},
  {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_11EnvIterator_5__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_11EnvIterator_4__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_11EnvIterator_7__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_11EnvIterator_6__setstate_cython__},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7_amplpy_EnvIterator_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7_amplpy_EnvIterator},
  {Py_tp_iter, (void *)__pyx_pw_7_amplpy_11EnvIterator_1__iter__},
  {Py_tp_iternext, (void *)__pyx_pw_7_amplpy_11EnvIterator_3__next__},
  {Py_tp_methods, (void *)__pyx_methods_7_amplpy_EnvIterator},
  {Py_tp_new, (void *)__pyx_tp_new_7_amplpy_EnvIterator},
  {0, 0},
};
static PyType_Spec __pyx_type_7_amplpy_EnvIterator_spec = {
  "_amplpy.EnvIterator",
  sizeof(struct __pyx_obj_7_amplpy_EnvIterator),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_7_amplpy_EnvIterator_slots,
};
#else

static PyTypeObject __pyx_type_7_amplpy_EnvIterator = {
  PyVarObject_HEAD_INIT(0, 0)
  "_amplpy.""EnvIterator", /*tp_name*/
  sizeof(struct __pyx_obj_7_amplpy_EnvIterator), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7_amplpy_EnvIterator, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_7_amplpy_11EnvIterator_1__iter__, /*tp_iter*/
  __pyx_pw_7_amplpy_11EnvIterator_3__next__, /*tp_iternext*/
  __pyx_methods_7_amplpy_EnvIterator, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7_amplpy_EnvIterator, /*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
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_7_amplpy_EntityMap __pyx_vtable_7_amplpy_EntityMap;

static PyObject *__pyx_tp_new_7_amplpy_EntityMap(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7_amplpy_EntityMap *p;
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  #endif
  p = ((struct __pyx_obj_7_amplpy_EntityMap *)o);
  p->__pyx_vtab = __pyx_vtabptr_7_amplpy_EntityMap;
  return o;
}

static void __pyx_tp_dealloc_7_amplpy_EntityMap(PyObject *o) {
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7_amplpy_EntityMap) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
    __pyx_pw_7_amplpy_9EntityMap_1__dealloc__(o);
    __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
    PyErr_Restore(etype, eval, etb);
  }
  #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
  (*Py_TYPE(o)->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
}
static PyObject *__pyx_sq_item_7_amplpy_EntityMap(PyObject *o, Py_ssize_t i) {
  PyObject *r;
  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  Py_DECREF(x);
  return r;
}

static PyObject *__pyx_specialmethod___pyx_pw_7_amplpy_9EntityMap_5__next__(PyObject *self, CYTHON_UNUSED PyObject *arg) {
  PyObject *res = __pyx_pw_7_amplpy_9EntityMap_5__next__(self);
  if (!res && !PyErr_Occurred()) { PyErr_SetNone(PyExc_StopIteration); }
  return res;
}

static PyMethodDef __pyx_methods_7_amplpy_EntityMap[] = {
  {"__next__", (PyCFunction)__pyx_specialmethod___pyx_pw_7_amplpy_9EntityMap_5__next__, METH_NOARGS|METH_COEXIST, 0},
  {"size", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_9EntityMap_9size, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_9EntityMap_8size},
  {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_9EntityMap_13__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_9EntityMap_12__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_9EntityMap_15__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_9EntityMap_14__setstate_cython__},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7_amplpy_EntityMap_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7_amplpy_EntityMap},
  {Py_sq_length, (void *)__pyx_pw_7_amplpy_9EntityMap_11__len__},
  {Py_sq_item, (void *)__pyx_sq_item_7_amplpy_EntityMap},
  {Py_mp_length, (void *)__pyx_pw_7_amplpy_9EntityMap_11__len__},
  {Py_mp_subscript, (void *)__pyx_pw_7_amplpy_9EntityMap_7__getitem__},
  {Py_tp_iter, (void *)__pyx_pw_7_amplpy_9EntityMap_3__iter__},
  {Py_tp_iternext, (void *)__pyx_pw_7_amplpy_9EntityMap_5__next__},
  {Py_tp_methods, (void *)__pyx_methods_7_amplpy_EntityMap},
  {Py_tp_new, (void *)__pyx_tp_new_7_amplpy_EntityMap},
  {0, 0},
};
static PyType_Spec __pyx_type_7_amplpy_EntityMap_spec = {
  "_amplpy.EntityMap",
  sizeof(struct __pyx_obj_7_amplpy_EntityMap),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_7_amplpy_EntityMap_slots,
};
#else

static PySequenceMethods __pyx_tp_as_sequence_EntityMap = {
  __pyx_pw_7_amplpy_9EntityMap_11__len__, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  __pyx_sq_item_7_amplpy_EntityMap, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_EntityMap = {
  __pyx_pw_7_amplpy_9EntityMap_11__len__, /*mp_length*/
  __pyx_pw_7_amplpy_9EntityMap_7__getitem__, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyTypeObject __pyx_type_7_amplpy_EntityMap = {
  PyVarObject_HEAD_INIT(0, 0)
  "_amplpy.""EntityMap", /*tp_name*/
  sizeof(struct __pyx_obj_7_amplpy_EntityMap), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7_amplpy_EntityMap, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  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*/
  &__pyx_tp_as_sequence_EntityMap, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_EntityMap, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_7_amplpy_9EntityMap_3__iter__, /*tp_iter*/
  __pyx_pw_7_amplpy_9EntityMap_5__next__, /*tp_iternext*/
  __pyx_methods_7_amplpy_EntityMap, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7_amplpy_EntityMap, /*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
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_7_amplpy_InstanceIterator __pyx_vtable_7_amplpy_InstanceIterator;

static PyObject *__pyx_tp_new_7_amplpy_InstanceIterator(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7_amplpy_InstanceIterator *p;
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  #endif
  p = ((struct __pyx_obj_7_amplpy_InstanceIterator *)o);
  p->__pyx_vtab = __pyx_vtabptr_7_amplpy_InstanceIterator;
  p->_entity = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_7_amplpy_InstanceIterator(PyObject *o) {
  struct __pyx_obj_7_amplpy_InstanceIterator *p = (struct __pyx_obj_7_amplpy_InstanceIterator *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7_amplpy_InstanceIterator) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
    __pyx_pw_7_amplpy_16InstanceIterator_1__dealloc__(o);
    __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
    PyErr_Restore(etype, eval, etb);
  }
  Py_CLEAR(p->_entity);
  #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
  (*Py_TYPE(o)->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
}

static int __pyx_tp_traverse_7_amplpy_InstanceIterator(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7_amplpy_InstanceIterator *p = (struct __pyx_obj_7_amplpy_InstanceIterator *)o;
  if (p->_entity) {
    e = (*v)(p->_entity, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7_amplpy_InstanceIterator(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7_amplpy_InstanceIterator *p = (struct __pyx_obj_7_amplpy_InstanceIterator *)o;
  tmp = ((PyObject*)p->_entity);
  p->_entity = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}
static PyObject *__pyx_sq_item_7_amplpy_InstanceIterator(PyObject *o, Py_ssize_t i) {
  PyObject *r;
  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  Py_DECREF(x);
  return r;
}

static PyObject *__pyx_specialmethod___pyx_pw_7_amplpy_16InstanceIterator_5__next__(PyObject *self, CYTHON_UNUSED PyObject *arg) {
  PyObject *res = __pyx_pw_7_amplpy_16InstanceIterator_5__next__(self);
  if (!res && !PyErr_Occurred()) { PyErr_SetNone(PyExc_StopIteration); }
  return res;
}

static PyMethodDef __pyx_methods_7_amplpy_InstanceIterator[] = {
  {"__next__", (PyCFunction)__pyx_specialmethod___pyx_pw_7_amplpy_16InstanceIterator_5__next__, METH_NOARGS|METH_COEXIST, 0},
  {"size", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_16InstanceIterator_9size, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_16InstanceIterator_8size},
  {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_16InstanceIterator_13__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_16InstanceIterator_12__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_16InstanceIterator_15__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_16InstanceIterator_14__setstate_cython__},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7_amplpy_InstanceIterator_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7_amplpy_InstanceIterator},
  {Py_sq_length, (void *)__pyx_pw_7_amplpy_16InstanceIterator_11__len__},
  {Py_sq_item, (void *)__pyx_sq_item_7_amplpy_InstanceIterator},
  {Py_mp_length, (void *)__pyx_pw_7_amplpy_16InstanceIterator_11__len__},
  {Py_mp_subscript, (void *)__pyx_pw_7_amplpy_16InstanceIterator_7__getitem__},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_7_amplpy_InstanceIterator},
  {Py_tp_clear, (void *)__pyx_tp_clear_7_amplpy_InstanceIterator},
  {Py_tp_iter, (void *)__pyx_pw_7_amplpy_16InstanceIterator_3__iter__},
  {Py_tp_iternext, (void *)__pyx_pw_7_amplpy_16InstanceIterator_5__next__},
  {Py_tp_methods, (void *)__pyx_methods_7_amplpy_InstanceIterator},
  {Py_tp_new, (void *)__pyx_tp_new_7_amplpy_InstanceIterator},
  {0, 0},
};
static PyType_Spec __pyx_type_7_amplpy_InstanceIterator_spec = {
  "_amplpy.InstanceIterator",
  sizeof(struct __pyx_obj_7_amplpy_InstanceIterator),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
  __pyx_type_7_amplpy_InstanceIterator_slots,
};
#else

static PySequenceMethods __pyx_tp_as_sequence_InstanceIterator = {
  __pyx_pw_7_amplpy_16InstanceIterator_11__len__, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  __pyx_sq_item_7_amplpy_InstanceIterator, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_InstanceIterator = {
  __pyx_pw_7_amplpy_16InstanceIterator_11__len__, /*mp_length*/
  __pyx_pw_7_amplpy_16InstanceIterator_7__getitem__, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyTypeObject __pyx_type_7_amplpy_InstanceIterator = {
  PyVarObject_HEAD_INIT(0, 0)
  "_amplpy.""InstanceIterator", /*tp_name*/
  sizeof(struct __pyx_obj_7_amplpy_InstanceIterator), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7_amplpy_InstanceIterator, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  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*/
  &__pyx_tp_as_sequence_InstanceIterator, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_InstanceIterator, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7_amplpy_InstanceIterator, /*tp_traverse*/
  __pyx_tp_clear_7_amplpy_InstanceIterator, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_7_amplpy_16InstanceIterator_3__iter__, /*tp_iter*/
  __pyx_pw_7_amplpy_16InstanceIterator_5__next__, /*tp_iternext*/
  __pyx_methods_7_amplpy_InstanceIterator, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7_amplpy_InstanceIterator, /*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
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_7_amplpy_MemberRangeIterator __pyx_vtable_7_amplpy_MemberRangeIterator;

static PyObject *__pyx_tp_new_7_amplpy_MemberRangeIterator(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7_amplpy_MemberRangeIterator *p;
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  #endif
  p = ((struct __pyx_obj_7_amplpy_MemberRangeIterator *)o);
  p->__pyx_vtab = __pyx_vtabptr_7_amplpy_MemberRangeIterator;
  p->_entity = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_7_amplpy_MemberRangeIterator(PyObject *o) {
  struct __pyx_obj_7_amplpy_MemberRangeIterator *p = (struct __pyx_obj_7_amplpy_MemberRangeIterator *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7_amplpy_MemberRangeIterator) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
    __pyx_pw_7_amplpy_19MemberRangeIterator_1__dealloc__(o);
    __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
    PyErr_Restore(etype, eval, etb);
  }
  Py_CLEAR(p->_entity);
  #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
  (*Py_TYPE(o)->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
}

static int __pyx_tp_traverse_7_amplpy_MemberRangeIterator(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7_amplpy_MemberRangeIterator *p = (struct __pyx_obj_7_amplpy_MemberRangeIterator *)o;
  if (p->_entity) {
    e = (*v)(p->_entity, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7_amplpy_MemberRangeIterator(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7_amplpy_MemberRangeIterator *p = (struct __pyx_obj_7_amplpy_MemberRangeIterator *)o;
  tmp = ((PyObject*)p->_entity);
  p->_entity = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_specialmethod___pyx_pw_7_amplpy_19MemberRangeIterator_9__next__(PyObject *self, CYTHON_UNUSED PyObject *arg) {
  PyObject *res = __pyx_pw_7_amplpy_19MemberRangeIterator_9__next__(self);
  if (!res && !PyErr_Occurred()) { PyErr_SetNone(PyExc_StopIteration); }
  return res;
}

static PyMethodDef __pyx_methods_7_amplpy_MemberRangeIterator[] = {
  {"size", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_19MemberRangeIterator_3size, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_19MemberRangeIterator_2size},
  {"__next__", (PyCFunction)__pyx_specialmethod___pyx_pw_7_amplpy_19MemberRangeIterator_9__next__, METH_NOARGS|METH_COEXIST, 0},
  {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_19MemberRangeIterator_11__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_19MemberRangeIterator_10__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_19MemberRangeIterator_13__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_19MemberRangeIterator_12__setstate_cython__},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7_amplpy_MemberRangeIterator_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7_amplpy_MemberRangeIterator},
  {Py_sq_length, (void *)__pyx_pw_7_amplpy_19MemberRangeIterator_5__len__},
  {Py_mp_length, (void *)__pyx_pw_7_amplpy_19MemberRangeIterator_5__len__},
  {Py_tp_doc, (void *)PyDoc_STR("Iterator for set members.")},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_7_amplpy_MemberRangeIterator},
  {Py_tp_clear, (void *)__pyx_tp_clear_7_amplpy_MemberRangeIterator},
  {Py_tp_iter, (void *)__pyx_pw_7_amplpy_19MemberRangeIterator_7__iter__},
  {Py_tp_iternext, (void *)__pyx_pw_7_amplpy_19MemberRangeIterator_9__next__},
  {Py_tp_methods, (void *)__pyx_methods_7_amplpy_MemberRangeIterator},
  {Py_tp_new, (void *)__pyx_tp_new_7_amplpy_MemberRangeIterator},
  {0, 0},
};
static PyType_Spec __pyx_type_7_amplpy_MemberRangeIterator_spec = {
  "_amplpy.MemberRangeIterator",
  sizeof(struct __pyx_obj_7_amplpy_MemberRangeIterator),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
  __pyx_type_7_amplpy_MemberRangeIterator_slots,
};
#else

static PySequenceMethods __pyx_tp_as_sequence_MemberRangeIterator = {
  __pyx_pw_7_amplpy_19MemberRangeIterator_5__len__, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_MemberRangeIterator = {
  __pyx_pw_7_amplpy_19MemberRangeIterator_5__len__, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyTypeObject __pyx_type_7_amplpy_MemberRangeIterator = {
  PyVarObject_HEAD_INIT(0, 0)
  "_amplpy.""MemberRangeIterator", /*tp_name*/
  sizeof(struct __pyx_obj_7_amplpy_MemberRangeIterator), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7_amplpy_MemberRangeIterator, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  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*/
  &__pyx_tp_as_sequence_MemberRangeIterator, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_MemberRangeIterator, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  PyDoc_STR("Iterator for set members."), /*tp_doc*/
  __pyx_tp_traverse_7_amplpy_MemberRangeIterator, /*tp_traverse*/
  __pyx_tp_clear_7_amplpy_MemberRangeIterator, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_7_amplpy_19MemberRangeIterator_7__iter__, /*tp_iter*/
  __pyx_pw_7_amplpy_19MemberRangeIterator_9__next__, /*tp_iternext*/
  __pyx_methods_7_amplpy_MemberRangeIterator, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7_amplpy_MemberRangeIterator, /*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
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_7_amplpy_ColIterator __pyx_vtable_7_amplpy_ColIterator;

static PyObject *__pyx_tp_new_7_amplpy_ColIterator(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7_amplpy_ColIterator *p;
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  #endif
  p = ((struct __pyx_obj_7_amplpy_ColIterator *)o);
  p->__pyx_vtab = __pyx_vtabptr_7_amplpy_ColIterator;
  return o;
}

static void __pyx_tp_dealloc_7_amplpy_ColIterator(PyObject *o) {
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7_amplpy_ColIterator) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
  (*Py_TYPE(o)->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
}

static PyObject *__pyx_specialmethod___pyx_pw_7_amplpy_11ColIterator_3__next__(PyObject *self, CYTHON_UNUSED PyObject *arg) {
  PyObject *res = __pyx_pw_7_amplpy_11ColIterator_3__next__(self);
  if (!res && !PyErr_Occurred()) { PyErr_SetNone(PyExc_StopIteration); }
  return res;
}

static PyMethodDef __pyx_methods_7_amplpy_ColIterator[] = {
  {"__next__", (PyCFunction)__pyx_specialmethod___pyx_pw_7_amplpy_11ColIterator_3__next__, METH_NOARGS|METH_COEXIST, 0},
  {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_11ColIterator_5__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_11ColIterator_4__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_11ColIterator_7__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_11ColIterator_6__setstate_cython__},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7_amplpy_ColIterator_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7_amplpy_ColIterator},
  {Py_tp_iter, (void *)__pyx_pw_7_amplpy_11ColIterator_1__iter__},
  {Py_tp_iternext, (void *)__pyx_pw_7_amplpy_11ColIterator_3__next__},
  {Py_tp_methods, (void *)__pyx_methods_7_amplpy_ColIterator},
  {Py_tp_new, (void *)__pyx_tp_new_7_amplpy_ColIterator},
  {0, 0},
};
static PyType_Spec __pyx_type_7_amplpy_ColIterator_spec = {
  "_amplpy.ColIterator",
  sizeof(struct __pyx_obj_7_amplpy_ColIterator),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_7_amplpy_ColIterator_slots,
};
#else

static PyTypeObject __pyx_type_7_amplpy_ColIterator = {
  PyVarObject_HEAD_INIT(0, 0)
  "_amplpy.""ColIterator", /*tp_name*/
  sizeof(struct __pyx_obj_7_amplpy_ColIterator), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7_amplpy_ColIterator, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_7_amplpy_11ColIterator_1__iter__, /*tp_iter*/
  __pyx_pw_7_amplpy_11ColIterator_3__next__, /*tp_iternext*/
  __pyx_methods_7_amplpy_ColIterator, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7_amplpy_ColIterator, /*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
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_7_amplpy_RowIterator __pyx_vtable_7_amplpy_RowIterator;

static PyObject *__pyx_tp_new_7_amplpy_RowIterator(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7_amplpy_RowIterator *p;
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  #endif
  p = ((struct __pyx_obj_7_amplpy_RowIterator *)o);
  p->__pyx_vtab = __pyx_vtabptr_7_amplpy_RowIterator;
  return o;
}

static void __pyx_tp_dealloc_7_amplpy_RowIterator(PyObject *o) {
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7_amplpy_RowIterator) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
  (*Py_TYPE(o)->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
}

static PyObject *__pyx_specialmethod___pyx_pw_7_amplpy_11RowIterator_3__next__(PyObject *self, CYTHON_UNUSED PyObject *arg) {
  PyObject *res = __pyx_pw_7_amplpy_11RowIterator_3__next__(self);
  if (!res && !PyErr_Occurred()) { PyErr_SetNone(PyExc_StopIteration); }
  return res;
}

static PyMethodDef __pyx_methods_7_amplpy_RowIterator[] = {
  {"__next__", (PyCFunction)__pyx_specialmethod___pyx_pw_7_amplpy_11RowIterator_3__next__, METH_NOARGS|METH_COEXIST, 0},
  {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_11RowIterator_5__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_11RowIterator_4__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_11RowIterator_7__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_11RowIterator_6__setstate_cython__},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7_amplpy_RowIterator_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7_amplpy_RowIterator},
  {Py_tp_iter, (void *)__pyx_pw_7_amplpy_11RowIterator_1__iter__},
  {Py_tp_iternext, (void *)__pyx_pw_7_amplpy_11RowIterator_3__next__},
  {Py_tp_methods, (void *)__pyx_methods_7_amplpy_RowIterator},
  {Py_tp_new, (void *)__pyx_tp_new_7_amplpy_RowIterator},
  {0, 0},
};
static PyType_Spec __pyx_type_7_amplpy_RowIterator_spec = {
  "_amplpy.RowIterator",
  sizeof(struct __pyx_obj_7_amplpy_RowIterator),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_7_amplpy_RowIterator_slots,
};
#else

static PyTypeObject __pyx_type_7_amplpy_RowIterator = {
  PyVarObject_HEAD_INIT(0, 0)
  "_amplpy.""RowIterator", /*tp_name*/
  sizeof(struct __pyx_obj_7_amplpy_RowIterator), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7_amplpy_RowIterator, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_7_amplpy_11RowIterator_1__iter__, /*tp_iter*/
  __pyx_pw_7_amplpy_11RowIterator_3__next__, /*tp_iternext*/
  __pyx_methods_7_amplpy_RowIterator, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7_amplpy_RowIterator, /*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
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_7_amplpy_Objective __pyx_vtable_7_amplpy_Objective;

static PyObject *__pyx_tp_new_7_amplpy_Objective(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7_amplpy_Objective *p;
  PyObject *o = __pyx_tp_new_7_amplpy_Entity(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7_amplpy_Objective *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7_amplpy_Entity*)__pyx_vtabptr_7_amplpy_Objective;
  return o;
}

static PyMethodDef __pyx_methods_7_amplpy_Objective[] = {
  {"value", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_9Objective_1value, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_9Objective_value},
  {"astatus", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_9Objective_3astatus, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_9Objective_2astatus},
  {"sstatus", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_9Objective_5sstatus, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_9Objective_4sstatus},
  {"exitcode", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_9Objective_7exitcode, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_9Objective_6exitcode},
  {"message", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_9Objective_9message, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_9Objective_8message},
  {"result", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_9Objective_11result, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_9Objective_10result},
  {"drop", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_9Objective_13drop, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_9Objective_12drop},
  {"restore", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_9Objective_15restore, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_9Objective_14restore},
  {"minimization", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_9Objective_17minimization, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_9Objective_16minimization},
  {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_9Objective_19__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_9Objective_18__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_9Objective_21__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_9Objective_20__setstate_cython__},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7_amplpy_Objective_slots[] = {
  {Py_tp_doc, (void *)PyDoc_STR("\n    Bases: :class:`~amplpy.Entity`.\n\n    Represents an AMPL objective. Note that, in case of a scalar objective, all\n    the properties (corresponding to AMPL suffixes) of the objective instance\n    can be accessed through methods like :func:`~amplpy.Objective.value`.\n    The methods have the same name of the corresponding AMPL suffixes.\n    See http://www.ampl.com/NEW/suffbuiltin.html for a list of the available\n    suffixes.\n\n    All these methods throw a TypeError if called for a non scalar\n    objective and an RuntimeError if called on an entity which has been deleted\n    in the underlying intepreter.\n\n    To gain access to all the values in an entity (for all instances and all\n    suffixes for that entities), see\n    :func:`~amplpy.Entity.get_values`\n    and the :class:`~amplpy.DataFrame` class.\n    ")},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_7_amplpy_Entity},
  {Py_tp_clear, (void *)__pyx_tp_clear_7_amplpy_Entity},
  {Py_tp_methods, (void *)__pyx_methods_7_amplpy_Objective},
  {Py_tp_new, (void *)__pyx_tp_new_7_amplpy_Objective},
  {0, 0},
};
static PyType_Spec __pyx_type_7_amplpy_Objective_spec = {
  "_amplpy.Objective",
  sizeof(struct __pyx_obj_7_amplpy_Objective),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
  __pyx_type_7_amplpy_Objective_slots,
};
#else

static PyTypeObject __pyx_type_7_amplpy_Objective = {
  PyVarObject_HEAD_INIT(0, 0)
  "_amplpy.""Objective", /*tp_name*/
  sizeof(struct __pyx_obj_7_amplpy_Objective), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7_amplpy_Entity, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  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*/
  #if CYTHON_COMPILING_IN_PYPY || 0
  __pyx_pw_7_amplpy_6Entity_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  PyDoc_STR("\n    Bases: :class:`~amplpy.Entity`.\n\n    Represents an AMPL objective. Note that, in case of a scalar objective, all\n    the properties (corresponding to AMPL suffixes) of the objective instance\n    can be accessed through methods like :func:`~amplpy.Objective.value`.\n    The methods have the same name of the corresponding AMPL suffixes.\n    See http://www.ampl.com/NEW/suffbuiltin.html for a list of the available\n    suffixes.\n\n    All these methods throw a TypeError if called for a non scalar\n    objective and an RuntimeError if called on an entity which has been deleted\n    in the underlying intepreter.\n\n    To gain access to all the values in an entity (for all instances and all\n    suffixes for that entities), see\n    :func:`~amplpy.Entity.get_values`\n    and the :class:`~amplpy.DataFrame` class.\n    "), /*tp_doc*/
  __pyx_tp_traverse_7_amplpy_Entity, /*tp_traverse*/
  __pyx_tp_clear_7_amplpy_Entity, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY || 0
  __pyx_pw_7_amplpy_6Entity_7__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  __pyx_methods_7_amplpy_Objective, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7_amplpy_Objective, /*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
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyObject *__pyx_tp_new_7_amplpy_OutputHandler(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  #endif
  return o;
}

static void __pyx_tp_dealloc_7_amplpy_OutputHandler(PyObject *o) {
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7_amplpy_OutputHandler) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
  (*Py_TYPE(o)->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
}

static PyMethodDef __pyx_methods_7_amplpy_OutputHandler[] = {
  {"output", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_13OutputHandler_1output, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_13OutputHandler_output},
  {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_13OutputHandler_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_13OutputHandler_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_13OutputHandler_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_13OutputHandler_4__setstate_cython__},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7_amplpy_OutputHandler_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7_amplpy_OutputHandler},
  {Py_tp_doc, (void *)PyDoc_STR("\n    Interface to handle the outputs from the calls to any\n    function that causes the underlying AMPL interpreter to display a message.\n    If an application needs to\n    implement customised output handling, it must implement this interface and\n    then register an instance with the AMPL API using the\n    :func:`~amplpy.AMPL.set_output_handler`\n    method.\n\n    Note that errors and warnings are not passed through this interface,\n    see :class:`~amplpy.ErrorHandler` for more information.\n    ")},
  {Py_tp_methods, (void *)__pyx_methods_7_amplpy_OutputHandler},
  {Py_tp_new, (void *)__pyx_tp_new_7_amplpy_OutputHandler},
  {0, 0},
};
static PyType_Spec __pyx_type_7_amplpy_OutputHandler_spec = {
  "_amplpy.OutputHandler",
  sizeof(struct __pyx_obj_7_amplpy_OutputHandler),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_7_amplpy_OutputHandler_slots,
};
#else

static PyTypeObject __pyx_type_7_amplpy_OutputHandler = {
  PyVarObject_HEAD_INIT(0, 0)
  "_amplpy.""OutputHandler", /*tp_name*/
  sizeof(struct __pyx_obj_7_amplpy_OutputHandler), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7_amplpy_OutputHandler, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  PyDoc_STR("\n    Interface to handle the outputs from the calls to any\n    function that causes the underlying AMPL interpreter to display a message.\n    If an application needs to\n    implement customised output handling, it must implement this interface and\n    then register an instance with the AMPL API using the\n    :func:`~amplpy.AMPL.set_output_handler`\n    method.\n\n    Note that errors and warnings are not passed through this interface,\n    see :class:`~amplpy.ErrorHandler` for more information.\n    "), /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7_amplpy_OutputHandler, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7_amplpy_OutputHandler, /*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
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_7_amplpy_Parameter __pyx_vtable_7_amplpy_Parameter;

static PyObject *__pyx_tp_new_7_amplpy_Parameter(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7_amplpy_Parameter *p;
  PyObject *o = __pyx_tp_new_7_amplpy_Entity(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7_amplpy_Parameter *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7_amplpy_Entity*)__pyx_vtabptr_7_amplpy_Parameter;
  return o;
}
static PyObject *__pyx_sq_item_7_amplpy_Parameter(PyObject *o, Py_ssize_t i) {
  PyObject *r;
  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  Py_DECREF(x);
  return r;
}

static int __pyx_mp_ass_subscript_7_amplpy_Parameter(PyObject *o, PyObject *i, PyObject *v) {
  if (v) {
    return __pyx_pw_7_amplpy_9Parameter_1__setitem__(o, i, v);
  }
  else {
    __Pyx_TypeName o_type_name;
    if (__pyx_ptype_7_amplpy_Entity->tp_as_mapping && __pyx_ptype_7_amplpy_Entity->tp_as_mapping->mp_ass_subscript)
      return __pyx_ptype_7_amplpy_Entity->tp_as_mapping->mp_ass_subscript(o, i, v);
    o_type_name = __Pyx_PyType_GetName(Py_TYPE(o));
    PyErr_Format(PyExc_NotImplementedError,
      "Subscript deletion not supported by " __Pyx_FMT_TYPENAME, o_type_name);
    __Pyx_DECREF_TypeName(o_type_name);
    return -1;
  }
}

static PyMethodDef __pyx_methods_7_amplpy_Parameter[] = {
  {"is_symbolic", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_9Parameter_3is_symbolic, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_9Parameter_2is_symbolic},
  {"has_default", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_9Parameter_5has_default, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_9Parameter_4has_default},
  {"value", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_9Parameter_9value, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_9Parameter_8value},
  {"set", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7_amplpy_9Parameter_11set, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7_amplpy_9Parameter_10set},
  {"set_values", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_9Parameter_13set_values, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_9Parameter_12set_values},
  {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_9Parameter_15__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_9Parameter_14__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_9Parameter_17__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_9Parameter_16__setstate_cython__},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7_amplpy_Parameter_slots[] = {
  {Py_sq_item, (void *)__pyx_sq_item_7_amplpy_Parameter},
  {Py_mp_subscript, (void *)__pyx_pw_7_amplpy_9Parameter_7__getitem__},
  {Py_mp_ass_subscript, (void *)__pyx_mp_ass_subscript_7_amplpy_Parameter},
  {Py_tp_doc, (void *)PyDoc_STR("\n    Represents an AMPL parameter. The values can be float or string (in case of\n    symbolic parameters).\n\n    Data can be assigned to the set using the methods\n    :func:`~amplpy.Parameter.set` and\n    :func:`~amplpy.Parameter.set_values`\n    or using\n    :func:`~amplpy.AMPL.set_data`\n    and an object of class :class:`~amplpy.DataFrame`.\n    ")},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_7_amplpy_Entity},
  {Py_tp_clear, (void *)__pyx_tp_clear_7_amplpy_Entity},
  {Py_tp_methods, (void *)__pyx_methods_7_amplpy_Parameter},
  {Py_tp_new, (void *)__pyx_tp_new_7_amplpy_Parameter},
  {0, 0},
};
static PyType_Spec __pyx_type_7_amplpy_Parameter_spec = {
  "_amplpy.Parameter",
  sizeof(struct __pyx_obj_7_amplpy_Parameter),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
  __pyx_type_7_amplpy_Parameter_slots,
};
#else

static PySequenceMethods __pyx_tp_as_sequence_Parameter = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  __pyx_sq_item_7_amplpy_Parameter, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_Parameter = {
  0, /*mp_length*/
  __pyx_pw_7_amplpy_9Parameter_7__getitem__, /*mp_subscript*/
  __pyx_mp_ass_subscript_7_amplpy_Parameter, /*mp_ass_subscript*/
};

static PyTypeObject __pyx_type_7_amplpy_Parameter = {
  PyVarObject_HEAD_INIT(0, 0)
  "_amplpy.""Parameter", /*tp_name*/
  sizeof(struct __pyx_obj_7_amplpy_Parameter), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7_amplpy_Entity, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  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*/
  &__pyx_tp_as_sequence_Parameter, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_Parameter, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY || 0
  __pyx_pw_7_amplpy_6Entity_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  PyDoc_STR("\n    Represents an AMPL parameter. The values can be float or string (in case of\n    symbolic parameters).\n\n    Data can be assigned to the set using the methods\n    :func:`~amplpy.Parameter.set` and\n    :func:`~amplpy.Parameter.set_values`\n    or using\n    :func:`~amplpy.AMPL.set_data`\n    and an object of class :class:`~amplpy.DataFrame`.\n    "), /*tp_doc*/
  __pyx_tp_traverse_7_amplpy_Entity, /*tp_traverse*/
  __pyx_tp_clear_7_amplpy_Entity, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY || 0
  __pyx_pw_7_amplpy_6Entity_7__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  __pyx_methods_7_amplpy_Parameter, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7_amplpy_Parameter, /*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
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_7_amplpy_Set __pyx_vtable_7_amplpy_Set;

static PyObject *__pyx_tp_new_7_amplpy_Set(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7_amplpy_Set *p;
  PyObject *o = __pyx_tp_new_7_amplpy_Entity(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7_amplpy_Set *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7_amplpy_Entity*)__pyx_vtabptr_7_amplpy_Set;
  return o;
}

static int __pyx_mp_ass_subscript_7_amplpy_Set(PyObject *o, PyObject *i, PyObject *v) {
  if (v) {
    return __pyx_pw_7_amplpy_3Set_1__setitem__(o, i, v);
  }
  else {
    __Pyx_TypeName o_type_name;
    if (__pyx_ptype_7_amplpy_Entity->tp_as_mapping && __pyx_ptype_7_amplpy_Entity->tp_as_mapping->mp_ass_subscript)
      return __pyx_ptype_7_amplpy_Entity->tp_as_mapping->mp_ass_subscript(o, i, v);
    o_type_name = __Pyx_PyType_GetName(Py_TYPE(o));
    PyErr_Format(PyExc_NotImplementedError,
      "Subscript deletion not supported by " __Pyx_FMT_TYPENAME, o_type_name);
    __Pyx_DECREF_TypeName(o_type_name);
    return -1;
  }
}

static PyMethodDef __pyx_methods_7_amplpy_Set[] = {
  {"instances", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_3Set_5instances, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_3Set_4instances},
  {"arity", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_3Set_7arity, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_3Set_6arity},
  {"get_values", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_3Set_9get_values, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_3Set_8get_values},
  {"members", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_3Set_11members, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_3Set_10members},
  {"size", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_3Set_13size, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_3Set_12size},
  {"contains", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_3Set_15contains, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_3Set_14contains},
  {"set_values", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_3Set_17set_values, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_3Set_16set_values},
  {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_3Set_19__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_3Set_18__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_3Set_21__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_3Set_20__setstate_cython__},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7_amplpy_Set_slots[] = {
  {Py_mp_ass_subscript, (void *)__pyx_mp_ass_subscript_7_amplpy_Set},
  {Py_tp_doc, (void *)PyDoc_STR("\n    Represents an AMPL set. In case of not indexed sets, this class exposes\n    iterators for accessing its elements. The members of the set are tuples.\n    All these methods throw a TypeError if called for an indexed set.\n\n    In case of indexed sets, you can gain access to the instances using the\n    operator [].\n\n    All the accessors in this class throw an RuntimeError if the instance has\n    been deleted in the underlying AMPL interpreter.\n\n    Data can be assigned to the set using the methods\n    :func:`~amplpy.Set.set_values`\n    (for non-indexed sets only) or using\n    :func:`~amplpy.AMPL.set_data`\n    and an object of class\n    :class:`~amplpy.DataFrame`.\n    ")},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_7_amplpy_Entity},
  {Py_tp_clear, (void *)__pyx_tp_clear_7_amplpy_Entity},
  {Py_tp_iter, (void *)__pyx_pw_7_amplpy_3Set_3__iter__},
  {Py_tp_methods, (void *)__pyx_methods_7_amplpy_Set},
  {Py_tp_new, (void *)__pyx_tp_new_7_amplpy_Set},
  {0, 0},
};
static PyType_Spec __pyx_type_7_amplpy_Set_spec = {
  "_amplpy.Set",
  sizeof(struct __pyx_obj_7_amplpy_Set),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
  __pyx_type_7_amplpy_Set_slots,
};
#else

static PyMappingMethods __pyx_tp_as_mapping_Set = {
  0, /*mp_length*/
  #if CYTHON_COMPILING_IN_PYPY || 0
  __pyx_pw_7_amplpy_6Entity_9__getitem__, /*mp_subscript*/
  #else
  0, /*mp_subscript*/
  #endif
  __pyx_mp_ass_subscript_7_amplpy_Set, /*mp_ass_subscript*/
};

static PyTypeObject __pyx_type_7_amplpy_Set = {
  PyVarObject_HEAD_INIT(0, 0)
  "_amplpy.""Set", /*tp_name*/
  sizeof(struct __pyx_obj_7_amplpy_Set), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7_amplpy_Entity, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  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*/
  &__pyx_tp_as_mapping_Set, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY || 0
  __pyx_pw_7_amplpy_6Entity_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  PyDoc_STR("\n    Represents an AMPL set. In case of not indexed sets, this class exposes\n    iterators for accessing its elements. The members of the set are tuples.\n    All these methods throw a TypeError if called for an indexed set.\n\n    In case of indexed sets, you can gain access to the instances using the\n    operator [].\n\n    All the accessors in this class throw an RuntimeError if the instance has\n    been deleted in the underlying AMPL interpreter.\n\n    Data can be assigned to the set using the methods\n    :func:`~amplpy.Set.set_values`\n    (for non-indexed sets only) or using\n    :func:`~amplpy.AMPL.set_data`\n    and an object of class\n    :class:`~amplpy.DataFrame`.\n    "), /*tp_doc*/
  __pyx_tp_traverse_7_amplpy_Entity, /*tp_traverse*/
  __pyx_tp_clear_7_amplpy_Entity, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_7_amplpy_3Set_3__iter__, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7_amplpy_Set, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7_amplpy_Set, /*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
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_7_amplpy_Variable __pyx_vtable_7_amplpy_Variable;

static PyObject *__pyx_tp_new_7_amplpy_Variable(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7_amplpy_Variable *p;
  PyObject *o = __pyx_tp_new_7_amplpy_Entity(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7_amplpy_Variable *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7_amplpy_Entity*)__pyx_vtabptr_7_amplpy_Variable;
  return o;
}

static int __pyx_mp_ass_subscript_7_amplpy_Variable(PyObject *o, PyObject *i, PyObject *v) {
  if (v) {
    return __pyx_pw_7_amplpy_8Variable_1__setitem__(o, i, v);
  }
  else {
    __Pyx_TypeName o_type_name;
    if (__pyx_ptype_7_amplpy_Entity->tp_as_mapping && __pyx_ptype_7_amplpy_Entity->tp_as_mapping->mp_ass_subscript)
      return __pyx_ptype_7_amplpy_Entity->tp_as_mapping->mp_ass_subscript(o, i, v);
    o_type_name = __Pyx_PyType_GetName(Py_TYPE(o));
    PyErr_Format(PyExc_NotImplementedError,
      "Subscript deletion not supported by " __Pyx_FMT_TYPENAME, o_type_name);
    __Pyx_DECREF_TypeName(o_type_name);
    return -1;
  }
}

static PyMethodDef __pyx_methods_7_amplpy_Variable[] = {
  {"value", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_8Variable_3value, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_8Variable_2value},
  {"fix", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_8Variable_5fix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_8Variable_4fix},
  {"unfix", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_8Variable_7unfix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_8Variable_6unfix},
  {"set_value", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_8Variable_9set_value, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_8Variable_8set_value},
  {"astatus", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_8Variable_11astatus, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_8Variable_10astatus},
  {"defeqn", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_8Variable_13defeqn, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_8Variable_12defeqn},
  {"dual", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_8Variable_15dual, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_8Variable_14dual},
  {"init", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_8Variable_17init, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_8Variable_16init},
  {"init0", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_8Variable_19init0, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_8Variable_18init0},
  {"lb", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_8Variable_21lb, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_8Variable_20lb},
  {"ub", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_8Variable_23ub, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_8Variable_22ub},
  {"lb0", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_8Variable_25lb0, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_8Variable_24lb0},
  {"ub0", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_8Variable_27ub0, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_8Variable_26ub0},
  {"lb1", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_8Variable_29lb1, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_8Variable_28lb1},
  {"ub1", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_8Variable_31ub1, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_8Variable_30ub1},
  {"lb2", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_8Variable_33lb2, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_8Variable_32lb2},
  {"ub2", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_8Variable_35ub2, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_8Variable_34ub2},
  {"lrc", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_8Variable_37lrc, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_8Variable_36lrc},
  {"urc", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_8Variable_39urc, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_8Variable_38urc},
  {"lslack", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_8Variable_41lslack, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_8Variable_40lslack},
  {"uslack", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_8Variable_43uslack, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_8Variable_42uslack},
  {"rc", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_8Variable_45rc, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_8Variable_44rc},
  {"slack", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_8Variable_47slack, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_8Variable_46slack},
  {"sstatus", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_8Variable_49sstatus, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_8Variable_48sstatus},
  {"status", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_8Variable_51status, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_8Variable_50status},
  {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_8Variable_53__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_8Variable_52__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_8Variable_55__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_8Variable_54__setstate_cython__},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7_amplpy_Variable_slots[] = {
  {Py_mp_ass_subscript, (void *)__pyx_mp_ass_subscript_7_amplpy_Variable},
  {Py_tp_doc, (void *)PyDoc_STR("\n    Bases: :class:`~amplpy.Entity`.\n\n    Represents an AMPL decision variable. Note that, in case of a scalar\n    variable, all the properties of the variable instance can be accessed\n    through methods like :func:`~amplpy.Variable.value`. The methods have the\n    same name of the corresponding AMPL suffixes.\n    See http://www.ampl.com/NEW/suffbuiltin.html for a list of the available\n    suffixes.\n\n    All these methods throw a TypeError if called for a non scalar\n    objective and an RuntimeError if called on an entity which has been deleted\n    in the underlying intepreter.\n\n    To gain access to all the values in an entity (for all instances and all\n    suffixes for that entities), see\n    :func:`~amplpy.Entity.get_values`\n    and the :class:`~amplpy.DataFrame` class.\n    ")},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_7_amplpy_Entity},
  {Py_tp_clear, (void *)__pyx_tp_clear_7_amplpy_Entity},
  {Py_tp_methods, (void *)__pyx_methods_7_amplpy_Variable},
  {Py_tp_new, (void *)__pyx_tp_new_7_amplpy_Variable},
  {0, 0},
};
static PyType_Spec __pyx_type_7_amplpy_Variable_spec = {
  "_amplpy.Variable",
  sizeof(struct __pyx_obj_7_amplpy_Variable),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
  __pyx_type_7_amplpy_Variable_slots,
};
#else

static PyMappingMethods __pyx_tp_as_mapping_Variable = {
  0, /*mp_length*/
  #if CYTHON_COMPILING_IN_PYPY || 0
  __pyx_pw_7_amplpy_6Entity_9__getitem__, /*mp_subscript*/
  #else
  0, /*mp_subscript*/
  #endif
  __pyx_mp_ass_subscript_7_amplpy_Variable, /*mp_ass_subscript*/
};

static PyTypeObject __pyx_type_7_amplpy_Variable = {
  PyVarObject_HEAD_INIT(0, 0)
  "_amplpy.""Variable", /*tp_name*/
  sizeof(struct __pyx_obj_7_amplpy_Variable), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7_amplpy_Entity, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  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*/
  &__pyx_tp_as_mapping_Variable, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY || 0
  __pyx_pw_7_amplpy_6Entity_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  PyDoc_STR("\n    Bases: :class:`~amplpy.Entity`.\n\n    Represents an AMPL decision variable. Note that, in case of a scalar\n    variable, all the properties of the variable instance can be accessed\n    through methods like :func:`~amplpy.Variable.value`. The methods have the\n    same name of the corresponding AMPL suffixes.\n    See http://www.ampl.com/NEW/suffbuiltin.html for a list of the available\n    suffixes.\n\n    All these methods throw a TypeError if called for a non scalar\n    objective and an RuntimeError if called on an entity which has been deleted\n    in the underlying intepreter.\n\n    To gain access to all the values in an entity (for all instances and all\n    suffixes for that entities), see\n    :func:`~amplpy.Entity.get_values`\n    and the :class:`~amplpy.DataFrame` class.\n    "), /*tp_doc*/
  __pyx_tp_traverse_7_amplpy_Entity, /*tp_traverse*/
  __pyx_tp_clear_7_amplpy_Entity, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY || 0
  __pyx_pw_7_amplpy_6Entity_7__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  __pyx_methods_7_amplpy_Variable, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7_amplpy_Variable, /*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
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyObject *__pyx_tp_new_7_amplpy_AMPL(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7_amplpy_AMPL *p;
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  #endif
  p = ((struct __pyx_obj_7_amplpy_AMPL *)o);
  p->_output_handler = Py_None; Py_INCREF(Py_None);
  p->_error_handler = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_7_amplpy_AMPL(PyObject *o) {
  struct __pyx_obj_7_amplpy_AMPL *p = (struct __pyx_obj_7_amplpy_AMPL *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7_amplpy_AMPL) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
    __pyx_pw_7_amplpy_4AMPL_3__dealloc__(o);
    __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
    PyErr_Restore(etype, eval, etb);
  }
  Py_CLEAR(p->_output_handler);
  Py_CLEAR(p->_error_handler);
  #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
  (*Py_TYPE(o)->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
}

static int __pyx_tp_traverse_7_amplpy_AMPL(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7_amplpy_AMPL *p = (struct __pyx_obj_7_amplpy_AMPL *)o;
  if (p->_output_handler) {
    e = (*v)(p->_output_handler, a); if (e) return e;
  }
  if (p->_error_handler) {
    e = (*v)(p->_error_handler, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7_amplpy_AMPL(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7_amplpy_AMPL *p = (struct __pyx_obj_7_amplpy_AMPL *)o;
  tmp = ((PyObject*)p->_output_handler);
  p->_output_handler = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_error_handler);
  p->_error_handler = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_7_amplpy_4AMPL_solve_result(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7_amplpy_4AMPL_12solve_result_1__get__(o);
}

static PyObject *__pyx_getprop_7_amplpy_4AMPL_solve_result_num(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7_amplpy_4AMPL_16solve_result_num_1__get__(o);
}

static PyMethodDef __pyx_methods_7_amplpy_AMPL[] = {
  {"get_data", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7_amplpy_4AMPL_5get_data, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7_amplpy_4AMPL_4get_data},
  {"get_entity", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_7get_entity, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_4AMPL_6get_entity},
  {"get_variable", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_9get_variable, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_4AMPL_8get_variable},
  {"get_constraint", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_11get_constraint, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_4AMPL_10get_constraint},
  {"get_objective", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_13get_objective, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_4AMPL_12get_objective},
  {"get_set", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_15get_set, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_4AMPL_14get_set},
  {"get_parameter", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_17get_parameter, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_4AMPL_16get_parameter},
  {"eval", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_19eval, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_4AMPL_18eval},
  {"get_output", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_21get_output, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_4AMPL_20get_output},
  {"reset", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_23reset, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_4AMPL_22reset},
  {"close", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_25close, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_4AMPL_24close},
  {"is_running", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_27is_running, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_4AMPL_26is_running},
  {"solve", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_29solve, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_4AMPL_28solve},
  {"cd", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_31cd, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_4AMPL_30cd},
  {"set_option", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_33set_option, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_4AMPL_32set_option},
  {"get_option", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_35get_option, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_4AMPL_34get_option},
  {"read", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_37read, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_4AMPL_36read},
  {"read_data", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_39read_data, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_4AMPL_38read_data},
  {"get_value", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_41get_value, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_4AMPL_40get_value},
  {"set_data", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_43set_data, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_4AMPL_42set_data},
  {"read_table", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_45read_table, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_4AMPL_44read_table},
  {"write_table", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_47write_table, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_4AMPL_46write_table},
  {"display", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7_amplpy_4AMPL_49display, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7_amplpy_4AMPL_48display},
  {"set_output_handler", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_51set_output_handler, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_4AMPL_50set_output_handler},
  {"set_error_handler", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_53set_error_handler, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_4AMPL_52set_error_handler},
  {"get_output_handler", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_55get_output_handler, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_4AMPL_54get_output_handler},
  {"get_error_handler", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_57get_error_handler, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_4AMPL_56get_error_handler},
  {"get_variables", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_59get_variables, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_4AMPL_58get_variables},
  {"get_constraints", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_61get_constraints, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_4AMPL_60get_constraints},
  {"get_objectives", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_63get_objectives, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_4AMPL_62get_objectives},
  {"get_sets", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_65get_sets, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_4AMPL_64get_sets},
  {"get_parameters", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_67get_parameters, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_4AMPL_66get_parameters},
  {"get_current_objective", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_69get_current_objective, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_4AMPL_68get_current_objective},
  {"_var", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_71_var, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_4AMPL_70_var},
  {"_con", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_73_con, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_4AMPL_72_con},
  {"_obj", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_75_obj, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_4AMPL_74_obj},
  {"_set", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_77_set, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_4AMPL_76_set},
  {"_param", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_79_param, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_4AMPL_78_param},
  {"_option", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_81_option, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_4AMPL_80_option},
  {"export_model", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_83export_model, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_4AMPL_82export_model},
  {"export_data", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_85export_data, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_4AMPL_84export_data},
  {"snapshot", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_87snapshot, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_4AMPL_86snapshot},
  {"write", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_89write, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_4AMPL_88write},
  {"get_iis", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_91get_iis, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_4AMPL_90get_iis},
  {"get_solution", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_93get_solution, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_4AMPL_92get_solution},
  {"_start_recording", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_95_start_recording, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_4AMPL_94_start_recording},
  {"_stop_recording", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_97_stop_recording, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_4AMPL_96_stop_recording},
  {"_load_session", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_99_load_session, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_4AMPL_98_load_session},
  {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_101__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_4AMPL_100__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7_amplpy_4AMPL_103__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7_amplpy_4AMPL_102__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7_amplpy_AMPL[] = {
  {(char *)"solve_result", __pyx_getprop_7_amplpy_4AMPL_solve_result, 0, (char *)PyDoc_STR("\n        Return solve_result value, which indicates if the problem has been solved.\n\n        +---------+-----------+---------------------------------------------+\n        | Number  |  String   |           Interpretation                    |\n        +=========+===========+=============================================+\n        |    0-99 |  solved   | Optimal solution found                      |\n        +---------+-----------+---------------------------------------------+\n        | 100-199 |  solved?  | Optimal solution indicated, but error likely|\n        +---------+-----------+---------------------------------------------+\n        | 200-299 | infeasible| Constraints cannot be satisfied             |\n        +---------+-----------+---------------------------------------------+\n        | 300-399 | unbounded | Objective can be improved without limit     |\n        +---------+-----------+---------------------------------------------+\n        | 400-499 |   limit   | Stopped by a limit that you set (such as on |\n        |         |           | iterations)                                 |\n        +---------+-----------+---------------------------------------------+\n        | 500-599 |  failure  | Stopped by an error condition in the solver |\n        |         |           | routines                                    |\n        +---------+-----------+---------------------------------------------+\n        "), 0},
  {(char *)"solve_result_num", __pyx_getprop_7_amplpy_4AMPL_solve_result_num, 0, (char *)PyDoc_STR("\n        Return solve_result_num value, which indicates if the problem has been solved.\n\n        +---------+-----------+---------------------------------------------+\n        | Number  |  String   |           Interpretation                    |\n        +=========+===========+=============================================+\n        |    0-99 |  solved   | Optimal solution found                      |\n        +---------+-----------+---------------------------------------------+\n        | 100-199 |  solved?  | Optimal solution indicated, but error likely|\n        +---------+-----------+---------------------------------------------+\n        | 200-299 | infeasible| Constraints cannot be satisfied             |\n        +---------+-----------+---------------------------------------------+\n        | 300-399 | unbounded | Objective can be improved without limit     |\n        +---------+-----------+---------------------------------------------+\n        | 400-499 |   limit   | Stopped by a limit that you set (such as on |\n        |         |           | iterations)                                 |\n        +---------+-----------+---------------------------------------------+\n        | 500-599 |  failure  | Stopped by an error condition in the solver |\n        |         |           | routines                                    |\n        +---------+-----------+---------------------------------------------+\n        "), 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7_amplpy_AMPL_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7_amplpy_AMPL},
  {Py_tp_doc, (void *)PyDoc_STR("AMPL(environment=None)\nAn AMPL translator.\n\n    An object of this class can be used to do the following tasks:\n\n    - Run AMPL code. See :func:`~amplpy.AMPL.eval`.\n    - Read models and data from files. See :func:`~amplpy.AMPL.read`,\n      :func:`~amplpy.AMPL.read_data`.\n    - Solve optimization problems constructed from model and data (see\n      :func:`~amplpy.AMPL.solve`).\n    - Access single Elements of an optimization problem. See\n      :func:`~amplpy.AMPL.get_variable`,\n      :func:`~amplpy.AMPL.get_constraint`,\n      :func:`~amplpy.AMPL.get_objective`,\n      :func:`~amplpy.AMPL.get_set`,\n      and :func:`~amplpy.AMPL.get_parameter`.\n    - Access lists of available entities of an optimization problem. See\n      :func:`~amplpy.AMPL.get_variables`,\n      :func:`~amplpy.AMPL.get_constraints`,\n      :func:`~amplpy.AMPL.get_objectives`,\n      :func:`~amplpy.AMPL.get_sets`,\n      and :func:`~amplpy.AMPL.get_parameters`.\n\n    Error handling is two-faced:\n\n    - Errors coming from the underlying AMPL translator (e.g. syntax errors and\n      warnings obtained calling the eval method) are handled by\n      the :class:`~amplpy.ErrorHandler` which can be set and get via\n      :func:`~amplpy.AMPL.get_error_handler` and\n      :func:`~amplpy.AMPL.set_error_handler`.\n    - Generic errors coming from misusing the API, which are detected in\n      Python, are thrown as exceptions.\n\n    The default implementation of the error handler throws exceptions on errors\n    and prints to console on warnings.\n\n    The output of every user interaction with the underlying translator is\n    handled implementing the abstract class :class:`~amplpy.OutputHandler`.\n    The (only) method is called at each block of output from the translator.\n    The current output handler can be accessed and set via\n    :func:`~amplpy.AMPL.get_output_handler` and\n    :func:`~amplpy.AMPL.set_output_handler`.\n    ")},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_7_amplpy_AMPL},
  {Py_tp_clear, (void *)__pyx_tp_clear_7_amplpy_AMPL},
  {Py_tp_methods, (void *)__pyx_methods_7_amplpy_AMPL},
  {Py_tp_getset, (void *)__pyx_getsets_7_amplpy_AMPL},
  {Py_tp_init, (void *)__pyx_pw_7_amplpy_4AMPL_1__init__},
  {Py_tp_new, (void *)__pyx_tp_new_7_amplpy_AMPL},
  {0, 0},
};
static PyType_Spec __pyx_type_7_amplpy_AMPL_spec = {
  "_amplpy.AMPL",
  sizeof(struct __pyx_obj_7_amplpy_AMPL),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
  __pyx_type_7_amplpy_AMPL_slots,
};
#else

static PyTypeObject __pyx_type_7_amplpy_AMPL = {
  PyVarObject_HEAD_INIT(0, 0)
  "_amplpy.""AMPL", /*tp_name*/
  sizeof(struct __pyx_obj_7_amplpy_AMPL), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7_amplpy_AMPL, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  PyDoc_STR("AMPL(environment=None)\nAn AMPL translator.\n\n    An object of this class can be used to do the following tasks:\n\n    - Run AMPL code. See :func:`~amplpy.AMPL.eval`.\n    - Read models and data from files. See :func:`~amplpy.AMPL.read`,\n      :func:`~amplpy.AMPL.read_data`.\n    - Solve optimization problems constructed from model and data (see\n      :func:`~amplpy.AMPL.solve`).\n    - Access single Elements of an optimization problem. See\n      :func:`~amplpy.AMPL.get_variable`,\n      :func:`~amplpy.AMPL.get_constraint`,\n      :func:`~amplpy.AMPL.get_objective`,\n      :func:`~amplpy.AMPL.get_set`,\n      and :func:`~amplpy.AMPL.get_parameter`.\n    - Access lists of available entities of an optimization problem. See\n      :func:`~amplpy.AMPL.get_variables`,\n      :func:`~amplpy.AMPL.get_constraints`,\n      :func:`~amplpy.AMPL.get_objectives`,\n      :func:`~amplpy.AMPL.get_sets`,\n      and :func:`~amplpy.AMPL.get_parameters`.\n\n    Error handling is two-faced:\n\n    - Errors coming from the underlying AMPL translator (e.g. syntax errors and\n      warnings obtained calling the eval method) are handled by\n      the :class:`~amplpy.ErrorHandler` which can be set and get via\n      :func:`~amplpy.AMPL.get_error_handler` and\n      :func:`~amplpy.AMPL.set_error_handler`.\n    - Generic errors coming from misusing the API, which are detected in\n      Python, are thrown as exceptions.\n\n    The default implementation of the error handler throws exceptions on errors\n    and prints to console on warnings.\n\n    The output of every user interaction with the underlying translator is\n    handled implementing the abstract class :class:`~amplpy.OutputHandler`.\n    The (only) method is called at each block of output from the translator.\n    The current output handler can be accessed and set via\n    :func:`~amplpy.AMPL.get_output_handler` and\n    :func:`~amplpy.AMPL.set_output_handler`.\n    "), /*tp_doc*/
  __pyx_tp_traverse_7_amplpy_AMPL, /*tp_traverse*/
  __pyx_tp_clear_7_amplpy_AMPL, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7_amplpy_AMPL, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7_amplpy_AMPL, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __pyx_pw_7_amplpy_4AMPL_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7_amplpy_AMPL, /*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
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_7_amplpy___pyx_scope_struct____iter__ *__pyx_freelist_7_amplpy___pyx_scope_struct____iter__[8];
static int __pyx_freecount_7_amplpy___pyx_scope_struct____iter__ = 0;
#endif

static PyObject *__pyx_tp_new_7_amplpy___pyx_scope_struct____iter__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_7_amplpy___pyx_scope_struct____iter__ > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_7_amplpy___pyx_scope_struct____iter__)))) {
    o = (PyObject*)__pyx_freelist_7_amplpy___pyx_scope_struct____iter__[--__pyx_freecount_7_amplpy___pyx_scope_struct____iter__];
    memset(o, 0, sizeof(struct __pyx_obj_7_amplpy___pyx_scope_struct____iter__));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_7_amplpy___pyx_scope_struct____iter__(PyObject *o) {
  struct __pyx_obj_7_amplpy___pyx_scope_struct____iter__ *p = (struct __pyx_obj_7_amplpy___pyx_scope_struct____iter__ *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7_amplpy___pyx_scope_struct____iter__) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_self);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_7_amplpy___pyx_scope_struct____iter__ < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7_amplpy___pyx_scope_struct____iter__)))) {
    __pyx_freelist_7_amplpy___pyx_scope_struct____iter__[__pyx_freecount_7_amplpy___pyx_scope_struct____iter__++] = ((struct __pyx_obj_7_amplpy___pyx_scope_struct____iter__ *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_7_amplpy___pyx_scope_struct____iter__(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7_amplpy___pyx_scope_struct____iter__ *p = (struct __pyx_obj_7_amplpy___pyx_scope_struct____iter__ *)o;
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7_amplpy___pyx_scope_struct____iter__(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7_amplpy___pyx_scope_struct____iter__ *p = (struct __pyx_obj_7_amplpy___pyx_scope_struct____iter__ *)o;
  tmp = ((PyObject*)p->__pyx_v_self);
  p->__pyx_v_self = ((struct __pyx_obj_7_amplpy_DataFrame *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7_amplpy___pyx_scope_struct____iter___slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7_amplpy___pyx_scope_struct____iter__},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_7_amplpy___pyx_scope_struct____iter__},
  {Py_tp_clear, (void *)__pyx_tp_clear_7_amplpy___pyx_scope_struct____iter__},
  {Py_tp_new, (void *)__pyx_tp_new_7_amplpy___pyx_scope_struct____iter__},
  {0, 0},
};
static PyType_Spec __pyx_type_7_amplpy___pyx_scope_struct____iter___spec = {
  "_amplpy.__pyx_scope_struct____iter__",
  sizeof(struct __pyx_obj_7_amplpy___pyx_scope_struct____iter__),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_7_amplpy___pyx_scope_struct____iter___slots,
};
#else

static PyTypeObject __pyx_type_7_amplpy___pyx_scope_struct____iter__ = {
  PyVarObject_HEAD_INIT(0, 0)
  "_amplpy.""__pyx_scope_struct____iter__", /*tp_name*/
  sizeof(struct __pyx_obj_7_amplpy___pyx_scope_struct____iter__), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7_amplpy___pyx_scope_struct____iter__, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  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|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7_amplpy___pyx_scope_struct____iter__, /*tp_traverse*/
  __pyx_tp_clear_7_amplpy___pyx_scope_struct____iter__, /*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*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7_amplpy___pyx_scope_struct____iter__, /*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
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_7_amplpy___pyx_scope_struct_1_genexpr *__pyx_freelist_7_amplpy___pyx_scope_struct_1_genexpr[8];
static int __pyx_freecount_7_amplpy___pyx_scope_struct_1_genexpr = 0;
#endif

static PyObject *__pyx_tp_new_7_amplpy___pyx_scope_struct_1_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_7_amplpy___pyx_scope_struct_1_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_7_amplpy___pyx_scope_struct_1_genexpr)))) {
    o = (PyObject*)__pyx_freelist_7_amplpy___pyx_scope_struct_1_genexpr[--__pyx_freecount_7_amplpy___pyx_scope_struct_1_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_7_amplpy___pyx_scope_struct_1_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_7_amplpy___pyx_scope_struct_1_genexpr(PyObject *o) {
  struct __pyx_obj_7_amplpy___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_7_amplpy___pyx_scope_struct_1_genexpr *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7_amplpy___pyx_scope_struct_1_genexpr) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_genexpr_arg_0);
  Py_CLEAR(p->__pyx_v_i);
  Py_CLEAR(p->__pyx_t_0);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_7_amplpy___pyx_scope_struct_1_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7_amplpy___pyx_scope_struct_1_genexpr)))) {
    __pyx_freelist_7_amplpy___pyx_scope_struct_1_genexpr[__pyx_freecount_7_amplpy___pyx_scope_struct_1_genexpr++] = ((struct __pyx_obj_7_amplpy___pyx_scope_struct_1_genexpr *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_7_amplpy___pyx_scope_struct_1_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7_amplpy___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_7_amplpy___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_genexpr_arg_0) {
    e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e;
  }
  if (p->__pyx_v_i) {
    e = (*v)(p->__pyx_v_i, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7_amplpy___pyx_scope_struct_1_genexpr_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7_amplpy___pyx_scope_struct_1_genexpr},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_7_amplpy___pyx_scope_struct_1_genexpr},
  {Py_tp_new, (void *)__pyx_tp_new_7_amplpy___pyx_scope_struct_1_genexpr},
  {0, 0},
};
static PyType_Spec __pyx_type_7_amplpy___pyx_scope_struct_1_genexpr_spec = {
  "_amplpy.__pyx_scope_struct_1_genexpr",
  sizeof(struct __pyx_obj_7_amplpy___pyx_scope_struct_1_genexpr),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_7_amplpy___pyx_scope_struct_1_genexpr_slots,
};
#else

static PyTypeObject __pyx_type_7_amplpy___pyx_scope_struct_1_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "_amplpy.""__pyx_scope_struct_1_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_7_amplpy___pyx_scope_struct_1_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7_amplpy___pyx_scope_struct_1_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  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|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7_amplpy___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*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7_amplpy___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
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_7_amplpy___pyx_scope_struct_2_genexpr *__pyx_freelist_7_amplpy___pyx_scope_struct_2_genexpr[8];
static int __pyx_freecount_7_amplpy___pyx_scope_struct_2_genexpr = 0;
#endif

static PyObject *__pyx_tp_new_7_amplpy___pyx_scope_struct_2_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_7_amplpy___pyx_scope_struct_2_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_7_amplpy___pyx_scope_struct_2_genexpr)))) {
    o = (PyObject*)__pyx_freelist_7_amplpy___pyx_scope_struct_2_genexpr[--__pyx_freecount_7_amplpy___pyx_scope_struct_2_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_7_amplpy___pyx_scope_struct_2_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_7_amplpy___pyx_scope_struct_2_genexpr(PyObject *o) {
  struct __pyx_obj_7_amplpy___pyx_scope_struct_2_genexpr *p = (struct __pyx_obj_7_amplpy___pyx_scope_struct_2_genexpr *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7_amplpy___pyx_scope_struct_2_genexpr) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_genexpr_arg_0);
  Py_CLEAR(p->__pyx_v_value);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_7_amplpy___pyx_scope_struct_2_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7_amplpy___pyx_scope_struct_2_genexpr)))) {
    __pyx_freelist_7_amplpy___pyx_scope_struct_2_genexpr[__pyx_freecount_7_amplpy___pyx_scope_struct_2_genexpr++] = ((struct __pyx_obj_7_amplpy___pyx_scope_struct_2_genexpr *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_7_amplpy___pyx_scope_struct_2_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7_amplpy___pyx_scope_struct_2_genexpr *p = (struct __pyx_obj_7_amplpy___pyx_scope_struct_2_genexpr *)o;
  if (p->__pyx_genexpr_arg_0) {
    e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e;
  }
  if (p->__pyx_v_value) {
    e = (*v)(p->__pyx_v_value, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7_amplpy___pyx_scope_struct_2_genexpr_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7_amplpy___pyx_scope_struct_2_genexpr},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_7_amplpy___pyx_scope_struct_2_genexpr},
  {Py_tp_new, (void *)__pyx_tp_new_7_amplpy___pyx_scope_struct_2_genexpr},
  {0, 0},
};
static PyType_Spec __pyx_type_7_amplpy___pyx_scope_struct_2_genexpr_spec = {
  "_amplpy.__pyx_scope_struct_2_genexpr",
  sizeof(struct __pyx_obj_7_amplpy___pyx_scope_struct_2_genexpr),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_7_amplpy___pyx_scope_struct_2_genexpr_slots,
};
#else

static PyTypeObject __pyx_type_7_amplpy___pyx_scope_struct_2_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "_amplpy.""__pyx_scope_struct_2_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_7_amplpy___pyx_scope_struct_2_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7_amplpy___pyx_scope_struct_2_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  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|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7_amplpy___pyx_scope_struct_2_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*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7_amplpy___pyx_scope_struct_2_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_7_amplpy___pyx_scope_struct_3_genexpr *__pyx_freelist_7_amplpy___pyx_scope_struct_3_genexpr[8];
static int __pyx_freecount_7_amplpy___pyx_scope_struct_3_genexpr = 0;
#endif

static PyObject *__pyx_tp_new_7_amplpy___pyx_scope_struct_3_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_7_amplpy___pyx_scope_struct_3_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_7_amplpy___pyx_scope_struct_3_genexpr)))) {
    o = (PyObject*)__pyx_freelist_7_amplpy___pyx_scope_struct_3_genexpr[--__pyx_freecount_7_amplpy___pyx_scope_struct_3_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_7_amplpy___pyx_scope_struct_3_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_7_amplpy___pyx_scope_struct_3_genexpr(PyObject *o) {
  struct __pyx_obj_7_amplpy___pyx_scope_struct_3_genexpr *p = (struct __pyx_obj_7_amplpy___pyx_scope_struct_3_genexpr *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7_amplpy___pyx_scope_struct_3_genexpr) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_genexpr_arg_0);
  Py_CLEAR(p->__pyx_v_value);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_7_amplpy___pyx_scope_struct_3_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7_amplpy___pyx_scope_struct_3_genexpr)))) {
    __pyx_freelist_7_amplpy___pyx_scope_struct_3_genexpr[__pyx_freecount_7_amplpy___pyx_scope_struct_3_genexpr++] = ((struct __pyx_obj_7_amplpy___pyx_scope_struct_3_genexpr *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_7_amplpy___pyx_scope_struct_3_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7_amplpy___pyx_scope_struct_3_genexpr *p = (struct __pyx_obj_7_amplpy___pyx_scope_struct_3_genexpr *)o;
  if (p->__pyx_genexpr_arg_0) {
    e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e;
  }
  if (p->__pyx_v_value) {
    e = (*v)(p->__pyx_v_value, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7_amplpy___pyx_scope_struct_3_genexpr_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7_amplpy___pyx_scope_struct_3_genexpr},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_7_amplpy___pyx_scope_struct_3_genexpr},
  {Py_tp_new, (void *)__pyx_tp_new_7_amplpy___pyx_scope_struct_3_genexpr},
  {0, 0},
};
static PyType_Spec __pyx_type_7_amplpy___pyx_scope_struct_3_genexpr_spec = {
  "_amplpy.__pyx_scope_struct_3_genexpr",
  sizeof(struct __pyx_obj_7_amplpy___pyx_scope_struct_3_genexpr),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_7_amplpy___pyx_scope_struct_3_genexpr_slots,
};
#else

static PyTypeObject __pyx_type_7_amplpy___pyx_scope_struct_3_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "_amplpy.""__pyx_scope_struct_3_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_7_amplpy___pyx_scope_struct_3_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7_amplpy___pyx_scope_struct_3_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  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|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7_amplpy___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*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7_amplpy___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
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_7_amplpy___pyx_scope_struct_4__get_headers *__pyx_freelist_7_amplpy___pyx_scope_struct_4__get_headers[8];
static int __pyx_freecount_7_amplpy___pyx_scope_struct_4__get_headers = 0;
#endif

static PyObject *__pyx_tp_new_7_amplpy___pyx_scope_struct_4__get_headers(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_7_amplpy___pyx_scope_struct_4__get_headers > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_7_amplpy___pyx_scope_struct_4__get_headers)))) {
    o = (PyObject*)__pyx_freelist_7_amplpy___pyx_scope_struct_4__get_headers[--__pyx_freecount_7_amplpy___pyx_scope_struct_4__get_headers];
    memset(o, 0, sizeof(struct __pyx_obj_7_amplpy___pyx_scope_struct_4__get_headers));
    (void) PyObject_INIT(o, t);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_7_amplpy___pyx_scope_struct_4__get_headers(PyObject *o) {
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7_amplpy___pyx_scope_struct_4__get_headers) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_7_amplpy___pyx_scope_struct_4__get_headers < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7_amplpy___pyx_scope_struct_4__get_headers)))) {
    __pyx_freelist_7_amplpy___pyx_scope_struct_4__get_headers[__pyx_freecount_7_amplpy___pyx_scope_struct_4__get_headers++] = ((struct __pyx_obj_7_amplpy___pyx_scope_struct_4__get_headers *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7_amplpy___pyx_scope_struct_4__get_headers_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7_amplpy___pyx_scope_struct_4__get_headers},
  {Py_tp_new, (void *)__pyx_tp_new_7_amplpy___pyx_scope_struct_4__get_headers},
  {0, 0},
};
static PyType_Spec __pyx_type_7_amplpy___pyx_scope_struct_4__get_headers_spec = {
  "_amplpy.__pyx_scope_struct_4__get_headers",
  sizeof(struct __pyx_obj_7_amplpy___pyx_scope_struct_4__get_headers),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_7_amplpy___pyx_scope_struct_4__get_headers_slots,
};
#else

static PyTypeObject __pyx_type_7_amplpy___pyx_scope_struct_4__get_headers = {
  PyVarObject_HEAD_INIT(0, 0)
  "_amplpy.""__pyx_scope_struct_4__get_headers", /*tp_name*/
  sizeof(struct __pyx_obj_7_amplpy___pyx_scope_struct_4__get_headers), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7_amplpy___pyx_scope_struct_4__get_headers, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  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_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7_amplpy___pyx_scope_struct_4__get_headers, /*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
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_7_amplpy___pyx_scope_struct_5_genexpr *__pyx_freelist_7_amplpy___pyx_scope_struct_5_genexpr[8];
static int __pyx_freecount_7_amplpy___pyx_scope_struct_5_genexpr = 0;
#endif

static PyObject *__pyx_tp_new_7_amplpy___pyx_scope_struct_5_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_7_amplpy___pyx_scope_struct_5_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_7_amplpy___pyx_scope_struct_5_genexpr)))) {
    o = (PyObject*)__pyx_freelist_7_amplpy___pyx_scope_struct_5_genexpr[--__pyx_freecount_7_amplpy___pyx_scope_struct_5_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_7_amplpy___pyx_scope_struct_5_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_7_amplpy___pyx_scope_struct_5_genexpr(PyObject *o) {
  struct __pyx_obj_7_amplpy___pyx_scope_struct_5_genexpr *p = (struct __pyx_obj_7_amplpy___pyx_scope_struct_5_genexpr *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7_amplpy___pyx_scope_struct_5_genexpr) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_7_amplpy___pyx_scope_struct_5_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7_amplpy___pyx_scope_struct_5_genexpr)))) {
    __pyx_freelist_7_amplpy___pyx_scope_struct_5_genexpr[__pyx_freecount_7_amplpy___pyx_scope_struct_5_genexpr++] = ((struct __pyx_obj_7_amplpy___pyx_scope_struct_5_genexpr *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_7_amplpy___pyx_scope_struct_5_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7_amplpy___pyx_scope_struct_5_genexpr *p = (struct __pyx_obj_7_amplpy___pyx_scope_struct_5_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7_amplpy___pyx_scope_struct_5_genexpr_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7_amplpy___pyx_scope_struct_5_genexpr},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_7_amplpy___pyx_scope_struct_5_genexpr},
  {Py_tp_new, (void *)__pyx_tp_new_7_amplpy___pyx_scope_struct_5_genexpr},
  {0, 0},
};
static PyType_Spec __pyx_type_7_amplpy___pyx_scope_struct_5_genexpr_spec = {
  "_amplpy.__pyx_scope_struct_5_genexpr",
  sizeof(struct __pyx_obj_7_amplpy___pyx_scope_struct_5_genexpr),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_7_amplpy___pyx_scope_struct_5_genexpr_slots,
};
#else

static PyTypeObject __pyx_type_7_amplpy___pyx_scope_struct_5_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "_amplpy.""__pyx_scope_struct_5_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_7_amplpy___pyx_scope_struct_5_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7_amplpy___pyx_scope_struct_5_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  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|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7_amplpy___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*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7_amplpy___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
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_7_amplpy___pyx_scope_struct_6_from_dict *__pyx_freelist_7_amplpy___pyx_scope_struct_6_from_dict[8];
static int __pyx_freecount_7_amplpy___pyx_scope_struct_6_from_dict = 0;
#endif

static PyObject *__pyx_tp_new_7_amplpy___pyx_scope_struct_6_from_dict(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_7_amplpy___pyx_scope_struct_6_from_dict > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_7_amplpy___pyx_scope_struct_6_from_dict)))) {
    o = (PyObject*)__pyx_freelist_7_amplpy___pyx_scope_struct_6_from_dict[--__pyx_freecount_7_amplpy___pyx_scope_struct_6_from_dict];
    memset(o, 0, sizeof(struct __pyx_obj_7_amplpy___pyx_scope_struct_6_from_dict));
    (void) PyObject_INIT(o, t);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_7_amplpy___pyx_scope_struct_6_from_dict(PyObject *o) {
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7_amplpy___pyx_scope_struct_6_from_dict) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_7_amplpy___pyx_scope_struct_6_from_dict < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7_amplpy___pyx_scope_struct_6_from_dict)))) {
    __pyx_freelist_7_amplpy___pyx_scope_struct_6_from_dict[__pyx_freecount_7_amplpy___pyx_scope_struct_6_from_dict++] = ((struct __pyx_obj_7_amplpy___pyx_scope_struct_6_from_dict *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7_amplpy___pyx_scope_struct_6_from_dict_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7_amplpy___pyx_scope_struct_6_from_dict},
  {Py_tp_new, (void *)__pyx_tp_new_7_amplpy___pyx_scope_struct_6_from_dict},
  {0, 0},
};
static PyType_Spec __pyx_type_7_amplpy___pyx_scope_struct_6_from_dict_spec = {
  "_amplpy.__pyx_scope_struct_6_from_dict",
  sizeof(struct __pyx_obj_7_amplpy___pyx_scope_struct_6_from_dict),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_7_amplpy___pyx_scope_struct_6_from_dict_slots,
};
#else

static PyTypeObject __pyx_type_7_amplpy___pyx_scope_struct_6_from_dict = {
  PyVarObject_HEAD_INIT(0, 0)
  "_amplpy.""__pyx_scope_struct_6_from_dict", /*tp_name*/
  sizeof(struct __pyx_obj_7_amplpy___pyx_scope_struct_6_from_dict), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7_amplpy___pyx_scope_struct_6_from_dict, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  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_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7_amplpy___pyx_scope_struct_6_from_dict, /*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
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_7_amplpy___pyx_scope_struct_7_genexpr *__pyx_freelist_7_amplpy___pyx_scope_struct_7_genexpr[8];
static int __pyx_freecount_7_amplpy___pyx_scope_struct_7_genexpr = 0;
#endif

static PyObject *__pyx_tp_new_7_amplpy___pyx_scope_struct_7_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_7_amplpy___pyx_scope_struct_7_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_7_amplpy___pyx_scope_struct_7_genexpr)))) {
    o = (PyObject*)__pyx_freelist_7_amplpy___pyx_scope_struct_7_genexpr[--__pyx_freecount_7_amplpy___pyx_scope_struct_7_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_7_amplpy___pyx_scope_struct_7_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_7_amplpy___pyx_scope_struct_7_genexpr(PyObject *o) {
  struct __pyx_obj_7_amplpy___pyx_scope_struct_7_genexpr *p = (struct __pyx_obj_7_amplpy___pyx_scope_struct_7_genexpr *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7_amplpy___pyx_scope_struct_7_genexpr) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_genexpr_arg_0);
  Py_CLEAR(p->__pyx_v_k);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_7_amplpy___pyx_scope_struct_7_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7_amplpy___pyx_scope_struct_7_genexpr)))) {
    __pyx_freelist_7_amplpy___pyx_scope_struct_7_genexpr[__pyx_freecount_7_amplpy___pyx_scope_struct_7_genexpr++] = ((struct __pyx_obj_7_amplpy___pyx_scope_struct_7_genexpr *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_7_amplpy___pyx_scope_struct_7_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7_amplpy___pyx_scope_struct_7_genexpr *p = (struct __pyx_obj_7_amplpy___pyx_scope_struct_7_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_genexpr_arg_0) {
    e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e;
  }
  if (p->__pyx_v_k) {
    e = (*v)(p->__pyx_v_k, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7_amplpy___pyx_scope_struct_7_genexpr_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7_amplpy___pyx_scope_struct_7_genexpr},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_7_amplpy___pyx_scope_struct_7_genexpr},
  {Py_tp_new, (void *)__pyx_tp_new_7_amplpy___pyx_scope_struct_7_genexpr},
  {0, 0},
};
static PyType_Spec __pyx_type_7_amplpy___pyx_scope_struct_7_genexpr_spec = {
  "_amplpy.__pyx_scope_struct_7_genexpr",
  sizeof(struct __pyx_obj_7_amplpy___pyx_scope_struct_7_genexpr),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_7_amplpy___pyx_scope_struct_7_genexpr_slots,
};
#else

static PyTypeObject __pyx_type_7_amplpy___pyx_scope_struct_7_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "_amplpy.""__pyx_scope_struct_7_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_7_amplpy___pyx_scope_struct_7_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7_amplpy___pyx_scope_struct_7_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  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|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7_amplpy___pyx_scope_struct_7_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7_amplpy___pyx_scope_struct_7_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_7_amplpy___pyx_scope_struct_8_genexpr *__pyx_freelist_7_amplpy___pyx_scope_struct_8_genexpr[8];
static int __pyx_freecount_7_amplpy___pyx_scope_struct_8_genexpr = 0;
#endif

static PyObject *__pyx_tp_new_7_amplpy___pyx_scope_struct_8_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_7_amplpy___pyx_scope_struct_8_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_7_amplpy___pyx_scope_struct_8_genexpr)))) {
    o = (PyObject*)__pyx_freelist_7_amplpy___pyx_scope_struct_8_genexpr[--__pyx_freecount_7_amplpy___pyx_scope_struct_8_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_7_amplpy___pyx_scope_struct_8_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_7_amplpy___pyx_scope_struct_8_genexpr(PyObject *o) {
  struct __pyx_obj_7_amplpy___pyx_scope_struct_8_genexpr *p = (struct __pyx_obj_7_amplpy___pyx_scope_struct_8_genexpr *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7_amplpy___pyx_scope_struct_8_genexpr) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_genexpr_arg_0);
  Py_CLEAR(p->__pyx_v_v);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_7_amplpy___pyx_scope_struct_8_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7_amplpy___pyx_scope_struct_8_genexpr)))) {
    __pyx_freelist_7_amplpy___pyx_scope_struct_8_genexpr[__pyx_freecount_7_amplpy___pyx_scope_struct_8_genexpr++] = ((struct __pyx_obj_7_amplpy___pyx_scope_struct_8_genexpr *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_7_amplpy___pyx_scope_struct_8_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7_amplpy___pyx_scope_struct_8_genexpr *p = (struct __pyx_obj_7_amplpy___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_genexpr_arg_0) {
    e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e;
  }
  if (p->__pyx_v_v) {
    e = (*v)(p->__pyx_v_v, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7_amplpy___pyx_scope_struct_8_genexpr_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7_amplpy___pyx_scope_struct_8_genexpr},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_7_amplpy___pyx_scope_struct_8_genexpr},
  {Py_tp_new, (void *)__pyx_tp_new_7_amplpy___pyx_scope_struct_8_genexpr},
  {0, 0},
};
static PyType_Spec __pyx_type_7_amplpy___pyx_scope_struct_8_genexpr_spec = {
  "_amplpy.__pyx_scope_struct_8_genexpr",
  sizeof(struct __pyx_obj_7_amplpy___pyx_scope_struct_8_genexpr),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_7_amplpy___pyx_scope_struct_8_genexpr_slots,
};
#else

static PyTypeObject __pyx_type_7_amplpy___pyx_scope_struct_8_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "_amplpy.""__pyx_scope_struct_8_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_7_amplpy___pyx_scope_struct_8_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7_amplpy___pyx_scope_struct_8_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  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|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7_amplpy___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*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7_amplpy___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
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_7_amplpy___pyx_scope_struct_9_genexpr *__pyx_freelist_7_amplpy___pyx_scope_struct_9_genexpr[8];
static int __pyx_freecount_7_amplpy___pyx_scope_struct_9_genexpr = 0;
#endif

static PyObject *__pyx_tp_new_7_amplpy___pyx_scope_struct_9_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_7_amplpy___pyx_scope_struct_9_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_7_amplpy___pyx_scope_struct_9_genexpr)))) {
    o = (PyObject*)__pyx_freelist_7_amplpy___pyx_scope_struct_9_genexpr[--__pyx_freecount_7_amplpy___pyx_scope_struct_9_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_7_amplpy___pyx_scope_struct_9_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_7_amplpy___pyx_scope_struct_9_genexpr(PyObject *o) {
  struct __pyx_obj_7_amplpy___pyx_scope_struct_9_genexpr *p = (struct __pyx_obj_7_amplpy___pyx_scope_struct_9_genexpr *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7_amplpy___pyx_scope_struct_9_genexpr) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_genexpr_arg_0);
  Py_CLEAR(p->__pyx_v_value);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_7_amplpy___pyx_scope_struct_9_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7_amplpy___pyx_scope_struct_9_genexpr)))) {
    __pyx_freelist_7_amplpy___pyx_scope_struct_9_genexpr[__pyx_freecount_7_amplpy___pyx_scope_struct_9_genexpr++] = ((struct __pyx_obj_7_amplpy___pyx_scope_struct_9_genexpr *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_7_amplpy___pyx_scope_struct_9_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7_amplpy___pyx_scope_struct_9_genexpr *p = (struct __pyx_obj_7_amplpy___pyx_scope_struct_9_genexpr *)o;
  if (p->__pyx_genexpr_arg_0) {
    e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e;
  }
  if (p->__pyx_v_value) {
    e = (*v)(p->__pyx_v_value, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7_amplpy___pyx_scope_struct_9_genexpr_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7_amplpy___pyx_scope_struct_9_genexpr},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_7_amplpy___pyx_scope_struct_9_genexpr},
  {Py_tp_new, (void *)__pyx_tp_new_7_amplpy___pyx_scope_struct_9_genexpr},
  {0, 0},
};
static PyType_Spec __pyx_type_7_amplpy___pyx_scope_struct_9_genexpr_spec = {
  "_amplpy.__pyx_scope_struct_9_genexpr",
  sizeof(struct __pyx_obj_7_amplpy___pyx_scope_struct_9_genexpr),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_7_amplpy___pyx_scope_struct_9_genexpr_slots,
};
#else

static PyTypeObject __pyx_type_7_amplpy___pyx_scope_struct_9_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "_amplpy.""__pyx_scope_struct_9_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_7_amplpy___pyx_scope_struct_9_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7_amplpy___pyx_scope_struct_9_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  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|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7_amplpy___pyx_scope_struct_9_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7_amplpy___pyx_scope_struct_9_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_7_amplpy___pyx_scope_struct_10_genexpr *__pyx_freelist_7_amplpy___pyx_scope_struct_10_genexpr[8];
static int __pyx_freecount_7_amplpy___pyx_scope_struct_10_genexpr = 0;
#endif

static PyObject *__pyx_tp_new_7_amplpy___pyx_scope_struct_10_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_7_amplpy___pyx_scope_struct_10_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_7_amplpy___pyx_scope_struct_10_genexpr)))) {
    o = (PyObject*)__pyx_freelist_7_amplpy___pyx_scope_struct_10_genexpr[--__pyx_freecount_7_amplpy___pyx_scope_struct_10_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_7_amplpy___pyx_scope_struct_10_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_7_amplpy___pyx_scope_struct_10_genexpr(PyObject *o) {
  struct __pyx_obj_7_amplpy___pyx_scope_struct_10_genexpr *p = (struct __pyx_obj_7_amplpy___pyx_scope_struct_10_genexpr *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7_amplpy___pyx_scope_struct_10_genexpr) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_genexpr_arg_0);
  Py_CLEAR(p->__pyx_v_value);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_7_amplpy___pyx_scope_struct_10_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7_amplpy___pyx_scope_struct_10_genexpr)))) {
    __pyx_freelist_7_amplpy___pyx_scope_struct_10_genexpr[__pyx_freecount_7_amplpy___pyx_scope_struct_10_genexpr++] = ((struct __pyx_obj_7_amplpy___pyx_scope_struct_10_genexpr *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_7_amplpy___pyx_scope_struct_10_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7_amplpy___pyx_scope_struct_10_genexpr *p = (struct __pyx_obj_7_amplpy___pyx_scope_struct_10_genexpr *)o;
  if (p->__pyx_genexpr_arg_0) {
    e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e;
  }
  if (p->__pyx_v_value) {
    e = (*v)(p->__pyx_v_value, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7_amplpy___pyx_scope_struct_10_genexpr_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7_amplpy___pyx_scope_struct_10_genexpr},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_7_amplpy___pyx_scope_struct_10_genexpr},
  {Py_tp_new, (void *)__pyx_tp_new_7_amplpy___pyx_scope_struct_10_genexpr},
  {0, 0},
};
static PyType_Spec __pyx_type_7_amplpy___pyx_scope_struct_10_genexpr_spec = {
  "_amplpy.__pyx_scope_struct_10_genexpr",
  sizeof(struct __pyx_obj_7_amplpy___pyx_scope_struct_10_genexpr),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_7_amplpy___pyx_scope_struct_10_genexpr_slots,
};
#else

static PyTypeObject __pyx_type_7_amplpy___pyx_scope_struct_10_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "_amplpy.""__pyx_scope_struct_10_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_7_amplpy___pyx_scope_struct_10_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7_amplpy___pyx_scope_struct_10_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  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|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7_amplpy___pyx_scope_struct_10_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*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7_amplpy___pyx_scope_struct_10_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_7_amplpy___pyx_scope_struct_11_set_values *__pyx_freelist_7_amplpy___pyx_scope_struct_11_set_values[8];
static int __pyx_freecount_7_amplpy___pyx_scope_struct_11_set_values = 0;
#endif

static PyObject *__pyx_tp_new_7_amplpy___pyx_scope_struct_11_set_values(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_7_amplpy___pyx_scope_struct_11_set_values > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_7_amplpy___pyx_scope_struct_11_set_values)))) {
    o = (PyObject*)__pyx_freelist_7_amplpy___pyx_scope_struct_11_set_values[--__pyx_freecount_7_amplpy___pyx_scope_struct_11_set_values];
    memset(o, 0, sizeof(struct __pyx_obj_7_amplpy___pyx_scope_struct_11_set_values));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_7_amplpy___pyx_scope_struct_11_set_values(PyObject *o) {
  struct __pyx_obj_7_amplpy___pyx_scope_struct_11_set_values *p = (struct __pyx_obj_7_amplpy___pyx_scope_struct_11_set_values *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7_amplpy___pyx_scope_struct_11_set_values) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_cast_value);
  Py_CLEAR(p->__pyx_v_dimen);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_7_amplpy___pyx_scope_struct_11_set_values < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7_amplpy___pyx_scope_struct_11_set_values)))) {
    __pyx_freelist_7_amplpy___pyx_scope_struct_11_set_values[__pyx_freecount_7_amplpy___pyx_scope_struct_11_set_values++] = ((struct __pyx_obj_7_amplpy___pyx_scope_struct_11_set_values *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_7_amplpy___pyx_scope_struct_11_set_values(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7_amplpy___pyx_scope_struct_11_set_values *p = (struct __pyx_obj_7_amplpy___pyx_scope_struct_11_set_values *)o;
  if (p->__pyx_v_cast_value) {
    e = (*v)(p->__pyx_v_cast_value, a); if (e) return e;
  }
  if (p->__pyx_v_dimen) {
    e = (*v)(p->__pyx_v_dimen, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7_amplpy___pyx_scope_struct_11_set_values(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7_amplpy___pyx_scope_struct_11_set_values *p = (struct __pyx_obj_7_amplpy___pyx_scope_struct_11_set_values *)o;
  tmp = ((PyObject*)p->__pyx_v_cast_value);
  p->__pyx_v_cast_value = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_dimen);
  p->__pyx_v_dimen = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7_amplpy___pyx_scope_struct_11_set_values_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7_amplpy___pyx_scope_struct_11_set_values},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_7_amplpy___pyx_scope_struct_11_set_values},
  {Py_tp_clear, (void *)__pyx_tp_clear_7_amplpy___pyx_scope_struct_11_set_values},
  {Py_tp_new, (void *)__pyx_tp_new_7_amplpy___pyx_scope_struct_11_set_values},
  {0, 0},
};
static PyType_Spec __pyx_type_7_amplpy___pyx_scope_struct_11_set_values_spec = {
  "_amplpy.__pyx_scope_struct_11_set_values",
  sizeof(struct __pyx_obj_7_amplpy___pyx_scope_struct_11_set_values),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_7_amplpy___pyx_scope_struct_11_set_values_slots,
};
#else

static PyTypeObject __pyx_type_7_amplpy___pyx_scope_struct_11_set_values = {
  PyVarObject_HEAD_INIT(0, 0)
  "_amplpy.""__pyx_scope_struct_11_set_values", /*tp_name*/
  sizeof(struct __pyx_obj_7_amplpy___pyx_scope_struct_11_set_values), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7_amplpy___pyx_scope_struct_11_set_values, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  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|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7_amplpy___pyx_scope_struct_11_set_values, /*tp_traverse*/
  __pyx_tp_clear_7_amplpy___pyx_scope_struct_11_set_values, /*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*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7_amplpy___pyx_scope_struct_11_set_values, /*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
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_7_amplpy___pyx_scope_struct_12_genexpr *__pyx_freelist_7_amplpy___pyx_scope_struct_12_genexpr[8];
static int __pyx_freecount_7_amplpy___pyx_scope_struct_12_genexpr = 0;
#endif

static PyObject *__pyx_tp_new_7_amplpy___pyx_scope_struct_12_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_7_amplpy___pyx_scope_struct_12_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_7_amplpy___pyx_scope_struct_12_genexpr)))) {
    o = (PyObject*)__pyx_freelist_7_amplpy___pyx_scope_struct_12_genexpr[--__pyx_freecount_7_amplpy___pyx_scope_struct_12_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_7_amplpy___pyx_scope_struct_12_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_7_amplpy___pyx_scope_struct_12_genexpr(PyObject *o) {
  struct __pyx_obj_7_amplpy___pyx_scope_struct_12_genexpr *p = (struct __pyx_obj_7_amplpy___pyx_scope_struct_12_genexpr *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7_amplpy___pyx_scope_struct_12_genexpr) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_genexpr_arg_0);
  Py_CLEAR(p->__pyx_v_value);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_7_amplpy___pyx_scope_struct_12_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7_amplpy___pyx_scope_struct_12_genexpr)))) {
    __pyx_freelist_7_amplpy___pyx_scope_struct_12_genexpr[__pyx_freecount_7_amplpy___pyx_scope_struct_12_genexpr++] = ((struct __pyx_obj_7_amplpy___pyx_scope_struct_12_genexpr *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_7_amplpy___pyx_scope_struct_12_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7_amplpy___pyx_scope_struct_12_genexpr *p = (struct __pyx_obj_7_amplpy___pyx_scope_struct_12_genexpr *)o;
  if (p->__pyx_genexpr_arg_0) {
    e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e;
  }
  if (p->__pyx_v_value) {
    e = (*v)(p->__pyx_v_value, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7_amplpy___pyx_scope_struct_12_genexpr_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7_amplpy___pyx_scope_struct_12_genexpr},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_7_amplpy___pyx_scope_struct_12_genexpr},
  {Py_tp_new, (void *)__pyx_tp_new_7_amplpy___pyx_scope_struct_12_genexpr},
  {0, 0},
};
static PyType_Spec __pyx_type_7_amplpy___pyx_scope_struct_12_genexpr_spec = {
  "_amplpy.__pyx_scope_struct_12_genexpr",
  sizeof(struct __pyx_obj_7_amplpy___pyx_scope_struct_12_genexpr),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_7_amplpy___pyx_scope_struct_12_genexpr_slots,
};
#else

static PyTypeObject __pyx_type_7_amplpy___pyx_scope_struct_12_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "_amplpy.""__pyx_scope_struct_12_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_7_amplpy___pyx_scope_struct_12_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7_amplpy___pyx_scope_struct_12_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  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|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7_amplpy___pyx_scope_struct_12_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*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7_amplpy___pyx_scope_struct_12_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
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_7_amplpy___pyx_scope_struct_13_genexpr *__pyx_freelist_7_amplpy___pyx_scope_struct_13_genexpr[8];
static int __pyx_freecount_7_amplpy___pyx_scope_struct_13_genexpr = 0;
#endif

static PyObject *__pyx_tp_new_7_amplpy___pyx_scope_struct_13_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_7_amplpy___pyx_scope_struct_13_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_7_amplpy___pyx_scope_struct_13_genexpr)))) {
    o = (PyObject*)__pyx_freelist_7_amplpy___pyx_scope_struct_13_genexpr[--__pyx_freecount_7_amplpy___pyx_scope_struct_13_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_7_amplpy___pyx_scope_struct_13_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_7_amplpy___pyx_scope_struct_13_genexpr(PyObject *o) {
  struct __pyx_obj_7_amplpy___pyx_scope_struct_13_genexpr *p = (struct __pyx_obj_7_amplpy___pyx_scope_struct_13_genexpr *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7_amplpy___pyx_scope_struct_13_genexpr) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_genexpr_arg_0);
  Py_CLEAR(p->__pyx_v_value);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_7_amplpy___pyx_scope_struct_13_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7_amplpy___pyx_scope_struct_13_genexpr)))) {
    __pyx_freelist_7_amplpy___pyx_scope_struct_13_genexpr[__pyx_freecount_7_amplpy___pyx_scope_struct_13_genexpr++] = ((struct __pyx_obj_7_amplpy___pyx_scope_struct_13_genexpr *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_7_amplpy___pyx_scope_struct_13_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7_amplpy___pyx_scope_struct_13_genexpr *p = (struct __pyx_obj_7_amplpy___pyx_scope_struct_13_genexpr *)o;
  if (p->__pyx_genexpr_arg_0) {
    e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e;
  }
  if (p->__pyx_v_value) {
    e = (*v)(p->__pyx_v_value, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7_amplpy___pyx_scope_struct_13_genexpr_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7_amplpy___pyx_scope_struct_13_genexpr},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_7_amplpy___pyx_scope_struct_13_genexpr},
  {Py_tp_new, (void *)__pyx_tp_new_7_amplpy___pyx_scope_struct_13_genexpr},
  {0, 0},
};
static PyType_Spec __pyx_type_7_amplpy___pyx_scope_struct_13_genexpr_spec = {
  "_amplpy.__pyx_scope_struct_13_genexpr",
  sizeof(struct __pyx_obj_7_amplpy___pyx_scope_struct_13_genexpr),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_7_amplpy___pyx_scope_struct_13_genexpr_slots,
};
#else

static PyTypeObject __pyx_type_7_amplpy___pyx_scope_struct_13_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "_amplpy.""__pyx_scope_struct_13_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_7_amplpy___pyx_scope_struct_13_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7_amplpy___pyx_scope_struct_13_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  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|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7_amplpy___pyx_scope_struct_13_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*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7_amplpy___pyx_scope_struct_13_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_7_amplpy___pyx_scope_struct_14_genexpr *__pyx_freelist_7_amplpy___pyx_scope_struct_14_genexpr[8];
static int __pyx_freecount_7_amplpy___pyx_scope_struct_14_genexpr = 0;
#endif

static PyObject *__pyx_tp_new_7_amplpy___pyx_scope_struct_14_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_7_amplpy___pyx_scope_struct_14_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_7_amplpy___pyx_scope_struct_14_genexpr)))) {
    o = (PyObject*)__pyx_freelist_7_amplpy___pyx_scope_struct_14_genexpr[--__pyx_freecount_7_amplpy___pyx_scope_struct_14_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_7_amplpy___pyx_scope_struct_14_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_7_amplpy___pyx_scope_struct_14_genexpr(PyObject *o) {
  struct __pyx_obj_7_amplpy___pyx_scope_struct_14_genexpr *p = (struct __pyx_obj_7_amplpy___pyx_scope_struct_14_genexpr *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7_amplpy___pyx_scope_struct_14_genexpr) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_genexpr_arg_0);
  Py_CLEAR(p->__pyx_v_row);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_7_amplpy___pyx_scope_struct_14_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7_amplpy___pyx_scope_struct_14_genexpr)))) {
    __pyx_freelist_7_amplpy___pyx_scope_struct_14_genexpr[__pyx_freecount_7_amplpy___pyx_scope_struct_14_genexpr++] = ((struct __pyx_obj_7_amplpy___pyx_scope_struct_14_genexpr *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_7_amplpy___pyx_scope_struct_14_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7_amplpy___pyx_scope_struct_14_genexpr *p = (struct __pyx_obj_7_amplpy___pyx_scope_struct_14_genexpr *)o;
  if (p->__pyx_genexpr_arg_0) {
    e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e;
  }
  if (p->__pyx_v_row) {
    e = (*v)(p->__pyx_v_row, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7_amplpy___pyx_scope_struct_14_genexpr_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7_amplpy___pyx_scope_struct_14_genexpr},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_7_amplpy___pyx_scope_struct_14_genexpr},
  {Py_tp_new, (void *)__pyx_tp_new_7_amplpy___pyx_scope_struct_14_genexpr},
  {0, 0},
};
static PyType_Spec __pyx_type_7_amplpy___pyx_scope_struct_14_genexpr_spec = {
  "_amplpy.__pyx_scope_struct_14_genexpr",
  sizeof(struct __pyx_obj_7_amplpy___pyx_scope_struct_14_genexpr),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_7_amplpy___pyx_scope_struct_14_genexpr_slots,
};
#else

static PyTypeObject __pyx_type_7_amplpy___pyx_scope_struct_14_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "_amplpy.""__pyx_scope_struct_14_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_7_amplpy___pyx_scope_struct_14_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7_amplpy___pyx_scope_struct_14_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  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|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7_amplpy___pyx_scope_struct_14_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7_amplpy___pyx_scope_struct_14_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_7_amplpy___pyx_scope_struct_15_genexpr *__pyx_freelist_7_amplpy___pyx_scope_struct_15_genexpr[8];
static int __pyx_freecount_7_amplpy___pyx_scope_struct_15_genexpr = 0;
#endif

static PyObject *__pyx_tp_new_7_amplpy___pyx_scope_struct_15_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_7_amplpy___pyx_scope_struct_15_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_7_amplpy___pyx_scope_struct_15_genexpr)))) {
    o = (PyObject*)__pyx_freelist_7_amplpy___pyx_scope_struct_15_genexpr[--__pyx_freecount_7_amplpy___pyx_scope_struct_15_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_7_amplpy___pyx_scope_struct_15_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_7_amplpy___pyx_scope_struct_15_genexpr(PyObject *o) {
  struct __pyx_obj_7_amplpy___pyx_scope_struct_15_genexpr *p = (struct __pyx_obj_7_amplpy___pyx_scope_struct_15_genexpr *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7_amplpy___pyx_scope_struct_15_genexpr) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_genexpr_arg_0);
  Py_CLEAR(p->__pyx_v_row);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_7_amplpy___pyx_scope_struct_15_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7_amplpy___pyx_scope_struct_15_genexpr)))) {
    __pyx_freelist_7_amplpy___pyx_scope_struct_15_genexpr[__pyx_freecount_7_amplpy___pyx_scope_struct_15_genexpr++] = ((struct __pyx_obj_7_amplpy___pyx_scope_struct_15_genexpr *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_7_amplpy___pyx_scope_struct_15_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7_amplpy___pyx_scope_struct_15_genexpr *p = (struct __pyx_obj_7_amplpy___pyx_scope_struct_15_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_genexpr_arg_0) {
    e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e;
  }
  if (p->__pyx_v_row) {
    e = (*v)(p->__pyx_v_row, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7_amplpy___pyx_scope_struct_15_genexpr_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7_amplpy___pyx_scope_struct_15_genexpr},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_7_amplpy___pyx_scope_struct_15_genexpr},
  {Py_tp_new, (void *)__pyx_tp_new_7_amplpy___pyx_scope_struct_15_genexpr},
  {0, 0},
};
static PyType_Spec __pyx_type_7_amplpy___pyx_scope_struct_15_genexpr_spec = {
  "_amplpy.__pyx_scope_struct_15_genexpr",
  sizeof(struct __pyx_obj_7_amplpy___pyx_scope_struct_15_genexpr),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_7_amplpy___pyx_scope_struct_15_genexpr_slots,
};
#else

static PyTypeObject __pyx_type_7_amplpy___pyx_scope_struct_15_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "_amplpy.""__pyx_scope_struct_15_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_7_amplpy___pyx_scope_struct_15_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7_amplpy___pyx_scope_struct_15_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  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|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7_amplpy___pyx_scope_struct_15_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*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7_amplpy___pyx_scope_struct_15_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
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyMethodDef __pyx_methods[] = {
  {0, 0, 0, 0}
};
#ifndef CYTHON_SMALL_CODE
#if defined(__clang__)
    #define CYTHON_SMALL_CODE
#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
    #define CYTHON_SMALL_CODE __attribute__((cold))
#else
    #define CYTHON_SMALL_CODE
#endif
#endif
/* #### Code section: pystring_table ### */

static int __Pyx_CreateStringTabAndInitStrings(void) {
  __Pyx_StringTabEntry __pyx_string_tab[] = {
    {&__pyx_kp_u_75, __pyx_k_75, sizeof(__pyx_k_75), 0, 1, 0, 0},
    {&__pyx_n_s_AMPL, __pyx_k_AMPL, sizeof(__pyx_k_AMPL), 0, 0, 1, 1},
    {&__pyx_n_s_AMPLException, __pyx_k_AMPLException, sizeof(__pyx_k_AMPLException), 0, 0, 1, 1},
    {&__pyx_n_s_AMPLException___init, __pyx_k_AMPLException___init, sizeof(__pyx_k_AMPLException___init), 0, 0, 1, 1},
    {&__pyx_n_s_AMPLException___str, __pyx_k_AMPLException___str, sizeof(__pyx_k_AMPLException___str), 0, 0, 1, 1},
    {&__pyx_n_s_AMPLException_get_line_number, __pyx_k_AMPLException_get_line_number, sizeof(__pyx_k_AMPLException_get_line_number), 0, 0, 1, 1},
    {&__pyx_n_s_AMPLException_get_message, __pyx_k_AMPLException_get_message, sizeof(__pyx_k_AMPLException_get_message), 0, 0, 1, 1},
    {&__pyx_n_s_AMPLException_get_offset, __pyx_k_AMPLException_get_offset, sizeof(__pyx_k_AMPLException_get_offset), 0, 0, 1, 1},
    {&__pyx_n_s_AMPLException_get_source_name, __pyx_k_AMPLException_get_source_name, sizeof(__pyx_k_AMPLException_get_source_name), 0, 0, 1, 1},
    {&__pyx_kp_u_AMPL_AMPL_INVALID_SUBSCRIPT_EXCE, __pyx_k_AMPL_AMPL_INVALID_SUBSCRIPT_EXCE, sizeof(__pyx_k_AMPL_AMPL_INVALID_SUBSCRIPT_EXCE), 0, 1, 0, 0},
    {&__pyx_kp_u_AMPL_AMPL_NO_DATA_EXCEPTION, __pyx_k_AMPL_AMPL_NO_DATA_EXCEPTION, sizeof(__pyx_k_AMPL_AMPL_NO_DATA_EXCEPTION), 0, 1, 0, 0},
    {&__pyx_kp_u_AMPL_AMPL_SYNTAX_ERROR_EXCEPTION, __pyx_k_AMPL_AMPL_SYNTAX_ERROR_EXCEPTION, sizeof(__pyx_k_AMPL_AMPL_SYNTAX_ERROR_EXCEPTION), 0, 1, 0, 0},
    {&__pyx_n_s_AMPL_NOT_FOUND_MESSAGE, __pyx_k_AMPL_NOT_FOUND_MESSAGE, sizeof(__pyx_k_AMPL_NOT_FOUND_MESSAGE), 0, 0, 1, 1},
    {&__pyx_n_s_AMPL___reduce_cython, __pyx_k_AMPL___reduce_cython, sizeof(__pyx_k_AMPL___reduce_cython), 0, 0, 1, 1},
    {&__pyx_n_s_AMPL___setstate_cython, __pyx_k_AMPL___setstate_cython, sizeof(__pyx_k_AMPL___setstate_cython), 0, 0, 1, 1},
    {&__pyx_n_s_AMPL__con, __pyx_k_AMPL__con, sizeof(__pyx_k_AMPL__con), 0, 0, 1, 1},
    {&__pyx_n_s_AMPL__load_session, __pyx_k_AMPL__load_session, sizeof(__pyx_k_AMPL__load_session), 0, 0, 1, 1},
    {&__pyx_n_s_AMPL__obj, __pyx_k_AMPL__obj, sizeof(__pyx_k_AMPL__obj), 0, 0, 1, 1},
    {&__pyx_n_s_AMPL__option, __pyx_k_AMPL__option, sizeof(__pyx_k_AMPL__option), 0, 0, 1, 1},
    {&__pyx_n_s_AMPL__param, __pyx_k_AMPL__param, sizeof(__pyx_k_AMPL__param), 0, 0, 1, 1},
    {&__pyx_n_s_AMPL__set, __pyx_k_AMPL__set, sizeof(__pyx_k_AMPL__set), 0, 0, 1, 1},
    {&__pyx_n_s_AMPL__start_recording, __pyx_k_AMPL__start_recording, sizeof(__pyx_k_AMPL__start_recording), 0, 0, 1, 1},
    {&__pyx_n_s_AMPL__stop_recording, __pyx_k_AMPL__stop_recording, sizeof(__pyx_k_AMPL__stop_recording), 0, 0, 1, 1},
    {&__pyx_n_s_AMPL__var, __pyx_k_AMPL__var, sizeof(__pyx_k_AMPL__var), 0, 0, 1, 1},
    {&__pyx_n_s_AMPL_cd, __pyx_k_AMPL_cd, sizeof(__pyx_k_AMPL_cd), 0, 0, 1, 1},
    {&__pyx_n_s_AMPL_close, __pyx_k_AMPL_close, sizeof(__pyx_k_AMPL_close), 0, 0, 1, 1},
    {&__pyx_kp_u_AMPL_could_not_be_started, __pyx_k_AMPL_could_not_be_started, sizeof(__pyx_k_AMPL_could_not_be_started), 0, 1, 0, 0},
    {&__pyx_n_s_AMPL_display, __pyx_k_AMPL_display, sizeof(__pyx_k_AMPL_display), 0, 0, 1, 1},
    {&__pyx_n_s_AMPL_eval, __pyx_k_AMPL_eval, sizeof(__pyx_k_AMPL_eval), 0, 0, 1, 1},
    {&__pyx_n_s_AMPL_export_data, __pyx_k_AMPL_export_data, sizeof(__pyx_k_AMPL_export_data), 0, 0, 1, 1},
    {&__pyx_n_s_AMPL_export_model, __pyx_k_AMPL_export_model, sizeof(__pyx_k_AMPL_export_model), 0, 0, 1, 1},
    {&__pyx_n_s_AMPL_get_constraint, __pyx_k_AMPL_get_constraint, sizeof(__pyx_k_AMPL_get_constraint), 0, 0, 1, 1},
    {&__pyx_n_s_AMPL_get_constraints, __pyx_k_AMPL_get_constraints, sizeof(__pyx_k_AMPL_get_constraints), 0, 0, 1, 1},
    {&__pyx_n_s_AMPL_get_current_objective, __pyx_k_AMPL_get_current_objective, sizeof(__pyx_k_AMPL_get_current_objective), 0, 0, 1, 1},
    {&__pyx_n_s_AMPL_get_data, __pyx_k_AMPL_get_data, sizeof(__pyx_k_AMPL_get_data), 0, 0, 1, 1},
    {&__pyx_n_s_AMPL_get_entity, __pyx_k_AMPL_get_entity, sizeof(__pyx_k_AMPL_get_entity), 0, 0, 1, 1},
    {&__pyx_n_s_AMPL_get_error_handler, __pyx_k_AMPL_get_error_handler, sizeof(__pyx_k_AMPL_get_error_handler), 0, 0, 1, 1},
    {&__pyx_n_s_AMPL_get_iis, __pyx_k_AMPL_get_iis, sizeof(__pyx_k_AMPL_get_iis), 0, 0, 1, 1},
    {&__pyx_n_s_AMPL_get_objective, __pyx_k_AMPL_get_objective, sizeof(__pyx_k_AMPL_get_objective), 0, 0, 1, 1},
    {&__pyx_n_s_AMPL_get_objectives, __pyx_k_AMPL_get_objectives, sizeof(__pyx_k_AMPL_get_objectives), 0, 0, 1, 1},
    {&__pyx_n_s_AMPL_get_option, __pyx_k_AMPL_get_option, sizeof(__pyx_k_AMPL_get_option), 0, 0, 1, 1},
    {&__pyx_n_s_AMPL_get_output, __pyx_k_AMPL_get_output, sizeof(__pyx_k_AMPL_get_output), 0, 0, 1, 1},
    {&__pyx_n_s_AMPL_get_output_handler, __pyx_k_AMPL_get_output_handler, sizeof(__pyx_k_AMPL_get_output_handler), 0, 0, 1, 1},
    {&__pyx_n_s_AMPL_get_parameter, __pyx_k_AMPL_get_parameter, sizeof(__pyx_k_AMPL_get_parameter), 0, 0, 1, 1},
    {&__pyx_n_s_AMPL_get_parameters, __pyx_k_AMPL_get_parameters, sizeof(__pyx_k_AMPL_get_parameters), 0, 0, 1, 1},
    {&__pyx_n_s_AMPL_get_set, __pyx_k_AMPL_get_set, sizeof(__pyx_k_AMPL_get_set), 0, 0, 1, 1},
    {&__pyx_n_s_AMPL_get_sets, __pyx_k_AMPL_get_sets, sizeof(__pyx_k_AMPL_get_sets), 0, 0, 1, 1},
    {&__pyx_n_s_AMPL_get_solution, __pyx_k_AMPL_get_solution, sizeof(__pyx_k_AMPL_get_solution), 0, 0, 1, 1},
    {&__pyx_n_s_AMPL_get_value, __pyx_k_AMPL_get_value, sizeof(__pyx_k_AMPL_get_value), 0, 0, 1, 1},
    {&__pyx_n_s_AMPL_get_variable, __pyx_k_AMPL_get_variable, sizeof(__pyx_k_AMPL_get_variable), 0, 0, 1, 1},
    {&__pyx_n_s_AMPL_get_variables, __pyx_k_AMPL_get_variables, sizeof(__pyx_k_AMPL_get_variables), 0, 0, 1, 1},
    {&__pyx_n_s_AMPL_is_running, __pyx_k_AMPL_is_running, sizeof(__pyx_k_AMPL_is_running), 0, 0, 1, 1},
    {&__pyx_n_s_AMPL_read, __pyx_k_AMPL_read, sizeof(__pyx_k_AMPL_read), 0, 0, 1, 1},
    {&__pyx_n_s_AMPL_read_data, __pyx_k_AMPL_read_data, sizeof(__pyx_k_AMPL_read_data), 0, 0, 1, 1},
    {&__pyx_n_s_AMPL_read_table, __pyx_k_AMPL_read_table, sizeof(__pyx_k_AMPL_read_table), 0, 0, 1, 1},
    {&__pyx_n_s_AMPL_reset, __pyx_k_AMPL_reset, sizeof(__pyx_k_AMPL_reset), 0, 0, 1, 1},
    {&__pyx_n_s_AMPL_set_data, __pyx_k_AMPL_set_data, sizeof(__pyx_k_AMPL_set_data), 0, 0, 1, 1},
    {&__pyx_n_s_AMPL_set_error_handler, __pyx_k_AMPL_set_error_handler, sizeof(__pyx_k_AMPL_set_error_handler), 0, 0, 1, 1},
    {&__pyx_n_s_AMPL_set_option, __pyx_k_AMPL_set_option, sizeof(__pyx_k_AMPL_set_option), 0, 0, 1, 1},
    {&__pyx_n_s_AMPL_set_output_handler, __pyx_k_AMPL_set_output_handler, sizeof(__pyx_k_AMPL_set_output_handler), 0, 0, 1, 1},
    {&__pyx_n_s_AMPL_snapshot, __pyx_k_AMPL_snapshot, sizeof(__pyx_k_AMPL_snapshot), 0, 0, 1, 1},
    {&__pyx_n_s_AMPL_solve, __pyx_k_AMPL_solve, sizeof(__pyx_k_AMPL_solve), 0, 0, 1, 1},
    {&__pyx_kp_u_AMPL_unknown_return_code, __pyx_k_AMPL_unknown_return_code, sizeof(__pyx_k_AMPL_unknown_return_code), 0, 1, 0, 0},
    {&__pyx_n_s_AMPL_write, __pyx_k_AMPL_write, sizeof(__pyx_k_AMPL_write), 0, 0, 1, 1},
    {&__pyx_n_s_AMPL_write_table, __pyx_k_AMPL_write_table, sizeof(__pyx_k_AMPL_write_table), 0, 0, 1, 1},
    {&__pyx_kp_u_A_constraint_called_name_cannot, __pyx_k_A_constraint_called_name_cannot, sizeof(__pyx_k_A_constraint_called_name_cannot), 0, 1, 0, 0},
    {&__pyx_kp_u_A_parameter_called_name_cannot_b, __pyx_k_A_parameter_called_name_cannot_b, sizeof(__pyx_k_A_parameter_called_name_cannot_b), 0, 1, 0, 0},
    {&__pyx_kp_u_A_set_called_name_cannot_be_foun, __pyx_k_A_set_called_name_cannot_be_foun, sizeof(__pyx_k_A_set_called_name_cannot_be_foun), 0, 1, 0, 0},
    {&__pyx_kp_u_A_variable_called_name_cannot_be, __pyx_k_A_variable_called_name_cannot_be, sizeof(__pyx_k_A_variable_called_name_cannot_be), 0, 1, 0, 0},
    {&__pyx_kp_u_All_values_must_be_either_number, __pyx_k_All_values_must_be_either_number, sizeof(__pyx_k_All_values_must_be_either_number), 0, 1, 0, 0},
    {&__pyx_kp_u_An_objective_called_name_cannot, __pyx_k_An_objective_called_name_cannot, sizeof(__pyx_k_An_objective_called_name_cannot), 0, 1, 0, 0},
    {&__pyx_n_s_AssertionError, __pyx_k_AssertionError, sizeof(__pyx_k_AssertionError), 0, 0, 1, 1},
    {&__pyx_n_s_AttributeError, __pyx_k_AttributeError, sizeof(__pyx_k_AttributeError), 0, 0, 1, 1},
    {&__pyx_n_s_BREAK, __pyx_k_BREAK, sizeof(__pyx_k_BREAK), 0, 0, 1, 1},
    {&__pyx_n_s_BREAKPOINT, __pyx_k_BREAKPOINT, sizeof(__pyx_k_BREAKPOINT), 0, 0, 1, 1},
    {&__pyx_n_s_CALL, __pyx_k_CALL, sizeof(__pyx_k_CALL), 0, 0, 1, 1},
    {&__pyx_n_s_CD, __pyx_k_CD, sizeof(__pyx_k_CD), 0, 0, 1, 1},
    {&__pyx_n_s_CHECK, __pyx_k_CHECK, sizeof(__pyx_k_CHECK), 0, 0, 1, 1},
    {&__pyx_n_s_CLOSE, __pyx_k_CLOSE, sizeof(__pyx_k_CLOSE), 0, 0, 1, 1},
    {&__pyx_n_s_COMMANDS, __pyx_k_COMMANDS, sizeof(__pyx_k_COMMANDS), 0, 0, 1, 1},
    {&__pyx_n_s_CONTINUE, __pyx_k_CONTINUE, sizeof(__pyx_k_CONTINUE), 0, 0, 1, 1},
    {&__pyx_n_s_ColIterator, __pyx_k_ColIterator, sizeof(__pyx_k_ColIterator), 0, 0, 1, 1},
    {&__pyx_n_s_ColIterator___reduce_cython, __pyx_k_ColIterator___reduce_cython, sizeof(__pyx_k_ColIterator___reduce_cython), 0, 0, 1, 1},
    {&__pyx_n_s_ColIterator___setstate_cython, __pyx_k_ColIterator___setstate_cython, sizeof(__pyx_k_ColIterator___setstate_cython), 0, 0, 1, 1},
    {&__pyx_n_s_Column, __pyx_k_Column, sizeof(__pyx_k_Column), 0, 0, 1, 1},
    {&__pyx_n_s_Column___reduce_cython, __pyx_k_Column___reduce_cython, sizeof(__pyx_k_Column___reduce_cython), 0, 0, 1, 1},
    {&__pyx_n_s_Column___setstate_cython, __pyx_k_Column___setstate_cython, sizeof(__pyx_k_Column___setstate_cython), 0, 0, 1, 1},
    {&__pyx_n_s_Column_to_list, __pyx_k_Column_to_list, sizeof(__pyx_k_Column_to_list), 0, 0, 1, 1},
    {&__pyx_n_s_Column_to_string, __pyx_k_Column_to_string, sizeof(__pyx_k_Column_to_string), 0, 0, 1, 1},
    {&__pyx_n_s_Constraint, __pyx_k_Constraint, sizeof(__pyx_k_Constraint), 0, 0, 1, 1},
    {&__pyx_n_s_Constraint___reduce_cython, __pyx_k_Constraint___reduce_cython, sizeof(__pyx_k_Constraint___reduce_cython), 0, 0, 1, 1},
    {&__pyx_n_s_Constraint___setstate_cython, __pyx_k_Constraint___setstate_cython, sizeof(__pyx_k_Constraint___setstate_cython), 0, 0, 1, 1},
    {&__pyx_n_s_Constraint_astatus, __pyx_k_Constraint_astatus, sizeof(__pyx_k_Constraint_astatus), 0, 0, 1, 1},
    {&__pyx_n_s_Constraint_body, __pyx_k_Constraint_body, sizeof(__pyx_k_Constraint_body), 0, 0, 1, 1},
    {&__pyx_n_s_Constraint_defvar, __pyx_k_Constraint_defvar, sizeof(__pyx_k_Constraint_defvar), 0, 0, 1, 1},
    {&__pyx_n_s_Constraint_dinit, __pyx_k_Constraint_dinit, sizeof(__pyx_k_Constraint_dinit), 0, 0, 1, 1},
    {&__pyx_n_s_Constraint_dinit0, __pyx_k_Constraint_dinit0, sizeof(__pyx_k_Constraint_dinit0), 0, 0, 1, 1},
    {&__pyx_n_s_Constraint_drop, __pyx_k_Constraint_drop, sizeof(__pyx_k_Constraint_drop), 0, 0, 1, 1},
    {&__pyx_n_s_Constraint_dual, __pyx_k_Constraint_dual, sizeof(__pyx_k_Constraint_dual), 0, 0, 1, 1},
    {&__pyx_n_s_Constraint_is_logical, __pyx_k_Constraint_is_logical, sizeof(__pyx_k_Constraint_is_logical), 0, 0, 1, 1},
    {&__pyx_n_s_Constraint_lb, __pyx_k_Constraint_lb, sizeof(__pyx_k_Constraint_lb), 0, 0, 1, 1},
    {&__pyx_n_s_Constraint_lbs, __pyx_k_Constraint_lbs, sizeof(__pyx_k_Constraint_lbs), 0, 0, 1, 1},
    {&__pyx_n_s_Constraint_ldual, __pyx_k_Constraint_ldual, sizeof(__pyx_k_Constraint_ldual), 0, 0, 1, 1},
    {&__pyx_n_s_Constraint_lslack, __pyx_k_Constraint_lslack, sizeof(__pyx_k_Constraint_lslack), 0, 0, 1, 1},
    {&__pyx_n_s_Constraint_restore, __pyx_k_Constraint_restore, sizeof(__pyx_k_Constraint_restore), 0, 0, 1, 1},
    {&__pyx_n_s_Constraint_set_dual, __pyx_k_Constraint_set_dual, sizeof(__pyx_k_Constraint_set_dual), 0, 0, 1, 1},
    {&__pyx_n_s_Constraint_slack, __pyx_k_Constraint_slack, sizeof(__pyx_k_Constraint_slack), 0, 0, 1, 1},
    {&__pyx_n_s_Constraint_sstatus, __pyx_k_Constraint_sstatus, sizeof(__pyx_k_Constraint_sstatus), 0, 0, 1, 1},
    {&__pyx_n_s_Constraint_status, __pyx_k_Constraint_status, sizeof(__pyx_k_Constraint_status), 0, 0, 1, 1},
    {&__pyx_n_s_Constraint_ub, __pyx_k_Constraint_ub, sizeof(__pyx_k_Constraint_ub), 0, 0, 1, 1},
    {&__pyx_n_s_Constraint_ubs, __pyx_k_Constraint_ubs, sizeof(__pyx_k_Constraint_ubs), 0, 0, 1, 1},
    {&__pyx_n_s_Constraint_udual, __pyx_k_Constraint_udual, sizeof(__pyx_k_Constraint_udual), 0, 0, 1, 1},
    {&__pyx_n_s_Constraint_uslack, __pyx_k_Constraint_uslack, sizeof(__pyx_k_Constraint_uslack), 0, 0, 1, 1},
    {&__pyx_n_s_Constraint_val, __pyx_k_Constraint_val, sizeof(__pyx_k_Constraint_val), 0, 0, 1, 1},
    {&__pyx_n_s_Constraints, __pyx_k_Constraints, sizeof(__pyx_k_Constraints), 0, 0, 1, 1},
    {&__pyx_n_s_DATA, __pyx_k_DATA, sizeof(__pyx_k_DATA), 0, 0, 1, 1},
    {&__pyx_n_s_DELETECMD, __pyx_k_DELETECMD, sizeof(__pyx_k_DELETECMD), 0, 0, 1, 1},
    {&__pyx_n_s_DISPLAY, __pyx_k_DISPLAY, sizeof(__pyx_k_DISPLAY), 0, 0, 1, 1},
    {&__pyx_n_s_DROP, __pyx_k_DROP, sizeof(__pyx_k_DROP), 0, 0, 1, 1},
    {&__pyx_n_s_DROP_OR_RESTORE_ALL, __pyx_k_DROP_OR_RESTORE_ALL, sizeof(__pyx_k_DROP_OR_RESTORE_ALL), 0, 0, 1, 1},
    {&__pyx_n_s_DataFrame, __pyx_k_DataFrame, sizeof(__pyx_k_DataFrame), 0, 0, 1, 1},
    {&__pyx_n_s_DataFrame___reduce_cython, __pyx_k_DataFrame___reduce_cython, sizeof(__pyx_k_DataFrame___reduce_cython), 0, 0, 1, 1},
    {&__pyx_n_s_DataFrame___setstate_cython, __pyx_k_DataFrame___setstate_cython, sizeof(__pyx_k_DataFrame___setstate_cython), 0, 0, 1, 1},
    {&__pyx_n_s_DataFrame__add_column, __pyx_k_DataFrame__add_column, sizeof(__pyx_k_DataFrame__add_column), 0, 0, 1, 1},
    {&__pyx_n_s_DataFrame__add_row, __pyx_k_DataFrame__add_row, sizeof(__pyx_k_DataFrame__add_row), 0, 0, 1, 1},
    {&__pyx_n_s_DataFrame__from_data_frame_ref, __pyx_k_DataFrame__from_data_frame_ref, sizeof(__pyx_k_DataFrame__from_data_frame_ref), 0, 0, 1, 1},
    {&__pyx_n_s_DataFrame__get_column, __pyx_k_DataFrame__get_column, sizeof(__pyx_k_DataFrame__get_column), 0, 0, 1, 1},
    {&__pyx_n_s_DataFrame__get_headers, __pyx_k_DataFrame__get_headers, sizeof(__pyx_k_DataFrame__get_headers), 0, 0, 1, 1},
    {&__pyx_n_s_DataFrame__get_num_cols, __pyx_k_DataFrame__get_num_cols, sizeof(__pyx_k_DataFrame__get_num_cols), 0, 0, 1, 1},
    {&__pyx_n_s_DataFrame__get_num_indices, __pyx_k_DataFrame__get_num_indices, sizeof(__pyx_k_DataFrame__get_num_indices), 0, 0, 1, 1},
    {&__pyx_n_s_DataFrame__get_num_rows, __pyx_k_DataFrame__get_num_rows, sizeof(__pyx_k_DataFrame__get_num_rows), 0, 0, 1, 1},
    {&__pyx_n_s_DataFrame__get_row, __pyx_k_DataFrame__get_row, sizeof(__pyx_k_DataFrame__get_row), 0, 0, 1, 1},
    {&__pyx_n_s_DataFrame__get_row_by_index, __pyx_k_DataFrame__get_row_by_index, sizeof(__pyx_k_DataFrame__get_row_by_index), 0, 0, 1, 1},
    {&__pyx_n_s_DataFrame__set_column, __pyx_k_DataFrame__set_column, sizeof(__pyx_k_DataFrame__set_column), 0, 0, 1, 1},
    {&__pyx_n_s_DataFrame__set_values, __pyx_k_DataFrame__set_values, sizeof(__pyx_k_DataFrame__set_values), 0, 0, 1, 1},
    {&__pyx_n_s_DataFrame_from_dict, __pyx_k_DataFrame_from_dict, sizeof(__pyx_k_DataFrame_from_dict), 0, 0, 1, 1},
    {&__pyx_n_s_DataFrame_from_numpy, __pyx_k_DataFrame_from_numpy, sizeof(__pyx_k_DataFrame_from_numpy), 0, 0, 1, 1},
    {&__pyx_n_s_DataFrame_from_pandas, __pyx_k_DataFrame_from_pandas, sizeof(__pyx_k_DataFrame_from_pandas), 0, 0, 1, 1},
    {&__pyx_n_s_DataFrame_to_dict, __pyx_k_DataFrame_to_dict, sizeof(__pyx_k_DataFrame_to_dict), 0, 0, 1, 1},
    {&__pyx_n_s_DataFrame_to_list, __pyx_k_DataFrame_to_list, sizeof(__pyx_k_DataFrame_to_list), 0, 0, 1, 1},
    {&__pyx_n_s_DataFrame_to_pandas, __pyx_k_DataFrame_to_pandas, sizeof(__pyx_k_DataFrame_to_pandas), 0, 0, 1, 1},
    {&__pyx_n_s_DataFrame_to_string, __pyx_k_DataFrame_to_string, sizeof(__pyx_k_DataFrame_to_string), 0, 0, 1, 1},
    {&__pyx_kp_u_Dictionary_must_contain_either_a, __pyx_k_Dictionary_must_contain_either_a, sizeof(__pyx_k_Dictionary_must_contain_either_a), 0, 1, 0, 0},
    {&__pyx_n_s_ELSE, __pyx_k_ELSE, sizeof(__pyx_k_ELSE), 0, 0, 1, 1},
    {&__pyx_n_s_ELSE_CHECK, __pyx_k_ELSE_CHECK, sizeof(__pyx_k_ELSE_CHECK), 0, 0, 1, 1},
    {&__pyx_n_s_ENDIF, __pyx_k_ENDIF, sizeof(__pyx_k_ENDIF), 0, 0, 1, 1},
    {&__pyx_n_s_ENVIRON, __pyx_k_ENVIRON, sizeof(__pyx_k_ENVIRON), 0, 0, 1, 1},
    {&__pyx_n_s_EXIT, __pyx_k_EXIT, sizeof(__pyx_k_EXIT), 0, 0, 1, 1},
    {&__pyx_n_s_EXPAND, __pyx_k_EXPAND, sizeof(__pyx_k_EXPAND), 0, 0, 1, 1},
    {&__pyx_n_s_Entity, __pyx_k_Entity, sizeof(__pyx_k_Entity), 0, 0, 1, 1},
    {&__pyx_n_s_EntityMap, __pyx_k_EntityMap, sizeof(__pyx_k_EntityMap), 0, 0, 1, 1},
    {&__pyx_n_s_EntityMap___reduce_cython, __pyx_k_EntityMap___reduce_cython, sizeof(__pyx_k_EntityMap___reduce_cython), 0, 0, 1, 1},
    {&__pyx_n_s_EntityMap___setstate_cython, __pyx_k_EntityMap___setstate_cython, sizeof(__pyx_k_EntityMap___setstate_cython), 0, 0, 1, 1},
    {&__pyx_n_s_EntityMap_size, __pyx_k_EntityMap_size, sizeof(__pyx_k_EntityMap_size), 0, 0, 1, 1},
    {&__pyx_n_s_Entity___reduce_cython, __pyx_k_Entity___reduce_cython, sizeof(__pyx_k_Entity___reduce_cython), 0, 0, 1, 1},
    {&__pyx_n_s_Entity___setstate_cython, __pyx_k_Entity___setstate_cython, sizeof(__pyx_k_Entity___setstate_cython), 0, 0, 1, 1},
    {&__pyx_n_s_Entity_find, __pyx_k_Entity_find, sizeof(__pyx_k_Entity_find), 0, 0, 1, 1},
    {&__pyx_n_s_Entity_get, __pyx_k_Entity_get, sizeof(__pyx_k_Entity_get), 0, 0, 1, 1},
    {&__pyx_n_s_Entity_get_indexing_sets, __pyx_k_Entity_get_indexing_sets, sizeof(__pyx_k_Entity_get_indexing_sets), 0, 0, 1, 1},
    {&__pyx_n_s_Entity_get_values, __pyx_k_Entity_get_values, sizeof(__pyx_k_Entity_get_values), 0, 0, 1, 1},
    {&__pyx_n_s_Entity_indexarity, __pyx_k_Entity_indexarity, sizeof(__pyx_k_Entity_indexarity), 0, 0, 1, 1},
    {&__pyx_n_s_Entity_instances, __pyx_k_Entity_instances, sizeof(__pyx_k_Entity_instances), 0, 0, 1, 1},
    {&__pyx_n_s_Entity_is_scalar, __pyx_k_Entity_is_scalar, sizeof(__pyx_k_Entity_is_scalar), 0, 0, 1, 1},
    {&__pyx_n_s_Entity_name, __pyx_k_Entity_name, sizeof(__pyx_k_Entity_name), 0, 0, 1, 1},
    {&__pyx_n_s_Entity_num_instances, __pyx_k_Entity_num_instances, sizeof(__pyx_k_Entity_num_instances), 0, 0, 1, 1},
    {&__pyx_n_s_Entity_set_values, __pyx_k_Entity_set_values, sizeof(__pyx_k_Entity_set_values), 0, 0, 1, 1},
    {&__pyx_n_s_Entity_to_dict, __pyx_k_Entity_to_dict, sizeof(__pyx_k_Entity_to_dict), 0, 0, 1, 1},
    {&__pyx_n_s_Entity_to_list, __pyx_k_Entity_to_list, sizeof(__pyx_k_Entity_to_list), 0, 0, 1, 1},
    {&__pyx_n_s_Entity_to_pandas, __pyx_k_Entity_to_pandas, sizeof(__pyx_k_Entity_to_pandas), 0, 0, 1, 1},
    {&__pyx_n_s_Entity_to_string, __pyx_k_Entity_to_string, sizeof(__pyx_k_Entity_to_string), 0, 0, 1, 1},
    {&__pyx_n_s_Entity_xref, __pyx_k_Entity_xref, sizeof(__pyx_k_Entity_xref), 0, 0, 1, 1},
    {&__pyx_n_s_Enum, __pyx_k_Enum, sizeof(__pyx_k_Enum), 0, 0, 1, 1},
    {&__pyx_n_s_EnvIterator, __pyx_k_EnvIterator, sizeof(__pyx_k_EnvIterator), 0, 0, 1, 1},
    {&__pyx_n_s_EnvIterator___reduce_cython, __pyx_k_EnvIterator___reduce_cython, sizeof(__pyx_k_EnvIterator___reduce_cython), 0, 0, 1, 1},
    {&__pyx_n_s_EnvIterator___setstate_cython, __pyx_k_EnvIterator___setstate_cython, sizeof(__pyx_k_EnvIterator___setstate_cython), 0, 0, 1, 1},
    {&__pyx_n_s_Environment, __pyx_k_Environment, sizeof(__pyx_k_Environment), 0, 0, 1, 1},
    {&__pyx_n_s_Environment___reduce_cython, __pyx_k_Environment___reduce_cython, sizeof(__pyx_k_Environment___reduce_cython), 0, 0, 1, 1},
    {&__pyx_n_s_Environment___setstate_cython, __pyx_k_Environment___setstate_cython, sizeof(__pyx_k_Environment___setstate_cython), 0, 0, 1, 1},
    {&__pyx_n_s_Environment_get_bin_dir, __pyx_k_Environment_get_bin_dir, sizeof(__pyx_k_Environment_get_bin_dir), 0, 0, 1, 1},
    {&__pyx_n_s_Environment_get_bin_name, __pyx_k_Environment_get_bin_name, sizeof(__pyx_k_Environment_get_bin_name), 0, 0, 1, 1},
    {&__pyx_n_s_Environment_set_bin_dir, __pyx_k_Environment_set_bin_dir, sizeof(__pyx_k_Environment_set_bin_dir), 0, 0, 1, 1},
    {&__pyx_n_s_Environment_set_bin_name, __pyx_k_Environment_set_bin_name, sizeof(__pyx_k_Environment_set_bin_name), 0, 0, 1, 1},
    {&__pyx_n_s_Environment_to_string, __pyx_k_Environment_to_string, sizeof(__pyx_k_Environment_to_string), 0, 0, 1, 1},
    {&__pyx_kp_u_Error, __pyx_k_Error, sizeof(__pyx_k_Error), 0, 1, 0, 0},
    {&__pyx_n_s_ErrorHandler, __pyx_k_ErrorHandler, sizeof(__pyx_k_ErrorHandler), 0, 0, 1, 1},
    {&__pyx_n_s_ErrorHandler___reduce_cython, __pyx_k_ErrorHandler___reduce_cython, sizeof(__pyx_k_ErrorHandler___reduce_cython), 0, 0, 1, 1},
    {&__pyx_n_s_ErrorHandler___setstate_cython, __pyx_k_ErrorHandler___setstate_cython, sizeof(__pyx_k_ErrorHandler___setstate_cython), 0, 0, 1, 1},
    {&__pyx_n_s_ErrorHandler_error, __pyx_k_ErrorHandler_error, sizeof(__pyx_k_ErrorHandler_error), 0, 0, 1, 1},
    {&__pyx_n_s_ErrorHandler_warning, __pyx_k_ErrorHandler_warning, sizeof(__pyx_k_ErrorHandler_warning), 0, 0, 1, 1},
    {&__pyx_kp_u_Excepted_dictionary_of_set_membe, __pyx_k_Excepted_dictionary_of_set_membe, sizeof(__pyx_k_Excepted_dictionary_of_set_membe), 0, 1, 0, 0},
    {&__pyx_kp_u_Excepted_string_or_real, __pyx_k_Excepted_string_or_real, sizeof(__pyx_k_Excepted_string_or_real), 0, 1, 0, 0},
    {&__pyx_kp_u_Excepted_tuple_of_arity, __pyx_k_Excepted_tuple_of_arity, sizeof(__pyx_k_Excepted_tuple_of_arity), 0, 1, 0, 0},
    {&__pyx_kp_u_Expected_a_dictionary, __pyx_k_Expected_a_dictionary, sizeof(__pyx_k_Expected_a_dictionary), 0, 1, 0, 0},
    {&__pyx_kp_u_Expected_tuples_of_arity, __pyx_k_Expected_tuples_of_arity, sizeof(__pyx_k_Expected_tuples_of_arity), 0, 1, 0, 0},
    {&__pyx_n_s_FIX, __pyx_k_FIX, sizeof(__pyx_k_FIX), 0, 0, 1, 1},
    {&__pyx_n_s_FOR, __pyx_k_FOR, sizeof(__pyx_k_FOR), 0, 0, 1, 1},
    {&__pyx_kp_u_Failed_to_access_value, __pyx_k_Failed_to_access_value, sizeof(__pyx_k_Failed_to_access_value), 0, 1, 0, 0},
    {&__pyx_n_s_IF, __pyx_k_IF, sizeof(__pyx_k_IF), 0, 0, 1, 1},
    {&__pyx_n_s_IOError, __pyx_k_IOError, sizeof(__pyx_k_IOError), 0, 0, 1, 1},
    {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
    {&__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_k_Incompatible_checksums_0x_x_vs_0, sizeof(__pyx_k_Incompatible_checksums_0x_x_vs_0), 0, 0, 1, 0},
    {&__pyx_n_s_InfeasibilityException, __pyx_k_InfeasibilityException, sizeof(__pyx_k_InfeasibilityException), 0, 0, 1, 1},
    {&__pyx_kp_u_InfeasibilityException_2, __pyx_k_InfeasibilityException_2, sizeof(__pyx_k_InfeasibilityException_2), 0, 1, 0, 0},
    {&__pyx_n_s_InstanceIterator, __pyx_k_InstanceIterator, sizeof(__pyx_k_InstanceIterator), 0, 0, 1, 1},
    {&__pyx_n_s_InstanceIterator___reduce_cython, __pyx_k_InstanceIterator___reduce_cython, sizeof(__pyx_k_InstanceIterator___reduce_cython), 0, 0, 1, 1},
    {&__pyx_n_s_InstanceIterator___setstate_cyth, __pyx_k_InstanceIterator___setstate_cyth, sizeof(__pyx_k_InstanceIterator___setstate_cyth), 0, 0, 1, 1},
    {&__pyx_n_s_InstanceIterator_size, __pyx_k_InstanceIterator_size, sizeof(__pyx_k_InstanceIterator_size), 0, 0, 1, 1},
    {&__pyx_n_s_Iterable, __pyx_k_Iterable, sizeof(__pyx_k_Iterable), 0, 0, 1, 1},
    {&__pyx_n_s_KeyError, __pyx_k_KeyError, sizeof(__pyx_k_KeyError), 0, 0, 1, 1},
    {&__pyx_n_s_Kind, __pyx_k_Kind, sizeof(__pyx_k_Kind), 0, 0, 1, 1},
    {&__pyx_n_s_LET, __pyx_k_LET, sizeof(__pyx_k_LET), 0, 0, 1, 1},
    {&__pyx_n_s_LOAD, __pyx_k_LOAD, sizeof(__pyx_k_LOAD), 0, 0, 1, 1},
    {&__pyx_n_s_LOOPEND, __pyx_k_LOOPEND, sizeof(__pyx_k_LOOPEND), 0, 0, 1, 1},
    {&__pyx_n_s_MISC, __pyx_k_MISC, sizeof(__pyx_k_MISC), 0, 0, 1, 1},
    {&__pyx_n_s_MemberRangeIterator, __pyx_k_MemberRangeIterator, sizeof(__pyx_k_MemberRangeIterator), 0, 0, 1, 1},
    {&__pyx_n_s_MemberRangeIterator___reduce_cyt, __pyx_k_MemberRangeIterator___reduce_cyt, sizeof(__pyx_k_MemberRangeIterator___reduce_cyt), 0, 0, 1, 1},
    {&__pyx_n_s_MemberRangeIterator___setstate_c, __pyx_k_MemberRangeIterator___setstate_c, sizeof(__pyx_k_MemberRangeIterator___setstate_c), 0, 0, 1, 1},
    {&__pyx_n_s_MemberRangeIterator_size, __pyx_k_MemberRangeIterator_size, sizeof(__pyx_k_MemberRangeIterator_size), 0, 0, 1, 1},
    {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
    {&__pyx_n_s_MultiIndex, __pyx_k_MultiIndex, sizeof(__pyx_k_MultiIndex), 0, 0, 1, 1},
    {&__pyx_n_s_NotImplementedError, __pyx_k_NotImplementedError, sizeof(__pyx_k_NotImplementedError), 0, 0, 1, 1},
    {&__pyx_n_s_OBJECTIVE, __pyx_k_OBJECTIVE, sizeof(__pyx_k_OBJECTIVE), 0, 0, 1, 1},
    {&__pyx_n_s_OPTION, __pyx_k_OPTION, sizeof(__pyx_k_OPTION), 0, 0, 1, 1},
    {&__pyx_n_s_OPTION_RESET, __pyx_k_OPTION_RESET, sizeof(__pyx_k_OPTION_RESET), 0, 0, 1, 1},
    {&__pyx_n_s_Objective, __pyx_k_Objective, sizeof(__pyx_k_Objective), 0, 0, 1, 1},
    {&__pyx_n_s_Objective___reduce_cython, __pyx_k_Objective___reduce_cython, sizeof(__pyx_k_Objective___reduce_cython), 0, 0, 1, 1},
    {&__pyx_n_s_Objective___setstate_cython, __pyx_k_Objective___setstate_cython, sizeof(__pyx_k_Objective___setstate_cython), 0, 0, 1, 1},
    {&__pyx_n_s_Objective_astatus, __pyx_k_Objective_astatus, sizeof(__pyx_k_Objective_astatus), 0, 0, 1, 1},
    {&__pyx_n_s_Objective_drop, __pyx_k_Objective_drop, sizeof(__pyx_k_Objective_drop), 0, 0, 1, 1},
    {&__pyx_n_s_Objective_exitcode, __pyx_k_Objective_exitcode, sizeof(__pyx_k_Objective_exitcode), 0, 0, 1, 1},
    {&__pyx_n_s_Objective_message, __pyx_k_Objective_message, sizeof(__pyx_k_Objective_message), 0, 0, 1, 1},
    {&__pyx_n_s_Objective_minimization, __pyx_k_Objective_minimization, sizeof(__pyx_k_Objective_minimization), 0, 0, 1, 1},
    {&__pyx_n_s_Objective_restore, __pyx_k_Objective_restore, sizeof(__pyx_k_Objective_restore), 0, 0, 1, 1},
    {&__pyx_n_s_Objective_result, __pyx_k_Objective_result, sizeof(__pyx_k_Objective_result), 0, 0, 1, 1},
    {&__pyx_n_s_Objective_sstatus, __pyx_k_Objective_sstatus, sizeof(__pyx_k_Objective_sstatus), 0, 0, 1, 1},
    {&__pyx_n_s_Objective_value, __pyx_k_Objective_value, sizeof(__pyx_k_Objective_value), 0, 0, 1, 1},
    {&__pyx_n_s_Objectives, __pyx_k_Objectives, sizeof(__pyx_k_Objectives), 0, 0, 1, 1},
    {&__pyx_n_s_Options, __pyx_k_Options, sizeof(__pyx_k_Options), 0, 0, 1, 1},
    {&__pyx_n_s_OutputHandler, __pyx_k_OutputHandler, sizeof(__pyx_k_OutputHandler), 0, 0, 1, 1},
    {&__pyx_n_s_OutputHandler___reduce_cython, __pyx_k_OutputHandler___reduce_cython, sizeof(__pyx_k_OutputHandler___reduce_cython), 0, 0, 1, 1},
    {&__pyx_n_s_OutputHandler___setstate_cython, __pyx_k_OutputHandler___setstate_cython, sizeof(__pyx_k_OutputHandler___setstate_cython), 0, 0, 1, 1},
    {&__pyx_n_s_OutputHandler_output, __pyx_k_OutputHandler_output, sizeof(__pyx_k_OutputHandler_output), 0, 0, 1, 1},
    {&__pyx_n_s_PRINT, __pyx_k_PRINT, sizeof(__pyx_k_PRINT), 0, 0, 1, 1},
    {&__pyx_n_s_PRINTF, __pyx_k_PRINTF, sizeof(__pyx_k_PRINTF), 0, 0, 1, 1},
    {&__pyx_n_s_PROBLEM, __pyx_k_PROBLEM, sizeof(__pyx_k_PROBLEM), 0, 0, 1, 1},
    {&__pyx_n_s_PROMPT, __pyx_k_PROMPT, sizeof(__pyx_k_PROMPT), 0, 0, 1, 1},
    {&__pyx_n_s_PURGE, __pyx_k_PURGE, sizeof(__pyx_k_PURGE), 0, 0, 1, 1},
    {&__pyx_n_s_Parameter, __pyx_k_Parameter, sizeof(__pyx_k_Parameter), 0, 0, 1, 1},
    {&__pyx_n_s_Parameter___reduce_cython, __pyx_k_Parameter___reduce_cython, sizeof(__pyx_k_Parameter___reduce_cython), 0, 0, 1, 1},
    {&__pyx_n_s_Parameter___setstate_cython, __pyx_k_Parameter___setstate_cython, sizeof(__pyx_k_Parameter___setstate_cython), 0, 0, 1, 1},
    {&__pyx_n_s_Parameter_has_default, __pyx_k_Parameter_has_default, sizeof(__pyx_k_Parameter_has_default), 0, 0, 1, 1},
    {&__pyx_n_s_Parameter_is_symbolic, __pyx_k_Parameter_is_symbolic, sizeof(__pyx_k_Parameter_is_symbolic), 0, 0, 1, 1},
    {&__pyx_n_s_Parameter_set, __pyx_k_Parameter_set, sizeof(__pyx_k_Parameter_set), 0, 0, 1, 1},
    {&__pyx_n_s_Parameter_set_values, __pyx_k_Parameter_set_values, sizeof(__pyx_k_Parameter_set_values), 0, 0, 1, 1},
    {&__pyx_n_s_Parameter_value, __pyx_k_Parameter_value, sizeof(__pyx_k_Parameter_value), 0, 0, 1, 1},
    {&__pyx_n_s_Parameters, __pyx_k_Parameters, sizeof(__pyx_k_Parameters), 0, 0, 1, 1},
    {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
    {&__pyx_kp_u_Please_make_sure_that_the_AMPL, __pyx_k_Please_make_sure_that_the_AMPL, sizeof(__pyx_k_Please_make_sure_that_the_AMPL), 0, 1, 0, 0},
    {&__pyx_n_s_PresolveException, __pyx_k_PresolveException, sizeof(__pyx_k_PresolveException), 0, 0, 1, 1},
    {&__pyx_kp_u_PresolveException_2, __pyx_k_PresolveException_2, sizeof(__pyx_k_PresolveException_2), 0, 1, 0, 0},
    {&__pyx_n_s_RBRACE, __pyx_k_RBRACE, sizeof(__pyx_k_RBRACE), 0, 0, 1, 1},
    {&__pyx_n_s_READ, __pyx_k_READ, sizeof(__pyx_k_READ), 0, 0, 1, 1},
    {&__pyx_n_s_READTABLE, __pyx_k_READTABLE, sizeof(__pyx_k_READTABLE), 0, 0, 1, 1},
    {&__pyx_n_s_READ_TABLE, __pyx_k_READ_TABLE, sizeof(__pyx_k_READ_TABLE), 0, 0, 1, 1},
    {&__pyx_n_s_RELOAD, __pyx_k_RELOAD, sizeof(__pyx_k_RELOAD), 0, 0, 1, 1},
    {&__pyx_n_s_REMOVE, __pyx_k_REMOVE, sizeof(__pyx_k_REMOVE), 0, 0, 1, 1},
    {&__pyx_n_s_REPEAT, __pyx_k_REPEAT, sizeof(__pyx_k_REPEAT), 0, 0, 1, 1},
    {&__pyx_n_s_REPEAT_END, __pyx_k_REPEAT_END, sizeof(__pyx_k_REPEAT_END), 0, 0, 1, 1},
    {&__pyx_n_s_RESET, __pyx_k_RESET, sizeof(__pyx_k_RESET), 0, 0, 1, 1},
    {&__pyx_n_s_RESTORE, __pyx_k_RESTORE, sizeof(__pyx_k_RESTORE), 0, 0, 1, 1},
    {&__pyx_n_s_RUN_ARGS, __pyx_k_RUN_ARGS, sizeof(__pyx_k_RUN_ARGS), 0, 0, 1, 1},
    {&__pyx_n_s_Real, __pyx_k_Real, sizeof(__pyx_k_Real), 0, 0, 1, 1},
    {&__pyx_kp_s_Represent_an_exception_generate, __pyx_k_Represent_an_exception_generate, sizeof(__pyx_k_Represent_an_exception_generate), 0, 0, 1, 0},
    {&__pyx_kp_s_Represents_the_type_of_the_outp, __pyx_k_Represents_the_type_of_the_outp, sizeof(__pyx_k_Represents_the_type_of_the_outp), 0, 0, 1, 0},
    {&__pyx_n_s_Row, __pyx_k_Row, sizeof(__pyx_k_Row), 0, 0, 1, 1},
    {&__pyx_n_s_RowIterator, __pyx_k_RowIterator, sizeof(__pyx_k_RowIterator), 0, 0, 1, 1},
    {&__pyx_n_s_RowIterator___reduce_cython, __pyx_k_RowIterator___reduce_cython, sizeof(__pyx_k_RowIterator___reduce_cython), 0, 0, 1, 1},
    {&__pyx_n_s_RowIterator___setstate_cython, __pyx_k_RowIterator___setstate_cython, sizeof(__pyx_k_RowIterator___setstate_cython), 0, 0, 1, 1},
    {&__pyx_n_s_Row___reduce_cython, __pyx_k_Row___reduce_cython, sizeof(__pyx_k_Row___reduce_cython), 0, 0, 1, 1},
    {&__pyx_n_s_Row___setstate_cython, __pyx_k_Row___setstate_cython, sizeof(__pyx_k_Row___setstate_cython), 0, 0, 1, 1},
    {&__pyx_n_s_Row_to_string, __pyx_k_Row_to_string, sizeof(__pyx_k_Row_to_string), 0, 0, 1, 1},
    {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
    {&__pyx_n_s_SEMICOLON, __pyx_k_SEMICOLON, sizeof(__pyx_k_SEMICOLON), 0, 0, 1, 1},
    {&__pyx_n_s_SHELL_MESSAGE, __pyx_k_SHELL_MESSAGE, sizeof(__pyx_k_SHELL_MESSAGE), 0, 0, 1, 1},
    {&__pyx_n_s_SHELL_OUTPUT, __pyx_k_SHELL_OUTPUT, sizeof(__pyx_k_SHELL_OUTPUT), 0, 0, 1, 1},
    {&__pyx_n_s_SHOW, __pyx_k_SHOW, sizeof(__pyx_k_SHOW), 0, 0, 1, 1},
    {&__pyx_n_s_SOLUTION, __pyx_k_SOLUTION, sizeof(__pyx_k_SOLUTION), 0, 0, 1, 1},
    {&__pyx_n_s_SOLVE, __pyx_k_SOLVE, sizeof(__pyx_k_SOLVE), 0, 0, 1, 1},
    {&__pyx_n_s_SSTEP, __pyx_k_SSTEP, sizeof(__pyx_k_SSTEP), 0, 0, 1, 1},
    {&__pyx_n_s_SUPPORT_MESSAGE, __pyx_k_SUPPORT_MESSAGE, sizeof(__pyx_k_SUPPORT_MESSAGE), 0, 0, 1, 1},
    {&__pyx_n_s_Series, __pyx_k_Series, sizeof(__pyx_k_Series), 0, 0, 1, 1},
    {&__pyx_n_s_Set, __pyx_k_Set, sizeof(__pyx_k_Set), 0, 0, 1, 1},
    {&__pyx_n_s_Set___reduce_cython, __pyx_k_Set___reduce_cython, sizeof(__pyx_k_Set___reduce_cython), 0, 0, 1, 1},
    {&__pyx_n_s_Set___setstate_cython, __pyx_k_Set___setstate_cython, sizeof(__pyx_k_Set___setstate_cython), 0, 0, 1, 1},
    {&__pyx_n_s_Set_arity, __pyx_k_Set_arity, sizeof(__pyx_k_Set_arity), 0, 0, 1, 1},
    {&__pyx_n_s_Set_contains, __pyx_k_Set_contains, sizeof(__pyx_k_Set_contains), 0, 0, 1, 1},
    {&__pyx_n_s_Set_get_values, __pyx_k_Set_get_values, sizeof(__pyx_k_Set_get_values), 0, 0, 1, 1},
    {&__pyx_n_s_Set_instances, __pyx_k_Set_instances, sizeof(__pyx_k_Set_instances), 0, 0, 1, 1},
    {&__pyx_n_s_Set_members, __pyx_k_Set_members, sizeof(__pyx_k_Set_members), 0, 0, 1, 1},
    {&__pyx_n_s_Set_set_values, __pyx_k_Set_set_values, sizeof(__pyx_k_Set_set_values), 0, 0, 1, 1},
    {&__pyx_n_s_Set_size, __pyx_k_Set_size, sizeof(__pyx_k_Set_size), 0, 0, 1, 1},
    {&__pyx_n_s_Sets, __pyx_k_Sets, sizeof(__pyx_k_Sets), 0, 0, 1, 1},
    {&__pyx_n_s_StopIteration, __pyx_k_StopIteration, sizeof(__pyx_k_StopIteration), 0, 0, 1, 1},
    {&__pyx_n_s_SystemError, __pyx_k_SystemError, sizeof(__pyx_k_SystemError), 0, 0, 1, 1},
    {&__pyx_n_s_THEN, __pyx_k_THEN, sizeof(__pyx_k_THEN), 0, 0, 1, 1},
    {&__pyx_kp_u_Trying_to_assign_tuples_to_set_o, __pyx_k_Trying_to_assign_tuples_to_set_o, sizeof(__pyx_k_Trying_to_assign_tuples_to_set_o), 0, 1, 0, 0},
    {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
    {&__pyx_n_s_UNFIX, __pyx_k_UNFIX, sizeof(__pyx_k_UNFIX), 0, 0, 1, 1},
    {&__pyx_n_s_UNLOAD, __pyx_k_UNLOAD, sizeof(__pyx_k_UNLOAD), 0, 0, 1, 1},
    {&__pyx_n_s_UPDATE, __pyx_k_UPDATE, sizeof(__pyx_k_UPDATE), 0, 0, 1, 1},
    {&__pyx_kp_u_Unable_to_allocate_memory_for_ar, __pyx_k_Unable_to_allocate_memory_for_ar, sizeof(__pyx_k_Unable_to_allocate_memory_for_ar), 0, 1, 0, 0},
    {&__pyx_kp_u_Unexpected_data_type, __pyx_k_Unexpected_data_type, sizeof(__pyx_k_Unexpected_data_type), 0, 1, 0, 0},
    {&__pyx_kp_u_Unknown_entity_class, __pyx_k_Unknown_entity_class, sizeof(__pyx_k_Unknown_entity_class), 0, 1, 0, 0},
    {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
    {&__pyx_n_s_Variable, __pyx_k_Variable, sizeof(__pyx_k_Variable), 0, 0, 1, 1},
    {&__pyx_n_s_Variable___reduce_cython, __pyx_k_Variable___reduce_cython, sizeof(__pyx_k_Variable___reduce_cython), 0, 0, 1, 1},
    {&__pyx_n_s_Variable___setstate_cython, __pyx_k_Variable___setstate_cython, sizeof(__pyx_k_Variable___setstate_cython), 0, 0, 1, 1},
    {&__pyx_n_s_Variable_astatus, __pyx_k_Variable_astatus, sizeof(__pyx_k_Variable_astatus), 0, 0, 1, 1},
    {&__pyx_n_s_Variable_defeqn, __pyx_k_Variable_defeqn, sizeof(__pyx_k_Variable_defeqn), 0, 0, 1, 1},
    {&__pyx_n_s_Variable_dual, __pyx_k_Variable_dual, sizeof(__pyx_k_Variable_dual), 0, 0, 1, 1},
    {&__pyx_n_s_Variable_fix, __pyx_k_Variable_fix, sizeof(__pyx_k_Variable_fix), 0, 0, 1, 1},
    {&__pyx_n_s_Variable_init, __pyx_k_Variable_init, sizeof(__pyx_k_Variable_init), 0, 0, 1, 1},
    {&__pyx_n_s_Variable_init0, __pyx_k_Variable_init0, sizeof(__pyx_k_Variable_init0), 0, 0, 1, 1},
    {&__pyx_n_s_Variable_lb, __pyx_k_Variable_lb, sizeof(__pyx_k_Variable_lb), 0, 0, 1, 1},
    {&__pyx_n_s_Variable_lb0, __pyx_k_Variable_lb0, sizeof(__pyx_k_Variable_lb0), 0, 0, 1, 1},
    {&__pyx_n_s_Variable_lb1, __pyx_k_Variable_lb1, sizeof(__pyx_k_Variable_lb1), 0, 0, 1, 1},
    {&__pyx_n_s_Variable_lb2, __pyx_k_Variable_lb2, sizeof(__pyx_k_Variable_lb2), 0, 0, 1, 1},
    {&__pyx_n_s_Variable_lrc, __pyx_k_Variable_lrc, sizeof(__pyx_k_Variable_lrc), 0, 0, 1, 1},
    {&__pyx_n_s_Variable_lslack, __pyx_k_Variable_lslack, sizeof(__pyx_k_Variable_lslack), 0, 0, 1, 1},
    {&__pyx_n_s_Variable_rc, __pyx_k_Variable_rc, sizeof(__pyx_k_Variable_rc), 0, 0, 1, 1},
    {&__pyx_n_s_Variable_set_value, __pyx_k_Variable_set_value, sizeof(__pyx_k_Variable_set_value), 0, 0, 1, 1},
    {&__pyx_n_s_Variable_slack, __pyx_k_Variable_slack, sizeof(__pyx_k_Variable_slack), 0, 0, 1, 1},
    {&__pyx_n_s_Variable_sstatus, __pyx_k_Variable_sstatus, sizeof(__pyx_k_Variable_sstatus), 0, 0, 1, 1},
    {&__pyx_n_s_Variable_status, __pyx_k_Variable_status, sizeof(__pyx_k_Variable_status), 0, 0, 1, 1},
    {&__pyx_n_s_Variable_ub, __pyx_k_Variable_ub, sizeof(__pyx_k_Variable_ub), 0, 0, 1, 1},
    {&__pyx_n_s_Variable_ub0, __pyx_k_Variable_ub0, sizeof(__pyx_k_Variable_ub0), 0, 0, 1, 1},
    {&__pyx_n_s_Variable_ub1, __pyx_k_Variable_ub1, sizeof(__pyx_k_Variable_ub1), 0, 0, 1, 1},
    {&__pyx_n_s_Variable_ub2, __pyx_k_Variable_ub2, sizeof(__pyx_k_Variable_ub2), 0, 0, 1, 1},
    {&__pyx_n_s_Variable_unfix, __pyx_k_Variable_unfix, sizeof(__pyx_k_Variable_unfix), 0, 0, 1, 1},
    {&__pyx_n_s_Variable_urc, __pyx_k_Variable_urc, sizeof(__pyx_k_Variable_urc), 0, 0, 1, 1},
    {&__pyx_n_s_Variable_uslack, __pyx_k_Variable_uslack, sizeof(__pyx_k_Variable_uslack), 0, 0, 1, 1},
    {&__pyx_n_s_Variable_value, __pyx_k_Variable_value, sizeof(__pyx_k_Variable_value), 0, 0, 1, 1},
    {&__pyx_n_s_Variables, __pyx_k_Variables, sizeof(__pyx_k_Variables), 0, 0, 1, 1},
    {&__pyx_n_s_WAITING, __pyx_k_WAITING, sizeof(__pyx_k_WAITING), 0, 0, 1, 1},
    {&__pyx_n_s_WRITE, __pyx_k_WRITE, sizeof(__pyx_k_WRITE), 0, 0, 1, 1},
    {&__pyx_n_s_WRITETABLE, __pyx_k_WRITETABLE, sizeof(__pyx_k_WRITETABLE), 0, 0, 1, 1},
    {&__pyx_n_s_WRITE_TABLE, __pyx_k_WRITE_TABLE, sizeof(__pyx_k_WRITE_TABLE), 0, 0, 1, 1},
    {&__pyx_kp_u_Warning, __pyx_k_Warning, sizeof(__pyx_k_Warning), 0, 1, 0, 0},
    {&__pyx_n_s_XREF, __pyx_k_XREF, sizeof(__pyx_k_XREF), 0, 0, 1, 1},
    {&__pyx_kp_u__21, __pyx_k__21, sizeof(__pyx_k__21), 0, 1, 0, 0},
    {&__pyx_kp_u__22, __pyx_k__22, sizeof(__pyx_k__22), 0, 1, 0, 0},
    {&__pyx_kp_u__24, __pyx_k__24, sizeof(__pyx_k__24), 0, 1, 0, 0},
    {&__pyx_kp_u__25, __pyx_k__25, sizeof(__pyx_k__25), 0, 1, 0, 0},
    {&__pyx_kp_u__26, __pyx_k__26, sizeof(__pyx_k__26), 0, 1, 0, 0},
    {&__pyx_kp_u__33, __pyx_k__33, sizeof(__pyx_k__33), 0, 1, 0, 0},
    {&__pyx_kp_u__34, __pyx_k__34, sizeof(__pyx_k__34), 0, 1, 0, 0},
    {&__pyx_kp_u__35, __pyx_k__35, sizeof(__pyx_k__35), 0, 1, 0, 0},
    {&__pyx_kp_u__36, __pyx_k__36, sizeof(__pyx_k__36), 0, 1, 0, 0},
    {&__pyx_kp_u__38, __pyx_k__38, sizeof(__pyx_k__38), 0, 1, 0, 0},
    {&__pyx_kp_u__39, __pyx_k__39, sizeof(__pyx_k__39), 0, 1, 0, 0},
    {&__pyx_n_s__390, __pyx_k__390, sizeof(__pyx_k__390), 0, 0, 1, 1},
    {&__pyx_kp_u__40, __pyx_k__40, sizeof(__pyx_k__40), 0, 1, 0, 0},
    {&__pyx_kp_u__41, __pyx_k__41, sizeof(__pyx_k__41), 0, 1, 0, 0},
    {&__pyx_n_s__84, __pyx_k__84, sizeof(__pyx_k__84), 0, 0, 1, 1},
    {&__pyx_n_s_addColumn, __pyx_k_addColumn, sizeof(__pyx_k_addColumn), 0, 0, 1, 1},
    {&__pyx_n_s_addRow, __pyx_k_addRow, sizeof(__pyx_k_addRow), 0, 0, 1, 1},
    {&__pyx_n_s_add_column, __pyx_k_add_column, sizeof(__pyx_k_add_column), 0, 0, 1, 1},
    {&__pyx_n_s_add_column_locals_genexpr, __pyx_k_add_column_locals_genexpr, sizeof(__pyx_k_add_column_locals_genexpr), 0, 0, 1, 1},
    {&__pyx_n_s_add_row, __pyx_k_add_row, sizeof(__pyx_k_add_row), 0, 0, 1, 1},
    {&__pyx_n_s_ampl, __pyx_k_ampl, sizeof(__pyx_k_ampl), 0, 0, 1, 1},
    {&__pyx_n_s_ampl_expressions, __pyx_k_ampl_expressions, sizeof(__pyx_k_ampl_expressions), 0, 0, 1, 1},
    {&__pyx_n_u_ampl_libpath, __pyx_k_ampl_libpath, sizeof(__pyx_k_ampl_libpath), 0, 1, 0, 1},
    {&__pyx_n_s_amplpy, __pyx_k_amplpy, sizeof(__pyx_k_amplpy), 0, 0, 1, 1},
    {&__pyx_kp_s_amplpy_ampl_pyx, __pyx_k_amplpy_ampl_pyx, sizeof(__pyx_k_amplpy_ampl_pyx), 0, 0, 1, 0},
    {&__pyx_kp_s_amplpy_constraint_pxi, __pyx_k_amplpy_constraint_pxi, sizeof(__pyx_k_amplpy_constraint_pxi), 0, 0, 1, 0},
    {&__pyx_kp_s_amplpy_dataframe_pxi, __pyx_k_amplpy_dataframe_pxi, sizeof(__pyx_k_amplpy_dataframe_pxi), 0, 0, 1, 0},
    {&__pyx_kp_s_amplpy_entity_pxi, __pyx_k_amplpy_entity_pxi, sizeof(__pyx_k_amplpy_entity_pxi), 0, 0, 1, 0},
    {&__pyx_kp_s_amplpy_environment_pxi, __pyx_k_amplpy_environment_pxi, sizeof(__pyx_k_amplpy_environment_pxi), 0, 0, 1, 0},
    {&__pyx_kp_s_amplpy_errorhandler_pxi, __pyx_k_amplpy_errorhandler_pxi, sizeof(__pyx_k_amplpy_errorhandler_pxi), 0, 0, 1, 0},
    {&__pyx_kp_s_amplpy_exceptions_pxi, __pyx_k_amplpy_exceptions_pxi, sizeof(__pyx_k_amplpy_exceptions_pxi), 0, 0, 1, 0},
    {&__pyx_kp_s_amplpy_iterators_pxi, __pyx_k_amplpy_iterators_pxi, sizeof(__pyx_k_amplpy_iterators_pxi), 0, 0, 1, 0},
    {&__pyx_kp_s_amplpy_objective_pxi, __pyx_k_amplpy_objective_pxi, sizeof(__pyx_k_amplpy_objective_pxi), 0, 0, 1, 0},
    {&__pyx_kp_s_amplpy_outputhandler_pxi, __pyx_k_amplpy_outputhandler_pxi, sizeof(__pyx_k_amplpy_outputhandler_pxi), 0, 0, 1, 0},
    {&__pyx_kp_s_amplpy_parameter_pxi, __pyx_k_amplpy_parameter_pxi, sizeof(__pyx_k_amplpy_parameter_pxi), 0, 0, 1, 0},
    {&__pyx_kp_s_amplpy_set_pxi, __pyx_k_amplpy_set_pxi, sizeof(__pyx_k_amplpy_set_pxi), 0, 0, 1, 0},
    {&__pyx_kp_s_amplpy_variable_pxi, __pyx_k_amplpy_variable_pxi, sizeof(__pyx_k_amplpy_variable_pxi), 0, 0, 1, 0},
    {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1},
    {&__pyx_n_s_arity, __pyx_k_arity, sizeof(__pyx_k_arity), 0, 0, 1, 1},
    {&__pyx_n_s_array, __pyx_k_array, sizeof(__pyx_k_array), 0, 0, 1, 1},
    {&__pyx_n_s_ast, __pyx_k_ast, sizeof(__pyx_k_ast), 0, 0, 1, 1},
    {&__pyx_n_s_astatus, __pyx_k_astatus, sizeof(__pyx_k_astatus), 0, 0, 1, 1},
    {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1},
    {&__pyx_n_s_auxfiles, __pyx_k_auxfiles, sizeof(__pyx_k_auxfiles), 0, 0, 1, 1},
    {&__pyx_n_s_bin_dir, __pyx_k_bin_dir, sizeof(__pyx_k_bin_dir), 0, 0, 1, 1},
    {&__pyx_n_s_bin_dir_c, __pyx_k_bin_dir_c, sizeof(__pyx_k_bin_dir_c), 0, 0, 1, 1},
    {&__pyx_n_s_bin_name, __pyx_k_bin_name, sizeof(__pyx_k_bin_name), 0, 0, 1, 1},
    {&__pyx_n_s_bin_name_c, __pyx_k_bin_name_c, sizeof(__pyx_k_bin_name_c), 0, 0, 1, 1},
    {&__pyx_n_s_binary_directory, __pyx_k_binary_directory, sizeof(__pyx_k_binary_directory), 0, 0, 1, 1},
    {&__pyx_n_s_binary_name, __pyx_k_binary_name, sizeof(__pyx_k_binary_name), 0, 0, 1, 1},
    {&__pyx_n_s_body, __pyx_k_body, sizeof(__pyx_k_body), 0, 0, 1, 1},
    {&__pyx_n_u_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 1, 0, 1},
    {&__pyx_n_s_c_double_array, __pyx_k_c_double_array, sizeof(__pyx_k_c_double_array), 0, 0, 1, 1},
    {&__pyx_n_s_c_string_array, __pyx_k_c_string_array, sizeof(__pyx_k_c_string_array), 0, 0, 1, 1},
    {&__pyx_kp_u_cannot_convert_to_dictionary_wit, __pyx_k_cannot_convert_to_dictionary_wit, sizeof(__pyx_k_cannot_convert_to_dictionary_wit), 0, 1, 0, 0},
    {&__pyx_n_s_cast_row, __pyx_k_cast_row, sizeof(__pyx_k_cast_row), 0, 0, 1, 1},
    {&__pyx_n_s_cast_value, __pyx_k_cast_value, sizeof(__pyx_k_cast_value), 0, 0, 1, 1},
    {&__pyx_n_s_cd, __pyx_k_cd, sizeof(__pyx_k_cd), 0, 0, 1, 1},
    {&__pyx_n_s_chain, __pyx_k_chain, sizeof(__pyx_k_chain), 0, 0, 1, 1},
    {&__pyx_n_s_cindex, __pyx_k_cindex, sizeof(__pyx_k_cindex), 0, 0, 1, 1},
    {&__pyx_n_s_class_getitem, __pyx_k_class_getitem, sizeof(__pyx_k_class_getitem), 0, 0, 1, 1},
    {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
    {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1},
    {&__pyx_n_s_cls, __pyx_k_cls, sizeof(__pyx_k_cls), 0, 0, 1, 1},
    {&__pyx_n_s_cname, __pyx_k_cname, sizeof(__pyx_k_cname), 0, 0, 1, 1},
    {&__pyx_n_s_col, __pyx_k_col, sizeof(__pyx_k_col), 0, 0, 1, 1},
    {&__pyx_n_s_collections_abc, __pyx_k_collections_abc, sizeof(__pyx_k_collections_abc), 0, 0, 1, 1},
    {&__pyx_n_s_column, __pyx_k_column, sizeof(__pyx_k_column), 0, 0, 1, 1},
    {&__pyx_n_s_column_names, __pyx_k_column_names, sizeof(__pyx_k_column_names), 0, 0, 1, 1},
    {&__pyx_n_s_columns, __pyx_k_columns, sizeof(__pyx_k_columns), 0, 0, 1, 1},
    {&__pyx_n_s_con, __pyx_k_con, sizeof(__pyx_k_con), 0, 0, 1, 1},
    {&__pyx_n_s_con_2, __pyx_k_con_2, sizeof(__pyx_k_con_2), 0, 0, 1, 1},
    {&__pyx_n_s_con_locals_Constraints, __pyx_k_con_locals_Constraints, sizeof(__pyx_k_con_locals_Constraints), 0, 0, 1, 1},
    {&__pyx_n_s_con_locals_Constraints___getite, __pyx_k_con_locals_Constraints___getite, sizeof(__pyx_k_con_locals_Constraints___getite), 0, 0, 1, 1},
    {&__pyx_n_s_con_locals_Constraints___init, __pyx_k_con_locals_Constraints___init, sizeof(__pyx_k_con_locals_Constraints___init), 0, 0, 1, 1},
    {&__pyx_n_s_con_locals_Constraints___iter, __pyx_k_con_locals_Constraints___iter, sizeof(__pyx_k_con_locals_Constraints___iter), 0, 0, 1, 1},
    {&__pyx_n_s_con_locals_Constraints___setite, __pyx_k_con_locals_Constraints___setite, sizeof(__pyx_k_con_locals_Constraints___setite), 0, 0, 1, 1},
    {&__pyx_n_s_contains, __pyx_k_contains, sizeof(__pyx_k_contains), 0, 0, 1, 1},
    {&__pyx_n_s_contains_c, __pyx_k_contains_c, sizeof(__pyx_k_contains_c), 0, 0, 1, 1},
    {&__pyx_n_s_conv_to_list, __pyx_k_conv_to_list, sizeof(__pyx_k_conv_to_list), 0, 0, 1, 1},
    {&__pyx_n_s_d, __pyx_k_d, sizeof(__pyx_k_d), 0, 0, 1, 1},
    {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1},
    {&__pyx_n_s_data_c, __pyx_k_data_c, sizeof(__pyx_k_data_c), 0, 0, 1, 1},
    {&__pyx_n_s_data_frame, __pyx_k_data_frame, sizeof(__pyx_k_data_frame), 0, 0, 1, 1},
    {&__pyx_n_s_defeqn, __pyx_k_defeqn, sizeof(__pyx_k_defeqn), 0, 0, 1, 1},
    {&__pyx_n_s_defvar, __pyx_k_defvar, sizeof(__pyx_k_defvar), 0, 0, 1, 1},
    {&__pyx_n_s_df, __pyx_k_df, sizeof(__pyx_k_df), 0, 0, 1, 1},
    {&__pyx_n_s_df_c, __pyx_k_df_c, sizeof(__pyx_k_df_c), 0, 0, 1, 1},
    {&__pyx_n_s_df_ref, __pyx_k_df_ref, sizeof(__pyx_k_df_ref), 0, 0, 1, 1},
    {&__pyx_n_s_dic, __pyx_k_dic, sizeof(__pyx_k_dic), 0, 0, 1, 1},
    {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1},
    {&__pyx_n_s_dict_2, __pyx_k_dict_2, sizeof(__pyx_k_dict_2), 0, 0, 1, 1},
    {&__pyx_n_s_dimen, __pyx_k_dimen, sizeof(__pyx_k_dimen), 0, 0, 1, 1},
    {&__pyx_n_s_dinit, __pyx_k_dinit, sizeof(__pyx_k_dinit), 0, 0, 1, 1},
    {&__pyx_n_s_dinit0, __pyx_k_dinit0, sizeof(__pyx_k_dinit0), 0, 0, 1, 1},
    {&__pyx_kp_u_disable, __pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0, 0},
    {&__pyx_n_s_display, __pyx_k_display, sizeof(__pyx_k_display), 0, 0, 1, 1},
    {&__pyx_n_u_display, __pyx_k_display, sizeof(__pyx_k_display), 0, 1, 0, 1},
    {&__pyx_n_s_display_error_message, __pyx_k_display_error_message, sizeof(__pyx_k_display_error_message), 0, 0, 1, 1},
    {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1},
    {&__pyx_n_s_drop, __pyx_k_drop, sizeof(__pyx_k_drop), 0, 0, 1, 1},
    {&__pyx_n_s_dual, __pyx_k_dual, sizeof(__pyx_k_dual), 0, 0, 1, 1},
    {&__pyx_n_s_e, __pyx_k_e, sizeof(__pyx_k_e), 0, 0, 1, 1},
    {&__pyx_kp_u_enable, __pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0, 0},
    {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
    {&__pyx_n_s_end, __pyx_k_end, sizeof(__pyx_k_end), 0, 0, 1, 1},
    {&__pyx_n_s_endswith, __pyx_k_endswith, sizeof(__pyx_k_endswith), 0, 0, 1, 1},
    {&__pyx_n_s_entity, __pyx_k_entity, sizeof(__pyx_k_entity), 0, 0, 1, 1},
    {&__pyx_n_s_entitytype, __pyx_k_entitytype, sizeof(__pyx_k_entitytype), 0, 0, 1, 1},
    {&__pyx_n_s_enum, __pyx_k_enum, sizeof(__pyx_k_enum), 0, 0, 1, 1},
    {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
    {&__pyx_n_s_environ, __pyx_k_environ, sizeof(__pyx_k_environ), 0, 0, 1, 1},
    {&__pyx_n_s_environment, __pyx_k_environment, sizeof(__pyx_k_environment), 0, 0, 1, 1},
    {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1},
    {&__pyx_n_s_error_handler, __pyx_k_error_handler, sizeof(__pyx_k_error_handler), 0, 0, 1, 1},
    {&__pyx_n_s_errorinfo, __pyx_k_errorinfo, sizeof(__pyx_k_errorinfo), 0, 0, 1, 1},
    {&__pyx_n_s_eval, __pyx_k_eval, sizeof(__pyx_k_eval), 0, 0, 1, 1},
    {&__pyx_n_s_exception, __pyx_k_exception, sizeof(__pyx_k_exception), 0, 0, 1, 1},
    {&__pyx_n_s_exists, __pyx_k_exists, sizeof(__pyx_k_exists), 0, 0, 1, 1},
    {&__pyx_n_s_exitcode, __pyx_k_exitcode, sizeof(__pyx_k_exitcode), 0, 0, 1, 1},
    {&__pyx_n_s_exp, __pyx_k_exp, sizeof(__pyx_k_exp), 0, 0, 1, 1},
    {&__pyx_n_s_exportData, __pyx_k_exportData, sizeof(__pyx_k_exportData), 0, 0, 1, 1},
    {&__pyx_n_s_exportModel, __pyx_k_exportModel, sizeof(__pyx_k_exportModel), 0, 0, 1, 1},
    {&__pyx_n_s_export_data, __pyx_k_export_data, sizeof(__pyx_k_export_data), 0, 0, 1, 1},
    {&__pyx_n_s_export_model, __pyx_k_export_model, sizeof(__pyx_k_export_model), 0, 0, 1, 1},
    {&__pyx_n_s_exprs, __pyx_k_exprs, sizeof(__pyx_k_exprs), 0, 0, 1, 1},
    {&__pyx_kp_u_file, __pyx_k_file, sizeof(__pyx_k_file), 0, 1, 0, 0},
    {&__pyx_n_s_file_2, __pyx_k_file_2, sizeof(__pyx_k_file_2), 0, 0, 1, 1},
    {&__pyx_n_s_filename, __pyx_k_filename, sizeof(__pyx_k_filename), 0, 0, 1, 1},
    {&__pyx_n_s_find, __pyx_k_find, sizeof(__pyx_k_find), 0, 0, 1, 1},
    {&__pyx_n_s_fix, __pyx_k_fix, sizeof(__pyx_k_fix), 0, 0, 1, 1},
    {&__pyx_n_s_flat, __pyx_k_flat, sizeof(__pyx_k_flat), 0, 0, 1, 1},
    {&__pyx_n_s_flush, __pyx_k_flush, sizeof(__pyx_k_flush), 0, 0, 1, 1},
    {&__pyx_n_s_fromDict, __pyx_k_fromDict, sizeof(__pyx_k_fromDict), 0, 0, 1, 1},
    {&__pyx_n_s_fromNumpy, __pyx_k_fromNumpy, sizeof(__pyx_k_fromNumpy), 0, 0, 1, 1},
    {&__pyx_n_s_fromPandas, __pyx_k_fromPandas, sizeof(__pyx_k_fromPandas), 0, 0, 1, 1},
    {&__pyx_n_s_from_arrays, __pyx_k_from_arrays, sizeof(__pyx_k_from_arrays), 0, 0, 1, 1},
    {&__pyx_n_s_from_data_frame_ref, __pyx_k_from_data_frame_ref, sizeof(__pyx_k_from_data_frame_ref), 0, 0, 1, 1},
    {&__pyx_n_s_from_dict, __pyx_k_from_dict, sizeof(__pyx_k_from_dict), 0, 0, 1, 1},
    {&__pyx_n_s_from_dict_locals_genexpr, __pyx_k_from_dict_locals_genexpr, sizeof(__pyx_k_from_dict_locals_genexpr), 0, 0, 1, 1},
    {&__pyx_n_s_from_dict_locals_to_tuple, __pyx_k_from_dict_locals_to_tuple, sizeof(__pyx_k_from_dict_locals_to_tuple), 0, 0, 1, 1},
    {&__pyx_n_s_from_numpy, __pyx_k_from_numpy, sizeof(__pyx_k_from_numpy), 0, 0, 1, 1},
    {&__pyx_n_s_from_pandas, __pyx_k_from_pandas, sizeof(__pyx_k_from_pandas), 0, 0, 1, 1},
    {&__pyx_n_s_from_tuples, __pyx_k_from_tuples, sizeof(__pyx_k_from_tuples), 0, 0, 1, 1},
    {&__pyx_kp_u_gc, __pyx_k_gc, sizeof(__pyx_k_gc), 0, 1, 0, 0},
    {&__pyx_n_s_genexpr, __pyx_k_genexpr, sizeof(__pyx_k_genexpr), 0, 0, 1, 1},
    {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1},
    {&__pyx_n_s_getBinDir, __pyx_k_getBinDir, sizeof(__pyx_k_getBinDir), 0, 0, 1, 1},
    {&__pyx_n_s_getBinName, __pyx_k_getBinName, sizeof(__pyx_k_getBinName), 0, 0, 1, 1},
    {&__pyx_n_s_getColumn, __pyx_k_getColumn, sizeof(__pyx_k_getColumn), 0, 0, 1, 1},
    {&__pyx_n_s_getConstraint, __pyx_k_getConstraint, sizeof(__pyx_k_getConstraint), 0, 0, 1, 1},
    {&__pyx_n_s_getConstraints, __pyx_k_getConstraints, sizeof(__pyx_k_getConstraints), 0, 0, 1, 1},
    {&__pyx_n_s_getCurrentObjective, __pyx_k_getCurrentObjective, sizeof(__pyx_k_getCurrentObjective), 0, 0, 1, 1},
    {&__pyx_n_s_getData, __pyx_k_getData, sizeof(__pyx_k_getData), 0, 0, 1, 1},
    {&__pyx_n_s_getEntity, __pyx_k_getEntity, sizeof(__pyx_k_getEntity), 0, 0, 1, 1},
    {&__pyx_n_s_getErrorHandler, __pyx_k_getErrorHandler, sizeof(__pyx_k_getErrorHandler), 0, 0, 1, 1},
    {&__pyx_n_s_getHeaders, __pyx_k_getHeaders, sizeof(__pyx_k_getHeaders), 0, 0, 1, 1},
    {&__pyx_n_s_getIndexingSets, __pyx_k_getIndexingSets, sizeof(__pyx_k_getIndexingSets), 0, 0, 1, 1},
    {&__pyx_n_s_getLineNumber, __pyx_k_getLineNumber, sizeof(__pyx_k_getLineNumber), 0, 0, 1, 1},
    {&__pyx_n_s_getMessage, __pyx_k_getMessage, sizeof(__pyx_k_getMessage), 0, 0, 1, 1},
    {&__pyx_n_s_getNumCols, __pyx_k_getNumCols, sizeof(__pyx_k_getNumCols), 0, 0, 1, 1},
    {&__pyx_n_s_getNumIndices, __pyx_k_getNumIndices, sizeof(__pyx_k_getNumIndices), 0, 0, 1, 1},
    {&__pyx_n_s_getNumRows, __pyx_k_getNumRows, sizeof(__pyx_k_getNumRows), 0, 0, 1, 1},
    {&__pyx_n_s_getObjective, __pyx_k_getObjective, sizeof(__pyx_k_getObjective), 0, 0, 1, 1},
    {&__pyx_n_s_getObjectives, __pyx_k_getObjectives, sizeof(__pyx_k_getObjectives), 0, 0, 1, 1},
    {&__pyx_n_s_getOffset, __pyx_k_getOffset, sizeof(__pyx_k_getOffset), 0, 0, 1, 1},
    {&__pyx_n_s_getOption, __pyx_k_getOption, sizeof(__pyx_k_getOption), 0, 0, 1, 1},
    {&__pyx_n_s_getOutput, __pyx_k_getOutput, sizeof(__pyx_k_getOutput), 0, 0, 1, 1},
    {&__pyx_n_s_getOutputHandler, __pyx_k_getOutputHandler, sizeof(__pyx_k_getOutputHandler), 0, 0, 1, 1},
    {&__pyx_n_s_getParameter, __pyx_k_getParameter, sizeof(__pyx_k_getParameter), 0, 0, 1, 1},
    {&__pyx_n_s_getParameters, __pyx_k_getParameters, sizeof(__pyx_k_getParameters), 0, 0, 1, 1},
    {&__pyx_n_s_getRow, __pyx_k_getRow, sizeof(__pyx_k_getRow), 0, 0, 1, 1},
    {&__pyx_n_s_getRowByIndex, __pyx_k_getRowByIndex, sizeof(__pyx_k_getRowByIndex), 0, 0, 1, 1},
    {&__pyx_n_s_getSet, __pyx_k_getSet, sizeof(__pyx_k_getSet), 0, 0, 1, 1},
    {&__pyx_n_s_getSets, __pyx_k_getSets, sizeof(__pyx_k_getSets), 0, 0, 1, 1},
    {&__pyx_n_s_getSourceName, __pyx_k_getSourceName, sizeof(__pyx_k_getSourceName), 0, 0, 1, 1},
    {&__pyx_n_s_getValue, __pyx_k_getValue, sizeof(__pyx_k_getValue), 0, 0, 1, 1},
    {&__pyx_n_s_getValues, __pyx_k_getValues, sizeof(__pyx_k_getValues), 0, 0, 1, 1},
    {&__pyx_n_s_getVariable, __pyx_k_getVariable, sizeof(__pyx_k_getVariable), 0, 0, 1, 1},
    {&__pyx_n_s_getVariables, __pyx_k_getVariables, sizeof(__pyx_k_getVariables), 0, 0, 1, 1},
    {&__pyx_n_s_get_bin_dir, __pyx_k_get_bin_dir, sizeof(__pyx_k_get_bin_dir), 0, 0, 1, 1},
    {&__pyx_n_s_get_bin_name, __pyx_k_get_bin_name, sizeof(__pyx_k_get_bin_name), 0, 0, 1, 1},
    {&__pyx_n_s_get_column, __pyx_k_get_column, sizeof(__pyx_k_get_column), 0, 0, 1, 1},
    {&__pyx_n_s_get_constraint, __pyx_k_get_constraint, sizeof(__pyx_k_get_constraint), 0, 0, 1, 1},
    {&__pyx_n_s_get_constraints, __pyx_k_get_constraints, sizeof(__pyx_k_get_constraints), 0, 0, 1, 1},
    {&__pyx_n_s_get_current_objective, __pyx_k_get_current_objective, sizeof(__pyx_k_get_current_objective), 0, 0, 1, 1},
    {&__pyx_n_s_get_data, __pyx_k_get_data, sizeof(__pyx_k_get_data), 0, 0, 1, 1},
    {&__pyx_n_s_get_entity, __pyx_k_get_entity, sizeof(__pyx_k_get_entity), 0, 0, 1, 1},
    {&__pyx_n_s_get_error_handler, __pyx_k_get_error_handler, sizeof(__pyx_k_get_error_handler), 0, 0, 1, 1},
    {&__pyx_n_s_get_headers, __pyx_k_get_headers, sizeof(__pyx_k_get_headers), 0, 0, 1, 1},
    {&__pyx_n_s_get_headers_locals_genexpr, __pyx_k_get_headers_locals_genexpr, sizeof(__pyx_k_get_headers_locals_genexpr), 0, 0, 1, 1},
    {&__pyx_n_s_get_iis, __pyx_k_get_iis, sizeof(__pyx_k_get_iis), 0, 0, 1, 1},
    {&__pyx_n_s_get_indexing_sets, __pyx_k_get_indexing_sets, sizeof(__pyx_k_get_indexing_sets), 0, 0, 1, 1},
    {&__pyx_n_s_get_line_number, __pyx_k_get_line_number, sizeof(__pyx_k_get_line_number), 0, 0, 1, 1},
    {&__pyx_n_s_get_message, __pyx_k_get_message, sizeof(__pyx_k_get_message), 0, 0, 1, 1},
    {&__pyx_n_s_get_num_cols, __pyx_k_get_num_cols, sizeof(__pyx_k_get_num_cols), 0, 0, 1, 1},
    {&__pyx_n_s_get_num_indices, __pyx_k_get_num_indices, sizeof(__pyx_k_get_num_indices), 0, 0, 1, 1},
    {&__pyx_n_s_get_num_rows, __pyx_k_get_num_rows, sizeof(__pyx_k_get_num_rows), 0, 0, 1, 1},
    {&__pyx_n_s_get_objective, __pyx_k_get_objective, sizeof(__pyx_k_get_objective), 0, 0, 1, 1},
    {&__pyx_n_s_get_objectives, __pyx_k_get_objectives, sizeof(__pyx_k_get_objectives), 0, 0, 1, 1},
    {&__pyx_n_s_get_offset, __pyx_k_get_offset, sizeof(__pyx_k_get_offset), 0, 0, 1, 1},
    {&__pyx_n_s_get_option, __pyx_k_get_option, sizeof(__pyx_k_get_option), 0, 0, 1, 1},
    {&__pyx_n_s_get_output, __pyx_k_get_output, sizeof(__pyx_k_get_output), 0, 0, 1, 1},
    {&__pyx_n_s_get_output_handler, __pyx_k_get_output_handler, sizeof(__pyx_k_get_output_handler), 0, 0, 1, 1},
    {&__pyx_n_s_get_parameter, __pyx_k_get_parameter, sizeof(__pyx_k_get_parameter), 0, 0, 1, 1},
    {&__pyx_n_s_get_parameters, __pyx_k_get_parameters, sizeof(__pyx_k_get_parameters), 0, 0, 1, 1},
    {&__pyx_n_s_get_row, __pyx_k_get_row, sizeof(__pyx_k_get_row), 0, 0, 1, 1},
    {&__pyx_n_s_get_row_by_index, __pyx_k_get_row_by_index, sizeof(__pyx_k_get_row_by_index), 0, 0, 1, 1},
    {&__pyx_n_s_get_set, __pyx_k_get_set, sizeof(__pyx_k_get_set), 0, 0, 1, 1},
    {&__pyx_n_s_get_sets, __pyx_k_get_sets, sizeof(__pyx_k_get_sets), 0, 0, 1, 1},
    {&__pyx_n_s_get_solution, __pyx_k_get_solution, sizeof(__pyx_k_get_solution), 0, 0, 1, 1},
    {&__pyx_n_s_get_source_name, __pyx_k_get_source_name, sizeof(__pyx_k_get_source_name), 0, 0, 1, 1},
    {&__pyx_n_s_get_value, __pyx_k_get_value, sizeof(__pyx_k_get_value), 0, 0, 1, 1},
    {&__pyx_n_s_get_values, __pyx_k_get_values, sizeof(__pyx_k_get_values), 0, 0, 1, 1},
    {&__pyx_n_s_get_variable, __pyx_k_get_variable, sizeof(__pyx_k_get_variable), 0, 0, 1, 1},
    {&__pyx_n_s_get_variables, __pyx_k_get_variables, sizeof(__pyx_k_get_variables), 0, 0, 1, 1},
    {&__pyx_n_s_getitem, __pyx_k_getitem, sizeof(__pyx_k_getitem), 0, 0, 1, 1},
    {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
    {&__pyx_n_s_hasDefault, __pyx_k_hasDefault, sizeof(__pyx_k_hasDefault), 0, 0, 1, 1},
    {&__pyx_n_s_has_default, __pyx_k_has_default, sizeof(__pyx_k_has_default), 0, 0, 1, 1},
    {&__pyx_n_s_header, __pyx_k_header, sizeof(__pyx_k_header), 0, 0, 1, 1},
    {&__pyx_n_s_headers, __pyx_k_headers, sizeof(__pyx_k_headers), 0, 0, 1, 1},
    {&__pyx_n_s_headers_py, __pyx_k_headers_py, sizeof(__pyx_k_headers_py), 0, 0, 1, 1},
    {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1},
    {&__pyx_kp_u_i_in_1__ncons__con_i_iis_non__c, __pyx_k_i_in_1__ncons__con_i_iis_non__c, sizeof(__pyx_k_i_in_1__ncons__con_i_iis_non__c), 0, 1, 0, 0},
    {&__pyx_kp_u_i_in_1__nvars__var_i_iis_non__v, __pyx_k_i_in_1__nvars__var_i_iis_non__v, sizeof(__pyx_k_i_in_1__nvars__var_i_iis_non__v), 0, 1, 0, 0},
    {&__pyx_kp_u_i_in_1__nvars__var_i_val_0__var, __pyx_k_i_in_1__nvars__var_i_val_0__var, sizeof(__pyx_k_i_in_1__nvars__var_i_val_0__var), 0, 1, 0, 0},
    {&__pyx_kp_u_i_in_1__nvars__varname_i__var_i, __pyx_k_i_in_1__nvars__varname_i__var_i, sizeof(__pyx_k_i_in_1__nvars__varname_i__var_i), 0, 1, 0, 0},
    {&__pyx_n_s_iis_con, __pyx_k_iis_con, sizeof(__pyx_k_iis_con), 0, 0, 1, 1},
    {&__pyx_n_s_iis_var, __pyx_k_iis_var, sizeof(__pyx_k_iis_var), 0, 0, 1, 1},
    {&__pyx_n_s_impl, __pyx_k_impl, sizeof(__pyx_k_impl), 0, 0, 1, 1},
    {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
    {&__pyx_n_s_index, __pyx_k_index, sizeof(__pyx_k_index), 0, 0, 1, 1},
    {&__pyx_n_u_index, __pyx_k_index, sizeof(__pyx_k_index), 0, 1, 0, 1},
    {&__pyx_n_s_index_c, __pyx_k_index_c, sizeof(__pyx_k_index_c), 0, 0, 1, 1},
    {&__pyx_n_s_index_names, __pyx_k_index_names, sizeof(__pyx_k_index_names), 0, 0, 1, 1},
    {&__pyx_n_s_indexarity, __pyx_k_indexarity, sizeof(__pyx_k_indexarity), 0, 0, 1, 1},
    {&__pyx_n_s_indices_c, __pyx_k_indices_c, sizeof(__pyx_k_indices_c), 0, 0, 1, 1},
    {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1},
    {&__pyx_n_s_init0, __pyx_k_init0, sizeof(__pyx_k_init0), 0, 0, 1, 1},
    {&__pyx_n_s_init_2, __pyx_k_init_2, sizeof(__pyx_k_init_2), 0, 0, 1, 1},
    {&__pyx_n_s_init_subclass, __pyx_k_init_subclass, sizeof(__pyx_k_init_subclass), 0, 0, 1, 1},
    {&__pyx_n_s_initializing, __pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 0, 1, 1},
    {&__pyx_n_s_instances, __pyx_k_instances, sizeof(__pyx_k_instances), 0, 0, 1, 1},
    {&__pyx_n_s_isLogical, __pyx_k_isLogical, sizeof(__pyx_k_isLogical), 0, 0, 1, 1},
    {&__pyx_n_s_isRunning, __pyx_k_isRunning, sizeof(__pyx_k_isRunning), 0, 0, 1, 1},
    {&__pyx_n_s_isScalar, __pyx_k_isScalar, sizeof(__pyx_k_isScalar), 0, 0, 1, 1},
    {&__pyx_n_s_isSymbolic, __pyx_k_isSymbolic, sizeof(__pyx_k_isSymbolic), 0, 0, 1, 1},
    {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1},
    {&__pyx_n_s_is_logical, __pyx_k_is_logical, sizeof(__pyx_k_is_logical), 0, 0, 1, 1},
    {&__pyx_n_s_is_running, __pyx_k_is_running, sizeof(__pyx_k_is_running), 0, 0, 1, 1},
    {&__pyx_n_s_is_scalar, __pyx_k_is_scalar, sizeof(__pyx_k_is_scalar), 0, 0, 1, 1},
    {&__pyx_n_s_is_symbolic, __pyx_k_is_symbolic, sizeof(__pyx_k_is_symbolic), 0, 0, 1, 1},
    {&__pyx_kp_u_isenabled, __pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0, 0},
    {&__pyx_n_s_isrunning, __pyx_k_isrunning, sizeof(__pyx_k_isrunning), 0, 0, 1, 1},
    {&__pyx_n_s_items, __pyx_k_items, sizeof(__pyx_k_items), 0, 0, 1, 1},
    {&__pyx_n_s_iter, __pyx_k_iter, sizeof(__pyx_k_iter), 0, 0, 1, 1},
    {&__pyx_n_s_iter___locals_genexpr, __pyx_k_iter___locals_genexpr, sizeof(__pyx_k_iter___locals_genexpr), 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_key, __pyx_k_key, sizeof(__pyx_k_key), 0, 0, 1, 1},
    {&__pyx_n_s_keys, __pyx_k_keys, sizeof(__pyx_k_keys), 0, 0, 1, 1},
    {&__pyx_n_s_kind, __pyx_k_kind, sizeof(__pyx_k_kind), 0, 0, 1, 1},
    {&__pyx_n_s_kwargs, __pyx_k_kwargs, sizeof(__pyx_k_kwargs), 0, 0, 1, 1},
    {&__pyx_n_s_lb, __pyx_k_lb, sizeof(__pyx_k_lb), 0, 0, 1, 1},
    {&__pyx_n_s_lb0, __pyx_k_lb0, sizeof(__pyx_k_lb0), 0, 0, 1, 1},
    {&__pyx_n_s_lb1, __pyx_k_lb1, sizeof(__pyx_k_lb1), 0, 0, 1, 1},
    {&__pyx_n_s_lb2, __pyx_k_lb2, sizeof(__pyx_k_lb2), 0, 0, 1, 1},
    {&__pyx_n_s_lbs, __pyx_k_lbs, sizeof(__pyx_k_lbs), 0, 0, 1, 1},
    {&__pyx_n_s_ldual, __pyx_k_ldual, sizeof(__pyx_k_ldual), 0, 0, 1, 1},
    {&__pyx_n_s_line_number, __pyx_k_line_number, sizeof(__pyx_k_line_number), 0, 0, 1, 1},
    {&__pyx_n_s_literal_eval, __pyx_k_literal_eval, sizeof(__pyx_k_literal_eval), 0, 0, 1, 1},
    {&__pyx_n_s_loadSession, __pyx_k_loadSession, sizeof(__pyx_k_loadSession), 0, 0, 1, 1},
    {&__pyx_n_s_load_session, __pyx_k_load_session, sizeof(__pyx_k_load_session), 0, 0, 1, 1},
    {&__pyx_n_s_lrc, __pyx_k_lrc, sizeof(__pyx_k_lrc), 0, 0, 1, 1},
    {&__pyx_n_s_lslack, __pyx_k_lslack, sizeof(__pyx_k_lslack), 0, 0, 1, 1},
    {&__pyx_n_s_lst, __pyx_k_lst, sizeof(__pyx_k_lst), 0, 0, 1, 1},
    {&__pyx_n_s_lst_columns, __pyx_k_lst_columns, sizeof(__pyx_k_lst_columns), 0, 0, 1, 1},
    {&__pyx_n_s_lst_index, __pyx_k_lst_index, sizeof(__pyx_k_lst_index), 0, 0, 1, 1},
    {&__pyx_n_s_lst_solution, __pyx_k_lst_solution, sizeof(__pyx_k_lst_solution), 0, 0, 1, 1},
    {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
    {&__pyx_n_s_map, __pyx_k_map, sizeof(__pyx_k_map), 0, 0, 1, 1},
    {&__pyx_n_s_members, __pyx_k_members, sizeof(__pyx_k_members), 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_minimization, __pyx_k_minimization, sizeof(__pyx_k_minimization), 0, 0, 1, 1},
    {&__pyx_n_u_minimize, __pyx_k_minimize, sizeof(__pyx_k_minimize), 0, 1, 0, 1},
    {&__pyx_n_s_model, __pyx_k_model, sizeof(__pyx_k_model), 0, 0, 1, 1},
    {&__pyx_n_s_model_c, __pyx_k_model_c, sizeof(__pyx_k_model_c), 0, 0, 1, 1},
    {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1},
    {&__pyx_n_s_mro_entries, __pyx_k_mro_entries, sizeof(__pyx_k_mro_entries), 0, 0, 1, 1},
    {&__pyx_n_s_msg, __pyx_k_msg, sizeof(__pyx_k_msg), 0, 0, 1, 1},
    {&__pyx_n_s_multi_index, __pyx_k_multi_index, sizeof(__pyx_k_multi_index), 0, 0, 1, 1},
    {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1},
    {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
    {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
    {&__pyx_n_s_name_c, __pyx_k_name_c, sizeof(__pyx_k_name_c), 0, 0, 1, 1},
    {&__pyx_n_s_name_c_2, __pyx_k_name_c_2, sizeof(__pyx_k_name_c_2), 0, 0, 1, 1},
    {&__pyx_n_s_names, __pyx_k_names, sizeof(__pyx_k_names), 0, 0, 1, 1},
    {&__pyx_n_s_ncols, __pyx_k_ncols, sizeof(__pyx_k_ncols), 0, 0, 1, 1},
    {&__pyx_n_s_ncolumns, __pyx_k_ncolumns, sizeof(__pyx_k_ncolumns), 0, 0, 1, 1},
    {&__pyx_n_s_ndarray, __pyx_k_ndarray, sizeof(__pyx_k_ndarray), 0, 0, 1, 1},
    {&__pyx_n_s_nested, __pyx_k_nested, sizeof(__pyx_k_nested), 0, 0, 1, 1},
    {&__pyx_n_s_nested_dict_of_suffixes, __pyx_k_nested_dict_of_suffixes, sizeof(__pyx_k_nested_dict_of_suffixes), 0, 0, 1, 1},
    {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1},
    {&__pyx_n_s_nindices, __pyx_k_nindices, sizeof(__pyx_k_nindices), 0, 0, 1, 1},
    {&__pyx_n_s_nlevels, __pyx_k_nlevels, sizeof(__pyx_k_nlevels), 0, 0, 1, 1},
    {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0},
    {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1},
    {&__pyx_n_u_nt, __pyx_k_nt, sizeof(__pyx_k_nt), 0, 1, 0, 1},
    {&__pyx_n_s_num, __pyx_k_num, sizeof(__pyx_k_num), 0, 0, 1, 1},
    {&__pyx_n_s_numInstances, __pyx_k_numInstances, sizeof(__pyx_k_numInstances), 0, 0, 1, 1},
    {&__pyx_n_s_num_instances, __pyx_k_num_instances, sizeof(__pyx_k_num_instances), 0, 0, 1, 1},
    {&__pyx_n_s_numbers, __pyx_k_numbers, sizeof(__pyx_k_numbers), 0, 0, 1, 1},
    {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
    {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1},
    {&__pyx_n_s_obj_2, __pyx_k_obj_2, sizeof(__pyx_k_obj_2), 0, 0, 1, 1},
    {&__pyx_n_s_obj_locals_Objectives, __pyx_k_obj_locals_Objectives, sizeof(__pyx_k_obj_locals_Objectives), 0, 0, 1, 1},
    {&__pyx_n_s_obj_locals_Objectives___getitem, __pyx_k_obj_locals_Objectives___getitem, sizeof(__pyx_k_obj_locals_Objectives___getitem), 0, 0, 1, 1},
    {&__pyx_n_s_obj_locals_Objectives___init, __pyx_k_obj_locals_Objectives___init, sizeof(__pyx_k_obj_locals_Objectives___init), 0, 0, 1, 1},
    {&__pyx_n_s_obj_locals_Objectives___iter, __pyx_k_obj_locals_Objectives___iter, sizeof(__pyx_k_obj_locals_Objectives___iter), 0, 0, 1, 1},
    {&__pyx_n_s_object, __pyx_k_object, sizeof(__pyx_k_object), 0, 0, 1, 1},
    {&__pyx_n_s_objname, __pyx_k_objname, sizeof(__pyx_k_objname), 0, 0, 1, 1},
    {&__pyx_n_s_objname_c, __pyx_k_objname_c, sizeof(__pyx_k_objname_c), 0, 0, 1, 1},
    {&__pyx_n_s_offset, __pyx_k_offset, sizeof(__pyx_k_offset), 0, 0, 1, 1},
    {&__pyx_n_s_open, __pyx_k_open, sizeof(__pyx_k_open), 0, 0, 1, 1},
    {&__pyx_n_s_option, __pyx_k_option, sizeof(__pyx_k_option), 0, 0, 1, 1},
    {&__pyx_n_s_option_2, __pyx_k_option_2, sizeof(__pyx_k_option_2), 0, 0, 1, 1},
    {&__pyx_n_s_option_locals_Options, __pyx_k_option_locals_Options, sizeof(__pyx_k_option_locals_Options), 0, 0, 1, 1},
    {&__pyx_n_s_option_locals_Options___getitem, __pyx_k_option_locals_Options___getitem, sizeof(__pyx_k_option_locals_Options___getitem), 0, 0, 1, 1},
    {&__pyx_n_s_option_locals_Options___init, __pyx_k_option_locals_Options___init, sizeof(__pyx_k_option_locals_Options___init), 0, 0, 1, 1},
    {&__pyx_n_s_option_locals_Options___setitem, __pyx_k_option_locals_Options___setitem, sizeof(__pyx_k_option_locals_Options___setitem), 0, 0, 1, 1},
    {&__pyx_n_u_options, __pyx_k_options, sizeof(__pyx_k_options), 0, 1, 0, 1},
    {&__pyx_n_s_options_2, __pyx_k_options_2, sizeof(__pyx_k_options_2), 0, 0, 1, 1},
    {&__pyx_n_s_options_c, __pyx_k_options_c, sizeof(__pyx_k_options_c), 0, 0, 1, 1},
    {&__pyx_n_s_os, __pyx_k_os, sizeof(__pyx_k_os), 0, 0, 1, 1},
    {&__pyx_n_s_output, __pyx_k_output, sizeof(__pyx_k_output), 0, 0, 1, 1},
    {&__pyx_n_s_output_c, __pyx_k_output_c, sizeof(__pyx_k_output_c), 0, 0, 1, 1},
    {&__pyx_n_s_output_handler, __pyx_k_output_handler, sizeof(__pyx_k_output_handler), 0, 0, 1, 1},
    {&__pyx_n_s_p, __pyx_k_p, sizeof(__pyx_k_p), 0, 0, 1, 1},
    {&__pyx_n_s_pandas, __pyx_k_pandas, sizeof(__pyx_k_pandas), 0, 0, 1, 1},
    {&__pyx_n_s_param, __pyx_k_param, sizeof(__pyx_k_param), 0, 0, 1, 1},
    {&__pyx_n_s_param_2, __pyx_k_param_2, sizeof(__pyx_k_param_2), 0, 0, 1, 1},
    {&__pyx_n_s_param_locals_Parameters, __pyx_k_param_locals_Parameters, sizeof(__pyx_k_param_locals_Parameters), 0, 0, 1, 1},
    {&__pyx_n_s_param_locals_Parameters___getit, __pyx_k_param_locals_Parameters___getit, sizeof(__pyx_k_param_locals_Parameters___getit), 0, 0, 1, 1},
    {&__pyx_n_s_param_locals_Parameters___init, __pyx_k_param_locals_Parameters___init, sizeof(__pyx_k_param_locals_Parameters___init), 0, 0, 1, 1},
    {&__pyx_n_s_param_locals_Parameters___iter, __pyx_k_param_locals_Parameters___iter, sizeof(__pyx_k_param_locals_Parameters___iter), 0, 0, 1, 1},
    {&__pyx_n_s_param_locals_Parameters___setit, __pyx_k_param_locals_Parameters___setit, sizeof(__pyx_k_param_locals_Parameters___setit), 0, 0, 1, 1},
    {&__pyx_n_s_path, __pyx_k_path, sizeof(__pyx_k_path), 0, 0, 1, 1},
    {&__pyx_n_s_pd, __pyx_k_pd, sizeof(__pyx_k_pd), 0, 0, 1, 1},
    {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 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_problem, __pyx_k_problem, sizeof(__pyx_k_problem), 0, 0, 1, 1},
    {&__pyx_n_s_property, __pyx_k_property, sizeof(__pyx_k_property), 0, 0, 1, 1},
    {&__pyx_n_s_py_list, __pyx_k_py_list, sizeof(__pyx_k_py_list), 0, 0, 1, 1},
    {&__pyx_n_s_py_variant, __pyx_k_py_variant, sizeof(__pyx_k_py_variant), 0, 0, 1, 1},
    {&__pyx_n_s_pylist, __pyx_k_pylist, sizeof(__pyx_k_pylist), 0, 0, 1, 1},
    {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
    {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
    {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
    {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
    {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
    {&__pyx_n_s_pyx_unpickle_ErrorHandler, __pyx_k_pyx_unpickle_ErrorHandler, sizeof(__pyx_k_pyx_unpickle_ErrorHandler), 0, 0, 1, 1},
    {&__pyx_n_s_pyx_unpickle_OutputHandler, __pyx_k_pyx_unpickle_OutputHandler, sizeof(__pyx_k_pyx_unpickle_OutputHandler), 0, 0, 1, 1},
    {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 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_rc, __pyx_k_rc, sizeof(__pyx_k_rc), 0, 0, 1, 1},
    {&__pyx_n_s_read, __pyx_k_read, sizeof(__pyx_k_read), 0, 0, 1, 1},
    {&__pyx_n_s_readData, __pyx_k_readData, sizeof(__pyx_k_readData), 0, 0, 1, 1},
    {&__pyx_n_s_readTable, __pyx_k_readTable, sizeof(__pyx_k_readTable), 0, 0, 1, 1},
    {&__pyx_n_s_read_data, __pyx_k_read_data, sizeof(__pyx_k_read_data), 0, 0, 1, 1},
    {&__pyx_n_s_read_table, __pyx_k_read_table, sizeof(__pyx_k_read_table), 0, 0, 1, 1},
    {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
    {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
    {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
    {&__pyx_n_s_reset, __pyx_k_reset, sizeof(__pyx_k_reset), 0, 0, 1, 1},
    {&__pyx_n_s_restore, __pyx_k_restore, sizeof(__pyx_k_restore), 0, 0, 1, 1},
    {&__pyx_n_s_result, __pyx_k_result, sizeof(__pyx_k_result), 0, 0, 1, 1},
    {&__pyx_n_s_return_output, __pyx_k_return_output, sizeof(__pyx_k_return_output), 0, 0, 1, 1},
    {&__pyx_n_s_row, __pyx_k_row, sizeof(__pyx_k_row), 0, 0, 1, 1},
    {&__pyx_n_s_rowindex, __pyx_k_rowindex, sizeof(__pyx_k_rowindex), 0, 0, 1, 1},
    {&__pyx_n_s_scalar_expression, __pyx_k_scalar_expression, sizeof(__pyx_k_scalar_expression), 0, 0, 1, 1},
    {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1},
    {&__pyx_kp_s_self__c_ampl_cannot_be_converted, __pyx_k_self__c_ampl_cannot_be_converted, sizeof(__pyx_k_self__c_ampl_cannot_be_converted), 0, 0, 1, 0},
    {&__pyx_kp_s_self__c_ampl_self__index_cannot, __pyx_k_self__c_ampl_self__index_cannot, sizeof(__pyx_k_self__c_ampl_self__index_cannot), 0, 0, 1, 0},
    {&__pyx_kp_s_self__c_ampl_self__index_self_be, __pyx_k_self__c_ampl_self__index_self_be, sizeof(__pyx_k_self__c_ampl_self__index_self_be), 0, 0, 1, 0},
    {&__pyx_kp_s_self__c_ampl_self_begin_self_end, __pyx_k_self__c_ampl_self_begin_self_end, sizeof(__pyx_k_self__c_ampl_self_begin_self_end), 0, 0, 1, 0},
    {&__pyx_kp_s_self__df_cannot_be_converted_to, __pyx_k_self__df_cannot_be_converted_to, sizeof(__pyx_k_self__df_cannot_be_converted_to), 0, 0, 1, 0},
    {&__pyx_kp_s_self_begin_self_end_self_env_c_s, __pyx_k_self_begin_self_end_self_env_c_s, sizeof(__pyx_k_self_begin_self_end_self_env_c_s), 0, 0, 1, 0},
    {&__pyx_n_s_send, __pyx_k_send, sizeof(__pyx_k_send), 0, 0, 1, 1},
    {&__pyx_n_s_set, __pyx_k_set, sizeof(__pyx_k_set), 0, 0, 1, 1},
    {&__pyx_n_s_setBinDir, __pyx_k_setBinDir, sizeof(__pyx_k_setBinDir), 0, 0, 1, 1},
    {&__pyx_n_s_setBinName, __pyx_k_setBinName, sizeof(__pyx_k_setBinName), 0, 0, 1, 1},
    {&__pyx_n_s_setColumn, __pyx_k_setColumn, sizeof(__pyx_k_setColumn), 0, 0, 1, 1},
    {&__pyx_n_s_setData, __pyx_k_setData, sizeof(__pyx_k_setData), 0, 0, 1, 1},
    {&__pyx_n_s_setDual, __pyx_k_setDual, sizeof(__pyx_k_setDual), 0, 0, 1, 1},
    {&__pyx_n_s_setErrorHandler, __pyx_k_setErrorHandler, sizeof(__pyx_k_setErrorHandler), 0, 0, 1, 1},
    {&__pyx_n_s_setOption, __pyx_k_setOption, sizeof(__pyx_k_setOption), 0, 0, 1, 1},
    {&__pyx_n_s_setOutputHandler, __pyx_k_setOutputHandler, sizeof(__pyx_k_setOutputHandler), 0, 0, 1, 1},
    {&__pyx_n_s_setValue, __pyx_k_setValue, sizeof(__pyx_k_setValue), 0, 0, 1, 1},
    {&__pyx_n_s_setValues, __pyx_k_setValues, sizeof(__pyx_k_setValues), 0, 0, 1, 1},
    {&__pyx_n_s_setValues_2, __pyx_k_setValues_2, sizeof(__pyx_k_setValues_2), 0, 0, 1, 1},
    {&__pyx_n_s_set_2, __pyx_k_set_2, sizeof(__pyx_k_set_2), 0, 0, 1, 1},
    {&__pyx_n_s_set_bin_dir, __pyx_k_set_bin_dir, sizeof(__pyx_k_set_bin_dir), 0, 0, 1, 1},
    {&__pyx_n_s_set_bin_name, __pyx_k_set_bin_name, sizeof(__pyx_k_set_bin_name), 0, 0, 1, 1},
    {&__pyx_n_s_set_column, __pyx_k_set_column, sizeof(__pyx_k_set_column), 0, 0, 1, 1},
    {&__pyx_n_s_set_data, __pyx_k_set_data, sizeof(__pyx_k_set_data), 0, 0, 1, 1},
    {&__pyx_n_s_set_dual, __pyx_k_set_dual, sizeof(__pyx_k_set_dual), 0, 0, 1, 1},
    {&__pyx_n_s_set_error_handler, __pyx_k_set_error_handler, sizeof(__pyx_k_set_error_handler), 0, 0, 1, 1},
    {&__pyx_n_s_set_locals_Sets, __pyx_k_set_locals_Sets, sizeof(__pyx_k_set_locals_Sets), 0, 0, 1, 1},
    {&__pyx_n_s_set_locals_Sets___getitem, __pyx_k_set_locals_Sets___getitem, sizeof(__pyx_k_set_locals_Sets___getitem), 0, 0, 1, 1},
    {&__pyx_n_s_set_locals_Sets___init, __pyx_k_set_locals_Sets___init, sizeof(__pyx_k_set_locals_Sets___init), 0, 0, 1, 1},
    {&__pyx_n_s_set_locals_Sets___iter, __pyx_k_set_locals_Sets___iter, sizeof(__pyx_k_set_locals_Sets___iter), 0, 0, 1, 1},
    {&__pyx_n_s_set_locals_Sets___setitem, __pyx_k_set_locals_Sets___setitem, sizeof(__pyx_k_set_locals_Sets___setitem), 0, 0, 1, 1},
    {&__pyx_n_s_set_name, __pyx_k_set_name, sizeof(__pyx_k_set_name), 0, 0, 1, 1},
    {&__pyx_n_s_set_name_2, __pyx_k_set_name_2, sizeof(__pyx_k_set_name_2), 0, 0, 1, 1},
    {&__pyx_n_s_set_option, __pyx_k_set_option, sizeof(__pyx_k_set_option), 0, 0, 1, 1},
    {&__pyx_n_s_set_output_handler, __pyx_k_set_output_handler, sizeof(__pyx_k_set_output_handler), 0, 0, 1, 1},
    {&__pyx_n_s_set_value, __pyx_k_set_value, sizeof(__pyx_k_set_value), 0, 0, 1, 1},
    {&__pyx_n_s_set_values, __pyx_k_set_values, sizeof(__pyx_k_set_values), 0, 0, 1, 1},
    {&__pyx_n_s_set_values_2, __pyx_k_set_values_2, sizeof(__pyx_k_set_values_2), 0, 0, 1, 1},
    {&__pyx_n_s_set_values_locals_cast_row, __pyx_k_set_values_locals_cast_row, sizeof(__pyx_k_set_values_locals_cast_row), 0, 0, 1, 1},
    {&__pyx_n_s_set_values_locals_cast_value, __pyx_k_set_values_locals_cast_value, sizeof(__pyx_k_set_values_locals_cast_value), 0, 0, 1, 1},
    {&__pyx_n_s_set_values_locals_conv_to_list, __pyx_k_set_values_locals_conv_to_list, sizeof(__pyx_k_set_values_locals_conv_to_list), 0, 0, 1, 1},
    {&__pyx_n_s_set_values_locals_genexpr, __pyx_k_set_values_locals_genexpr, sizeof(__pyx_k_set_values_locals_genexpr), 0, 0, 1, 1},
    {&__pyx_n_s_setitem, __pyx_k_setitem, sizeof(__pyx_k_setitem), 0, 0, 1, 1},
    {&__pyx_n_s_sets, __pyx_k_sets, sizeof(__pyx_k_sets), 0, 0, 1, 1},
    {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
    {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
    {&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1},
    {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1},
    {&__pyx_n_s_skip_index, __pyx_k_skip_index, sizeof(__pyx_k_skip_index), 0, 0, 1, 1},
    {&__pyx_n_s_slack, __pyx_k_slack, sizeof(__pyx_k_slack), 0, 0, 1, 1},
    {&__pyx_n_s_snapshot, __pyx_k_snapshot, sizeof(__pyx_k_snapshot), 0, 0, 1, 1},
    {&__pyx_kp_u_solve, __pyx_k_solve, sizeof(__pyx_k_solve), 0, 1, 0, 0},
    {&__pyx_n_s_solve_2, __pyx_k_solve_2, sizeof(__pyx_k_solve_2), 0, 0, 1, 1},
    {&__pyx_n_u_solve_result, __pyx_k_solve_result, sizeof(__pyx_k_solve_result), 0, 1, 0, 1},
    {&__pyx_n_u_solve_result_num, __pyx_k_solve_result_num, sizeof(__pyx_k_solve_result_num), 0, 1, 0, 1},
    {&__pyx_n_s_solver, __pyx_k_solver, sizeof(__pyx_k_solver), 0, 0, 1, 1},
    {&__pyx_n_u_solver, __pyx_k_solver, sizeof(__pyx_k_solver), 0, 1, 0, 1},
    {&__pyx_n_s_source_name, __pyx_k_source_name, sizeof(__pyx_k_source_name), 0, 0, 1, 1},
    {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1},
    {&__pyx_n_s_split, __pyx_k_split, sizeof(__pyx_k_split), 0, 0, 1, 1},
    {&__pyx_n_s_sstatus, __pyx_k_sstatus, sizeof(__pyx_k_sstatus), 0, 0, 1, 1},
    {&__pyx_n_s_stack, __pyx_k_stack, sizeof(__pyx_k_stack), 0, 0, 1, 1},
    {&__pyx_n_s_startRecording, __pyx_k_startRecording, sizeof(__pyx_k_startRecording), 0, 0, 1, 1},
    {&__pyx_n_s_start_recording, __pyx_k_start_recording, sizeof(__pyx_k_start_recording), 0, 0, 1, 1},
    {&__pyx_n_s_state, __pyx_k_state, sizeof(__pyx_k_state), 0, 0, 1, 1},
    {&__pyx_n_s_statements, __pyx_k_statements, sizeof(__pyx_k_statements), 0, 0, 1, 1},
    {&__pyx_n_s_statements_c, __pyx_k_statements_c, sizeof(__pyx_k_statements_c), 0, 0, 1, 1},
    {&__pyx_n_s_status, __pyx_k_status, sizeof(__pyx_k_status), 0, 0, 1, 1},
    {&__pyx_n_s_stderr, __pyx_k_stderr, sizeof(__pyx_k_stderr), 0, 0, 1, 1},
    {&__pyx_n_s_stmt, __pyx_k_stmt, sizeof(__pyx_k_stmt), 0, 0, 1, 1},
    {&__pyx_n_s_stopRecording, __pyx_k_stopRecording, sizeof(__pyx_k_stopRecording), 0, 0, 1, 1},
    {&__pyx_n_s_stop_recording, __pyx_k_stop_recording, sizeof(__pyx_k_stop_recording), 0, 0, 1, 1},
    {&__pyx_n_s_str, __pyx_k_str, sizeof(__pyx_k_str), 0, 0, 1, 1},
    {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
    {&__pyx_n_s_suffixes, __pyx_k_suffixes, sizeof(__pyx_k_suffixes), 0, 0, 1, 1},
    {&__pyx_n_s_suffixes_c, __pyx_k_suffixes_c, sizeof(__pyx_k_suffixes_c), 0, 0, 1, 1},
    {&__pyx_n_s_super, __pyx_k_super, sizeof(__pyx_k_super), 0, 0, 1, 1},
    {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1},
    {&__pyx_n_s_t, __pyx_k_t, sizeof(__pyx_k_t), 0, 0, 1, 1},
    {&__pyx_n_s_t_c, __pyx_k_t_c, sizeof(__pyx_k_t_c), 0, 0, 1, 1},
    {&__pyx_n_s_table_name, __pyx_k_table_name, sizeof(__pyx_k_table_name), 0, 0, 1, 1},
    {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
    {&__pyx_n_s_throw, __pyx_k_throw, sizeof(__pyx_k_throw), 0, 0, 1, 1},
    {&__pyx_n_s_toDict, __pyx_k_toDict, sizeof(__pyx_k_toDict), 0, 0, 1, 1},
    {&__pyx_n_s_toList, __pyx_k_toList, sizeof(__pyx_k_toList), 0, 0, 1, 1},
    {&__pyx_n_s_toPandas, __pyx_k_toPandas, sizeof(__pyx_k_toPandas), 0, 0, 1, 1},
    {&__pyx_n_s_toString, __pyx_k_toString, sizeof(__pyx_k_toString), 0, 0, 1, 1},
    {&__pyx_n_s_to_dict, __pyx_k_to_dict, sizeof(__pyx_k_to_dict), 0, 0, 1, 1},
    {&__pyx_n_s_to_list, __pyx_k_to_list, sizeof(__pyx_k_to_list), 0, 0, 1, 1},
    {&__pyx_n_s_to_pandas, __pyx_k_to_pandas, sizeof(__pyx_k_to_pandas), 0, 0, 1, 1},
    {&__pyx_n_s_to_string, __pyx_k_to_string, sizeof(__pyx_k_to_string), 0, 0, 1, 1},
    {&__pyx_n_s_to_string_c, __pyx_k_to_string_c, sizeof(__pyx_k_to_string_c), 0, 0, 1, 1},
    {&__pyx_n_s_to_tuple, __pyx_k_to_tuple, sizeof(__pyx_k_to_tuple), 0, 0, 1, 1},
    {&__pyx_n_s_tolist, __pyx_k_tolist, sizeof(__pyx_k_tolist), 0, 0, 1, 1},
    {&__pyx_n_s_tools, __pyx_k_tools, sizeof(__pyx_k_tools), 0, 0, 1, 1},
    {&__pyx_n_s_tuple, __pyx_k_tuple, sizeof(__pyx_k_tuple), 0, 0, 1, 1},
    {&__pyx_n_s_tuple_c, __pyx_k_tuple_c, sizeof(__pyx_k_tuple_c), 0, 0, 1, 1},
    {&__pyx_n_s_ub, __pyx_k_ub, sizeof(__pyx_k_ub), 0, 0, 1, 1},
    {&__pyx_n_s_ub0, __pyx_k_ub0, sizeof(__pyx_k_ub0), 0, 0, 1, 1},
    {&__pyx_n_s_ub1, __pyx_k_ub1, sizeof(__pyx_k_ub1), 0, 0, 1, 1},
    {&__pyx_n_s_ub2, __pyx_k_ub2, sizeof(__pyx_k_ub2), 0, 0, 1, 1},
    {&__pyx_n_s_ubs, __pyx_k_ubs, sizeof(__pyx_k_ubs), 0, 0, 1, 1},
    {&__pyx_n_s_udual, __pyx_k_udual, sizeof(__pyx_k_udual), 0, 0, 1, 1},
    {&__pyx_n_s_unfix, __pyx_k_unfix, sizeof(__pyx_k_unfix), 0, 0, 1, 1},
    {&__pyx_kp_u_unsupported_type, __pyx_k_unsupported_type, sizeof(__pyx_k_unsupported_type), 0, 1, 0, 0},
    {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1},
    {&__pyx_n_s_urc, __pyx_k_urc, sizeof(__pyx_k_urc), 0, 0, 1, 1},
    {&__pyx_n_s_use_setstate, __pyx_k_use_setstate, sizeof(__pyx_k_use_setstate), 0, 0, 1, 1},
    {&__pyx_n_s_uslack, __pyx_k_uslack, sizeof(__pyx_k_uslack), 0, 0, 1, 1},
    {&__pyx_kp_u_utf_8, __pyx_k_utf_8, sizeof(__pyx_k_utf_8), 0, 1, 0, 0},
    {&__pyx_n_s_v, __pyx_k_v, sizeof(__pyx_k_v), 0, 0, 1, 1},
    {&__pyx_n_s_val, __pyx_k_val, sizeof(__pyx_k_val), 0, 0, 1, 1},
    {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1},
    {&__pyx_n_u_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 1, 0, 1},
    {&__pyx_n_s_value_c, __pyx_k_value_c, sizeof(__pyx_k_value_c), 0, 0, 1, 1},
    {&__pyx_n_s_values, __pyx_k_values, sizeof(__pyx_k_values), 0, 0, 1, 1},
    {&__pyx_n_s_var, __pyx_k_var, sizeof(__pyx_k_var), 0, 0, 1, 1},
    {&__pyx_n_s_var_2, __pyx_k_var_2, sizeof(__pyx_k_var_2), 0, 0, 1, 1},
    {&__pyx_n_s_var_locals_Variables, __pyx_k_var_locals_Variables, sizeof(__pyx_k_var_locals_Variables), 0, 0, 1, 1},
    {&__pyx_n_s_var_locals_Variables___getitem, __pyx_k_var_locals_Variables___getitem, sizeof(__pyx_k_var_locals_Variables___getitem), 0, 0, 1, 1},
    {&__pyx_n_s_var_locals_Variables___init, __pyx_k_var_locals_Variables___init, sizeof(__pyx_k_var_locals_Variables___init), 0, 0, 1, 1},
    {&__pyx_n_s_var_locals_Variables___iter, __pyx_k_var_locals_Variables___iter, sizeof(__pyx_k_var_locals_Variables___iter), 0, 0, 1, 1},
    {&__pyx_n_s_var_locals_Variables___setitem, __pyx_k_var_locals_Variables___setitem, sizeof(__pyx_k_var_locals_Variables___setitem), 0, 0, 1, 1},
    {&__pyx_n_s_verbose, __pyx_k_verbose, sizeof(__pyx_k_verbose), 0, 0, 1, 1},
    {&__pyx_n_s_warning, __pyx_k_warning, sizeof(__pyx_k_warning), 0, 0, 1, 1},
    {&__pyx_n_s_workdir, __pyx_k_workdir, sizeof(__pyx_k_workdir), 0, 0, 1, 1},
    {&__pyx_n_s_workdir_c, __pyx_k_workdir_c, sizeof(__pyx_k_workdir_c), 0, 0, 1, 1},
    {&__pyx_n_s_write, __pyx_k_write, sizeof(__pyx_k_write), 0, 0, 1, 1},
    {&__pyx_n_s_writeTable, __pyx_k_writeTable, sizeof(__pyx_k_writeTable), 0, 0, 1, 1},
    {&__pyx_n_s_write_table, __pyx_k_write_table, sizeof(__pyx_k_write_table), 0, 0, 1, 1},
    {&__pyx_n_s_xref, __pyx_k_xref, sizeof(__pyx_k_xref), 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}
  };
  return __Pyx_InitStrings(__pyx_string_tab);
}
/* #### Code section: cached_builtins ### */
static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
  __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(0, 9, __pyx_L1_error)
  __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(1, 50, __pyx_L1_error)
  __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) __PYX_ERR(2, 36, __pyx_L1_error)
  __pyx_builtin_property = __Pyx_GetBuiltinName(__pyx_n_s_property); if (!__pyx_builtin_property) __PYX_ERR(3, 893, __pyx_L1_error)
  __pyx_builtin_SystemError = __Pyx_GetBuiltinName(__pyx_n_s_SystemError); if (!__pyx_builtin_SystemError) __PYX_ERR(4, 24, __pyx_L1_error)
  __pyx_builtin_IOError = __Pyx_GetBuiltinName(__pyx_n_s_IOError); if (!__pyx_builtin_IOError) __PYX_ERR(4, 27, __pyx_L1_error)
  __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(4, 30, __pyx_L1_error)
  __pyx_builtin_print = __Pyx_GetBuiltinName(__pyx_n_s_print); if (!__pyx_builtin_print) __PYX_ERR(4, 32, __pyx_L1_error)
  __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(4, 53, __pyx_L1_error)
  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(4, 56, __pyx_L1_error)
  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(4, 69, __pyx_L1_error)
  __pyx_builtin_AttributeError = __Pyx_GetBuiltinName(__pyx_n_s_AttributeError); if (!__pyx_builtin_AttributeError) __PYX_ERR(5, 60, __pyx_L1_error)
  __pyx_builtin_AssertionError = __Pyx_GetBuiltinName(__pyx_n_s_AssertionError); if (!__pyx_builtin_AssertionError) __PYX_ERR(0, 243, __pyx_L1_error)
  __pyx_builtin_map = __Pyx_GetBuiltinName(__pyx_n_s_map); if (!__pyx_builtin_map) __PYX_ERR(0, 280, __pyx_L1_error)
  __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) __PYX_ERR(0, 287, __pyx_L1_error)
  __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_n_s_zip); if (!__pyx_builtin_zip) __PYX_ERR(0, 414, __pyx_L1_error)
  __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(0, 514, __pyx_L1_error)
  __pyx_builtin_super = __Pyx_GetBuiltinName(__pyx_n_s_super); if (!__pyx_builtin_super) __PYX_ERR(1, 10, __pyx_L1_error)
  __pyx_builtin_StopIteration = __Pyx_GetBuiltinName(__pyx_n_s_StopIteration); if (!__pyx_builtin_StopIteration) __PYX_ERR(6, 26, __pyx_L1_error)
  __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(3, 663, __pyx_L1_error)
  __pyx_builtin_open = __Pyx_GetBuiltinName(__pyx_n_s_open); if (!__pyx_builtin_open) __PYX_ERR(3, 1128, __pyx_L1_error)
  return 0;
  __pyx_L1_error:;
  return -1;
}
/* #### Code section: cached_constants ### */

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

  /* "amplpy/util.pxi":32
 *         raise TypeError(message.decode('utf-8'))
 *     elif rc == campl.AMPL_INVALID_SUBSCRIPT_EXCEPTION:
 *         print("AMPL: AMPL_INVALID_SUBSCRIPT_EXCEPTION")             # <<<<<<<<<<<<<<
 *         #throw InvalidSubscriptException(AMPL_ErrorInfoGetSource(call), AMPL_ErrorInfoGetLine(call), AMPL_ErrorInfoGetOffset(call),
 *         #                              AMPL_ErrorInfoGetMessage(call))
 */
  __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_u_AMPL_AMPL_INVALID_SUBSCRIPT_EXCE); if (unlikely(!__pyx_tuple_)) __PYX_ERR(4, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple_);
  __Pyx_GIVEREF(__pyx_tuple_);

  /* "amplpy/util.pxi":36
 *         #                              AMPL_ErrorInfoGetMessage(call))
 *     elif rc == campl.AMPL_SYNTAX_ERROR_EXCEPTION:
 *         print("AMPL: AMPL_SYNTAX_ERROR_EXCEPTION")             # <<<<<<<<<<<<<<
 *         #throw SyntaxErrorException(AMPL_ErrorInfoGetSource(call), AMPL_ErrorInfoGetLine(call), AMPL_ErrorInfoGetOffset(call),
 *         #                         AMPL_ErrorInfoGetMessage(call))
 */
  __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_u_AMPL_AMPL_SYNTAX_ERROR_EXCEPTION); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(4, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__2);
  __Pyx_GIVEREF(__pyx_tuple__2);

  /* "amplpy/util.pxi":40
 *         #                         AMPL_ErrorInfoGetMessage(call))
 *     elif rc == campl.AMPL_NO_DATA_EXCEPTION:
 *         print("AMPL: AMPL_NO_DATA_EXCEPTION")             # <<<<<<<<<<<<<<
 *         #throw NoDataException(AMPL_ErrorInfoGetMessage(call))
 *     elif rc == campl.AMPL_EXCEPTION:
 */
  __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_u_AMPL_AMPL_NO_DATA_EXCEPTION); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(4, 40, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__3);
  __Pyx_GIVEREF(__pyx_tuple__3);

  /* "amplpy/util.pxi":61
 *         raise Exception(message.decode('utf-8'))
 *     else:
 *         print("AMPL: unknown return code!")             # <<<<<<<<<<<<<<
 *         raise Exception('AMPL: unknown return code!')
 * 
 */
  __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_u_AMPL_unknown_return_code); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(4, 61, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__4);
  __Pyx_GIVEREF(__pyx_tuple__4);

  /* "amplpy/util.pxi":180
 * 
 *     if not PyDict_Check(dicts):
 *         raise ValueError("Expected a dictionary")             # <<<<<<<<<<<<<<
 * 
 *     cdef object d_keys = PyDict_Keys(dicts)
 */
  __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_Expected_a_dictionary); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(4, 180, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__5);
  __Pyx_GIVEREF(__pyx_tuple__5);

  /* "amplpy/util.pxi":192
 *         item = PyList_GetItem(d_values, i)
 *         if item == NULL:
 *             raise ValueError("Failed to access value")             # <<<<<<<<<<<<<<
 * 
 *         if PyUnicode_Check(<object>item):
 */
  __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_Failed_to_access_value); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(4, 192, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__6);
  __Pyx_GIVEREF(__pyx_tuple__6);

  /* "amplpy/util.pxi":200
 * 
 *         if has_numbers and has_strings:
 *             raise ValueError("All values must be either numbers or strings")             # <<<<<<<<<<<<<<
 * 
 *     if has_strings and not has_numbers:
 */
  __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_u_All_values_must_be_either_number); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(4, 200, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__7);
  __Pyx_GIVEREF(__pyx_tuple__7);

  /* "amplpy/util.pxi":229
 *         free(values_num_c)
 *     else:
 *         raise ValueError("Dictionary must contain either all strings or all numbers")             # <<<<<<<<<<<<<<
 * 
 * cdef raiseKeyError(campl.AMPL_ENTITYTYPE entity_class, char* name):
 */
  __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_u_Dictionary_must_contain_either_a); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(4, 229, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__8);
  __Pyx_GIVEREF(__pyx_tuple__8);

  /* "amplpy/util.pxi":233
 * cdef raiseKeyError(campl.AMPL_ENTITYTYPE entity_class, char* name):
 *     if entity_class == campl.AMPL_VARIABLE:
 *         raise KeyError("A variable called {name} cannot be found.")             # <<<<<<<<<<<<<<
 *     elif entity_class == campl.AMPL_CONSTRAINT:
 *         raise KeyError("A constraint called {name} cannot be found.")
 */
  __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_u_A_variable_called_name_cannot_be); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(4, 233, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__9);
  __Pyx_GIVEREF(__pyx_tuple__9);

  /* "amplpy/util.pxi":235
 *         raise KeyError("A variable called {name} cannot be found.")
 *     elif entity_class == campl.AMPL_CONSTRAINT:
 *         raise KeyError("A constraint called {name} cannot be found.")             # <<<<<<<<<<<<<<
 *     elif entity_class == campl.AMPL_OBJECTIVE:
 *         raise KeyError("An objective called {name} cannot be found.")
 */
  __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_u_A_constraint_called_name_cannot); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(4, 235, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__10);
  __Pyx_GIVEREF(__pyx_tuple__10);

  /* "amplpy/util.pxi":237
 *         raise KeyError("A constraint called {name} cannot be found.")
 *     elif entity_class == campl.AMPL_OBJECTIVE:
 *         raise KeyError("An objective called {name} cannot be found.")             # <<<<<<<<<<<<<<
 *     elif entity_class == campl.AMPL_SET:
 *         raise KeyError("A set called {name} cannot be found.")
 */
  __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_u_An_objective_called_name_cannot); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(4, 237, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__11);
  __Pyx_GIVEREF(__pyx_tuple__11);

  /* "amplpy/util.pxi":239
 *         raise KeyError("An objective called {name} cannot be found.")
 *     elif entity_class == campl.AMPL_SET:
 *         raise KeyError("A set called {name} cannot be found.")             # <<<<<<<<<<<<<<
 *     elif entity_class == campl.AMPL_PARAMETER:
 *         raise KeyError("A parameter called {name} cannot be found.")
 */
  __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_u_A_set_called_name_cannot_be_foun); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(4, 239, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__12);
  __Pyx_GIVEREF(__pyx_tuple__12);

  /* "amplpy/util.pxi":241
 *         raise KeyError("A set called {name} cannot be found.")
 *     elif entity_class == campl.AMPL_PARAMETER:
 *         raise KeyError("A parameter called {name} cannot be found.")             # <<<<<<<<<<<<<<
 *     else:
 *         pass
 */
  __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_u_A_parameter_called_name_cannot_b); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(4, 241, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__13);
  __Pyx_GIVEREF(__pyx_tuple__13);

  /* "amplpy/dataframe.pxi":391
 *         nindices = self._get_num_indices()
 * 
 *         def conv_to_list(value):             # <<<<<<<<<<<<<<
 *             if isinstance(value, list):
 *                 return value
 */
  __pyx_tuple__15 = PyTuple_Pack(1, __pyx_n_s_value); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 391, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__15);
  __Pyx_GIVEREF(__pyx_tuple__15);
  __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_dataframe_pxi, __pyx_n_s_conv_to_list, 391, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 391, __pyx_L1_error)

  /* "amplpy/dataframe.pxi":413
 *         nindices = self._get_num_indices()
 *         if nindices == 0:
 *             raise ValueError("cannot convert to dictionary without an index")             # <<<<<<<<<<<<<<
 *         data = zip(
 *             *[self._get_column(header).to_list() for header in self._get_headers()]
 */
  __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_u_cannot_convert_to_dictionary_wit); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 413, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__17);
  __Pyx_GIVEREF(__pyx_tuple__17);

  /* "amplpy/dataframe.pxi":491
 *         assert len(dic) != 0
 * 
 *         def to_tuple(e):             # <<<<<<<<<<<<<<
 *             if isinstance(e, (tuple, list)):
 *                 return tuple(e)
 */
  __pyx_tuple__18 = PyTuple_Pack(1, __pyx_n_s_e); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 491, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__18);
  __Pyx_GIVEREF(__pyx_tuple__18);
  __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_dataframe_pxi, __pyx_n_s_to_tuple, 491, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(0, 491, __pyx_L1_error)

  /* "amplpy/dataframe.pxi":574
 *     @classmethod
 *     def _from_data_frame_ref(cls, df_ref):
 *         return cls(None, None, _impl=df_ref)             # <<<<<<<<<<<<<<
 * 
 *     # Aliases
 */
  __pyx_tuple__20 = PyTuple_Pack(2, Py_None, Py_None); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 574, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__20);
  __Pyx_GIVEREF(__pyx_tuple__20);

  /* "amplpy/environment.pxi":29
 *         if os.name == "nt":
 *             # Workaround for Windows issue with environment variables
 *             for option_name in ["ampl_libpath", "solver"]:             # <<<<<<<<<<<<<<
 *                 option_value = os.environ.get(option_name, "")
 *                 if option_value:
 */
  __pyx_tuple__23 = PyTuple_Pack(2, __pyx_n_u_ampl_libpath, __pyx_n_u_solver); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(10, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__23);
  __Pyx_GIVEREF(__pyx_tuple__23);

  /* "amplpy/iterators.pxi":64
 *             errorinfo = campl.AMPL_GetParameters(entityit._c_ampl, &entityit._size, &entityit.begin)
 *         else:
 *             raise ValueError(f"Unknown entity class.")             # <<<<<<<<<<<<<<
 * 
 *         rc = campl.AMPL_ErrorInfoGetError(errorinfo)
 */
  __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_u_Unknown_entity_class); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(6, 64, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__27);
  __Pyx_GIVEREF(__pyx_tuple__27);

  /* "amplpy/set.pxi":157
 *                         return float(value)
 *                     else:
 *                         raise TypeError("Excepted string or real.")             # <<<<<<<<<<<<<<
 * 
 *                 def cast_row(row):
 */
  __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_u_Excepted_string_or_real); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(14, 157, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__28);
  __Pyx_GIVEREF(__pyx_tuple__28);

  /* "amplpy/set.pxi":134
 *         if not self.is_scalar():
 *             if not isinstance(values, dict):
 *                 raise TypeError("Excepted dictionary of set members for each index.")             # <<<<<<<<<<<<<<
 *             for index, members in values.items():
 *                 self[index].set_values(members)
 */
  __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_u_Excepted_dictionary_of_set_membe); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(14, 134, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__29);
  __Pyx_GIVEREF(__pyx_tuple__29);

  /* "amplpy/set.pxi":151
 *             else:
 * 
 *                 def cast_value(value):             # <<<<<<<<<<<<<<
 *                     if isinstance(value, str):
 *                         return value
 */
  __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_set_pxi, __pyx_n_s_cast_value, 151, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(14, 151, __pyx_L1_error)

  /* "amplpy/set.pxi":159
 *                         raise TypeError("Excepted string or real.")
 * 
 *                 def cast_row(row):             # <<<<<<<<<<<<<<
 *                     if isinstance(row, str):
 *                         return row
 */
  __pyx_tuple__31 = PyTuple_Pack(1, __pyx_n_s_row); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(14, 159, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__31);
  __Pyx_GIVEREF(__pyx_tuple__31);
  __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_set_pxi, __pyx_n_s_cast_row, 159, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(14, 159, __pyx_L1_error)

  /* "amplpy/ampl.pyx":133
 *         except RuntimeError as exp:
 *             if str(exp).startswith("AMPL could not be started"):
 *                 print("*" * 79, file=sys.stderr)             # <<<<<<<<<<<<<<
 *                 for line in AMPL_NOT_FOUND_MESSAGE.split("\n"):
 *                     print(f"* {line:75} *", file=sys.stderr)
 */
  __pyx_tuple__37 = PyTuple_Pack(1, __pyx_kp_u__36); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(3, 133, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__37);
  __Pyx_GIVEREF(__pyx_tuple__37);

  /* "amplpy/ampl.pyx":362
 *         """
 *         # Workaround for #56
 *         if not statements.endswith((" ", ";", "\n")):             # <<<<<<<<<<<<<<
 *             statements += "\n"
 *         try:
 */
  __pyx_tuple__42 = PyTuple_Pack(3, __pyx_kp_u__40, __pyx_kp_u__41, __pyx_kp_u__25); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(3, 362, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__42);
  __Pyx_GIVEREF(__pyx_tuple__42);

  /* "amplpy/ampl.pyx":663
 *         cdef const char** array = <const char**>malloc(size * sizeof(const char*))
 *         if array == NULL:
 *             raise MemoryError("Unable to allocate memory for array of strings")             # <<<<<<<<<<<<<<
 * 
 *         for i in range(size):
 */
  __pyx_tuple__43 = PyTuple_Pack(1, __pyx_kp_u_Unable_to_allocate_memory_for_ar); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(3, 663, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__43);
  __Pyx_GIVEREF(__pyx_tuple__43);

  /* "amplpy/ampl.pyx":774
 *         """
 * 
 *         class Variables(object):             # <<<<<<<<<<<<<<
 *             def __init__(self, ampl):
 *                 self.ampl = ampl
 */
  __pyx_tuple__44 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(3, 774, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__44);
  __Pyx_GIVEREF(__pyx_tuple__44);
  __pyx_tuple__45 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(3, 774, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__45);
  __Pyx_GIVEREF(__pyx_tuple__45);

  /* "amplpy/ampl.pyx":775
 * 
 *         class Variables(object):
 *             def __init__(self, ampl):             # <<<<<<<<<<<<<<
 *                 self.ampl = ampl
 * 
 */
  __pyx_tuple__46 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_ampl); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(3, 775, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__46);
  __Pyx_GIVEREF(__pyx_tuple__46);
  __pyx_codeobj__47 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__46, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_ampl_pyx, __pyx_n_s_init, 775, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__47)) __PYX_ERR(3, 775, __pyx_L1_error)

  /* "amplpy/ampl.pyx":778
 *                 self.ampl = ampl
 * 
 *             def __getitem__(self, name):             # <<<<<<<<<<<<<<
 *                 return self.ampl.get_variable(name)
 * 
 */
  __pyx_tuple__48 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_name); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(3, 778, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__48);
  __Pyx_GIVEREF(__pyx_tuple__48);
  __pyx_codeobj__49 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__48, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_ampl_pyx, __pyx_n_s_getitem, 778, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__49)) __PYX_ERR(3, 778, __pyx_L1_error)

  /* "amplpy/ampl.pyx":781
 *                 return self.ampl.get_variable(name)
 * 
 *             def __setitem__(self, name, value):             # <<<<<<<<<<<<<<
 *                 if isinstance(value, Real):
 *                     self.ampl.get_variable(name).set_value(value)
 */
  __pyx_tuple__50 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_name, __pyx_n_s_value); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(3, 781, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__50);
  __Pyx_GIVEREF(__pyx_tuple__50);
  __pyx_codeobj__51 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__50, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_ampl_pyx, __pyx_n_s_setitem, 781, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__51)) __PYX_ERR(3, 781, __pyx_L1_error)

  /* "amplpy/ampl.pyx":787
 *                     self.ampl.get_variable(name).set_values(value)
 * 
 *             def __iter__(self):             # <<<<<<<<<<<<<<
 *                 return self.ampl.get_variables()
 * 
 */
  __pyx_tuple__52 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(3, 787, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__52);
  __Pyx_GIVEREF(__pyx_tuple__52);
  __pyx_codeobj__53 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 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_amplpy_ampl_pyx, __pyx_n_s_iter, 787, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__53)) __PYX_ERR(3, 787, __pyx_L1_error)

  /* "amplpy/ampl.pyx":797
 *         """
 * 
 *         class Constraints(object):             # <<<<<<<<<<<<<<
 *             def __init__(self, ampl):
 *                 self.ampl = ampl
 */
  __pyx_tuple__54 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(3, 797, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__54);
  __Pyx_GIVEREF(__pyx_tuple__54);
  __pyx_tuple__55 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(3, 797, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__55);
  __Pyx_GIVEREF(__pyx_tuple__55);

  /* "amplpy/ampl.pyx":798
 * 
 *         class Constraints(object):
 *             def __init__(self, ampl):             # <<<<<<<<<<<<<<
 *                 self.ampl = ampl
 * 
 */
  __pyx_codeobj__56 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__46, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_ampl_pyx, __pyx_n_s_init, 798, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__56)) __PYX_ERR(3, 798, __pyx_L1_error)

  /* "amplpy/ampl.pyx":801
 *                 self.ampl = ampl
 * 
 *             def __getitem__(self, name):             # <<<<<<<<<<<<<<
 *                 return self.ampl.get_constraint(name)
 * 
 */
  __pyx_codeobj__57 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__48, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_ampl_pyx, __pyx_n_s_getitem, 801, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__57)) __PYX_ERR(3, 801, __pyx_L1_error)

  /* "amplpy/ampl.pyx":804
 *                 return self.ampl.get_constraint(name)
 * 
 *             def __setitem__(self, name, value):             # <<<<<<<<<<<<<<
 *                 self.ampl.get_constraint(name).set_dual(value)
 *                 if isinstance(value, Real):
 */
  __pyx_codeobj__58 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__50, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_ampl_pyx, __pyx_n_s_setitem, 804, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__58)) __PYX_ERR(3, 804, __pyx_L1_error)

  /* "amplpy/ampl.pyx":811
 *                     self.ampl.get_constraint(name).set_values(value)
 * 
 *             def __iter__(self):             # <<<<<<<<<<<<<<
 *                 return self.ampl.get_constraints()
 * 
 */
  __pyx_codeobj__59 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 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_amplpy_ampl_pyx, __pyx_n_s_iter, 811, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__59)) __PYX_ERR(3, 811, __pyx_L1_error)

  /* "amplpy/ampl.pyx":821
 *         """
 * 
 *         class Objectives(object):             # <<<<<<<<<<<<<<
 *             def __init__(self, ampl):
 *                 self.ampl = ampl
 */
  __pyx_tuple__60 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__60)) __PYX_ERR(3, 821, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__60);
  __Pyx_GIVEREF(__pyx_tuple__60);
  __pyx_tuple__61 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(3, 821, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__61);
  __Pyx_GIVEREF(__pyx_tuple__61);

  /* "amplpy/ampl.pyx":822
 * 
 *         class Objectives(object):
 *             def __init__(self, ampl):             # <<<<<<<<<<<<<<
 *                 self.ampl = ampl
 * 
 */
  __pyx_codeobj__62 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__46, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_ampl_pyx, __pyx_n_s_init, 822, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__62)) __PYX_ERR(3, 822, __pyx_L1_error)

  /* "amplpy/ampl.pyx":825
 *                 self.ampl = ampl
 * 
 *             def __getitem__(self, name):             # <<<<<<<<<<<<<<
 *                 return self.ampl.get_objective(name)
 * 
 */
  __pyx_codeobj__63 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__48, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_ampl_pyx, __pyx_n_s_getitem, 825, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__63)) __PYX_ERR(3, 825, __pyx_L1_error)

  /* "amplpy/ampl.pyx":828
 *                 return self.ampl.get_objective(name)
 * 
 *             def __iter__(self):             # <<<<<<<<<<<<<<
 *                 return self.ampl.get_objectives()
 * 
 */
  __pyx_codeobj__64 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 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_amplpy_ampl_pyx, __pyx_n_s_iter, 828, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__64)) __PYX_ERR(3, 828, __pyx_L1_error)

  /* "amplpy/ampl.pyx":838
 *         """
 * 
 *         class Sets(object):             # <<<<<<<<<<<<<<
 *             def __init__(self, ampl):
 *                 self.ampl = ampl
 */
  __pyx_tuple__65 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__65)) __PYX_ERR(3, 838, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__65);
  __Pyx_GIVEREF(__pyx_tuple__65);
  __pyx_tuple__66 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__66)) __PYX_ERR(3, 838, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__66);
  __Pyx_GIVEREF(__pyx_tuple__66);

  /* "amplpy/ampl.pyx":839
 * 
 *         class Sets(object):
 *             def __init__(self, ampl):             # <<<<<<<<<<<<<<
 *                 self.ampl = ampl
 * 
 */
  __pyx_codeobj__67 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__46, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_ampl_pyx, __pyx_n_s_init, 839, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__67)) __PYX_ERR(3, 839, __pyx_L1_error)

  /* "amplpy/ampl.pyx":842
 *                 self.ampl = ampl
 * 
 *             def __getitem__(self, name):             # <<<<<<<<<<<<<<
 *                 return self.ampl.get_set(name)
 * 
 */
  __pyx_codeobj__68 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__48, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_ampl_pyx, __pyx_n_s_getitem, 842, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__68)) __PYX_ERR(3, 842, __pyx_L1_error)

  /* "amplpy/ampl.pyx":845
 *                 return self.ampl.get_set(name)
 * 
 *             def __setitem__(self, name, values):             # <<<<<<<<<<<<<<
 *                 self.ampl.get_set(name).set_values(values)
 * 
 */
  __pyx_tuple__69 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_name, __pyx_n_s_values); if (unlikely(!__pyx_tuple__69)) __PYX_ERR(3, 845, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__69);
  __Pyx_GIVEREF(__pyx_tuple__69);
  __pyx_codeobj__70 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_ampl_pyx, __pyx_n_s_setitem, 845, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__70)) __PYX_ERR(3, 845, __pyx_L1_error)

  /* "amplpy/ampl.pyx":848
 *                 self.ampl.get_set(name).set_values(values)
 * 
 *             def __iter__(self):             # <<<<<<<<<<<<<<
 *                 return self.ampl.get_sets()
 * 
 */
  __pyx_codeobj__71 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 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_amplpy_ampl_pyx, __pyx_n_s_iter, 848, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__71)) __PYX_ERR(3, 848, __pyx_L1_error)

  /* "amplpy/ampl.pyx":858
 *         """
 * 
 *         class Parameters(object):             # <<<<<<<<<<<<<<
 *             def __init__(self, ampl):
 *                 self.ampl = ampl
 */
  __pyx_tuple__72 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__72)) __PYX_ERR(3, 858, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__72);
  __Pyx_GIVEREF(__pyx_tuple__72);
  __pyx_tuple__73 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__73)) __PYX_ERR(3, 858, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__73);
  __Pyx_GIVEREF(__pyx_tuple__73);

  /* "amplpy/ampl.pyx":859
 * 
 *         class Parameters(object):
 *             def __init__(self, ampl):             # <<<<<<<<<<<<<<
 *                 self.ampl = ampl
 * 
 */
  __pyx_codeobj__74 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__46, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_ampl_pyx, __pyx_n_s_init, 859, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__74)) __PYX_ERR(3, 859, __pyx_L1_error)

  /* "amplpy/ampl.pyx":862
 *                 self.ampl = ampl
 * 
 *             def __getitem__(self, name):             # <<<<<<<<<<<<<<
 *                 return self.ampl.get_parameter(name)
 * 
 */
  __pyx_codeobj__75 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__48, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_ampl_pyx, __pyx_n_s_getitem, 862, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__75)) __PYX_ERR(3, 862, __pyx_L1_error)

  /* "amplpy/ampl.pyx":865
 *                 return self.ampl.get_parameter(name)
 * 
 *             def __setitem__(self, name, value):             # <<<<<<<<<<<<<<
 *                 if isinstance(value, (Real, str)):
 *                     self.ampl.get_parameter(name).set(value)
 */
  __pyx_codeobj__76 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__50, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_ampl_pyx, __pyx_n_s_setitem, 865, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__76)) __PYX_ERR(3, 865, __pyx_L1_error)

  /* "amplpy/ampl.pyx":871
 *                     self.ampl.get_parameter(name).set_values(value)
 * 
 *             def __iter__(self):             # <<<<<<<<<<<<<<
 *                 return self.ampl.get_parameters()
 * 
 */
  __pyx_codeobj__77 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 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_amplpy_ampl_pyx, __pyx_n_s_iter, 871, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__77)) __PYX_ERR(3, 871, __pyx_L1_error)

  /* "amplpy/ampl.pyx":881
 *         """
 * 
 *         class Options(object):             # <<<<<<<<<<<<<<
 *             def __init__(self, ampl):
 *                 self.ampl = ampl
 */
  __pyx_tuple__78 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__78)) __PYX_ERR(3, 881, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__78);
  __Pyx_GIVEREF(__pyx_tuple__78);
  __pyx_tuple__79 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__79)) __PYX_ERR(3, 881, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__79);
  __Pyx_GIVEREF(__pyx_tuple__79);

  /* "amplpy/ampl.pyx":882
 * 
 *         class Options(object):
 *             def __init__(self, ampl):             # <<<<<<<<<<<<<<
 *                 self.ampl = ampl
 * 
 */
  __pyx_codeobj__80 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__46, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_ampl_pyx, __pyx_n_s_init, 882, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__80)) __PYX_ERR(3, 882, __pyx_L1_error)

  /* "amplpy/ampl.pyx":885
 *                 self.ampl = ampl
 * 
 *             def __getitem__(self, name):             # <<<<<<<<<<<<<<
 *                 return self.ampl.get_option(name)
 * 
 */
  __pyx_codeobj__81 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__48, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_ampl_pyx, __pyx_n_s_getitem, 885, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__81)) __PYX_ERR(3, 885, __pyx_L1_error)

  /* "amplpy/ampl.pyx":888
 *                 return self.ampl.get_option(name)
 * 
 *             def __setitem__(self, name, value):             # <<<<<<<<<<<<<<
 *                 self.ampl.set_option(name, value)
 * 
 */
  __pyx_codeobj__82 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__50, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_ampl_pyx, __pyx_n_s_setitem, 888, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__82)) __PYX_ERR(3, 888, __pyx_L1_error)

  /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum not in (0xe3b0c44, 0xda39a3e, 0xd41d8cd):             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe3b0c44, 0xda39a3e, 0xd41d8cd) = ())" % __pyx_checksum
 */
  __pyx_tuple__83 = PyTuple_Pack(3, __pyx_int_238750788, __pyx_int_228825662, __pyx_int_222419149); if (unlikely(!__pyx_tuple__83)) __PYX_ERR(8, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__83);
  __Pyx_GIVEREF(__pyx_tuple__83);

  /* "amplpy/constraint.pxi":47
 *         self.__getitem__(index).set_dual(value)
 * 
 *     def is_logical(self):             # <<<<<<<<<<<<<<
 *         """
 *         Check if the constraint is a logical constraint. Returns True if
 */
  __pyx_tuple__85 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_value); if (unlikely(!__pyx_tuple__85)) __PYX_ERR(5, 47, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__85);
  __Pyx_GIVEREF(__pyx_tuple__85);
  __pyx_codeobj__86 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__85, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_constraint_pxi, __pyx_n_s_is_logical, 47, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__86)) __PYX_ERR(5, 47, __pyx_L1_error)

  /* "amplpy/constraint.pxi":63
 *             return False
 * 
 *     def drop(self):             # <<<<<<<<<<<<<<
 *         """
 *         Drop all instances in this constraint entity, corresponding to the AMPL
 */
  __pyx_codeobj__87 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 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_amplpy_constraint_pxi, __pyx_n_s_drop, 63, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__87)) __PYX_ERR(5, 63, __pyx_L1_error)

  /* "amplpy/constraint.pxi":70
 *         PY_AMPL_CALL(campl.AMPL_EntityDrop(self._c_ampl, self._name))
 * 
 *     def restore(self):             # <<<<<<<<<<<<<<
 *         """
 *         Restore all instances in this constraint entity, corresponding to the
 */
  __pyx_codeobj__88 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 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_amplpy_constraint_pxi, __pyx_n_s_restore, 70, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__88)) __PYX_ERR(5, 70, __pyx_L1_error)

  /* "amplpy/constraint.pxi":77
 *         PY_AMPL_CALL(campl.AMPL_EntityRestore(self._c_ampl, self._name))
 * 
 *     def body(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the current value of the constraint's body.
 */
  __pyx_codeobj__89 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__85, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_constraint_pxi, __pyx_n_s_body, 77, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__89)) __PYX_ERR(5, 77, __pyx_L1_error)

  /* "amplpy/constraint.pxi":85
 *         return value
 * 
 *     def astatus(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the current AMPL status (dropped, presolved, or substituted out).
 */
  __pyx_tuple__90 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_errorinfo, __pyx_n_s_rc, __pyx_n_s_value_c, __pyx_n_s_value); if (unlikely(!__pyx_tuple__90)) __PYX_ERR(5, 85, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__90);
  __Pyx_GIVEREF(__pyx_tuple__90);
  __pyx_codeobj__91 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__90, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_constraint_pxi, __pyx_n_s_astatus, 85, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__91)) __PYX_ERR(5, 85, __pyx_L1_error)

  /* "amplpy/constraint.pxi":102
 *         return value
 * 
 *     def defvar(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the index in `_var` of "defined variable" substituted out by the
 */
  __pyx_codeobj__92 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__85, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_constraint_pxi, __pyx_n_s_defvar, 102, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__92)) __PYX_ERR(5, 102, __pyx_L1_error)

  /* "amplpy/constraint.pxi":111
 *         return value
 * 
 *     def dinit(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the current initial guess for the constraint's dual variable.
 */
  __pyx_codeobj__93 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__85, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_constraint_pxi, __pyx_n_s_dinit, 111, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__93)) __PYX_ERR(5, 111, __pyx_L1_error)

  /* "amplpy/constraint.pxi":119
 *         return value
 * 
 *     def dinit0(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the original initial guess for the constraint's dual variable.
 */
  __pyx_codeobj__94 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__85, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_constraint_pxi, __pyx_n_s_dinit0, 119, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__94)) __PYX_ERR(5, 119, __pyx_L1_error)

  /* "amplpy/constraint.pxi":127
 *         return value
 * 
 *     def dual(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the current value of the constraint's dual variable.
 */
  __pyx_codeobj__95 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__85, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_constraint_pxi, __pyx_n_s_dual, 127, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__95)) __PYX_ERR(5, 127, __pyx_L1_error)

  /* "amplpy/constraint.pxi":140
 *         return value
 * 
 *     def lb(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the current value of the constraint's lower bound.
 */
  __pyx_codeobj__96 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__85, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_constraint_pxi, __pyx_n_s_lb, 140, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__96)) __PYX_ERR(5, 140, __pyx_L1_error)

  /* "amplpy/constraint.pxi":148
 *         return value
 * 
 *     def ub(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the current value of the constraint's upper bound.
 */
  __pyx_codeobj__97 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__85, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_constraint_pxi, __pyx_n_s_ub, 148, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__97)) __PYX_ERR(5, 148, __pyx_L1_error)

  /* "amplpy/constraint.pxi":156
 *         return value
 * 
 *     def lbs(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the constraint lower bound sent to the solver (reflecting
 */
  __pyx_codeobj__98 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__85, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_constraint_pxi, __pyx_n_s_lbs, 156, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__98)) __PYX_ERR(5, 156, __pyx_L1_error)

  /* "amplpy/constraint.pxi":165
 *         return value
 * 
 *     def ubs(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the constraint upper bound sent to the solver (reflecting
 */
  __pyx_codeobj__99 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__85, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_constraint_pxi, __pyx_n_s_ubs, 165, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__99)) __PYX_ERR(5, 165, __pyx_L1_error)

  /* "amplpy/constraint.pxi":174
 *         return value
 * 
 *     def ldual(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the current dual value associated with the lower bound.
 */
  __pyx_codeobj__100 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__85, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_constraint_pxi, __pyx_n_s_ldual, 174, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__100)) __PYX_ERR(5, 174, __pyx_L1_error)

  /* "amplpy/constraint.pxi":182
 *         return value
 * 
 *     def udual(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the current dual value associated with the upper bounds.
 */
  __pyx_codeobj__101 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__85, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_constraint_pxi, __pyx_n_s_udual, 182, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__101)) __PYX_ERR(5, 182, __pyx_L1_error)

  /* "amplpy/constraint.pxi":190
 *         return value
 * 
 *     def lslack(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the slack at lower bound `body - lb`.
 */
  __pyx_codeobj__102 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__85, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_constraint_pxi, __pyx_n_s_lslack, 190, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__102)) __PYX_ERR(5, 190, __pyx_L1_error)

  /* "amplpy/constraint.pxi":198
 *         return value
 * 
 *     def uslack(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the slack at upper bound `ub - body`.
 */
  __pyx_codeobj__103 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__85, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_constraint_pxi, __pyx_n_s_uslack, 198, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__103)) __PYX_ERR(5, 198, __pyx_L1_error)

  /* "amplpy/constraint.pxi":206
 *         return value
 * 
 *     def slack(self):             # <<<<<<<<<<<<<<
 *         """
 *         Constraint slack (the lesser of lslack and uslack).
 */
  __pyx_codeobj__104 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__85, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_constraint_pxi, __pyx_n_s_slack, 206, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__104)) __PYX_ERR(5, 206, __pyx_L1_error)

  /* "amplpy/constraint.pxi":214
 *         return value
 * 
 *     def sstatus(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the solver status (basis status of constraint's slack or artificial
 */
  __pyx_codeobj__105 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__90, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_constraint_pxi, __pyx_n_s_sstatus, 214, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__105)) __PYX_ERR(5, 214, __pyx_L1_error)

  /* "amplpy/constraint.pxi":232
 *         return value
 * 
 *     def status(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the AMPL status if not `in`, otherwise solver status.
 */
  __pyx_codeobj__106 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__90, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_constraint_pxi, __pyx_n_s_status, 232, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__106)) __PYX_ERR(5, 232, __pyx_L1_error)

  /* "amplpy/constraint.pxi":249
 *         return value
 * 
 *     def set_dual(self, dual):             # <<<<<<<<<<<<<<
 *         """
 *         Set the value of the dual variable associated to this constraint (valid
 */
  __pyx_tuple__107 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_dual); if (unlikely(!__pyx_tuple__107)) __PYX_ERR(5, 249, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__107);
  __Pyx_GIVEREF(__pyx_tuple__107);
  __pyx_codeobj__108 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__107, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_constraint_pxi, __pyx_n_s_set_dual, 249, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__108)) __PYX_ERR(5, 249, __pyx_L1_error)

  /* "amplpy/constraint.pxi":266
 *         PY_AMPL_CALL(campl.AMPL_ConstraintSetDual(self._c_ampl, self._name, float(dual)))
 * 
 *     def val(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the AMPL val suffix. Valid only for logical constraints.
 */
  __pyx_codeobj__109 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__85, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_constraint_pxi, __pyx_n_s_val, 266, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__109)) __PYX_ERR(5, 266, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._c_ampl,self._index cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_codeobj__110 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 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_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__110)) __PYX_ERR(8, 1, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._c_ampl,self._index cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._c_ampl,self._index cannot be converted to a Python object for pickling"
 */
  __pyx_tuple__111 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__111)) __PYX_ERR(8, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__111);
  __Pyx_GIVEREF(__pyx_tuple__111);
  __pyx_codeobj__112 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__111, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__112)) __PYX_ERR(8, 3, __pyx_L1_error)

  /* "amplpy/dataframe.pxi":42
 *         return to_py_variant(v)
 * 
 *     def to_string(self):             # <<<<<<<<<<<<<<
 *         return str(list(self))
 * 
 */
  __pyx_codeobj__113 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 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_amplpy_dataframe_pxi, __pyx_n_s_to_string, 42, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__113)) __PYX_ERR(0, 42, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._df cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_codeobj__114 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 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_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__114)) __PYX_ERR(8, 1, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._df cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._df cannot be converted to a Python object for pickling"
 */
  __pyx_codeobj__115 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__111, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__115)) __PYX_ERR(8, 3, __pyx_L1_error)

  /* "amplpy/dataframe.pxi":69
 *         return ColIterator.create(self._df, self._index)
 * 
 *     def to_string(self):             # <<<<<<<<<<<<<<
 *         return str(self.to_list())
 * 
 */
  __pyx_codeobj__116 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 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_amplpy_dataframe_pxi, __pyx_n_s_to_string, 69, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__116)) __PYX_ERR(0, 69, __pyx_L1_error)

  /* "amplpy/dataframe.pxi":72
 *         return str(self.to_list())
 * 
 *     def to_list(self):             # <<<<<<<<<<<<<<
 *         py_list = []
 *         cdef campl.AMPL_VARIANT* v
 */
  __pyx_tuple__117 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_py_list, __pyx_n_s_v, __pyx_n_s_rowindex, __pyx_n_s_i); if (unlikely(!__pyx_tuple__117)) __PYX_ERR(0, 72, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__117);
  __Pyx_GIVEREF(__pyx_tuple__117);
  __pyx_codeobj__118 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__117, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_dataframe_pxi, __pyx_n_s_to_list, 72, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__118)) __PYX_ERR(0, 72, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._df cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_codeobj__119 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 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_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__119)) __PYX_ERR(8, 1, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._df cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._df cannot be converted to a Python object for pickling"
 */
  __pyx_codeobj__120 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__111, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__120)) __PYX_ERR(8, 3, __pyx_L1_error)

  /* "amplpy/dataframe.pxi":183
 *         campl.AMPL_DataFrameFree(&self._c_df)
 * 
 *     def to_string(self):             # <<<<<<<<<<<<<<
 *         cdef char* value_c
 *         PY_AMPL_CALL(campl.AMPL_DataFrameToString(self._c_df, &value_c))
 */
  __pyx_tuple__121 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_value_c, __pyx_n_s_value); if (unlikely(!__pyx_tuple__121)) __PYX_ERR(0, 183, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__121);
  __Pyx_GIVEREF(__pyx_tuple__121);
  __pyx_codeobj__122 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__121, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_dataframe_pxi, __pyx_n_s_to_string, 183, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__122)) __PYX_ERR(0, 183, __pyx_L1_error)

  /* "amplpy/dataframe.pxi":197
 *         return (self._get_row_by_index(i) for i in range(self._get_num_rows()))
 * 
 *     def _get_num_cols(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the total number of columns in this dataframe (indexarity + number
 */
  __pyx_tuple__123 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_num); if (unlikely(!__pyx_tuple__123)) __PYX_ERR(0, 197, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__123);
  __Pyx_GIVEREF(__pyx_tuple__123);
  __pyx_codeobj__124 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__123, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_dataframe_pxi, __pyx_n_s_get_num_cols, 197, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__124)) __PYX_ERR(0, 197, __pyx_L1_error)

  /* "amplpy/dataframe.pxi":209
 *         return int(num)
 * 
 *     def _get_num_rows(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the number of data rows in this dataframe.
 */
  __pyx_codeobj__125 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__123, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_dataframe_pxi, __pyx_n_s_get_num_rows, 209, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__125)) __PYX_ERR(0, 209, __pyx_L1_error)

  /* "amplpy/dataframe.pxi":220
 *         return int(num)
 * 
 *     def _get_num_indices(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the number of indices (the indexarity) of this dataframe.
 */
  __pyx_codeobj__126 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__123, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_dataframe_pxi, __pyx_n_s_get_num_indices, 220, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__126)) __PYX_ERR(0, 220, __pyx_L1_error)

  /* "amplpy/dataframe.pxi":231
 *         return int(num)
 * 
 *     def _add_row(self, *value):             # <<<<<<<<<<<<<<
 *         """
 *         Add a row to the DataFrame. The size of the tuple must be equal to the
 */
  __pyx_tuple__127 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_value, __pyx_n_s_tuple_c); if (unlikely(!__pyx_tuple__127)) __PYX_ERR(0, 231, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__127);
  __Pyx_GIVEREF(__pyx_tuple__127);
  __pyx_codeobj__128 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__127, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_dataframe_pxi, __pyx_n_s_add_row, 231, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__128)) __PYX_ERR(0, 231, __pyx_L1_error)

  /* "amplpy/dataframe.pxi":248
 *         campl.AMPL_TupleFree(&tuple_c)
 * 
 *     def _add_column(self, header, values=None):             # <<<<<<<<<<<<<<
 *         """
 *         Add a new column with the corresponding header and values to the
 */
  __pyx_tuple__129 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_header, __pyx_n_s_values, __pyx_n_s_size, __pyx_n_s_c_string_array, __pyx_n_s_c_double_array, __pyx_n_s_i, __pyx_n_s_genexpr, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__129)) __PYX_ERR(0, 248, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__129);
  __Pyx_GIVEREF(__pyx_tuple__129);
  __pyx_codeobj__130 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__129, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_dataframe_pxi, __pyx_n_s_add_column, 248, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__130)) __PYX_ERR(0, 248, __pyx_L1_error)
  __pyx_tuple__131 = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_tuple__131)) __PYX_ERR(0, 248, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__131);
  __Pyx_GIVEREF(__pyx_tuple__131);

  /* "amplpy/dataframe.pxi":289
 *                 raise NotImplementedError
 * 
 *     def _get_column(self, header):             # <<<<<<<<<<<<<<
 *         """
 *         Get the specified column as a view object.
 */
  __pyx_tuple__132 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_header, __pyx_n_s_index); if (unlikely(!__pyx_tuple__132)) __PYX_ERR(0, 289, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__132);
  __Pyx_GIVEREF(__pyx_tuple__132);
  __pyx_codeobj__133 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__132, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_dataframe_pxi, __pyx_n_s_get_column, 289, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__133)) __PYX_ERR(0, 289, __pyx_L1_error)

  /* "amplpy/dataframe.pxi":300
 *         return Column.create(self._c_df, index)
 * 
 *     def _set_column(self, header, values):             # <<<<<<<<<<<<<<
 *         """
 *         Set the values of a column.
 */
  __pyx_tuple__134 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_header, __pyx_n_s_values, __pyx_n_s_errorinfo, __pyx_n_s_rc, __pyx_n_s_c_double_array, __pyx_n_s_c_string_array, __pyx_n_s_size, __pyx_n_s_i); if (unlikely(!__pyx_tuple__134)) __PYX_ERR(0, 300, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__134);
  __Pyx_GIVEREF(__pyx_tuple__134);
  __pyx_codeobj__135 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__134, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_dataframe_pxi, __pyx_n_s_set_column, 300, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__135)) __PYX_ERR(0, 300, __pyx_L1_error)

  /* "amplpy/dataframe.pxi":336
 *                 PY_AMPL_CALL(errorinfo)
 * 
 *     def _get_row(self, key):             # <<<<<<<<<<<<<<
 *         """
 *         Get a row by value of the indexing columns. If the index is not
 */
  __pyx_tuple__136 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_key, __pyx_n_s_index, __pyx_n_s_tuple); if (unlikely(!__pyx_tuple__136)) __PYX_ERR(0, 336, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__136);
  __Pyx_GIVEREF(__pyx_tuple__136);
  __pyx_codeobj__137 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__136, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_dataframe_pxi, __pyx_n_s_get_row, 336, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__137)) __PYX_ERR(0, 336, __pyx_L1_error)

  /* "amplpy/dataframe.pxi":353
 *         return Row.create(self._c_df, index)
 * 
 *     def _get_row_by_index(self, index):             # <<<<<<<<<<<<<<
 *         """
 *         Get row by numeric index.
 */
  __pyx_tuple__138 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_index); if (unlikely(!__pyx_tuple__138)) __PYX_ERR(0, 353, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__138);
  __Pyx_GIVEREF(__pyx_tuple__138);
  __pyx_codeobj__139 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__138, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_dataframe_pxi, __pyx_n_s_get_row_by_index, 353, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__139)) __PYX_ERR(0, 353, __pyx_L1_error)

  /* "amplpy/dataframe.pxi":365
 *         return Row.create(self._c_df, index)
 * 
 *     def _get_headers(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the headers of this DataFrame.
 */
  __pyx_tuple__140 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_size, __pyx_n_s_headers, __pyx_n_s_headers_py, __pyx_n_s_i, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__140)) __PYX_ERR(0, 365, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__140);
  __Pyx_GIVEREF(__pyx_tuple__140);
  __pyx_codeobj__141 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__140, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_dataframe_pxi, __pyx_n_s_get_headers, 365, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__141)) __PYX_ERR(0, 365, __pyx_L1_error)

  /* "amplpy/dataframe.pxi":381
 *         return headers_py
 * 
 *     def _set_values(self, values):             # <<<<<<<<<<<<<<
 *         """
 *         Set the values of a DataFrame from a dictionary.
 */
  __pyx_tuple__142 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_values, __pyx_n_s_ncols, __pyx_n_s_nindices, __pyx_n_s_conv_to_list, __pyx_n_s_conv_to_list, __pyx_n_s_key, __pyx_n_s_value); if (unlikely(!__pyx_tuple__142)) __PYX_ERR(0, 381, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__142);
  __Pyx_GIVEREF(__pyx_tuple__142);
  __pyx_codeobj__143 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__142, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_dataframe_pxi, __pyx_n_s_set_values_2, 381, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__143)) __PYX_ERR(0, 381, __pyx_L1_error)

  /* "amplpy/dataframe.pxi":406
 *             self._add_row(key + value)
 * 
 *     def to_dict(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return a dictionary with the DataFrame data.
 */
  __pyx_tuple__144 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_d, __pyx_n_s_nindices, __pyx_n_s_data, __pyx_n_s_row, __pyx_n_s_key, __pyx_n_s_header); if (unlikely(!__pyx_tuple__144)) __PYX_ERR(0, 406, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__144);
  __Pyx_GIVEREF(__pyx_tuple__144);
  __pyx_codeobj__145 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__144, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_dataframe_pxi, __pyx_n_s_to_dict, 406, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__145)) __PYX_ERR(0, 406, __pyx_L1_error)

  /* "amplpy/dataframe.pxi":430
 *         return d
 * 
 *     def to_list(self, skip_index=False):             # <<<<<<<<<<<<<<
 *         """
 *         Return a list with the DataFrame data.
 */
  __pyx_tuple__146 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_skip_index, __pyx_n_s_lst, __pyx_n_s_ncols, __pyx_n_s_nindices, __pyx_n_s_i, __pyx_n_s_i, __pyx_n_s_row, __pyx_n_s_row); if (unlikely(!__pyx_tuple__146)) __PYX_ERR(0, 430, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__146);
  __Pyx_GIVEREF(__pyx_tuple__146);
  __pyx_codeobj__147 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__146, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_dataframe_pxi, __pyx_n_s_to_list, 430, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__147)) __PYX_ERR(0, 430, __pyx_L1_error)
  __pyx_tuple__148 = PyTuple_Pack(1, Py_False); if (unlikely(!__pyx_tuple__148)) __PYX_ERR(0, 430, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__148);
  __Pyx_GIVEREF(__pyx_tuple__148);

  /* "amplpy/dataframe.pxi":453
 *             return lst
 * 
 *     def to_pandas(self, multi_index=True):             # <<<<<<<<<<<<<<
 *         """
 *         Return a pandas.DataFrame with the DataFrame data.
 */
  __pyx_tuple__149 = PyTuple_Pack(11, __pyx_n_s_self, __pyx_n_s_multi_index, __pyx_n_s_nindices, __pyx_n_s_headers, __pyx_n_s_columns, __pyx_n_s_index_names, __pyx_n_s_index, __pyx_n_s_header, __pyx_n_s_header, __pyx_n_s_header, __pyx_n_s_key); if (unlikely(!__pyx_tuple__149)) __PYX_ERR(0, 453, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__149);
  __Pyx_GIVEREF(__pyx_tuple__149);
  __pyx_codeobj__150 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__149, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_dataframe_pxi, __pyx_n_s_to_pandas, 453, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__150)) __PYX_ERR(0, 453, __pyx_L1_error)
  __pyx_tuple__151 = PyTuple_Pack(1, Py_True); if (unlikely(!__pyx_tuple__151)) __PYX_ERR(0, 453, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__151);
  __Pyx_GIVEREF(__pyx_tuple__151);

  /* "amplpy/dataframe.pxi":478
 *                 return pd.DataFrame(columns, index=index)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def from_dict(cls, dic, index_names=None, column_names=None):
 *         """
 */
  __pyx_tuple__152 = PyTuple_Pack(21, __pyx_n_s_cls, __pyx_n_s_dic, __pyx_n_s_index_names, __pyx_n_s_column_names, __pyx_n_s_to_tuple, __pyx_n_s_to_tuple, __pyx_n_s_lst_index, __pyx_n_s_lst_columns, __pyx_n_s_nindices, __pyx_n_s_ncolumns, __pyx_n_s_index, __pyx_n_s_columns, __pyx_n_s_genexpr, __pyx_n_s_genexpr, __pyx_n_s_genexpr, __pyx_n_s_i, __pyx_n_s_i, __pyx_n_s_i, __pyx_n_s_cindex, __pyx_n_s_i, __pyx_n_s_column); if (unlikely(!__pyx_tuple__152)) __PYX_ERR(0, 478, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__152);
  __Pyx_GIVEREF(__pyx_tuple__152);
  __pyx_codeobj__153 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 21, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__152, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_dataframe_pxi, __pyx_n_s_from_dict, 478, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__153)) __PYX_ERR(0, 478, __pyx_L1_error)

  /* "amplpy/dataframe.pxi":520
 *         return cls(index=index, columns=columns)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def from_pandas(cls, df, index_names=None, indexarity=None):
 *         """
 */
  __pyx_tuple__154 = PyTuple_Pack(12, __pyx_n_s_cls, __pyx_n_s_df, __pyx_n_s_index_names, __pyx_n_s_indexarity, __pyx_n_s_keys, __pyx_n_s_index, __pyx_n_s_i, __pyx_n_s_columns, __pyx_n_s_key, __pyx_n_s_i, __pyx_n_s_cindex, __pyx_n_s_cname); if (unlikely(!__pyx_tuple__154)) __PYX_ERR(0, 520, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__154);
  __Pyx_GIVEREF(__pyx_tuple__154);
  __pyx_codeobj__155 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__154, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_dataframe_pxi, __pyx_n_s_from_pandas, 520, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__155)) __PYX_ERR(0, 520, __pyx_L1_error)

  /* "amplpy/dataframe.pxi":554
 *         return cls(index=index, columns=columns)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def from_numpy(cls, data):
 *         """
 */
  __pyx_tuple__156 = PyTuple_Pack(6, __pyx_n_s_cls, __pyx_n_s_data, __pyx_n_s_index, __pyx_n_s_columns, __pyx_n_s_i, __pyx_n_s_col); if (unlikely(!__pyx_tuple__156)) __PYX_ERR(0, 554, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__156);
  __Pyx_GIVEREF(__pyx_tuple__156);
  __pyx_codeobj__157 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__156, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_dataframe_pxi, __pyx_n_s_from_numpy, 554, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__157)) __PYX_ERR(0, 554, __pyx_L1_error)

  /* "amplpy/dataframe.pxi":572
 *         return cls(index=index, columns=columns)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def _from_data_frame_ref(cls, df_ref):
 *         return cls(None, None, _impl=df_ref)
 */
  __pyx_tuple__158 = PyTuple_Pack(2, __pyx_n_s_cls, __pyx_n_s_df_ref); if (unlikely(!__pyx_tuple__158)) __PYX_ERR(0, 572, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__158);
  __Pyx_GIVEREF(__pyx_tuple__158);
  __pyx_codeobj__159 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__158, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_dataframe_pxi, __pyx_n_s_from_data_frame_ref, 572, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__159)) __PYX_ERR(0, 572, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_codeobj__160 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 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_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__160)) __PYX_ERR(8, 1, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */
  __pyx_codeobj__161 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__111, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__161)) __PYX_ERR(8, 3, __pyx_L1_error)

  /* "amplpy/entity.pxi":69
 *             campl.AMPL_StringFree(&self._name)
 * 
 *     def to_string(self):             # <<<<<<<<<<<<<<
 *         cdef char* output_c
 *         campl.AMPL_EntityGetDeclaration(self._c_ampl, self._name, &output_c)
 */
  __pyx_tuple__162 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_output_c, __pyx_n_s_output); if (unlikely(!__pyx_tuple__162)) __PYX_ERR(9, 69, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__162);
  __Pyx_GIVEREF(__pyx_tuple__162);
  __pyx_codeobj__163 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__162, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_entity_pxi, __pyx_n_s_to_string, 69, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__163)) __PYX_ERR(9, 69, __pyx_L1_error)

  /* "amplpy/entity.pxi":90
 *         return create_entity(self.wrap_function, self._c_ampl, self._name, tuple_c, self)
 * 
 *     def get(self, *index):             # <<<<<<<<<<<<<<
 *         """
 *         Get the instance with the specified index.
 */
  __pyx_tuple__164 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_index, __pyx_n_s_tuple_c, __pyx_n_s_name_c, __pyx_n_s_entity); if (unlikely(!__pyx_tuple__164)) __PYX_ERR(9, 90, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__164);
  __Pyx_GIVEREF(__pyx_tuple__164);
  __pyx_codeobj__165 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__164, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_entity_pxi, __pyx_n_s_get, 90, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__165)) __PYX_ERR(9, 90, __pyx_L1_error)

  /* "amplpy/entity.pxi":115
 *                 return create_entity(self.wrap_function, self._c_ampl, self._name, tuple_c, self)
 * 
 *     def find(self, index):             # <<<<<<<<<<<<<<
 *         """
 *         Searches the current entity for an instance with the specified index.
 */
  __pyx_tuple__166 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_index, __pyx_n_s_i, __pyx_n_s_index_c, __pyx_n_s_indices_c, __pyx_n_s_size, __pyx_n_s_j); if (unlikely(!__pyx_tuple__166)) __PYX_ERR(9, 115, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__166);
  __Pyx_GIVEREF(__pyx_tuple__166);
  __pyx_codeobj__167 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__166, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_entity_pxi, __pyx_n_s_find, 115, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__167)) __PYX_ERR(9, 115, __pyx_L1_error)

  /* "amplpy/entity.pxi":140
 *         return None
 * 
 *     def instances(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get all the instances in this entity.
 */
  __pyx_codeobj__168 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 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_amplpy_entity_pxi, __pyx_n_s_instances, 140, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__168)) __PYX_ERR(9, 140, __pyx_L1_error)

  /* "amplpy/entity.pxi":146
 *         return InstanceIterator.create(self._c_ampl, self._name, self.wrap_function, self)
 * 
 *     def name(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the name of this entity.
 */
  __pyx_codeobj__169 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 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_amplpy_entity_pxi, __pyx_n_s_name, 146, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__169)) __PYX_ERR(9, 146, __pyx_L1_error)

  /* "amplpy/entity.pxi":152
 *         return self._name.decode('utf-8')
 * 
 *     def indexarity(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the indexarity of this entity (sum of the dimensions of the
 */
  __pyx_tuple__170 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_indexarity); if (unlikely(!__pyx_tuple__170)) __PYX_ERR(9, 152, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__170);
  __Pyx_GIVEREF(__pyx_tuple__170);
  __pyx_codeobj__171 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__170, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_entity_pxi, __pyx_n_s_indexarity, 152, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__171)) __PYX_ERR(9, 152, __pyx_L1_error)

  /* "amplpy/entity.pxi":178
 *         return indexarity
 * 
 *     def is_scalar(self):             # <<<<<<<<<<<<<<
 *         """
 *         Check whether this entity is scalar. Equivalent to testing whether
 */
  __pyx_codeobj__172 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 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_amplpy_entity_pxi, __pyx_n_s_is_scalar, 178, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__172)) __PYX_ERR(9, 178, __pyx_L1_error)

  /* "amplpy/entity.pxi":191
 *             return True
 * 
 *     def num_instances(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the number of instances in this entity.
 */
  __pyx_tuple__173 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_size); if (unlikely(!__pyx_tuple__173)) __PYX_ERR(9, 191, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__173);
  __Pyx_GIVEREF(__pyx_tuple__173);
  __pyx_codeobj__174 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__173, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_entity_pxi, __pyx_n_s_num_instances, 191, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__174)) __PYX_ERR(9, 191, __pyx_L1_error)

  /* "amplpy/entity.pxi":199
 *         return int(size)
 * 
 *     def get_indexing_sets(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the AMPL string representation of the sets on which this entity is
 */
  __pyx_tuple__175 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_i, __pyx_n_s_size, __pyx_n_s_sets, __pyx_n_s_pylist); if (unlikely(!__pyx_tuple__175)) __PYX_ERR(9, 199, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__175);
  __Pyx_GIVEREF(__pyx_tuple__175);
  __pyx_codeobj__176 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__175, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_entity_pxi, __pyx_n_s_get_indexing_sets, 199, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__176)) __PYX_ERR(9, 199, __pyx_L1_error)

  /* "amplpy/entity.pxi":224
 *         return pylist
 * 
 *     def xref(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the names of all entities which depend on this one.
 */
  __pyx_tuple__177 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_size, __pyx_n_s_xref, __pyx_n_s_pylist, __pyx_n_s_i); if (unlikely(!__pyx_tuple__177)) __PYX_ERR(9, 224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__177);
  __Pyx_GIVEREF(__pyx_tuple__177);
  __pyx_codeobj__178 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__177, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_entity_pxi, __pyx_n_s_xref, 224, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__178)) __PYX_ERR(9, 224, __pyx_L1_error)

  /* "amplpy/entity.pxi":244
 *         return pylist
 * 
 *     def get_values(self, suffixes=None):             # <<<<<<<<<<<<<<
 *         """
 *         If a list of suffixes is provided, get the specified suffixes value for
 */
  __pyx_tuple__179 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_suffixes, __pyx_n_s_df_c, __pyx_n_s_suffixes_c, __pyx_n_s_n, __pyx_n_s_i); if (unlikely(!__pyx_tuple__179)) __PYX_ERR(9, 244, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__179);
  __Pyx_GIVEREF(__pyx_tuple__179);
  __pyx_codeobj__180 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__179, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_entity_pxi, __pyx_n_s_get_values, 244, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__180)) __PYX_ERR(9, 244, __pyx_L1_error)

  /* "amplpy/entity.pxi":286
 *         return DataFrame.create(df_c)
 * 
 *     def to_pandas(self, **kwargs):             # <<<<<<<<<<<<<<
 *         """
 *         Equivalent to ``Entity.get_values().``:func:`~amplpy.DataFrame.to_pandas`.
 */
  __pyx_tuple__181 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_kwargs); if (unlikely(!__pyx_tuple__181)) __PYX_ERR(9, 286, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__181);
  __Pyx_GIVEREF(__pyx_tuple__181);
  __pyx_codeobj__182 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__181, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_entity_pxi, __pyx_n_s_to_pandas, 286, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__182)) __PYX_ERR(9, 286, __pyx_L1_error)

  /* "amplpy/entity.pxi":292
 *         return self.get_values().to_pandas(**kwargs)
 * 
 *     def to_dict(self, **kwargs):             # <<<<<<<<<<<<<<
 *         """
 *         Equivalent to ``Entity.get_values().``:func:`~amplpy.DataFrame.to_dict`.
 */
  __pyx_codeobj__183 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__181, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_entity_pxi, __pyx_n_s_to_dict, 292, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__183)) __PYX_ERR(9, 292, __pyx_L1_error)

  /* "amplpy/entity.pxi":298
 *         return self.get_values().to_dict(**kwargs)
 * 
 *     def to_list(self, **kwargs):             # <<<<<<<<<<<<<<
 *         """
 *         Equivalent to ``Entity.get_values().``:func:`~amplpy.DataFrame.to_list`.
 */
  __pyx_codeobj__184 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__181, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_entity_pxi, __pyx_n_s_to_list, 298, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__184)) __PYX_ERR(9, 298, __pyx_L1_error)

  /* "amplpy/entity.pxi":304
 *         return self.get_values().to_list(**kwargs)
 * 
 *     def set_values(self, data):             # <<<<<<<<<<<<<<
 *         """
 *         Set the values of this entiy to the correponding values of a
 */
  __pyx_tuple__185 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_data, __pyx_n_s_df, __pyx_n_s_df_c, __pyx_n_s_name_c_2); if (unlikely(!__pyx_tuple__185)) __PYX_ERR(9, 304, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__185);
  __Pyx_GIVEREF(__pyx_tuple__185);
  __pyx_codeobj__186 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__185, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_entity_pxi, __pyx_n_s_set_values, 304, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__186)) __PYX_ERR(9, 304, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._c_ampl,self._index cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_codeobj__187 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 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_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__187)) __PYX_ERR(8, 1, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._c_ampl,self._index cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._c_ampl,self._index cannot be converted to a Python object for pickling"
 */
  __pyx_codeobj__188 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__111, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__188)) __PYX_ERR(8, 3, __pyx_L1_error)

  /* "amplpy/environment.pxi":72
 *             return None
 * 
 *     def to_string(self):             # <<<<<<<<<<<<<<
 *         cdef const char* to_string_c
 *         campl.AMPL_EnvironmentToString(self._c_env, &to_string_c)
 */
  __pyx_tuple__189 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_to_string_c, __pyx_n_s_to_string); if (unlikely(!__pyx_tuple__189)) __PYX_ERR(10, 72, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__189);
  __Pyx_GIVEREF(__pyx_tuple__189);
  __pyx_codeobj__190 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__189, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_environment_pxi, __pyx_n_s_to_string, 72, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__190)) __PYX_ERR(10, 72, __pyx_L1_error)

  /* "amplpy/environment.pxi":78
 *         return to_string
 * 
 *     def set_bin_dir(self, binary_directory):             # <<<<<<<<<<<<<<
 *         """
 *         Set the location where AMPL API will search for the AMPL executable.
 */
  __pyx_tuple__191 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_binary_directory); if (unlikely(!__pyx_tuple__191)) __PYX_ERR(10, 78, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__191);
  __Pyx_GIVEREF(__pyx_tuple__191);
  __pyx_codeobj__192 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__191, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_environment_pxi, __pyx_n_s_set_bin_dir, 78, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__192)) __PYX_ERR(10, 78, __pyx_L1_error)

  /* "amplpy/environment.pxi":87
 *         campl.AMPL_EnvironmentSetBinaryDirectory(self._c_env, binary_directory.encode('utf-8'))
 * 
 *     def get_bin_dir(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the location where AMPL API will search for the AMPL executable.
 */
  __pyx_tuple__193 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_bin_dir_c, __pyx_n_s_bin_dir); if (unlikely(!__pyx_tuple__193)) __PYX_ERR(10, 87, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__193);
  __Pyx_GIVEREF(__pyx_tuple__193);
  __pyx_codeobj__194 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__193, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_environment_pxi, __pyx_n_s_get_bin_dir, 87, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__194)) __PYX_ERR(10, 87, __pyx_L1_error)

  /* "amplpy/environment.pxi":96
 *         return bin_dir
 * 
 *     def set_bin_name(self, binary_name):             # <<<<<<<<<<<<<<
 *         """
 *         Set the name of the AMPL executable.
 */
  __pyx_tuple__195 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_binary_name); if (unlikely(!__pyx_tuple__195)) __PYX_ERR(10, 96, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__195);
  __Pyx_GIVEREF(__pyx_tuple__195);
  __pyx_codeobj__196 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__195, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_environment_pxi, __pyx_n_s_set_bin_name, 96, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__196)) __PYX_ERR(10, 96, __pyx_L1_error)

  /* "amplpy/environment.pxi":105
 *         campl.AMPL_EnvironmentSetBinaryName(self._c_env, binary_name.encode('utf-8'))
 * 
 *     def get_bin_name(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the name of the AMPL executable.
 */
  __pyx_tuple__197 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_bin_name_c, __pyx_n_s_bin_name); if (unlikely(!__pyx_tuple__197)) __PYX_ERR(10, 105, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__197);
  __Pyx_GIVEREF(__pyx_tuple__197);
  __pyx_codeobj__198 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__197, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_environment_pxi, __pyx_n_s_get_bin_name, 105, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__198)) __PYX_ERR(10, 105, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_codeobj__199 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 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_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__199)) __PYX_ERR(8, 1, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */
  __pyx_codeobj__200 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__111, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__200)) __PYX_ERR(8, 3, __pyx_L1_error)

  /* "amplpy/errorhandler.pxi":7
 *     _SUPPORT_MESSAGE = ""
 * 
 * def display_error_message(exception, error=True):             # <<<<<<<<<<<<<<
 *     msg = "\t" + str(exception).replace("\n", "\n\t")
 *     if error:
 */
  __pyx_tuple__201 = PyTuple_Pack(3, __pyx_n_s_exception, __pyx_n_s_error, __pyx_n_s_msg); if (unlikely(!__pyx_tuple__201)) __PYX_ERR(11, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__201);
  __Pyx_GIVEREF(__pyx_tuple__201);
  __pyx_codeobj__202 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__201, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_errorhandler_pxi, __pyx_n_s_display_error_message, 7, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__202)) __PYX_ERR(11, 7, __pyx_L1_error)

  /* "amplpy/errorhandler.pxi":25
 *     """
 * 
 *     def error(self, exception):             # <<<<<<<<<<<<<<
 *         """
 *         Receives notification of an error.
 */
  __pyx_tuple__203 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_exception); if (unlikely(!__pyx_tuple__203)) __PYX_ERR(11, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__203);
  __Pyx_GIVEREF(__pyx_tuple__203);
  __pyx_codeobj__204 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__203, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_errorhandler_pxi, __pyx_n_s_error, 25, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__204)) __PYX_ERR(11, 25, __pyx_L1_error)

  /* "amplpy/errorhandler.pxi":32
 *         raise exception
 * 
 *     def warning(self, exception):             # <<<<<<<<<<<<<<
 *         """
 *         Receives notification of a warning.
 */
  __pyx_codeobj__205 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__203, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_errorhandler_pxi, __pyx_n_s_warning, 32, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__205)) __PYX_ERR(11, 32, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */
  __pyx_tuple__206 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_state, __pyx_n_s_dict_2, __pyx_n_s_use_setstate); if (unlikely(!__pyx_tuple__206)) __PYX_ERR(8, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__206);
  __Pyx_GIVEREF(__pyx_tuple__206);
  __pyx_codeobj__207 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__206, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__207)) __PYX_ERR(8, 1, __pyx_L1_error)

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_ErrorHandler, (type(self), 0xe3b0c44, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_ErrorHandler__set_state(self, __pyx_state)
 */
  __pyx_codeobj__208 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__111, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__208)) __PYX_ERR(8, 16, __pyx_L1_error)

  /* "amplpy/exceptions.pxi":9
 *     """
 * 
 *     def __init__(self, source_name, line_number, offset, message):             # <<<<<<<<<<<<<<
 *         super(AMPLException, self).__init__()
 *         self.source_name = source_name
 */
  __pyx_tuple__209 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_source_name, __pyx_n_s_line_number, __pyx_n_s_offset, __pyx_n_s_message); if (unlikely(!__pyx_tuple__209)) __PYX_ERR(1, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__209);
  __Pyx_GIVEREF(__pyx_tuple__209);
  __pyx_codeobj__210 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__209, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_exceptions_pxi, __pyx_n_s_init, 9, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__210)) __PYX_ERR(1, 9, __pyx_L1_error)

  /* "amplpy/exceptions.pxi":16
 *         self.message = message
 * 
 *     def get_source_name(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the name of the file where the error was detected.
 */
  __pyx_codeobj__211 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 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_amplpy_exceptions_pxi, __pyx_n_s_get_source_name, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__211)) __PYX_ERR(1, 16, __pyx_L1_error)

  /* "amplpy/exceptions.pxi":22
 *         return self.source_name
 * 
 *     def get_line_number(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the row where the error is located.
 */
  __pyx_codeobj__212 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 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_amplpy_exceptions_pxi, __pyx_n_s_get_line_number, 22, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__212)) __PYX_ERR(1, 22, __pyx_L1_error)

  /* "amplpy/exceptions.pxi":28
 *         return self.line_number
 * 
 *     def get_offset(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the offset where the error is located.
 */
  __pyx_codeobj__213 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 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_amplpy_exceptions_pxi, __pyx_n_s_get_offset, 28, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__213)) __PYX_ERR(1, 28, __pyx_L1_error)

  /* "amplpy/exceptions.pxi":34
 *         return self.offset
 * 
 *     def get_message(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the error message.
 */
  __pyx_codeobj__214 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 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_amplpy_exceptions_pxi, __pyx_n_s_get_message, 34, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__214)) __PYX_ERR(1, 34, __pyx_L1_error)

  /* "amplpy/exceptions.pxi":40
 *         return self.message
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return "file: " + self.source_name + self.message + _SUPPORT_MESSAGE #discuss with Filipe
 * 
 */
  __pyx_codeobj__215 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 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_amplpy_exceptions_pxi, __pyx_n_s_str, 40, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__215)) __PYX_ERR(1, 40, __pyx_L1_error)

  /* "amplpy/exceptions.pxi":50
 * 
 * 
 * class PresolveException(RuntimeError):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
  __pyx_tuple__216 = PyTuple_Pack(1, __pyx_builtin_RuntimeError); if (unlikely(!__pyx_tuple__216)) __PYX_ERR(1, 50, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__216);
  __Pyx_GIVEREF(__pyx_tuple__216);
  __pyx_tuple__217 = PyTuple_Pack(1, __pyx_builtin_RuntimeError); if (unlikely(!__pyx_tuple__217)) __PYX_ERR(1, 50, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__217);
  __Pyx_GIVEREF(__pyx_tuple__217);

  /* "amplpy/exceptions.pxi":54
 * 
 * 
 * class InfeasibilityException(RuntimeError):             # <<<<<<<<<<<<<<
 *     pass
 */
  __pyx_tuple__218 = PyTuple_Pack(1, __pyx_builtin_RuntimeError); if (unlikely(!__pyx_tuple__218)) __PYX_ERR(1, 54, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__218);
  __Pyx_GIVEREF(__pyx_tuple__218);
  __pyx_tuple__219 = PyTuple_Pack(1, __pyx_builtin_RuntimeError); if (unlikely(!__pyx_tuple__219)) __PYX_ERR(1, 54, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__219);
  __Pyx_GIVEREF(__pyx_tuple__219);

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.begin,self.end,self.env_c,self.iterator cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_codeobj__220 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 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_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__220)) __PYX_ERR(8, 1, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self.begin,self.end,self.env_c,self.iterator cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.begin,self.end,self.env_c,self.iterator cannot be converted to a Python object for pickling"
 */
  __pyx_codeobj__221 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__111, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__221)) __PYX_ERR(8, 3, __pyx_L1_error)

  /* "amplpy/iterators.pxi":111
 *         return create_entity(self.entity_class, self._c_ampl, name_c, NULL, None)
 * 
 *     def size(self):             # <<<<<<<<<<<<<<
 *         return int(self._size)
 * 
 */
  __pyx_codeobj__222 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 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_amplpy_iterators_pxi, __pyx_n_s_size, 111, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__222)) __PYX_ERR(6, 111, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._c_ampl,self.begin,self.end cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_codeobj__223 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 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_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__223)) __PYX_ERR(8, 1, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._c_ampl,self.begin,self.end cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._c_ampl,self.begin,self.end cannot be converted to a Python object for pickling"
 */
  __pyx_codeobj__224 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__111, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__224)) __PYX_ERR(8, 3, __pyx_L1_error)

  /* "amplpy/iterators.pxi":185
 *         return create_entity(self.entity_class, self._c_ampl, self._name, tuple_c, self._entity)
 * 
 *     def size(self):             # <<<<<<<<<<<<<<
 *         return int(self._size)
 * 
 */
  __pyx_codeobj__225 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 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_amplpy_iterators_pxi, __pyx_n_s_size, 185, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__225)) __PYX_ERR(6, 185, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._c_ampl,self.begin,self.end cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_codeobj__226 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 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_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__226)) __PYX_ERR(8, 1, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._c_ampl,self.begin,self.end cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._c_ampl,self.begin,self.end cannot be converted to a Python object for pickling"
 */
  __pyx_codeobj__227 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__111, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__227)) __PYX_ERR(8, 3, __pyx_L1_error)

  /* "amplpy/iterators.pxi":237
 *             self.begin = NULL
 * 
 *     def size(self):             # <<<<<<<<<<<<<<
 *         return int(self._size)
 * 
 */
  __pyx_codeobj__228 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 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_amplpy_iterators_pxi, __pyx_n_s_size, 237, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__228)) __PYX_ERR(6, 237, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._c_ampl,self._index,self.begin,self.end cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_codeobj__229 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 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_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__229)) __PYX_ERR(8, 1, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._c_ampl,self._index,self.begin,self.end cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._c_ampl,self._index,self.begin,self.end cannot be converted to a Python object for pickling"
 */
  __pyx_codeobj__230 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__111, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__230)) __PYX_ERR(8, 3, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._df cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_codeobj__231 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 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_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__231)) __PYX_ERR(8, 1, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._df cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._df cannot be converted to a Python object for pickling"
 */
  __pyx_codeobj__232 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__111, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__232)) __PYX_ERR(8, 3, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._df cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_codeobj__233 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 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_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__233)) __PYX_ERR(8, 1, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._df cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._df cannot be converted to a Python object for pickling"
 */
  __pyx_codeobj__234 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__111, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__234)) __PYX_ERR(8, 3, __pyx_L1_error)

  /* "amplpy/objective.pxi":36
 *         return entity
 * 
 *     def value(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the value of the objective.
 */
  __pyx_codeobj__235 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__85, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_objective_pxi, __pyx_n_s_value, 36, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__235)) __PYX_ERR(12, 36, __pyx_L1_error)

  /* "amplpy/objective.pxi":44
 *         return value
 * 
 *     def astatus(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the AMPL status.
 */
  __pyx_codeobj__236 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__90, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_objective_pxi, __pyx_n_s_astatus, 44, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__236)) __PYX_ERR(12, 44, __pyx_L1_error)

  /* "amplpy/objective.pxi":61
 *         return value
 * 
 *     def sstatus(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the solver status.
 */
  __pyx_codeobj__237 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__90, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_objective_pxi, __pyx_n_s_sstatus, 61, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__237)) __PYX_ERR(12, 61, __pyx_L1_error)

  /* "amplpy/objective.pxi":78
 *         return value
 * 
 *     def exitcode(self):             # <<<<<<<<<<<<<<
 *         """
 *         Exit code returned by solver after most recent solve with this
 */
  __pyx_codeobj__238 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__85, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_objective_pxi, __pyx_n_s_exitcode, 78, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__238)) __PYX_ERR(12, 78, __pyx_L1_error)

  /* "amplpy/objective.pxi":87
 *         return value
 * 
 *     def message(self):             # <<<<<<<<<<<<<<
 *         """
 *         Result message returned by solver after most recent solve with this
 */
  __pyx_codeobj__239 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__90, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_objective_pxi, __pyx_n_s_message, 87, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__239)) __PYX_ERR(12, 87, __pyx_L1_error)

  /* "amplpy/objective.pxi":105
 *         return value
 * 
 *     def result(self):             # <<<<<<<<<<<<<<
 *         """
 *         Result string returned by solver after most recent solve with this
 */
  __pyx_codeobj__240 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__90, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_objective_pxi, __pyx_n_s_result, 105, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__240)) __PYX_ERR(12, 105, __pyx_L1_error)

  /* "amplpy/objective.pxi":123
 *         return value
 * 
 *     def drop(self):             # <<<<<<<<<<<<<<
 *         """
 *         Drop this objective instance.
 */
  __pyx_codeobj__241 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 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_amplpy_objective_pxi, __pyx_n_s_drop, 123, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__241)) __PYX_ERR(12, 123, __pyx_L1_error)

  /* "amplpy/objective.pxi":129
 *         PY_AMPL_CALL(campl.AMPL_EntityDrop(self._c_ampl, self._name))
 * 
 *     def restore(self):             # <<<<<<<<<<<<<<
 *         """
 *         Restore this objective (if it had been dropped, no effect otherwise).
 */
  __pyx_codeobj__242 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 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_amplpy_objective_pxi, __pyx_n_s_restore, 129, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__242)) __PYX_ERR(12, 129, __pyx_L1_error)

  /* "amplpy/objective.pxi":135
 *         PY_AMPL_CALL(campl.AMPL_EntityRestore(self._c_ampl, self._name))
 * 
 *     def minimization(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the sense of this objective. Returns True if minimize,
 */
  __pyx_codeobj__243 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__90, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_objective_pxi, __pyx_n_s_minimization, 135, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__243)) __PYX_ERR(12, 135, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._c_ampl,self._index cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_codeobj__244 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 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_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__244)) __PYX_ERR(8, 1, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._c_ampl,self._index cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._c_ampl,self._index cannot be converted to a Python object for pickling"
 */
  __pyx_codeobj__245 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__111, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__245)) __PYX_ERR(8, 3, __pyx_L1_error)

  /* "amplpy/outputhandler.pxi":20
 *     """
 * 
 *     def output(self, kind, msg):             # <<<<<<<<<<<<<<
 *         """
 *         This method is called when AMPL sends some output derived from
 */
  __pyx_tuple__246 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_kind, __pyx_n_s_msg); if (unlikely(!__pyx_tuple__246)) __PYX_ERR(2, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__246);
  __Pyx_GIVEREF(__pyx_tuple__246);
  __pyx_codeobj__247 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__246, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_outputhandler_pxi, __pyx_n_s_output, 20, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__247)) __PYX_ERR(2, 20, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */
  __pyx_codeobj__248 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__206, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__248)) __PYX_ERR(8, 1, __pyx_L1_error)

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_OutputHandler, (type(self), 0xe3b0c44, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_OutputHandler__set_state(self, __pyx_state)
 */
  __pyx_codeobj__249 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__111, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__249)) __PYX_ERR(8, 16, __pyx_L1_error)

  /* "amplpy/outputhandler.pxi":36
 *     PyOutputHandler.output(kind, msg.decode('utf-8'))
 * 
 * class Kind(object):             # <<<<<<<<<<<<<<
 *     """
 *     Represents the type of the output coming from the interpreter.
 */
  __pyx_tuple__250 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__250)) __PYX_ERR(2, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__250);
  __Pyx_GIVEREF(__pyx_tuple__250);
  __pyx_tuple__251 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__251)) __PYX_ERR(2, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__251);
  __Pyx_GIVEREF(__pyx_tuple__251);

  /* "amplpy/parameter.pxi":46
 *         self.set(index, value)
 * 
 *     def is_symbolic(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns True if the parameter is declared as symbolic (can store both
 */
  __pyx_codeobj__252 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__85, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_parameter_pxi, __pyx_n_s_is_symbolic, 46, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__252)) __PYX_ERR(13, 46, __pyx_L1_error)

  /* "amplpy/parameter.pxi":55
 *         return value
 * 
 *     def has_default(self):             # <<<<<<<<<<<<<<
 *         """
 *         Check if the parameter has a default initial value. In case of the
 */
  __pyx_codeobj__253 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__85, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_parameter_pxi, __pyx_n_s_has_default, 55, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__253)) __PYX_ERR(13, 55, __pyx_L1_error)

  /* "amplpy/parameter.pxi":91
 *         return py_variant
 * 
 *     def value(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the value of this parameter. Valid only for non-indexed parameters.
 */
  __pyx_tuple__254 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_v, __pyx_n_s_py_variant); if (unlikely(!__pyx_tuple__254)) __PYX_ERR(13, 91, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__254);
  __Pyx_GIVEREF(__pyx_tuple__254);
  __pyx_codeobj__255 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__254, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_parameter_pxi, __pyx_n_s_value, 91, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__255)) __PYX_ERR(13, 91, __pyx_L1_error)

  /* "amplpy/parameter.pxi":101
 *         return py_variant
 * 
 *     def set(self, *args):             # <<<<<<<<<<<<<<
 *         """
 *         Set the value of a single instance of this parameter.
 */
  __pyx_tuple__256 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_args, __pyx_n_s_index_c, __pyx_n_s_value, __pyx_n_s_index); if (unlikely(!__pyx_tuple__256)) __PYX_ERR(13, 101, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__256);
  __Pyx_GIVEREF(__pyx_tuple__256);
  __pyx_codeobj__257 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__256, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_parameter_pxi, __pyx_n_s_set, 101, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__257)) __PYX_ERR(13, 101, __pyx_L1_error)

  /* "amplpy/parameter.pxi":142
 *                 raise TypeError
 * 
 *     def set_values(self, values):             # <<<<<<<<<<<<<<
 *         """
 *         Assign the values (string or float) to the parameter instances with the
 */
  __pyx_tuple__258 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_values, __pyx_n_s_genexpr, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__258)) __PYX_ERR(13, 142, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__258);
  __Pyx_GIVEREF(__pyx_tuple__258);
  __pyx_codeobj__259 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__258, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_parameter_pxi, __pyx_n_s_set_values, 142, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__259)) __PYX_ERR(13, 142, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._c_ampl,self._index cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_codeobj__260 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 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_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__260)) __PYX_ERR(8, 1, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._c_ampl,self._index cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._c_ampl,self._index cannot be converted to a Python object for pickling"
 */
  __pyx_codeobj__261 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__111, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__261)) __PYX_ERR(8, 3, __pyx_L1_error)

  /* "amplpy/set.pxi":52
 *             return self.instances()
 * 
 *     def instances(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get an iterator to iterate over all the instances in a Set.
 */
  __pyx_codeobj__262 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 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_amplpy_set_pxi, __pyx_n_s_instances, 52, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__262)) __PYX_ERR(14, 52, __pyx_L1_error)

  /* "amplpy/set.pxi":58
 *         return Entity.instances(self)
 * 
 *     def arity(self):             # <<<<<<<<<<<<<<
 *         """
 *         The arity of the set, or number of components in each member of this
 */
  __pyx_tuple__263 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_arity); if (unlikely(!__pyx_tuple__263)) __PYX_ERR(14, 58, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__263);
  __Pyx_GIVEREF(__pyx_tuple__263);
  __pyx_codeobj__264 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__263, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_set_pxi, __pyx_n_s_arity, 58, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__264)) __PYX_ERR(14, 58, __pyx_L1_error)

  /* "amplpy/set.pxi":67
 *         return int(arity)
 * 
 *     def get_values(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get values of this set in a DataFrame. Valid only for non-indexed sets.
 */
  __pyx_tuple__265 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_df_c); if (unlikely(!__pyx_tuple__265)) __PYX_ERR(14, 67, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__265);
  __Pyx_GIVEREF(__pyx_tuple__265);
  __pyx_codeobj__266 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__265, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_set_pxi, __pyx_n_s_get_values, 67, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__266)) __PYX_ERR(14, 67, __pyx_L1_error)

  /* "amplpy/set.pxi":75
 *         return DataFrame.create(df_c)
 * 
 *     def members(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get members (tuples) of this Set. Valid only for non-indexed sets.
 */
  __pyx_codeobj__267 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 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_amplpy_set_pxi, __pyx_n_s_members, 75, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__267)) __PYX_ERR(14, 75, __pyx_L1_error)

  /* "amplpy/set.pxi":81
 *         return MemberRangeIterator.create(self._c_ampl, self._name, self._index, self)
 * 
 *     def size(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the number of tuples in this set. Valid only for non-indexed sets.
 */
  __pyx_codeobj__268 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__173, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_set_pxi, __pyx_n_s_size, 81, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__268)) __PYX_ERR(14, 81, __pyx_L1_error)

  /* "amplpy/set.pxi":89
 *         return int(size)
 * 
 *     def contains(self, t):             # <<<<<<<<<<<<<<
 *         """
 *         Check wether this set instance contains the specified Tuple.
 */
  __pyx_tuple__269 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_t, __pyx_n_s_contains_c, __pyx_n_s_t_c); if (unlikely(!__pyx_tuple__269)) __PYX_ERR(14, 89, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__269);
  __Pyx_GIVEREF(__pyx_tuple__269);
  __pyx_codeobj__270 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__269, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_set_pxi, __pyx_n_s_contains, 89, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__270)) __PYX_ERR(14, 89, __pyx_L1_error)

  /* "amplpy/set.pxi":103
 *         return contains_c
 * 
 *     def set_values(self, values):             # <<<<<<<<<<<<<<
 *         """
 *         Set the tuples in this set. Valid only for non-indexed sets.
 */
  __pyx_tuple__271 = PyTuple_Pack(16, __pyx_n_s_self, __pyx_n_s_values, __pyx_n_s_df, __pyx_n_s_index, __pyx_n_s_members, __pyx_n_s_dimen, __pyx_n_s_cast_value, __pyx_n_s_cast_value, __pyx_n_s_cast_row, __pyx_n_s_cast_row, __pyx_n_s_genexpr, __pyx_n_s_genexpr, __pyx_n_s_genexpr, __pyx_n_s_row, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__271)) __PYX_ERR(14, 103, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__271);
  __Pyx_GIVEREF(__pyx_tuple__271);
  __pyx_codeobj__272 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 16, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__271, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_set_pxi, __pyx_n_s_set_values, 103, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__272)) __PYX_ERR(14, 103, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._c_ampl,self._index cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_codeobj__273 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 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_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__273)) __PYX_ERR(8, 1, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._c_ampl,self._index cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._c_ampl,self._index cannot be converted to a Python object for pickling"
 */
  __pyx_codeobj__274 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__111, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__274)) __PYX_ERR(8, 3, __pyx_L1_error)

  /* "amplpy/variable.pxi":38
 *         self.__getitem__(index).set_value(value)
 * 
 *     def value(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the current value of this variable.
 */
  __pyx_codeobj__275 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__85, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_variable_pxi, __pyx_n_s_value, 38, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__275)) __PYX_ERR(15, 38, __pyx_L1_error)

  /* "amplpy/variable.pxi":46
 *         return value
 * 
 *     def fix(self, value=None):             # <<<<<<<<<<<<<<
 *         """
 *         Fix all instances of this variable to a value if provided or to
 */
  __pyx_codeobj__276 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__85, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_variable_pxi, __pyx_n_s_fix, 46, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__276)) __PYX_ERR(15, 46, __pyx_L1_error)

  /* "amplpy/variable.pxi":59
 *             PY_AMPL_CALL(campl.AMPL_VariableInstanceFixToValue(self._c_ampl, self._name, self._index, value))
 * 
 *     def unfix(self):             # <<<<<<<<<<<<<<
 *         """
 *         Unfix all instances of this variable.
 */
  __pyx_codeobj__277 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 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_amplpy_variable_pxi, __pyx_n_s_unfix, 59, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__277)) __PYX_ERR(15, 59, __pyx_L1_error)

  /* "amplpy/variable.pxi":65
 *         PY_AMPL_CALL(campl.AMPL_VariableInstanceUnfix(self._c_ampl, self._name, self._index))
 * 
 *     def set_value(self, value):             # <<<<<<<<<<<<<<
 *         """
 *         Set the current value of this variable (does not fix it),
 */
  __pyx_codeobj__278 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__85, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_variable_pxi, __pyx_n_s_set_value, 65, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__278)) __PYX_ERR(15, 65, __pyx_L1_error)

  /* "amplpy/variable.pxi":78
 *             PY_AMPL_CALL(campl.AMPL_VariableInstanceSetValue(self._c_ampl, self._name, self._index, float(value)))
 * 
 *     def astatus(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the AMPL status (fixed, presolved, or substituted out).
 */
  __pyx_codeobj__279 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__90, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_variable_pxi, __pyx_n_s_astatus, 78, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__279)) __PYX_ERR(15, 78, __pyx_L1_error)

  /* "amplpy/variable.pxi":95
 *         return value
 * 
 *     def defeqn(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the index in `_con` of "defining constraint" used to substitute
 */
  __pyx_codeobj__280 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__85, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_variable_pxi, __pyx_n_s_defeqn, 95, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__280)) __PYX_ERR(15, 95, __pyx_L1_error)

  /* "amplpy/variable.pxi":104
 *         return value
 * 
 *     def dual(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the dual value on defining constraint of variable substituted out.
 */
  __pyx_codeobj__281 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__85, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_variable_pxi, __pyx_n_s_dual, 104, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__281)) __PYX_ERR(15, 104, __pyx_L1_error)

  /* "amplpy/variable.pxi":112
 *         return value
 * 
 *     def init(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the current initial guess.
 */
  __pyx_codeobj__282 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__85, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_variable_pxi, __pyx_n_s_init_2, 112, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__282)) __PYX_ERR(15, 112, __pyx_L1_error)

  /* "amplpy/variable.pxi":120
 *         return value
 * 
 *     def init0(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the original initial guess (set by `:=` or`default` or by a data
 */
  __pyx_codeobj__283 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__85, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_variable_pxi, __pyx_n_s_init0, 120, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__283)) __PYX_ERR(15, 120, __pyx_L1_error)

  /* "amplpy/variable.pxi":129
 *         return value
 * 
 *     def lb(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the current lower bound.
 */
  __pyx_codeobj__284 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__85, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_variable_pxi, __pyx_n_s_lb, 129, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__284)) __PYX_ERR(15, 129, __pyx_L1_error)

  /* "amplpy/variable.pxi":137
 *         return value
 * 
 *     def ub(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the current upper bound.
 */
  __pyx_codeobj__285 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__85, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_variable_pxi, __pyx_n_s_ub, 137, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__285)) __PYX_ERR(15, 137, __pyx_L1_error)

  /* "amplpy/variable.pxi":145
 *         return value
 * 
 *     def lb0(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the initial lower bounds, from the var declaration.
 */
  __pyx_codeobj__286 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__85, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_variable_pxi, __pyx_n_s_lb0, 145, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__286)) __PYX_ERR(15, 145, __pyx_L1_error)

  /* "amplpy/variable.pxi":153
 *         return value
 * 
 *     def ub0(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the initial upper bound, from the var declaration.
 */
  __pyx_codeobj__287 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__85, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_variable_pxi, __pyx_n_s_ub0, 153, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__287)) __PYX_ERR(15, 153, __pyx_L1_error)

  /* "amplpy/variable.pxi":161
 *         return value
 * 
 *     def lb1(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the weaker lower bound from AMPL's presolve phase.
 */
  __pyx_codeobj__288 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__85, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_variable_pxi, __pyx_n_s_lb1, 161, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__288)) __PYX_ERR(15, 161, __pyx_L1_error)

  /* "amplpy/variable.pxi":169
 *         return value
 * 
 *     def ub1(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the weaker upper bound from AMPL's presolve phase.
 */
  __pyx_codeobj__289 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__85, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_variable_pxi, __pyx_n_s_ub1, 169, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__289)) __PYX_ERR(15, 169, __pyx_L1_error)

  /* "amplpy/variable.pxi":177
 *         return value
 * 
 *     def lb2(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the stronger lower bound from AMPL's presolve phase.
 */
  __pyx_codeobj__290 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__85, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_variable_pxi, __pyx_n_s_lb2, 177, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__290)) __PYX_ERR(15, 177, __pyx_L1_error)

  /* "amplpy/variable.pxi":185
 *         return value
 * 
 *     def ub2(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the stronger upper bound from AMPL's presolve phase.
 */
  __pyx_codeobj__291 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__85, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_variable_pxi, __pyx_n_s_ub2, 185, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__291)) __PYX_ERR(15, 185, __pyx_L1_error)

  /* "amplpy/variable.pxi":193
 *         return value
 * 
 *     def lrc(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the reduced cost at lower bound.
 */
  __pyx_codeobj__292 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__85, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_variable_pxi, __pyx_n_s_lrc, 193, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__292)) __PYX_ERR(15, 193, __pyx_L1_error)

  /* "amplpy/variable.pxi":201
 *         return value
 * 
 *     def urc(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the reduced cost at upper bound.
 */
  __pyx_codeobj__293 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__85, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_variable_pxi, __pyx_n_s_urc, 201, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__293)) __PYX_ERR(15, 201, __pyx_L1_error)

  /* "amplpy/variable.pxi":209
 *         return value
 * 
 *     def lslack(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the slack at lower bound (``val - lb``).
 */
  __pyx_codeobj__294 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__85, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_variable_pxi, __pyx_n_s_lslack, 209, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__294)) __PYX_ERR(15, 209, __pyx_L1_error)

  /* "amplpy/variable.pxi":217
 *         return value
 * 
 *     def uslack(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the slack at upper bound (``ub - val``).
 */
  __pyx_codeobj__295 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__85, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_variable_pxi, __pyx_n_s_uslack, 217, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__295)) __PYX_ERR(15, 217, __pyx_L1_error)

  /* "amplpy/variable.pxi":225
 *         return value
 * 
 *     def rc(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the reduced cost (at the nearer bound).
 */
  __pyx_codeobj__296 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__85, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_variable_pxi, __pyx_n_s_rc, 225, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__296)) __PYX_ERR(15, 225, __pyx_L1_error)

  /* "amplpy/variable.pxi":233
 *         return value
 * 
 *     def slack(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the bound slack which is the lesser of
 */
  __pyx_codeobj__297 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__85, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_variable_pxi, __pyx_n_s_slack, 233, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__297)) __PYX_ERR(15, 233, __pyx_L1_error)

  /* "amplpy/variable.pxi":242
 *         return value
 * 
 *     def sstatus(self):             # <<<<<<<<<<<<<<
 *         """
 *         Solver status (basis status of variable).
 */
  __pyx_codeobj__298 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__90, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_variable_pxi, __pyx_n_s_sstatus, 242, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__298)) __PYX_ERR(15, 242, __pyx_L1_error)

  /* "amplpy/variable.pxi":258
 *         return value
 * 
 *     def status(self):             # <<<<<<<<<<<<<<
 *         """
 *         AMPL status if not `in`, otherwise solver status.
 */
  __pyx_codeobj__299 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__90, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_variable_pxi, __pyx_n_s_status, 258, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__299)) __PYX_ERR(15, 258, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._c_ampl,self._index cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_codeobj__300 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 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_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__300)) __PYX_ERR(8, 1, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._c_ampl,self._index cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._c_ampl,self._index cannot be converted to a Python object for pickling"
 */
  __pyx_codeobj__301 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__111, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__301)) __PYX_ERR(8, 3, __pyx_L1_error)

  /* "amplpy/ampl.pyx":31
 * 
 * 
 * def nested_dict_of_suffixes(lst):             # <<<<<<<<<<<<<<
 *     nested = {}
 *     for name, value in lst:
 */
  __pyx_tuple__302 = PyTuple_Pack(7, __pyx_n_s_lst, __pyx_n_s_nested, __pyx_n_s_name, __pyx_n_s_value, __pyx_n_s_p, __pyx_n_s_v, __pyx_n_s_index); if (unlikely(!__pyx_tuple__302)) __PYX_ERR(3, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__302);
  __Pyx_GIVEREF(__pyx_tuple__302);
  __pyx_codeobj__303 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__302, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_ampl_pyx, __pyx_n_s_nested_dict_of_suffixes, 31, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__303)) __PYX_ERR(3, 31, __pyx_L1_error)

  /* "amplpy/ampl.pyx":151
 *         self.close()
 * 
 *     def get_data(self, *statements):             # <<<<<<<<<<<<<<
 *         """
 *         Get the data corresponding to the display statements. The statements
 */
  __pyx_tuple__304 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_statements, __pyx_n_s_errorinfo, __pyx_n_s_rc, __pyx_n_s_data, __pyx_n_s_statements_c, __pyx_n_s_i); if (unlikely(!__pyx_tuple__304)) __PYX_ERR(3, 151, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__304);
  __Pyx_GIVEREF(__pyx_tuple__304);
  __pyx_codeobj__305 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__304, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_ampl_pyx, __pyx_n_s_get_data, 151, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__305)) __PYX_ERR(3, 151, __pyx_L1_error)

  /* "amplpy/ampl.pyx":198
 *         return DataFrame.create(data)
 * 
 *     def get_entity(self, name):             # <<<<<<<<<<<<<<
 *         """
 *         Get entity corresponding to the specified name (looks for it in all
 */
  __pyx_tuple__306 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_name, __pyx_n_s_name_c); if (unlikely(!__pyx_tuple__306)) __PYX_ERR(3, 198, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__306);
  __Pyx_GIVEREF(__pyx_tuple__306);
  __pyx_codeobj__307 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__306, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_ampl_pyx, __pyx_n_s_get_entity, 198, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__307)) __PYX_ERR(3, 198, __pyx_L1_error)

  /* "amplpy/ampl.pyx":215
 *         return Entity.create(self._c_ampl, name_c, NULL, None)
 * 
 *     def get_variable(self, name):             # <<<<<<<<<<<<<<
 *         """
 *         Get the variable with the corresponding name.
 */
  __pyx_tuple__308 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_name, __pyx_n_s_errorinfo, __pyx_n_s_rc, __pyx_n_s_entitytype, __pyx_n_s_name_c); if (unlikely(!__pyx_tuple__308)) __PYX_ERR(3, 215, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__308);
  __Pyx_GIVEREF(__pyx_tuple__308);
  __pyx_codeobj__309 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__308, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_ampl_pyx, __pyx_n_s_get_variable, 215, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__309)) __PYX_ERR(3, 215, __pyx_L1_error)

  /* "amplpy/ampl.pyx":239
 *         return Variable.create(self._c_ampl, name_c, NULL, None)
 * 
 *     def get_constraint(self, name):             # <<<<<<<<<<<<<<
 *         """
 *         Get the constraint with the corresponding name.
 */
  __pyx_codeobj__310 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__308, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_ampl_pyx, __pyx_n_s_get_constraint, 239, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__310)) __PYX_ERR(3, 239, __pyx_L1_error)

  /* "amplpy/ampl.pyx":263
 *         return Constraint.create(self._c_ampl, name_c, NULL, None)
 * 
 *     def get_objective(self, name):             # <<<<<<<<<<<<<<
 *         """
 *         Get the objective with the corresponding name.
 */
  __pyx_codeobj__311 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__308, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_ampl_pyx, __pyx_n_s_get_objective, 263, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__311)) __PYX_ERR(3, 263, __pyx_L1_error)

  /* "amplpy/ampl.pyx":287
 *         return Objective.create(self._c_ampl, name_c, NULL, None)
 * 
 *     def get_set(self, name):             # <<<<<<<<<<<<<<
 *         """
 *         Get the set with the corresponding name.
 */
  __pyx_codeobj__312 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__308, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_ampl_pyx, __pyx_n_s_get_set, 287, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__312)) __PYX_ERR(3, 287, __pyx_L1_error)

  /* "amplpy/ampl.pyx":311
 *         return Set.create(self._c_ampl, name_c, NULL, None)
 * 
 *     def get_parameter(self, name):             # <<<<<<<<<<<<<<
 *         """
 *         Get the parameter with the corresponding name.
 */
  __pyx_codeobj__313 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__308, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_ampl_pyx, __pyx_n_s_get_parameter, 311, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__313)) __PYX_ERR(3, 311, __pyx_L1_error)

  /* "amplpy/ampl.pyx":335
 *         return Parameter.create(self._c_ampl, name_c, NULL, None)
 * 
 *     def eval(self, statements):             # <<<<<<<<<<<<<<
 *         """
 *         Parses AMPL code and evaluates it as a possibly empty sequence of AMPL
 */
  __pyx_tuple__314 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_statements, __pyx_n_s_e); if (unlikely(!__pyx_tuple__314)) __PYX_ERR(3, 335, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__314);
  __Pyx_GIVEREF(__pyx_tuple__314);
  __pyx_codeobj__315 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__314, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_ampl_pyx, __pyx_n_s_eval, 335, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__315)) __PYX_ERR(3, 335, __pyx_L1_error)

  /* "amplpy/ampl.pyx":369
 *             raise RuntimeError(str(e))
 * 
 *     def get_output(self, statements):             # <<<<<<<<<<<<<<
 *         """
 *         Equivalent to :func:`~amplpy.AMPL.eval` but returns the output as a
 */
  __pyx_tuple__316 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_statements, __pyx_n_s_output_c, __pyx_n_s_output); if (unlikely(!__pyx_tuple__316)) __PYX_ERR(3, 369, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__316);
  __Pyx_GIVEREF(__pyx_tuple__316);
  __pyx_codeobj__317 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__316, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_ampl_pyx, __pyx_n_s_get_output, 369, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__317)) __PYX_ERR(3, 369, __pyx_L1_error)

  /* "amplpy/ampl.pyx":390
 *         return output
 * 
 *     def reset(self):             # <<<<<<<<<<<<<<
 *         """
 *         Clears all entities in the underlying AMPL interpreter, clears all maps
 */
  __pyx_codeobj__318 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 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_amplpy_ampl_pyx, __pyx_n_s_reset, 390, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__318)) __PYX_ERR(3, 390, __pyx_L1_error)

  /* "amplpy/ampl.pyx":397
 *         PY_AMPL_CALL(campl.AMPL_Reset(self._c_ampl))
 * 
 *     def close(self):             # <<<<<<<<<<<<<<
 *         """
 *         Stops the underlying engine, and release all any further attempt to
 */
  __pyx_codeobj__319 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 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_amplpy_ampl_pyx, __pyx_n_s_close, 397, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__319)) __PYX_ERR(3, 397, __pyx_L1_error)

  /* "amplpy/ampl.pyx":408
 *             self._c_ampl = NULL
 * 
 *     def is_running(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns true if the underlying engine is running.
 */
  __pyx_tuple__320 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_isrunning); if (unlikely(!__pyx_tuple__320)) __PYX_ERR(3, 408, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__320);
  __Pyx_GIVEREF(__pyx_tuple__320);
  __pyx_codeobj__321 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__320, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_ampl_pyx, __pyx_n_s_is_running, 408, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__321)) __PYX_ERR(3, 408, __pyx_L1_error)

  /* "amplpy/ampl.pyx":416
 *         return isrunning
 * 
 *     def solve(self, problem="", solver="", verbose=True, return_output=False, **kwargs):             # <<<<<<<<<<<<<<
 *         """
 *         Solve the current model or the problem specified by ``problem``.
 */
  __pyx_tuple__322 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_problem, __pyx_n_s_solver, __pyx_n_s_verbose, __pyx_n_s_return_output, __pyx_n_s_kwargs, __pyx_n_s_option, __pyx_n_s_value, __pyx_n_s_output); if (unlikely(!__pyx_tuple__322)) __PYX_ERR(3, 416, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__322);
  __Pyx_GIVEREF(__pyx_tuple__322);
  __pyx_codeobj__323 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__322, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_ampl_pyx, __pyx_n_s_solve_2, 416, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__323)) __PYX_ERR(3, 416, __pyx_L1_error)
  __pyx_tuple__324 = PyTuple_Pack(4, __pyx_kp_u__22, __pyx_kp_u__22, Py_True, Py_False); if (unlikely(!__pyx_tuple__324)) __PYX_ERR(3, 416, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__324);
  __Pyx_GIVEREF(__pyx_tuple__324);

  /* "amplpy/ampl.pyx":446
 *             PY_AMPL_CALL(campl.AMPL_Solve(self._c_ampl, problem.encode('utf-8'), solver.encode('utf-8')))
 * 
 *     def cd(self, path=None):             # <<<<<<<<<<<<<<
 *         """
 *         Get or set the current working directory from the underlying
 */
  __pyx_tuple__325 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_path, __pyx_n_s_errorinfo, __pyx_n_s_rc, __pyx_n_s_workdir_c, __pyx_n_s_workdir); if (unlikely(!__pyx_tuple__325)) __PYX_ERR(3, 446, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__325);
  __Pyx_GIVEREF(__pyx_tuple__325);
  __pyx_codeobj__326 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__325, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_ampl_pyx, __pyx_n_s_cd, 446, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__326)) __PYX_ERR(3, 446, __pyx_L1_error)

  /* "amplpy/ampl.pyx":474
 *         return workdir
 * 
 *     def set_option(self, name, value):             # <<<<<<<<<<<<<<
 *         """
 *         Set an AMPL option to a specified value.
 */
  __pyx_codeobj__327 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__50, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_ampl_pyx, __pyx_n_s_set_option, 474, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__327)) __PYX_ERR(3, 474, __pyx_L1_error)

  /* "amplpy/ampl.pyx":499
 *             raise TypeError
 * 
 *     def get_option(self, name):             # <<<<<<<<<<<<<<
 *         """
 *         Get the current value of the specified option. If the option does not
 */
  __pyx_tuple__328 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_name, __pyx_n_s_errorinfo, __pyx_n_s_rc, __pyx_n_s_exists, __pyx_n_s_value_c, __pyx_n_s_value); if (unlikely(!__pyx_tuple__328)) __PYX_ERR(3, 499, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__328);
  __Pyx_GIVEREF(__pyx_tuple__328);
  __pyx_codeobj__329 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__328, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_ampl_pyx, __pyx_n_s_get_option, 499, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__329)) __PYX_ERR(3, 499, __pyx_L1_error)

  /* "amplpy/ampl.pyx":535
 *                     return value
 * 
 *     def read(self, filename):             # <<<<<<<<<<<<<<
 *         """
 *         Interprets the specified file (script or model or mixed) As a side
 */
  __pyx_tuple__330 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_filename); if (unlikely(!__pyx_tuple__330)) __PYX_ERR(3, 535, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__330);
  __Pyx_GIVEREF(__pyx_tuple__330);
  __pyx_codeobj__331 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__330, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_ampl_pyx, __pyx_n_s_read, 535, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__331)) __PYX_ERR(3, 535, __pyx_L1_error)

  /* "amplpy/ampl.pyx":550
 *         PY_AMPL_CALL(campl.AMPL_Read(self._c_ampl, str(filename).encode('utf-8')))
 * 
 *     def read_data(self, filename):             # <<<<<<<<<<<<<<
 *         """
 *         Interprets the specified file as an AMPL data file. As a side effect,
 */
  __pyx_codeobj__332 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__330, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_ampl_pyx, __pyx_n_s_read_data, 550, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__332)) __PYX_ERR(3, 550, __pyx_L1_error)

  /* "amplpy/ampl.pyx":566
 *         PY_AMPL_CALL(campl.AMPL_ReadData(self._c_ampl, str(filename).encode('utf-8')))
 * 
 *     def get_value(self, scalar_expression):             # <<<<<<<<<<<<<<
 *         """
 *         Get a scalar value from the underlying AMPL interpreter, as a double or
 */
  __pyx_tuple__333 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_scalar_expression, __pyx_n_s_errorinfo, __pyx_n_s_rc, __pyx_n_s_v, __pyx_n_s_py_variant); if (unlikely(!__pyx_tuple__333)) __PYX_ERR(3, 566, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__333);
  __Pyx_GIVEREF(__pyx_tuple__333);
  __pyx_codeobj__334 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__333, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_ampl_pyx, __pyx_n_s_get_value, 566, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__334)) __PYX_ERR(3, 566, __pyx_L1_error)

  /* "amplpy/ampl.pyx":592
 *         return py_variant
 * 
 *     def set_data(self, data, set_name=None):             # <<<<<<<<<<<<<<
 *         """
 *         Assign the data in the dataframe to the AMPL entities with the names
 */
  __pyx_tuple__335 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_data, __pyx_n_s_set_name, __pyx_n_s_data_frame, __pyx_n_s_data_c); if (unlikely(!__pyx_tuple__335)) __PYX_ERR(3, 592, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__335);
  __Pyx_GIVEREF(__pyx_tuple__335);
  __pyx_codeobj__336 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__335, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_ampl_pyx, __pyx_n_s_set_data, 592, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__336)) __PYX_ERR(3, 592, __pyx_L1_error)

  /* "amplpy/ampl.pyx":616
 *             PY_AMPL_CALL(campl.AMPL_SetData(self._c_ampl, data_c, set_name.encode('utf-8')))
 * 
 *     def read_table(self, table_name):             # <<<<<<<<<<<<<<
 *         """
 *         Read the table corresponding to the specified name, equivalent to the
 */
  __pyx_tuple__337 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_table_name); if (unlikely(!__pyx_tuple__337)) __PYX_ERR(3, 616, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__337);
  __Pyx_GIVEREF(__pyx_tuple__337);
  __pyx_codeobj__338 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__337, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_ampl_pyx, __pyx_n_s_read_table, 616, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__338)) __PYX_ERR(3, 616, __pyx_L1_error)

  /* "amplpy/ampl.pyx":630
 *         PY_AMPL_CALL(campl.AMPL_ReadTable(self._c_ampl, table_name.encode('utf-8')))
 * 
 *     def write_table(self, table_name):             # <<<<<<<<<<<<<<
 *         """
 *         Write the table corresponding to the specified name, equivalent to the
 */
  __pyx_codeobj__339 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__337, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_ampl_pyx, __pyx_n_s_write_table, 630, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__339)) __PYX_ERR(3, 630, __pyx_L1_error)

  /* "amplpy/ampl.pyx":644
 *         PY_AMPL_CALL(campl.AMPL_WriteTable(self._c_ampl, table_name.encode('utf-8')))
 * 
 *     def display(self, *ampl_expressions):             # <<<<<<<<<<<<<<
 *         """
 *         Writes on the current OutputHandler the outcome of the AMPL statement.
 */
  __pyx_tuple__340 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_ampl_expressions, __pyx_n_s_errorinfo, __pyx_n_s_rc, __pyx_n_s_exprs, __pyx_n_s_size, __pyx_n_s_array, __pyx_n_s_i, __pyx_n_s_display); if (unlikely(!__pyx_tuple__340)) __PYX_ERR(3, 644, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__340);
  __Pyx_GIVEREF(__pyx_tuple__340);
  __pyx_codeobj__341 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__340, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_ampl_pyx, __pyx_n_s_display, 644, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__341)) __PYX_ERR(3, 644, __pyx_L1_error)

  /* "amplpy/ampl.pyx":677
 *             PY_AMPL_CALL(errorinfo)
 * 
 *     def set_output_handler(self, output_handler):             # <<<<<<<<<<<<<<
 *         """
 *         Sets a new output handler.
 */
  __pyx_tuple__342 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_output_handler); if (unlikely(!__pyx_tuple__342)) __PYX_ERR(3, 677, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__342);
  __Pyx_GIVEREF(__pyx_tuple__342);
  __pyx_codeobj__343 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__342, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_ampl_pyx, __pyx_n_s_set_output_handler, 677, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__343)) __PYX_ERR(3, 677, __pyx_L1_error)

  /* "amplpy/ampl.pyx":688
 *         PY_AMPL_CALL(campl.AMPL_SetOutputHandler(self._c_ampl, PyOutput, <void*>output_handler))
 * 
 *     def set_error_handler(self, error_handler):             # <<<<<<<<<<<<<<
 *         """
 *         Sets a new error handler.
 */
  __pyx_tuple__344 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_error_handler); if (unlikely(!__pyx_tuple__344)) __PYX_ERR(3, 688, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__344);
  __Pyx_GIVEREF(__pyx_tuple__344);
  __pyx_codeobj__345 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__344, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_ampl_pyx, __pyx_n_s_set_error_handler, 688, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__345)) __PYX_ERR(3, 688, __pyx_L1_error)

  /* "amplpy/ampl.pyx":698
 *         PY_AMPL_CALL(campl.AMPL_SetErrorHandler(self._c_ampl, <void*>error_handler, PyError))
 * 
 *     def get_output_handler(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the current output handler.
 */
  __pyx_codeobj__346 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__342, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_ampl_pyx, __pyx_n_s_get_output_handler, 698, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__346)) __PYX_ERR(3, 698, __pyx_L1_error)

  /* "amplpy/ampl.pyx":709
 *         return <OutputHandler>output_handler
 * 
 *     def get_error_handler(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the current error handler.
 */
  __pyx_codeobj__347 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__344, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_ampl_pyx, __pyx_n_s_get_error_handler, 709, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__347)) __PYX_ERR(3, 709, __pyx_L1_error)

  /* "amplpy/ampl.pyx":720
 *         return <ErrorHandler>error_handler
 * 
 *     def get_variables(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get all the variables declared.
 */
  __pyx_codeobj__348 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 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_amplpy_ampl_pyx, __pyx_n_s_get_variables, 720, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__348)) __PYX_ERR(3, 720, __pyx_L1_error)

  /* "amplpy/ampl.pyx":726
 *         return EntityMap.create(self._c_ampl, campl.AMPL_VARIABLE)
 * 
 *     def get_constraints(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get all the constraints declared.
 */
  __pyx_codeobj__349 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 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_amplpy_ampl_pyx, __pyx_n_s_get_constraints, 726, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__349)) __PYX_ERR(3, 726, __pyx_L1_error)

  /* "amplpy/ampl.pyx":732
 *         return EntityMap.create(self._c_ampl, campl.AMPL_CONSTRAINT)
 * 
 *     def get_objectives(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get all the objectives declared.
 */
  __pyx_codeobj__350 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 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_amplpy_ampl_pyx, __pyx_n_s_get_objectives, 732, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__350)) __PYX_ERR(3, 732, __pyx_L1_error)

  /* "amplpy/ampl.pyx":738
 *         return EntityMap.create(self._c_ampl, campl.AMPL_OBJECTIVE)
 * 
 *     def get_sets(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get all the sets declared.
 */
  __pyx_codeobj__351 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 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_amplpy_ampl_pyx, __pyx_n_s_get_sets, 738, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__351)) __PYX_ERR(3, 738, __pyx_L1_error)

  /* "amplpy/ampl.pyx":744
 *         return EntityMap.create(self._c_ampl, campl.AMPL_SET)
 * 
 *     def get_parameters(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get all the parameters declared.
 */
  __pyx_codeobj__352 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 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_amplpy_ampl_pyx, __pyx_n_s_get_parameters, 744, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__352)) __PYX_ERR(3, 744, __pyx_L1_error)

  /* "amplpy/ampl.pyx":750
 *         return EntityMap.create(self._c_ampl, campl.AMPL_PARAMETER)
 * 
 *     def get_current_objective(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the the current objective. Returns `None` if no objective is set.
 */
  __pyx_tuple__353 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_errorinfo, __pyx_n_s_rc, __pyx_n_s_objname_c, __pyx_n_s_objname); if (unlikely(!__pyx_tuple__353)) __PYX_ERR(3, 750, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__353);
  __Pyx_GIVEREF(__pyx_tuple__353);
  __pyx_codeobj__354 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__353, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_ampl_pyx, __pyx_n_s_get_current_objective, 750, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__354)) __PYX_ERR(3, 750, __pyx_L1_error)

  /* "amplpy/ampl.pyx":769
 *             return self.get_objective(objname)
 * 
 *     def _var(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get/Set a variable.
 */
  __pyx_tuple__355 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_Variables); if (unlikely(!__pyx_tuple__355)) __PYX_ERR(3, 769, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__355);
  __Pyx_GIVEREF(__pyx_tuple__355);
  __pyx_codeobj__356 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__355, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_ampl_pyx, __pyx_n_s_var, 769, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__356)) __PYX_ERR(3, 769, __pyx_L1_error)

  /* "amplpy/ampl.pyx":792
 *         return Variables(self)
 * 
 *     def _con(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get/Set a constraint.
 */
  __pyx_tuple__357 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_Constraints); if (unlikely(!__pyx_tuple__357)) __PYX_ERR(3, 792, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__357);
  __Pyx_GIVEREF(__pyx_tuple__357);
  __pyx_codeobj__358 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__357, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_ampl_pyx, __pyx_n_s_con, 792, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__358)) __PYX_ERR(3, 792, __pyx_L1_error)

  /* "amplpy/ampl.pyx":816
 *         return Constraints(self)
 * 
 *     def _obj(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get an objective.
 */
  __pyx_tuple__359 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_Objectives); if (unlikely(!__pyx_tuple__359)) __PYX_ERR(3, 816, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__359);
  __Pyx_GIVEREF(__pyx_tuple__359);
  __pyx_codeobj__360 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__359, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_ampl_pyx, __pyx_n_s_obj, 816, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__360)) __PYX_ERR(3, 816, __pyx_L1_error)

  /* "amplpy/ampl.pyx":833
 *         return Objectives(self)
 * 
 *     def _set(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get/Set a set.
 */
  __pyx_tuple__361 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_Sets); if (unlikely(!__pyx_tuple__361)) __PYX_ERR(3, 833, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__361);
  __Pyx_GIVEREF(__pyx_tuple__361);
  __pyx_codeobj__362 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__361, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_ampl_pyx, __pyx_n_s_set_2, 833, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__362)) __PYX_ERR(3, 833, __pyx_L1_error)

  /* "amplpy/ampl.pyx":853
 *         return Sets(self)
 * 
 *     def _param(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get/Set a parameter.
 */
  __pyx_tuple__363 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_Parameters); if (unlikely(!__pyx_tuple__363)) __PYX_ERR(3, 853, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__363);
  __Pyx_GIVEREF(__pyx_tuple__363);
  __pyx_codeobj__364 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__363, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_ampl_pyx, __pyx_n_s_param, 853, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__364)) __PYX_ERR(3, 853, __pyx_L1_error)

  /* "amplpy/ampl.pyx":876
 *         return Parameters(self)
 * 
 *     def _option(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get/Set an option.
 */
  __pyx_tuple__365 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_Options); if (unlikely(!__pyx_tuple__365)) __PYX_ERR(3, 876, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__365);
  __Pyx_GIVEREF(__pyx_tuple__365);
  __pyx_codeobj__366 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__365, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_ampl_pyx, __pyx_n_s_option_2, 876, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__366)) __PYX_ERR(3, 876, __pyx_L1_error)

  /* "amplpy/ampl.pyx":901
 * 
 * 
 *     def export_model(self, filename=""):             # <<<<<<<<<<<<<<
 *         """
 *         Create a .mod file with the model that has been loaded.
 */
  __pyx_tuple__367 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_filename, __pyx_n_s_errorinfo, __pyx_n_s_rc, __pyx_n_s_output_c, __pyx_n_s_output); if (unlikely(!__pyx_tuple__367)) __PYX_ERR(3, 901, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__367);
  __Pyx_GIVEREF(__pyx_tuple__367);
  __pyx_codeobj__368 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__367, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_ampl_pyx, __pyx_n_s_export_model, 901, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__368)) __PYX_ERR(3, 901, __pyx_L1_error)
  __pyx_tuple__369 = PyTuple_Pack(1, __pyx_kp_u__22); if (unlikely(!__pyx_tuple__369)) __PYX_ERR(3, 901, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__369);
  __Pyx_GIVEREF(__pyx_tuple__369);

  /* "amplpy/ampl.pyx":922
 *         return output
 * 
 *     def export_data(self, filename=""):             # <<<<<<<<<<<<<<
 *         """
 *         Create a .dat file with the data that has been loaded.
 */
  __pyx_codeobj__370 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__367, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_ampl_pyx, __pyx_n_s_export_data, 922, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__370)) __PYX_ERR(3, 922, __pyx_L1_error)

  /* "amplpy/ampl.pyx":943
 *         return output
 * 
 *     def snapshot(self, filename="", model=True, data=True, options=True):             # <<<<<<<<<<<<<<
 *         """
 *         Create a snapshot file that replicates the current session.
 */
  __pyx_tuple__371 = PyTuple_Pack(12, __pyx_n_s_self, __pyx_n_s_filename, __pyx_n_s_model, __pyx_n_s_data, __pyx_n_s_options_2, __pyx_n_s_errorinfo, __pyx_n_s_rc, __pyx_n_s_model_c, __pyx_n_s_data_c, __pyx_n_s_options_c, __pyx_n_s_output_c, __pyx_n_s_output); if (unlikely(!__pyx_tuple__371)) __PYX_ERR(3, 943, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__371);
  __Pyx_GIVEREF(__pyx_tuple__371);
  __pyx_codeobj__372 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__371, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_ampl_pyx, __pyx_n_s_snapshot, 943, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__372)) __PYX_ERR(3, 943, __pyx_L1_error)
  __pyx_tuple__373 = PyTuple_Pack(4, __pyx_kp_u__22, Py_True, Py_True, Py_True); if (unlikely(!__pyx_tuple__373)) __PYX_ERR(3, 943, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__373);
  __Pyx_GIVEREF(__pyx_tuple__373);

  /* "amplpy/ampl.pyx":973
 *         return output
 * 
 *     def write(self, filename, auxfiles=""):             # <<<<<<<<<<<<<<
 *         """
 *         Invoke write command with filename as argument and
 */
  __pyx_tuple__374 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_filename, __pyx_n_s_auxfiles); if (unlikely(!__pyx_tuple__374)) __PYX_ERR(3, 973, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__374);
  __Pyx_GIVEREF(__pyx_tuple__374);
  __pyx_codeobj__375 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__374, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_ampl_pyx, __pyx_n_s_write, 973, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__375)) __PYX_ERR(3, 973, __pyx_L1_error)

  /* "amplpy/ampl.pyx":1034
 *         return self.get_value("solve_result_num")
 * 
 *     def get_iis(self, flat=True):             # <<<<<<<<<<<<<<
 *         """
 *         Get IIS attributes for all variables and constraints.
 */
  __pyx_tuple__376 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_flat, __pyx_n_s_iis_var, __pyx_n_s_iis_con); if (unlikely(!__pyx_tuple__376)) __PYX_ERR(3, 1034, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__376);
  __Pyx_GIVEREF(__pyx_tuple__376);
  __pyx_codeobj__377 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__376, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_ampl_pyx, __pyx_n_s_get_iis, 1034, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__377)) __PYX_ERR(3, 1034, __pyx_L1_error)

  /* "amplpy/ampl.pyx":1078
 *         return iis_var, iis_con
 * 
 *     def get_solution(self, flat=True, zeros=False):             # <<<<<<<<<<<<<<
 *         """
 *         Get solution values for all variables.
 */
  __pyx_tuple__378 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_flat, __pyx_n_s_zeros, __pyx_n_s_stmt, __pyx_n_s_lst_solution); if (unlikely(!__pyx_tuple__378)) __PYX_ERR(3, 1078, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__378);
  __Pyx_GIVEREF(__pyx_tuple__378);
  __pyx_codeobj__379 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__378, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_ampl_pyx, __pyx_n_s_get_solution, 1078, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__379)) __PYX_ERR(3, 1078, __pyx_L1_error)
  __pyx_tuple__380 = PyTuple_Pack(2, Py_True, Py_False); if (unlikely(!__pyx_tuple__380)) __PYX_ERR(3, 1078, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__380);
  __Pyx_GIVEREF(__pyx_tuple__380);

  /* "amplpy/ampl.pyx":1107
 *         return nested_dict_of_suffixes(lst_solution)
 * 
 *     def _start_recording(self, filename):             # <<<<<<<<<<<<<<
 *         """
 *         Start recording the session to a file for debug purposes.
 */
  __pyx_codeobj__381 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__330, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_ampl_pyx, __pyx_n_s_start_recording, 1107, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__381)) __PYX_ERR(3, 1107, __pyx_L1_error)

  /* "amplpy/ampl.pyx":1116
 *         PY_AMPL_CALL(campl.AMPL_SetDblOption(self._c_ampl, "_log", 1))
 * 
 *     def _stop_recording(self):             # <<<<<<<<<<<<<<
 *         """
 *         Stop recording the session.
 */
  __pyx_codeobj__382 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 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_amplpy_ampl_pyx, __pyx_n_s_stop_recording, 1116, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__382)) __PYX_ERR(3, 1116, __pyx_L1_error)

  /* "amplpy/ampl.pyx":1122
 *         PY_AMPL_CALL(campl.AMPL_SetDblOption(self._c_ampl, "_log", 0))
 * 
 *     def _load_session(self, filename):             # <<<<<<<<<<<<<<
 *         """
 *         Load a recorded session.
 */
  __pyx_tuple__383 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_filename, __pyx_n_s_exp); if (unlikely(!__pyx_tuple__383)) __PYX_ERR(3, 1122, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__383);
  __Pyx_GIVEREF(__pyx_tuple__383);
  __pyx_codeobj__384 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__383, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_amplpy_ampl_pyx, __pyx_n_s_load_session, 1122, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__384)) __PYX_ERR(3, 1122, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._c_ampl cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_codeobj__385 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 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_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__385)) __PYX_ERR(8, 1, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._c_ampl cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._c_ampl cannot be converted to a Python object for pickling"
 */
  __pyx_codeobj__386 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__111, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__386)) __PYX_ERR(8, 3, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __pyx_unpickle_ErrorHandler(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */
  __pyx_tuple__387 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__387)) __PYX_ERR(8, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__387);
  __Pyx_GIVEREF(__pyx_tuple__387);
  __pyx_codeobj__388 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__387, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_ErrorHandler, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__388)) __PYX_ERR(8, 1, __pyx_L1_error)
  __pyx_codeobj__389 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__387, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_OutputHandler, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__389)) __PYX_ERR(8, 1, __pyx_L1_error)
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}
/* #### Code section: init_constants ### */

static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) {
  if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(3, 1, __pyx_L1_error);
  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(3, 1, __pyx_L1_error)
  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(3, 1, __pyx_L1_error)
  __pyx_int_222419149 = PyInt_FromLong(222419149L); if (unlikely(!__pyx_int_222419149)) __PYX_ERR(3, 1, __pyx_L1_error)
  __pyx_int_228825662 = PyInt_FromLong(228825662L); if (unlikely(!__pyx_int_228825662)) __PYX_ERR(3, 1, __pyx_L1_error)
  __pyx_int_238750788 = PyInt_FromLong(238750788L); if (unlikely(!__pyx_int_238750788)) __PYX_ERR(3, 1, __pyx_L1_error)
  return 0;
  __pyx_L1_error:;
  return -1;
}
/* #### Code section: init_globals ### */

static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
  /* AssertionsEnabled.init */
  if (likely(__Pyx_init_assertions_enabled() == 0)); else

if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 1, __pyx_L1_error)

  return 0;
  __pyx_L1_error:;
  return -1;
}
/* #### Code section: init_module ### */

static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
static CYTHON_SMALL_CODE 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
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
  /*--- Type init code ---*/
  __pyx_vtabptr_7_amplpy_Row = &__pyx_vtable_7_amplpy_Row;
  __pyx_vtable_7_amplpy_Row.create = (PyObject *(*)(AMPL_DATAFRAME *, size_t))__pyx_f_7_amplpy_3Row_create;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_7_amplpy_Row = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7_amplpy_Row_spec, NULL); if (unlikely(!__pyx_ptype_7_amplpy_Row)) __PYX_ERR(0, 17, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7_amplpy_Row_spec, __pyx_ptype_7_amplpy_Row) < 0) __PYX_ERR(0, 17, __pyx_L1_error)
  #else
  __pyx_ptype_7_amplpy_Row = &__pyx_type_7_amplpy_Row;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_7_amplpy_Row) < 0) __PYX_ERR(0, 17, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_7_amplpy_Row->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_7_amplpy_Row->tp_dictoffset && __pyx_ptype_7_amplpy_Row->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_7_amplpy_Row->tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_ptype_7_amplpy_Row, __pyx_vtabptr_7_amplpy_Row) < 0) __PYX_ERR(0, 17, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_MergeVtables(__pyx_ptype_7_amplpy_Row) < 0) __PYX_ERR(0, 17, __pyx_L1_error)
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Row, (PyObject *) __pyx_ptype_7_amplpy_Row) < 0) __PYX_ERR(0, 17, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_7_amplpy_Row) < 0) __PYX_ERR(0, 17, __pyx_L1_error)
  #endif
  __pyx_vtabptr_7_amplpy_Column = &__pyx_vtable_7_amplpy_Column;
  __pyx_vtable_7_amplpy_Column.create = (PyObject *(*)(AMPL_DATAFRAME *, size_t))__pyx_f_7_amplpy_6Column_create;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_7_amplpy_Column = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7_amplpy_Column_spec, NULL); if (unlikely(!__pyx_ptype_7_amplpy_Column)) __PYX_ERR(0, 49, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7_amplpy_Column_spec, __pyx_ptype_7_amplpy_Column) < 0) __PYX_ERR(0, 49, __pyx_L1_error)
  #else
  __pyx_ptype_7_amplpy_Column = &__pyx_type_7_amplpy_Column;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_7_amplpy_Column) < 0) __PYX_ERR(0, 49, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_7_amplpy_Column->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_7_amplpy_Column->tp_dictoffset && __pyx_ptype_7_amplpy_Column->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_7_amplpy_Column->tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_ptype_7_amplpy_Column, __pyx_vtabptr_7_amplpy_Column) < 0) __PYX_ERR(0, 49, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_MergeVtables(__pyx_ptype_7_amplpy_Column) < 0) __PYX_ERR(0, 49, __pyx_L1_error)
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Column, (PyObject *) __pyx_ptype_7_amplpy_Column) < 0) __PYX_ERR(0, 49, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_7_amplpy_Column) < 0) __PYX_ERR(0, 49, __pyx_L1_error)
  #endif
  __pyx_vtabptr_7_amplpy_DataFrame = &__pyx_vtable_7_amplpy_DataFrame;
  __pyx_vtable_7_amplpy_DataFrame.get_ptr = (AMPL_DATAFRAME *(*)(struct __pyx_obj_7_amplpy_DataFrame *))__pyx_f_7_amplpy_9DataFrame_get_ptr;
  __pyx_vtable_7_amplpy_DataFrame.create = (PyObject *(*)(AMPL_DATAFRAME *))__pyx_f_7_amplpy_9DataFrame_create;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_7_amplpy_DataFrame = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7_amplpy_DataFrame_spec, NULL); if (unlikely(!__pyx_ptype_7_amplpy_DataFrame)) __PYX_ERR(0, 88, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7_amplpy_DataFrame_spec, __pyx_ptype_7_amplpy_DataFrame) < 0) __PYX_ERR(0, 88, __pyx_L1_error)
  #else
  __pyx_ptype_7_amplpy_DataFrame = &__pyx_type_7_amplpy_DataFrame;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_7_amplpy_DataFrame) < 0) __PYX_ERR(0, 88, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_7_amplpy_DataFrame->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_7_amplpy_DataFrame->tp_dictoffset && __pyx_ptype_7_amplpy_DataFrame->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_7_amplpy_DataFrame->tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_ptype_7_amplpy_DataFrame, __pyx_vtabptr_7_amplpy_DataFrame) < 0) __PYX_ERR(0, 88, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_MergeVtables(__pyx_ptype_7_amplpy_DataFrame) < 0) __PYX_ERR(0, 88, __pyx_L1_error)
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_DataFrame, (PyObject *) __pyx_ptype_7_amplpy_DataFrame) < 0) __PYX_ERR(0, 88, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_7_amplpy_DataFrame) < 0) __PYX_ERR(0, 88, __pyx_L1_error)
  #endif
  __pyx_vtabptr_7_amplpy_Entity = &__pyx_vtable_7_amplpy_Entity;
  __pyx_vtable_7_amplpy_Entity.create = (PyObject *(*)(AMPL *, char *, AMPL_TUPLE *, PyObject *))__pyx_f_7_amplpy_6Entity_create;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_7_amplpy_Entity = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7_amplpy_Entity_spec, NULL); if (unlikely(!__pyx_ptype_7_amplpy_Entity)) __PYX_ERR(9, 12, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7_amplpy_Entity_spec, __pyx_ptype_7_amplpy_Entity) < 0) __PYX_ERR(9, 12, __pyx_L1_error)
  #else
  __pyx_ptype_7_amplpy_Entity = &__pyx_type_7_amplpy_Entity;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_7_amplpy_Entity) < 0) __PYX_ERR(9, 12, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_7_amplpy_Entity->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_7_amplpy_Entity->tp_dictoffset && __pyx_ptype_7_amplpy_Entity->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_7_amplpy_Entity->tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_ptype_7_amplpy_Entity, __pyx_vtabptr_7_amplpy_Entity) < 0) __PYX_ERR(9, 12, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_MergeVtables(__pyx_ptype_7_amplpy_Entity) < 0) __PYX_ERR(9, 12, __pyx_L1_error)
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Entity, (PyObject *) __pyx_ptype_7_amplpy_Entity) < 0) __PYX_ERR(9, 12, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_7_amplpy_Entity) < 0) __PYX_ERR(9, 12, __pyx_L1_error)
  #endif
  __pyx_vtabptr_7_amplpy_Constraint = &__pyx_vtable_7_amplpy_Constraint;
  __pyx_vtable_7_amplpy_Constraint.__pyx_base = *__pyx_vtabptr_7_amplpy_Entity;
  __pyx_vtable_7_amplpy_Constraint.__pyx_base.create = (PyObject *(*)(AMPL *, char *, AMPL_TUPLE *, PyObject *))__pyx_f_7_amplpy_10Constraint_create;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_ptype_7_amplpy_Entity); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_ptype_7_amplpy_Constraint = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7_amplpy_Constraint_spec, __pyx_t_1);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_ptype_7_amplpy_Constraint)) __PYX_ERR(5, 6, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7_amplpy_Constraint_spec, __pyx_ptype_7_amplpy_Constraint) < 0) __PYX_ERR(5, 6, __pyx_L1_error)
  #else
  __pyx_ptype_7_amplpy_Constraint = &__pyx_type_7_amplpy_Constraint;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_ptype_7_amplpy_Constraint->tp_base = __pyx_ptype_7_amplpy_Entity;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_7_amplpy_Constraint) < 0) __PYX_ERR(5, 6, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_7_amplpy_Constraint->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_7_amplpy_Constraint->tp_dictoffset && __pyx_ptype_7_amplpy_Constraint->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_7_amplpy_Constraint->tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_ptype_7_amplpy_Constraint, __pyx_vtabptr_7_amplpy_Constraint) < 0) __PYX_ERR(5, 6, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_MergeVtables(__pyx_ptype_7_amplpy_Constraint) < 0) __PYX_ERR(5, 6, __pyx_L1_error)
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Constraint, (PyObject *) __pyx_ptype_7_amplpy_Constraint) < 0) __PYX_ERR(5, 6, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_7_amplpy_Constraint) < 0) __PYX_ERR(5, 6, __pyx_L1_error)
  #endif
  __pyx_vtabptr_7_amplpy_Environment = &__pyx_vtable_7_amplpy_Environment;
  __pyx_vtable_7_amplpy_Environment.get_c_pointer = (AMPL_ENVIRONMENT *(*)(struct __pyx_obj_7_amplpy_Environment *))__pyx_f_7_amplpy_11Environment_get_c_pointer;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_7_amplpy_Environment = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7_amplpy_Environment_spec, NULL); if (unlikely(!__pyx_ptype_7_amplpy_Environment)) __PYX_ERR(10, 5, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7_amplpy_Environment_spec, __pyx_ptype_7_amplpy_Environment) < 0) __PYX_ERR(10, 5, __pyx_L1_error)
  #else
  __pyx_ptype_7_amplpy_Environment = &__pyx_type_7_amplpy_Environment;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_7_amplpy_Environment) < 0) __PYX_ERR(10, 5, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_7_amplpy_Environment->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_7_amplpy_Environment->tp_dictoffset && __pyx_ptype_7_amplpy_Environment->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_7_amplpy_Environment->tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #endif
  #if CYTHON_UPDATE_DESCRIPTOR_DOC
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)__pyx_ptype_7_amplpy_Environment, "__setitem__"); if (unlikely(!wrapper)) __PYX_ERR(10, 5, __pyx_L1_error)
    if (__Pyx_IS_TYPE(wrapper, &PyWrapperDescr_Type)) {
      __pyx_wrapperbase_7_amplpy_11Environment_8__setitem__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_7_amplpy_11Environment_8__setitem__.doc = __pyx_doc_7_amplpy_11Environment_8__setitem__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_7_amplpy_11Environment_8__setitem__;
    }
  }
  #endif
  #if CYTHON_UPDATE_DESCRIPTOR_DOC
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)__pyx_ptype_7_amplpy_Environment, "__getitem__"); if (unlikely(!wrapper)) __PYX_ERR(10, 5, __pyx_L1_error)
    if (__Pyx_IS_TYPE(wrapper, &PyWrapperDescr_Type)) {
      __pyx_wrapperbase_7_amplpy_11Environment_10__getitem__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_7_amplpy_11Environment_10__getitem__.doc = __pyx_doc_7_amplpy_11Environment_10__getitem__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_7_amplpy_11Environment_10__getitem__;
    }
  }
  #endif
  if (__Pyx_SetVtable(__pyx_ptype_7_amplpy_Environment, __pyx_vtabptr_7_amplpy_Environment) < 0) __PYX_ERR(10, 5, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_MergeVtables(__pyx_ptype_7_amplpy_Environment) < 0) __PYX_ERR(10, 5, __pyx_L1_error)
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Environment, (PyObject *) __pyx_ptype_7_amplpy_Environment) < 0) __PYX_ERR(10, 5, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_7_amplpy_Environment) < 0) __PYX_ERR(10, 5, __pyx_L1_error)
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_7_amplpy_ErrorHandler = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7_amplpy_ErrorHandler_spec, NULL); if (unlikely(!__pyx_ptype_7_amplpy_ErrorHandler)) __PYX_ERR(11, 15, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7_amplpy_ErrorHandler_spec, __pyx_ptype_7_amplpy_ErrorHandler) < 0) __PYX_ERR(11, 15, __pyx_L1_error)
  #else
  __pyx_ptype_7_amplpy_ErrorHandler = &__pyx_type_7_amplpy_ErrorHandler;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_7_amplpy_ErrorHandler) < 0) __PYX_ERR(11, 15, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_7_amplpy_ErrorHandler->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_7_amplpy_ErrorHandler->tp_dictoffset && __pyx_ptype_7_amplpy_ErrorHandler->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_7_amplpy_ErrorHandler->tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ErrorHandler, (PyObject *) __pyx_ptype_7_amplpy_ErrorHandler) < 0) __PYX_ERR(11, 15, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_7_amplpy_ErrorHandler) < 0) __PYX_ERR(11, 15, __pyx_L1_error)
  #endif
  __pyx_vtabptr_7_amplpy_EnvIterator = &__pyx_vtable_7_amplpy_EnvIterator;
  __pyx_vtable_7_amplpy_EnvIterator.create = (PyObject *(*)(AMPL_ENVIRONMENT *))__pyx_f_7_amplpy_11EnvIterator_create;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_7_amplpy_EnvIterator = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7_amplpy_EnvIterator_spec, NULL); if (unlikely(!__pyx_ptype_7_amplpy_EnvIterator)) __PYX_ERR(6, 1, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7_amplpy_EnvIterator_spec, __pyx_ptype_7_amplpy_EnvIterator) < 0) __PYX_ERR(6, 1, __pyx_L1_error)
  #else
  __pyx_ptype_7_amplpy_EnvIterator = &__pyx_type_7_amplpy_EnvIterator;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_7_amplpy_EnvIterator) < 0) __PYX_ERR(6, 1, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_7_amplpy_EnvIterator->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_7_amplpy_EnvIterator->tp_dictoffset && __pyx_ptype_7_amplpy_EnvIterator->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_7_amplpy_EnvIterator->tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_ptype_7_amplpy_EnvIterator, __pyx_vtabptr_7_amplpy_EnvIterator) < 0) __PYX_ERR(6, 1, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_MergeVtables(__pyx_ptype_7_amplpy_EnvIterator) < 0) __PYX_ERR(6, 1, __pyx_L1_error)
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_EnvIterator, (PyObject *) __pyx_ptype_7_amplpy_EnvIterator) < 0) __PYX_ERR(6, 1, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_7_amplpy_EnvIterator) < 0) __PYX_ERR(6, 1, __pyx_L1_error)
  #endif
  __pyx_vtabptr_7_amplpy_EntityMap = &__pyx_vtable_7_amplpy_EntityMap;
  __pyx_vtable_7_amplpy_EntityMap.create = (PyObject *(*)(AMPL *, AMPL_ENTITYTYPE))__pyx_f_7_amplpy_9EntityMap_create;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_7_amplpy_EntityMap = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7_amplpy_EntityMap_spec, NULL); if (unlikely(!__pyx_ptype_7_amplpy_EntityMap)) __PYX_ERR(6, 38, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7_amplpy_EntityMap_spec, __pyx_ptype_7_amplpy_EntityMap) < 0) __PYX_ERR(6, 38, __pyx_L1_error)
  #else
  __pyx_ptype_7_amplpy_EntityMap = &__pyx_type_7_amplpy_EntityMap;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_7_amplpy_EntityMap) < 0) __PYX_ERR(6, 38, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_7_amplpy_EntityMap->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_7_amplpy_EntityMap->tp_dictoffset && __pyx_ptype_7_amplpy_EntityMap->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_7_amplpy_EntityMap->tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_ptype_7_amplpy_EntityMap, __pyx_vtabptr_7_amplpy_EntityMap) < 0) __PYX_ERR(6, 38, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_MergeVtables(__pyx_ptype_7_amplpy_EntityMap) < 0) __PYX_ERR(6, 38, __pyx_L1_error)
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_EntityMap, (PyObject *) __pyx_ptype_7_amplpy_EntityMap) < 0) __PYX_ERR(6, 38, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_7_amplpy_EntityMap) < 0) __PYX_ERR(6, 38, __pyx_L1_error)
  #endif
  __pyx_vtabptr_7_amplpy_InstanceIterator = &__pyx_vtable_7_amplpy_InstanceIterator;
  __pyx_vtable_7_amplpy_InstanceIterator.create = (PyObject *(*)(AMPL *, char *, AMPL_ENTITYTYPE, PyObject *))__pyx_f_7_amplpy_16InstanceIterator_create;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_7_amplpy_InstanceIterator = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7_amplpy_InstanceIterator_spec, NULL); if (unlikely(!__pyx_ptype_7_amplpy_InstanceIterator)) __PYX_ERR(6, 117, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7_amplpy_InstanceIterator_spec, __pyx_ptype_7_amplpy_InstanceIterator) < 0) __PYX_ERR(6, 117, __pyx_L1_error)
  #else
  __pyx_ptype_7_amplpy_InstanceIterator = &__pyx_type_7_amplpy_InstanceIterator;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_7_amplpy_InstanceIterator) < 0) __PYX_ERR(6, 117, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_7_amplpy_InstanceIterator->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_7_amplpy_InstanceIterator->tp_dictoffset && __pyx_ptype_7_amplpy_InstanceIterator->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_7_amplpy_InstanceIterator->tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_ptype_7_amplpy_InstanceIterator, __pyx_vtabptr_7_amplpy_InstanceIterator) < 0) __PYX_ERR(6, 117, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_MergeVtables(__pyx_ptype_7_amplpy_InstanceIterator) < 0) __PYX_ERR(6, 117, __pyx_L1_error)
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_InstanceIterator, (PyObject *) __pyx_ptype_7_amplpy_InstanceIterator) < 0) __PYX_ERR(6, 117, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_7_amplpy_InstanceIterator) < 0) __PYX_ERR(6, 117, __pyx_L1_error)
  #endif
  __pyx_vtabptr_7_amplpy_MemberRangeIterator = &__pyx_vtable_7_amplpy_MemberRangeIterator;
  __pyx_vtable_7_amplpy_MemberRangeIterator.create = (PyObject *(*)(AMPL *, char *, AMPL_TUPLE *, PyObject *))__pyx_f_7_amplpy_19MemberRangeIterator_create;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_7_amplpy_MemberRangeIterator = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7_amplpy_MemberRangeIterator_spec, NULL); if (unlikely(!__pyx_ptype_7_amplpy_MemberRangeIterator)) __PYX_ERR(6, 192, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7_amplpy_MemberRangeIterator_spec, __pyx_ptype_7_amplpy_MemberRangeIterator) < 0) __PYX_ERR(6, 192, __pyx_L1_error)
  #else
  __pyx_ptype_7_amplpy_MemberRangeIterator = &__pyx_type_7_amplpy_MemberRangeIterator;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_7_amplpy_MemberRangeIterator) < 0) __PYX_ERR(6, 192, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_7_amplpy_MemberRangeIterator->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_7_amplpy_MemberRangeIterator->tp_dictoffset && __pyx_ptype_7_amplpy_MemberRangeIterator->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_7_amplpy_MemberRangeIterator->tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_ptype_7_amplpy_MemberRangeIterator, __pyx_vtabptr_7_amplpy_MemberRangeIterator) < 0) __PYX_ERR(6, 192, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_MergeVtables(__pyx_ptype_7_amplpy_MemberRangeIterator) < 0) __PYX_ERR(6, 192, __pyx_L1_error)
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_MemberRangeIterator, (PyObject *) __pyx_ptype_7_amplpy_MemberRangeIterator) < 0) __PYX_ERR(6, 192, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_7_amplpy_MemberRangeIterator) < 0) __PYX_ERR(6, 192, __pyx_L1_error)
  #endif
  __pyx_vtabptr_7_amplpy_ColIterator = &__pyx_vtable_7_amplpy_ColIterator;
  __pyx_vtable_7_amplpy_ColIterator.create = (PyObject *(*)(AMPL_DATAFRAME *, size_t))__pyx_f_7_amplpy_11ColIterator_create;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_7_amplpy_ColIterator = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7_amplpy_ColIterator_spec, NULL); if (unlikely(!__pyx_ptype_7_amplpy_ColIterator)) __PYX_ERR(6, 263, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7_amplpy_ColIterator_spec, __pyx_ptype_7_amplpy_ColIterator) < 0) __PYX_ERR(6, 263, __pyx_L1_error)
  #else
  __pyx_ptype_7_amplpy_ColIterator = &__pyx_type_7_amplpy_ColIterator;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_7_amplpy_ColIterator) < 0) __PYX_ERR(6, 263, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_7_amplpy_ColIterator->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_7_amplpy_ColIterator->tp_dictoffset && __pyx_ptype_7_amplpy_ColIterator->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_7_amplpy_ColIterator->tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_ptype_7_amplpy_ColIterator, __pyx_vtabptr_7_amplpy_ColIterator) < 0) __PYX_ERR(6, 263, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_MergeVtables(__pyx_ptype_7_amplpy_ColIterator) < 0) __PYX_ERR(6, 263, __pyx_L1_error)
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ColIterator, (PyObject *) __pyx_ptype_7_amplpy_ColIterator) < 0) __PYX_ERR(6, 263, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_7_amplpy_ColIterator) < 0) __PYX_ERR(6, 263, __pyx_L1_error)
  #endif
  __pyx_vtabptr_7_amplpy_RowIterator = &__pyx_vtable_7_amplpy_RowIterator;
  __pyx_vtable_7_amplpy_RowIterator.create = (PyObject *(*)(AMPL_DATAFRAME *, size_t))__pyx_f_7_amplpy_11RowIterator_create;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_7_amplpy_RowIterator = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7_amplpy_RowIterator_spec, NULL); if (unlikely(!__pyx_ptype_7_amplpy_RowIterator)) __PYX_ERR(6, 289, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7_amplpy_RowIterator_spec, __pyx_ptype_7_amplpy_RowIterator) < 0) __PYX_ERR(6, 289, __pyx_L1_error)
  #else
  __pyx_ptype_7_amplpy_RowIterator = &__pyx_type_7_amplpy_RowIterator;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_7_amplpy_RowIterator) < 0) __PYX_ERR(6, 289, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_7_amplpy_RowIterator->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_7_amplpy_RowIterator->tp_dictoffset && __pyx_ptype_7_amplpy_RowIterator->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_7_amplpy_RowIterator->tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_ptype_7_amplpy_RowIterator, __pyx_vtabptr_7_amplpy_RowIterator) < 0) __PYX_ERR(6, 289, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_MergeVtables(__pyx_ptype_7_amplpy_RowIterator) < 0) __PYX_ERR(6, 289, __pyx_L1_error)
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_RowIterator, (PyObject *) __pyx_ptype_7_amplpy_RowIterator) < 0) __PYX_ERR(6, 289, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_7_amplpy_RowIterator) < 0) __PYX_ERR(6, 289, __pyx_L1_error)
  #endif
  __pyx_vtabptr_7_amplpy_Objective = &__pyx_vtable_7_amplpy_Objective;
  __pyx_vtable_7_amplpy_Objective.__pyx_base = *__pyx_vtabptr_7_amplpy_Entity;
  __pyx_vtable_7_amplpy_Objective.__pyx_base.create = (PyObject *(*)(AMPL *, char *, AMPL_TUPLE *, PyObject *))__pyx_f_7_amplpy_9Objective_create;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_ptype_7_amplpy_Entity); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_ptype_7_amplpy_Objective = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7_amplpy_Objective_spec, __pyx_t_1);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_ptype_7_amplpy_Objective)) __PYX_ERR(12, 4, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7_amplpy_Objective_spec, __pyx_ptype_7_amplpy_Objective) < 0) __PYX_ERR(12, 4, __pyx_L1_error)
  #else
  __pyx_ptype_7_amplpy_Objective = &__pyx_type_7_amplpy_Objective;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_ptype_7_amplpy_Objective->tp_base = __pyx_ptype_7_amplpy_Entity;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_7_amplpy_Objective) < 0) __PYX_ERR(12, 4, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_7_amplpy_Objective->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_7_amplpy_Objective->tp_dictoffset && __pyx_ptype_7_amplpy_Objective->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_7_amplpy_Objective->tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_ptype_7_amplpy_Objective, __pyx_vtabptr_7_amplpy_Objective) < 0) __PYX_ERR(12, 4, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_MergeVtables(__pyx_ptype_7_amplpy_Objective) < 0) __PYX_ERR(12, 4, __pyx_L1_error)
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Objective, (PyObject *) __pyx_ptype_7_amplpy_Objective) < 0) __PYX_ERR(12, 4, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_7_amplpy_Objective) < 0) __PYX_ERR(12, 4, __pyx_L1_error)
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_7_amplpy_OutputHandler = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7_amplpy_OutputHandler_spec, NULL); if (unlikely(!__pyx_ptype_7_amplpy_OutputHandler)) __PYX_ERR(2, 6, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7_amplpy_OutputHandler_spec, __pyx_ptype_7_amplpy_OutputHandler) < 0) __PYX_ERR(2, 6, __pyx_L1_error)
  #else
  __pyx_ptype_7_amplpy_OutputHandler = &__pyx_type_7_amplpy_OutputHandler;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_7_amplpy_OutputHandler) < 0) __PYX_ERR(2, 6, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_7_amplpy_OutputHandler->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_7_amplpy_OutputHandler->tp_dictoffset && __pyx_ptype_7_amplpy_OutputHandler->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_7_amplpy_OutputHandler->tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_OutputHandler, (PyObject *) __pyx_ptype_7_amplpy_OutputHandler) < 0) __PYX_ERR(2, 6, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_7_amplpy_OutputHandler) < 0) __PYX_ERR(2, 6, __pyx_L1_error)
  #endif
  __pyx_vtabptr_7_amplpy_Parameter = &__pyx_vtable_7_amplpy_Parameter;
  __pyx_vtable_7_amplpy_Parameter.__pyx_base = *__pyx_vtabptr_7_amplpy_Entity;
  __pyx_vtable_7_amplpy_Parameter.__pyx_base.create = (PyObject *(*)(AMPL *, char *, AMPL_TUPLE *, PyObject *))__pyx_f_7_amplpy_9Parameter_create;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_ptype_7_amplpy_Entity); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 19, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_ptype_7_amplpy_Parameter = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7_amplpy_Parameter_spec, __pyx_t_1);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_ptype_7_amplpy_Parameter)) __PYX_ERR(13, 19, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7_amplpy_Parameter_spec, __pyx_ptype_7_amplpy_Parameter) < 0) __PYX_ERR(13, 19, __pyx_L1_error)
  #else
  __pyx_ptype_7_amplpy_Parameter = &__pyx_type_7_amplpy_Parameter;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_ptype_7_amplpy_Parameter->tp_base = __pyx_ptype_7_amplpy_Entity;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_7_amplpy_Parameter) < 0) __PYX_ERR(13, 19, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_7_amplpy_Parameter->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_7_amplpy_Parameter->tp_dictoffset && __pyx_ptype_7_amplpy_Parameter->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_7_amplpy_Parameter->tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_ptype_7_amplpy_Parameter, __pyx_vtabptr_7_amplpy_Parameter) < 0) __PYX_ERR(13, 19, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_MergeVtables(__pyx_ptype_7_amplpy_Parameter) < 0) __PYX_ERR(13, 19, __pyx_L1_error)
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Parameter, (PyObject *) __pyx_ptype_7_amplpy_Parameter) < 0) __PYX_ERR(13, 19, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_7_amplpy_Parameter) < 0) __PYX_ERR(13, 19, __pyx_L1_error)
  #endif
  __pyx_vtabptr_7_amplpy_Set = &__pyx_vtable_7_amplpy_Set;
  __pyx_vtable_7_amplpy_Set.__pyx_base = *__pyx_vtabptr_7_amplpy_Entity;
  __pyx_vtable_7_amplpy_Set.__pyx_base.create = (PyObject *(*)(AMPL *, char *, AMPL_TUPLE *, PyObject *))__pyx_f_7_amplpy_3Set_create;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_ptype_7_amplpy_Entity); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_ptype_7_amplpy_Set = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7_amplpy_Set_spec, __pyx_t_1);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_ptype_7_amplpy_Set)) __PYX_ERR(14, 12, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7_amplpy_Set_spec, __pyx_ptype_7_amplpy_Set) < 0) __PYX_ERR(14, 12, __pyx_L1_error)
  #else
  __pyx_ptype_7_amplpy_Set = &__pyx_type_7_amplpy_Set;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_ptype_7_amplpy_Set->tp_base = __pyx_ptype_7_amplpy_Entity;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_7_amplpy_Set) < 0) __PYX_ERR(14, 12, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_7_amplpy_Set->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_7_amplpy_Set->tp_dictoffset && __pyx_ptype_7_amplpy_Set->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_7_amplpy_Set->tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_ptype_7_amplpy_Set, __pyx_vtabptr_7_amplpy_Set) < 0) __PYX_ERR(14, 12, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_MergeVtables(__pyx_ptype_7_amplpy_Set) < 0) __PYX_ERR(14, 12, __pyx_L1_error)
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Set, (PyObject *) __pyx_ptype_7_amplpy_Set) < 0) __PYX_ERR(14, 12, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_7_amplpy_Set) < 0) __PYX_ERR(14, 12, __pyx_L1_error)
  #endif
  __pyx_vtabptr_7_amplpy_Variable = &__pyx_vtable_7_amplpy_Variable;
  __pyx_vtable_7_amplpy_Variable.__pyx_base = *__pyx_vtabptr_7_amplpy_Entity;
  __pyx_vtable_7_amplpy_Variable.__pyx_base.create = (PyObject *(*)(AMPL *, char *, AMPL_TUPLE *, PyObject *))__pyx_f_7_amplpy_8Variable_create;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_ptype_7_amplpy_Entity); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_ptype_7_amplpy_Variable = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7_amplpy_Variable_spec, __pyx_t_1);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_ptype_7_amplpy_Variable)) __PYX_ERR(15, 3, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7_amplpy_Variable_spec, __pyx_ptype_7_amplpy_Variable) < 0) __PYX_ERR(15, 3, __pyx_L1_error)
  #else
  __pyx_ptype_7_amplpy_Variable = &__pyx_type_7_amplpy_Variable;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_ptype_7_amplpy_Variable->tp_base = __pyx_ptype_7_amplpy_Entity;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_7_amplpy_Variable) < 0) __PYX_ERR(15, 3, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_7_amplpy_Variable->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_7_amplpy_Variable->tp_dictoffset && __pyx_ptype_7_amplpy_Variable->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_7_amplpy_Variable->tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_ptype_7_amplpy_Variable, __pyx_vtabptr_7_amplpy_Variable) < 0) __PYX_ERR(15, 3, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_MergeVtables(__pyx_ptype_7_amplpy_Variable) < 0) __PYX_ERR(15, 3, __pyx_L1_error)
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Variable, (PyObject *) __pyx_ptype_7_amplpy_Variable) < 0) __PYX_ERR(15, 3, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_7_amplpy_Variable) < 0) __PYX_ERR(15, 3, __pyx_L1_error)
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_7_amplpy_AMPL = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7_amplpy_AMPL_spec, NULL); if (unlikely(!__pyx_ptype_7_amplpy_AMPL)) __PYX_ERR(3, 61, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7_amplpy_AMPL_spec, __pyx_ptype_7_amplpy_AMPL) < 0) __PYX_ERR(3, 61, __pyx_L1_error)
  #else
  __pyx_ptype_7_amplpy_AMPL = &__pyx_type_7_amplpy_AMPL;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_7_amplpy_AMPL) < 0) __PYX_ERR(3, 61, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_7_amplpy_AMPL->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_7_amplpy_AMPL->tp_dictoffset && __pyx_ptype_7_amplpy_AMPL->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_7_amplpy_AMPL->tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #endif
  #if CYTHON_UPDATE_DESCRIPTOR_DOC
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)__pyx_ptype_7_amplpy_AMPL, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(3, 61, __pyx_L1_error)
    if (__Pyx_IS_TYPE(wrapper, &PyWrapperDescr_Type)) {
      __pyx_wrapperbase_7_amplpy_4AMPL___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_7_amplpy_4AMPL___init__.doc = __pyx_doc_7_amplpy_4AMPL___init__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_7_amplpy_4AMPL___init__;
    }
  }
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_AMPL, (PyObject *) __pyx_ptype_7_amplpy_AMPL) < 0) __PYX_ERR(3, 61, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_7_amplpy_AMPL) < 0) __PYX_ERR(3, 61, __pyx_L1_error)
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_7_amplpy___pyx_scope_struct____iter__ = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7_amplpy___pyx_scope_struct____iter___spec, NULL); if (unlikely(!__pyx_ptype_7_amplpy___pyx_scope_struct____iter__)) __PYX_ERR(0, 193, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7_amplpy___pyx_scope_struct____iter___spec, __pyx_ptype_7_amplpy___pyx_scope_struct____iter__) < 0) __PYX_ERR(0, 193, __pyx_L1_error)
  #else
  __pyx_ptype_7_amplpy___pyx_scope_struct____iter__ = &__pyx_type_7_amplpy___pyx_scope_struct____iter__;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_7_amplpy___pyx_scope_struct____iter__) < 0) __PYX_ERR(0, 193, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_7_amplpy___pyx_scope_struct____iter__->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_7_amplpy___pyx_scope_struct____iter__->tp_dictoffset && __pyx_ptype_7_amplpy___pyx_scope_struct____iter__->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_7_amplpy___pyx_scope_struct____iter__->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_7_amplpy___pyx_scope_struct_1_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7_amplpy___pyx_scope_struct_1_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_7_amplpy___pyx_scope_struct_1_genexpr)) __PYX_ERR(0, 195, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7_amplpy___pyx_scope_struct_1_genexpr_spec, __pyx_ptype_7_amplpy___pyx_scope_struct_1_genexpr) < 0) __PYX_ERR(0, 195, __pyx_L1_error)
  #else
  __pyx_ptype_7_amplpy___pyx_scope_struct_1_genexpr = &__pyx_type_7_amplpy___pyx_scope_struct_1_genexpr;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_7_amplpy___pyx_scope_struct_1_genexpr) < 0) __PYX_ERR(0, 195, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_7_amplpy___pyx_scope_struct_1_genexpr->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_7_amplpy___pyx_scope_struct_1_genexpr->tp_dictoffset && __pyx_ptype_7_amplpy___pyx_scope_struct_1_genexpr->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_7_amplpy___pyx_scope_struct_1_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_7_amplpy___pyx_scope_struct_2_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7_amplpy___pyx_scope_struct_2_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_7_amplpy___pyx_scope_struct_2_genexpr)) __PYX_ERR(0, 268, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7_amplpy___pyx_scope_struct_2_genexpr_spec, __pyx_ptype_7_amplpy___pyx_scope_struct_2_genexpr) < 0) __PYX_ERR(0, 268, __pyx_L1_error)
  #else
  __pyx_ptype_7_amplpy___pyx_scope_struct_2_genexpr = &__pyx_type_7_amplpy___pyx_scope_struct_2_genexpr;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_7_amplpy___pyx_scope_struct_2_genexpr) < 0) __PYX_ERR(0, 268, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_7_amplpy___pyx_scope_struct_2_genexpr->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_7_amplpy___pyx_scope_struct_2_genexpr->tp_dictoffset && __pyx_ptype_7_amplpy___pyx_scope_struct_2_genexpr->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_7_amplpy___pyx_scope_struct_2_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_7_amplpy___pyx_scope_struct_3_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7_amplpy___pyx_scope_struct_3_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_7_amplpy___pyx_scope_struct_3_genexpr)) __PYX_ERR(0, 279, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7_amplpy___pyx_scope_struct_3_genexpr_spec, __pyx_ptype_7_amplpy___pyx_scope_struct_3_genexpr) < 0) __PYX_ERR(0, 279, __pyx_L1_error)
  #else
  __pyx_ptype_7_amplpy___pyx_scope_struct_3_genexpr = &__pyx_type_7_amplpy___pyx_scope_struct_3_genexpr;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_7_amplpy___pyx_scope_struct_3_genexpr) < 0) __PYX_ERR(0, 279, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_7_amplpy___pyx_scope_struct_3_genexpr->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_7_amplpy___pyx_scope_struct_3_genexpr->tp_dictoffset && __pyx_ptype_7_amplpy___pyx_scope_struct_3_genexpr->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_7_amplpy___pyx_scope_struct_3_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_7_amplpy___pyx_scope_struct_4__get_headers = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7_amplpy___pyx_scope_struct_4__get_headers_spec, NULL); if (unlikely(!__pyx_ptype_7_amplpy___pyx_scope_struct_4__get_headers)) __PYX_ERR(0, 365, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7_amplpy___pyx_scope_struct_4__get_headers_spec, __pyx_ptype_7_amplpy___pyx_scope_struct_4__get_headers) < 0) __PYX_ERR(0, 365, __pyx_L1_error)
  #else
  __pyx_ptype_7_amplpy___pyx_scope_struct_4__get_headers = &__pyx_type_7_amplpy___pyx_scope_struct_4__get_headers;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_7_amplpy___pyx_scope_struct_4__get_headers) < 0) __PYX_ERR(0, 365, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_7_amplpy___pyx_scope_struct_4__get_headers->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_7_amplpy___pyx_scope_struct_4__get_headers->tp_dictoffset && __pyx_ptype_7_amplpy___pyx_scope_struct_4__get_headers->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_7_amplpy___pyx_scope_struct_4__get_headers->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_7_amplpy___pyx_scope_struct_5_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7_amplpy___pyx_scope_struct_5_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_7_amplpy___pyx_scope_struct_5_genexpr)) __PYX_ERR(0, 375, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7_amplpy___pyx_scope_struct_5_genexpr_spec, __pyx_ptype_7_amplpy___pyx_scope_struct_5_genexpr) < 0) __PYX_ERR(0, 375, __pyx_L1_error)
  #else
  __pyx_ptype_7_amplpy___pyx_scope_struct_5_genexpr = &__pyx_type_7_amplpy___pyx_scope_struct_5_genexpr;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_7_amplpy___pyx_scope_struct_5_genexpr) < 0) __PYX_ERR(0, 375, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_7_amplpy___pyx_scope_struct_5_genexpr->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_7_amplpy___pyx_scope_struct_5_genexpr->tp_dictoffset && __pyx_ptype_7_amplpy___pyx_scope_struct_5_genexpr->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_7_amplpy___pyx_scope_struct_5_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_7_amplpy___pyx_scope_struct_6_from_dict = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7_amplpy___pyx_scope_struct_6_from_dict_spec, NULL); if (unlikely(!__pyx_ptype_7_amplpy___pyx_scope_struct_6_from_dict)) __PYX_ERR(0, 478, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7_amplpy___pyx_scope_struct_6_from_dict_spec, __pyx_ptype_7_amplpy___pyx_scope_struct_6_from_dict) < 0) __PYX_ERR(0, 478, __pyx_L1_error)
  #else
  __pyx_ptype_7_amplpy___pyx_scope_struct_6_from_dict = &__pyx_type_7_amplpy___pyx_scope_struct_6_from_dict;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_7_amplpy___pyx_scope_struct_6_from_dict) < 0) __PYX_ERR(0, 478, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_7_amplpy___pyx_scope_struct_6_from_dict->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_7_amplpy___pyx_scope_struct_6_from_dict->tp_dictoffset && __pyx_ptype_7_amplpy___pyx_scope_struct_6_from_dict->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_7_amplpy___pyx_scope_struct_6_from_dict->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_7_amplpy___pyx_scope_struct_7_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7_amplpy___pyx_scope_struct_7_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_7_amplpy___pyx_scope_struct_7_genexpr)) __PYX_ERR(0, 502, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7_amplpy___pyx_scope_struct_7_genexpr_spec, __pyx_ptype_7_amplpy___pyx_scope_struct_7_genexpr) < 0) __PYX_ERR(0, 502, __pyx_L1_error)
  #else
  __pyx_ptype_7_amplpy___pyx_scope_struct_7_genexpr = &__pyx_type_7_amplpy___pyx_scope_struct_7_genexpr;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_7_amplpy___pyx_scope_struct_7_genexpr) < 0) __PYX_ERR(0, 502, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_7_amplpy___pyx_scope_struct_7_genexpr->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_7_amplpy___pyx_scope_struct_7_genexpr->tp_dictoffset && __pyx_ptype_7_amplpy___pyx_scope_struct_7_genexpr->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_7_amplpy___pyx_scope_struct_7_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_7_amplpy___pyx_scope_struct_8_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7_amplpy___pyx_scope_struct_8_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_7_amplpy___pyx_scope_struct_8_genexpr)) __PYX_ERR(0, 503, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7_amplpy___pyx_scope_struct_8_genexpr_spec, __pyx_ptype_7_amplpy___pyx_scope_struct_8_genexpr) < 0) __PYX_ERR(0, 503, __pyx_L1_error)
  #else
  __pyx_ptype_7_amplpy___pyx_scope_struct_8_genexpr = &__pyx_type_7_amplpy___pyx_scope_struct_8_genexpr;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_7_amplpy___pyx_scope_struct_8_genexpr) < 0) __PYX_ERR(0, 503, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_7_amplpy___pyx_scope_struct_8_genexpr->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_7_amplpy___pyx_scope_struct_8_genexpr->tp_dictoffset && __pyx_ptype_7_amplpy___pyx_scope_struct_8_genexpr->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_7_amplpy___pyx_scope_struct_8_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_7_amplpy___pyx_scope_struct_9_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7_amplpy___pyx_scope_struct_9_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_7_amplpy___pyx_scope_struct_9_genexpr)) __PYX_ERR(13, 172, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7_amplpy___pyx_scope_struct_9_genexpr_spec, __pyx_ptype_7_amplpy___pyx_scope_struct_9_genexpr) < 0) __PYX_ERR(13, 172, __pyx_L1_error)
  #else
  __pyx_ptype_7_amplpy___pyx_scope_struct_9_genexpr = &__pyx_type_7_amplpy___pyx_scope_struct_9_genexpr;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_7_amplpy___pyx_scope_struct_9_genexpr) < 0) __PYX_ERR(13, 172, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_7_amplpy___pyx_scope_struct_9_genexpr->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_7_amplpy___pyx_scope_struct_9_genexpr->tp_dictoffset && __pyx_ptype_7_amplpy___pyx_scope_struct_9_genexpr->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_7_amplpy___pyx_scope_struct_9_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_7_amplpy___pyx_scope_struct_10_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7_amplpy___pyx_scope_struct_10_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_7_amplpy___pyx_scope_struct_10_genexpr)) __PYX_ERR(13, 176, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7_amplpy___pyx_scope_struct_10_genexpr_spec, __pyx_ptype_7_amplpy___pyx_scope_struct_10_genexpr) < 0) __PYX_ERR(13, 176, __pyx_L1_error)
  #else
  __pyx_ptype_7_amplpy___pyx_scope_struct_10_genexpr = &__pyx_type_7_amplpy___pyx_scope_struct_10_genexpr;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_7_amplpy___pyx_scope_struct_10_genexpr) < 0) __PYX_ERR(13, 176, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_7_amplpy___pyx_scope_struct_10_genexpr->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_7_amplpy___pyx_scope_struct_10_genexpr->tp_dictoffset && __pyx_ptype_7_amplpy___pyx_scope_struct_10_genexpr->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_7_amplpy___pyx_scope_struct_10_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_7_amplpy___pyx_scope_struct_11_set_values = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7_amplpy___pyx_scope_struct_11_set_values_spec, NULL); if (unlikely(!__pyx_ptype_7_amplpy___pyx_scope_struct_11_set_values)) __PYX_ERR(14, 103, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7_amplpy___pyx_scope_struct_11_set_values_spec, __pyx_ptype_7_amplpy___pyx_scope_struct_11_set_values) < 0) __PYX_ERR(14, 103, __pyx_L1_error)
  #else
  __pyx_ptype_7_amplpy___pyx_scope_struct_11_set_values = &__pyx_type_7_amplpy___pyx_scope_struct_11_set_values;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_7_amplpy___pyx_scope_struct_11_set_values) < 0) __PYX_ERR(14, 103, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_7_amplpy___pyx_scope_struct_11_set_values->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_7_amplpy___pyx_scope_struct_11_set_values->tp_dictoffset && __pyx_ptype_7_amplpy___pyx_scope_struct_11_set_values->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_7_amplpy___pyx_scope_struct_11_set_values->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_7_amplpy___pyx_scope_struct_12_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7_amplpy___pyx_scope_struct_12_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_7_amplpy___pyx_scope_struct_12_genexpr)) __PYX_ERR(14, 142, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7_amplpy___pyx_scope_struct_12_genexpr_spec, __pyx_ptype_7_amplpy___pyx_scope_struct_12_genexpr) < 0) __PYX_ERR(14, 142, __pyx_L1_error)
  #else
  __pyx_ptype_7_amplpy___pyx_scope_struct_12_genexpr = &__pyx_type_7_amplpy___pyx_scope_struct_12_genexpr;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_7_amplpy___pyx_scope_struct_12_genexpr) < 0) __PYX_ERR(14, 142, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_7_amplpy___pyx_scope_struct_12_genexpr->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_7_amplpy___pyx_scope_struct_12_genexpr->tp_dictoffset && __pyx_ptype_7_amplpy___pyx_scope_struct_12_genexpr->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_7_amplpy___pyx_scope_struct_12_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_7_amplpy___pyx_scope_struct_13_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7_amplpy___pyx_scope_struct_13_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_7_amplpy___pyx_scope_struct_13_genexpr)) __PYX_ERR(14, 146, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7_amplpy___pyx_scope_struct_13_genexpr_spec, __pyx_ptype_7_amplpy___pyx_scope_struct_13_genexpr) < 0) __PYX_ERR(14, 146, __pyx_L1_error)
  #else
  __pyx_ptype_7_amplpy___pyx_scope_struct_13_genexpr = &__pyx_type_7_amplpy___pyx_scope_struct_13_genexpr;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_7_amplpy___pyx_scope_struct_13_genexpr) < 0) __PYX_ERR(14, 146, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_7_amplpy___pyx_scope_struct_13_genexpr->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_7_amplpy___pyx_scope_struct_13_genexpr->tp_dictoffset && __pyx_ptype_7_amplpy___pyx_scope_struct_13_genexpr->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_7_amplpy___pyx_scope_struct_13_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_7_amplpy___pyx_scope_struct_14_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7_amplpy___pyx_scope_struct_14_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_7_amplpy___pyx_scope_struct_14_genexpr)) __PYX_ERR(14, 174, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7_amplpy___pyx_scope_struct_14_genexpr_spec, __pyx_ptype_7_amplpy___pyx_scope_struct_14_genexpr) < 0) __PYX_ERR(14, 174, __pyx_L1_error)
  #else
  __pyx_ptype_7_amplpy___pyx_scope_struct_14_genexpr = &__pyx_type_7_amplpy___pyx_scope_struct_14_genexpr;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_7_amplpy___pyx_scope_struct_14_genexpr) < 0) __PYX_ERR(14, 174, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_7_amplpy___pyx_scope_struct_14_genexpr->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_7_amplpy___pyx_scope_struct_14_genexpr->tp_dictoffset && __pyx_ptype_7_amplpy___pyx_scope_struct_14_genexpr->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_7_amplpy___pyx_scope_struct_14_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_7_amplpy___pyx_scope_struct_15_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7_amplpy___pyx_scope_struct_15_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_7_amplpy___pyx_scope_struct_15_genexpr)) __PYX_ERR(14, 180, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7_amplpy___pyx_scope_struct_15_genexpr_spec, __pyx_ptype_7_amplpy___pyx_scope_struct_15_genexpr) < 0) __PYX_ERR(14, 180, __pyx_L1_error)
  #else
  __pyx_ptype_7_amplpy___pyx_scope_struct_15_genexpr = &__pyx_type_7_amplpy___pyx_scope_struct_15_genexpr;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_7_amplpy___pyx_scope_struct_15_genexpr) < 0) __PYX_ERR(14, 180, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_7_amplpy___pyx_scope_struct_15_genexpr->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_7_amplpy___pyx_scope_struct_15_genexpr->tp_dictoffset && __pyx_ptype_7_amplpy___pyx_scope_struct_15_genexpr->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_7_amplpy___pyx_scope_struct_15_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_type_import_code(void) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
  /*--- Type import code ---*/
  __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 8, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_ptype_7cpython_4bool_bool = __Pyx_ImportType_3_0_11(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "bool", sizeof(PyBoolObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyBoolObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_7cpython_4bool_bool) __PYX_ERR(16, 8, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_ptype_7cpython_4type_type = __Pyx_ImportType_3_0_11(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type", 
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyTypeObject),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyTypeObject),
  #else
  sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyHeapTypeObject),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(17, 9, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_ptype_7cpython_7complex_complex = __Pyx_ImportType_3_0_11(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "complex", sizeof(PyComplexObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyComplexObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_7cpython_7complex_complex) __PYX_ERR(18, 15, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_RefNannyFinishContext();
  return -1;
}

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
#if CYTHON_PEP489_MULTI_PHASE_INIT
static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
static int __pyx_pymod_exec__amplpy(PyObject* module); /*proto*/
static PyModuleDef_Slot __pyx_moduledef_slots[] = {
  {Py_mod_create, (void*)__pyx_pymod_create},
  {Py_mod_exec, (void*)__pyx_pymod_exec__amplpy},
  {0, NULL}
};
#endif

#ifdef __cplusplus
namespace {
  struct PyModuleDef __pyx_moduledef =
  #else
  static struct PyModuleDef __pyx_moduledef =
  #endif
  {
      PyModuleDef_HEAD_INIT,
      "_amplpy",
      0, /* m_doc */
    #if CYTHON_PEP489_MULTI_PHASE_INIT
      0, /* m_size */
    #elif CYTHON_USE_MODULE_STATE
      sizeof(__pyx_mstate), /* 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
    #if CYTHON_USE_MODULE_STATE
      __pyx_m_traverse, /* m_traverse */
      __pyx_m_clear, /* m_clear */
      NULL /* m_free */
    #else
      NULL, /* m_traverse */
      NULL, /* m_clear */
      NULL /* m_free */
    #endif
  };
  #ifdef __cplusplus
} /* anonymous namespace */
#endif
#endif

#ifndef CYTHON_NO_PYINIT_EXPORT
#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
#elif PY_MAJOR_VERSION < 3
#ifdef __cplusplus
#define __Pyx_PyMODINIT_FUNC extern "C" void
#else
#define __Pyx_PyMODINIT_FUNC void
#endif
#else
#ifdef __cplusplus
#define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
#else
#define __Pyx_PyMODINIT_FUNC PyObject *
#endif
#endif


#if PY_MAJOR_VERSION < 3
__Pyx_PyMODINIT_FUNC init_amplpy(void) CYTHON_SMALL_CODE; /*proto*/
__Pyx_PyMODINIT_FUNC init_amplpy(void)
#else
__Pyx_PyMODINIT_FUNC PyInit__amplpy(void) CYTHON_SMALL_CODE; /*proto*/
__Pyx_PyMODINIT_FUNC PyInit__amplpy(void)
#if CYTHON_PEP489_MULTI_PHASE_INIT
{
  return PyModuleDef_Init(&__pyx_moduledef);
}
static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
    #if PY_VERSION_HEX >= 0x030700A1
    static PY_INT64_T main_interpreter_id = -1;
    PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
    if (main_interpreter_id == -1) {
        main_interpreter_id = current_id;
        return (unlikely(current_id == -1)) ? -1 : 0;
    } else if (unlikely(main_interpreter_id != current_id))
    #else
    static PyInterpreterState *main_interpreter = NULL;
    PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
    if (!main_interpreter) {
        main_interpreter = current_interpreter;
    } else if (unlikely(main_interpreter != current_interpreter))
    #endif
    {
        PyErr_SetString(
            PyExc_ImportError,
            "Interpreter change detected - this module can only be loaded into one interpreter per process.");
        return -1;
    }
    return 0;
}
#if CYTHON_COMPILING_IN_LIMITED_API
static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none)
#else
static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none)
#endif
{
    PyObject *value = PyObject_GetAttrString(spec, from_name);
    int result = 0;
    if (likely(value)) {
        if (allow_none || value != Py_None) {
#if CYTHON_COMPILING_IN_LIMITED_API
            result = PyModule_AddObject(module, to_name, value);
#else
            result = PyDict_SetItemString(moddict, to_name, value);
#endif
        }
        Py_DECREF(value);
    } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
        PyErr_Clear();
    } else {
        result = -1;
    }
    return result;
}
static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) {
    PyObject *module = NULL, *moddict, *modname;
    CYTHON_UNUSED_VAR(def);
    if (__Pyx_check_single_interpreter())
        return NULL;
    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;
#if CYTHON_COMPILING_IN_LIMITED_API
    moddict = module;
#else
    moddict = PyModule_GetDict(module);
    if (unlikely(!moddict)) goto bad;
#endif
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
    return module;
bad:
    Py_XDECREF(module);
    return NULL;
}


static CYTHON_SMALL_CODE int __pyx_pymod_exec__amplpy(PyObject *__pyx_pyinit_module)
#endif
#endif
{
  int stringtab_initialized = 0;
  #if CYTHON_USE_MODULE_STATE
  int pystate_addmodule_run = 0;
  #endif
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  if (__pyx_m) {
    if (__pyx_m == __pyx_pyinit_module) return 0;
    PyErr_SetString(PyExc_RuntimeError, "Module '_amplpy' has already been imported. Re-initialisation is not supported.");
    return -1;
  }
  #elif PY_MAJOR_VERSION >= 3
  if (__pyx_m) return __Pyx_NewRef(__pyx_m);
  #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("_amplpy", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
  if (unlikely(!__pyx_m)) __PYX_ERR(3, 1, __pyx_L1_error)
  #elif CYTHON_USE_MODULE_STATE
  __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1, __pyx_L1_error)
  {
    int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef);
    __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "_amplpy" pseudovariable */
    if (unlikely((add_module_result < 0))) __PYX_ERR(3, 1, __pyx_L1_error)
    pystate_addmodule_run = 1;
  }
  #else
  __pyx_m = PyModule_Create(&__pyx_moduledef);
  if (unlikely(!__pyx_m)) __PYX_ERR(3, 1, __pyx_L1_error)
  #endif
  #endif
  CYTHON_UNUSED_VAR(__pyx_t_1);
  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(3, 1, __pyx_L1_error)
  Py_INCREF(__pyx_d);
  __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(3, 1, __pyx_L1_error)
  __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(3, 1, __pyx_L1_error)
  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(3, 1, __pyx_L1_error)
  #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__amplpy(void)", 0);
  if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(3, 1, __pyx_L1_error)
  #ifdef __Pxy_PyFrame_Initialize_Offsets
  __Pxy_PyFrame_Initialize_Offsets();
  #endif
  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(3, 1, __pyx_L1_error)
  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(3, 1, __pyx_L1_error)
  __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(3, 1, __pyx_L1_error)
  #ifdef __Pyx_CyFunction_USED
  if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(3, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_FusedFunction_USED
  if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(3, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_Coroutine_USED
  if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(3, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_Generator_USED
  if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(3, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_AsyncGen_USED
  if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(3, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_StopAsyncIteration_USED
  if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(3, 1, __pyx_L1_error)
  #endif
  /*--- Library function declarations ---*/
  /*--- Threads initialization code ---*/
  #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
  PyEval_InitThreads();
  #endif
  /*--- Initialize various global constants etc. ---*/
  if (__Pyx_InitConstants() < 0) __PYX_ERR(3, 1, __pyx_L1_error)
  stringtab_initialized = 1;
  if (__Pyx_InitGlobals() < 0) __PYX_ERR(3, 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(3, 1, __pyx_L1_error)
  #endif
  if (__pyx_module_is_main__amplpy) {
    if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(3, 1, __pyx_L1_error)
  }
  #if PY_MAJOR_VERSION >= 3
  {
    PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(3, 1, __pyx_L1_error)
    if (!PyDict_GetItemString(modules, "_amplpy")) {
      if (unlikely((PyDict_SetItemString(modules, "_amplpy", __pyx_m) < 0))) __PYX_ERR(3, 1, __pyx_L1_error)
    }
  }
  #endif
  /*--- Builtin init code ---*/
  if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(3, 1, __pyx_L1_error)
  /*--- Constants init code ---*/
  if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(3, 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))) __PYX_ERR(3, 1, __pyx_L1_error)
  if (unlikely((__Pyx_modinit_type_import_code() < 0))) __PYX_ERR(3, 1, __pyx_L1_error)
  (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(3, 1, __pyx_L1_error)
  #endif

  /* "amplpy/ampl.pyx":2
 * # https://cython.readthedocs.io/en/latest/src/tutorial/clibraries.html
 * import sys             # <<<<<<<<<<<<<<
 * 
 * cimport amplpy.ampl as campl
 */
  __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_sys, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_2) < 0) __PYX_ERR(3, 2, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "amplpy/ampl.pyx":13
 * from cpython cimport Py_INCREF, Py_DECREF
 * 
 * from numbers import Real             # <<<<<<<<<<<<<<
 * from ast import literal_eval
 * 
 */
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 13, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_Real);
  __Pyx_GIVEREF(__pyx_n_s_Real);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_Real)) __PYX_ERR(3, 13, __pyx_L1_error);
  __pyx_t_3 = __Pyx_Import(__pyx_n_s_numbers, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 13, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_Real); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 13, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Real, __pyx_t_2) < 0) __PYX_ERR(3, 13, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "amplpy/ampl.pyx":14
 * 
 * from numbers import Real
 * from ast import literal_eval             # <<<<<<<<<<<<<<
 * 
 * include "util.pxi" # must be first
 */
  __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 14, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_n_s_literal_eval);
  __Pyx_GIVEREF(__pyx_n_s_literal_eval);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_literal_eval)) __PYX_ERR(3, 14, __pyx_L1_error);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_ast, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 14, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_literal_eval); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 14, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_literal_eval, __pyx_t_3) < 0) __PYX_ERR(3, 14, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "amplpy/constraint.pxi":47
 *         self.__getitem__(index).set_dual(value)
 * 
 *     def is_logical(self):             # <<<<<<<<<<<<<<
 *         """
 *         Check if the constraint is a logical constraint. Returns True if
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_10Constraint_3is_logical, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Constraint_is_logical, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__86)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 47, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Constraint, __pyx_n_s_is_logical, __pyx_t_2) < 0) __PYX_ERR(5, 47, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Constraint);

  /* "amplpy/constraint.pxi":63
 *             return False
 * 
 *     def drop(self):             # <<<<<<<<<<<<<<
 *         """
 *         Drop all instances in this constraint entity, corresponding to the AMPL
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_10Constraint_5drop, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Constraint_drop, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__87)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 63, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Constraint, __pyx_n_s_drop, __pyx_t_2) < 0) __PYX_ERR(5, 63, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Constraint);

  /* "amplpy/constraint.pxi":70
 *         PY_AMPL_CALL(campl.AMPL_EntityDrop(self._c_ampl, self._name))
 * 
 *     def restore(self):             # <<<<<<<<<<<<<<
 *         """
 *         Restore all instances in this constraint entity, corresponding to the
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_10Constraint_7restore, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Constraint_restore, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__88)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 70, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Constraint, __pyx_n_s_restore, __pyx_t_2) < 0) __PYX_ERR(5, 70, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Constraint);

  /* "amplpy/constraint.pxi":77
 *         PY_AMPL_CALL(campl.AMPL_EntityRestore(self._c_ampl, self._name))
 * 
 *     def body(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the current value of the constraint's body.
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_10Constraint_9body, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Constraint_body, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__89)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 77, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Constraint, __pyx_n_s_body, __pyx_t_2) < 0) __PYX_ERR(5, 77, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Constraint);

  /* "amplpy/constraint.pxi":85
 *         return value
 * 
 *     def astatus(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the current AMPL status (dropped, presolved, or substituted out).
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_10Constraint_11astatus, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Constraint_astatus, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__91)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 85, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Constraint, __pyx_n_s_astatus, __pyx_t_2) < 0) __PYX_ERR(5, 85, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Constraint);

  /* "amplpy/constraint.pxi":102
 *         return value
 * 
 *     def defvar(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the index in `_var` of "defined variable" substituted out by the
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_10Constraint_13defvar, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Constraint_defvar, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__92)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 102, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Constraint, __pyx_n_s_defvar, __pyx_t_2) < 0) __PYX_ERR(5, 102, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Constraint);

  /* "amplpy/constraint.pxi":111
 *         return value
 * 
 *     def dinit(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the current initial guess for the constraint's dual variable.
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_10Constraint_15dinit, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Constraint_dinit, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__93)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 111, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Constraint, __pyx_n_s_dinit, __pyx_t_2) < 0) __PYX_ERR(5, 111, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Constraint);

  /* "amplpy/constraint.pxi":119
 *         return value
 * 
 *     def dinit0(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the original initial guess for the constraint's dual variable.
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_10Constraint_17dinit0, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Constraint_dinit0, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__94)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 119, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Constraint, __pyx_n_s_dinit0, __pyx_t_2) < 0) __PYX_ERR(5, 119, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Constraint);

  /* "amplpy/constraint.pxi":127
 *         return value
 * 
 *     def dual(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the current value of the constraint's dual variable.
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_10Constraint_19dual, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Constraint_dual, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__95)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 127, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Constraint, __pyx_n_s_dual, __pyx_t_2) < 0) __PYX_ERR(5, 127, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Constraint);

  /* "amplpy/constraint.pxi":140
 *         return value
 * 
 *     def lb(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the current value of the constraint's lower bound.
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_10Constraint_21lb, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Constraint_lb, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__96)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 140, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Constraint, __pyx_n_s_lb, __pyx_t_2) < 0) __PYX_ERR(5, 140, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Constraint);

  /* "amplpy/constraint.pxi":148
 *         return value
 * 
 *     def ub(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the current value of the constraint's upper bound.
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_10Constraint_23ub, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Constraint_ub, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__97)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Constraint, __pyx_n_s_ub, __pyx_t_2) < 0) __PYX_ERR(5, 148, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Constraint);

  /* "amplpy/constraint.pxi":156
 *         return value
 * 
 *     def lbs(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the constraint lower bound sent to the solver (reflecting
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_10Constraint_25lbs, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Constraint_lbs, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__98)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 156, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Constraint, __pyx_n_s_lbs, __pyx_t_2) < 0) __PYX_ERR(5, 156, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Constraint);

  /* "amplpy/constraint.pxi":165
 *         return value
 * 
 *     def ubs(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the constraint upper bound sent to the solver (reflecting
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_10Constraint_27ubs, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Constraint_ubs, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__99)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 165, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Constraint, __pyx_n_s_ubs, __pyx_t_2) < 0) __PYX_ERR(5, 165, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Constraint);

  /* "amplpy/constraint.pxi":174
 *         return value
 * 
 *     def ldual(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the current dual value associated with the lower bound.
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_10Constraint_29ldual, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Constraint_ldual, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__100)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 174, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Constraint, __pyx_n_s_ldual, __pyx_t_2) < 0) __PYX_ERR(5, 174, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Constraint);

  /* "amplpy/constraint.pxi":182
 *         return value
 * 
 *     def udual(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the current dual value associated with the upper bounds.
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_10Constraint_31udual, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Constraint_udual, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__101)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 182, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Constraint, __pyx_n_s_udual, __pyx_t_2) < 0) __PYX_ERR(5, 182, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Constraint);

  /* "amplpy/constraint.pxi":190
 *         return value
 * 
 *     def lslack(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the slack at lower bound `body - lb`.
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_10Constraint_33lslack, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Constraint_lslack, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__102)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 190, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Constraint, __pyx_n_s_lslack, __pyx_t_2) < 0) __PYX_ERR(5, 190, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Constraint);

  /* "amplpy/constraint.pxi":198
 *         return value
 * 
 *     def uslack(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the slack at upper bound `ub - body`.
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_10Constraint_35uslack, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Constraint_uslack, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__103)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 198, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Constraint, __pyx_n_s_uslack, __pyx_t_2) < 0) __PYX_ERR(5, 198, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Constraint);

  /* "amplpy/constraint.pxi":206
 *         return value
 * 
 *     def slack(self):             # <<<<<<<<<<<<<<
 *         """
 *         Constraint slack (the lesser of lslack and uslack).
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_10Constraint_37slack, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Constraint_slack, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__104)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 206, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Constraint, __pyx_n_s_slack, __pyx_t_2) < 0) __PYX_ERR(5, 206, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Constraint);

  /* "amplpy/constraint.pxi":214
 *         return value
 * 
 *     def sstatus(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the solver status (basis status of constraint's slack or artificial
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_10Constraint_39sstatus, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Constraint_sstatus, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__105)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 214, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Constraint, __pyx_n_s_sstatus, __pyx_t_2) < 0) __PYX_ERR(5, 214, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Constraint);

  /* "amplpy/constraint.pxi":232
 *         return value
 * 
 *     def status(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the AMPL status if not `in`, otherwise solver status.
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_10Constraint_41status, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Constraint_status, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__106)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 232, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Constraint, __pyx_n_s_status, __pyx_t_2) < 0) __PYX_ERR(5, 232, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Constraint);

  /* "amplpy/constraint.pxi":249
 *         return value
 * 
 *     def set_dual(self, dual):             # <<<<<<<<<<<<<<
 *         """
 *         Set the value of the dual variable associated to this constraint (valid
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_10Constraint_43set_dual, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Constraint_set_dual, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__108)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 249, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Constraint, __pyx_n_s_set_dual, __pyx_t_2) < 0) __PYX_ERR(5, 249, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Constraint);

  /* "amplpy/constraint.pxi":266
 *         PY_AMPL_CALL(campl.AMPL_ConstraintSetDual(self._c_ampl, self._name, float(dual)))
 * 
 *     def val(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the AMPL val suffix. Valid only for logical constraints.
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_10Constraint_45val, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Constraint_val, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__109)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 266, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Constraint, __pyx_n_s_val, __pyx_t_2) < 0) __PYX_ERR(5, 266, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Constraint);

  /* "amplpy/constraint.pxi":278
 * 
 *     # Aliases
 *     isLogical = is_logical             # <<<<<<<<<<<<<<
 *     setDual = set_dual
 */
  __Pyx_GetNameInClass(__pyx_t_2, (PyObject *)__pyx_ptype_7_amplpy_Constraint, __pyx_n_s_is_logical); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 278, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Constraint, __pyx_n_s_isLogical, __pyx_t_2) < 0) __PYX_ERR(5, 278, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Constraint);

  /* "amplpy/constraint.pxi":279
 *     # Aliases
 *     isLogical = is_logical
 *     setDual = set_dual             # <<<<<<<<<<<<<<
 */
  __Pyx_GetNameInClass(__pyx_t_2, (PyObject *)__pyx_ptype_7_amplpy_Constraint, __pyx_n_s_set_dual); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 279, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Constraint, __pyx_n_s_setDual, __pyx_t_2) < 0) __PYX_ERR(5, 279, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Constraint);

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._c_ampl,self._index cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_10Constraint_47__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Constraint___reduce_cython, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__110)); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._c_ampl,self._index cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._c_ampl,self._index cannot be converted to a Python object for pickling"
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_10Constraint_49__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Constraint___setstate_cython, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__112)); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(8, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "amplpy/dataframe.pxi":5
 * from libc.string cimport strdup
 * 
 * from numbers import Real             # <<<<<<<<<<<<<<
 * 
 * try:
 */
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_Real);
  __Pyx_GIVEREF(__pyx_n_s_Real);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_Real)) __PYX_ERR(0, 5, __pyx_L1_error);
  __pyx_t_3 = __Pyx_Import(__pyx_n_s_numbers, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_Real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Real, __pyx_t_2) < 0) __PYX_ERR(0, 5, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "amplpy/dataframe.pxi":7
 * from numbers import Real
 * 
 * try:             # <<<<<<<<<<<<<<
 *     import pandas as pd
 * except ImportError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "amplpy/dataframe.pxi":8
 * 
 * try:
 *     import pandas as pd             # <<<<<<<<<<<<<<
 * except ImportError:
 *     pd = None
 */
      __pyx_t_3 = __Pyx_ImportDottedModule(__pyx_n_s_pandas, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 8, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_pd, __pyx_t_3) < 0) __PYX_ERR(0, 8, __pyx_L2_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "amplpy/dataframe.pxi":7
 * from numbers import Real
 * 
 * try:             # <<<<<<<<<<<<<<
 *     import pandas as pd
 * except ImportError:
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 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_3); __pyx_t_3 = 0;

    /* "amplpy/dataframe.pxi":9
 * try:
 *     import pandas as pd
 * except ImportError:             # <<<<<<<<<<<<<<
 *     pd = None
 * try:
 */
    __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError);
    if (__pyx_t_6) {
      __Pyx_AddTraceback("_amplpy", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_2, &__pyx_t_7) < 0) __PYX_ERR(0, 9, __pyx_L4_except_error)
      __Pyx_XGOTREF(__pyx_t_3);
      __Pyx_XGOTREF(__pyx_t_2);
      __Pyx_XGOTREF(__pyx_t_7);

      /* "amplpy/dataframe.pxi":10
 *     import pandas as pd
 * except ImportError:
 *     pd = None             # <<<<<<<<<<<<<<
 * try:
 *     import numpy as np
 */
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_pd, Py_None) < 0) __PYX_ERR(0, 10, __pyx_L4_except_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L3_exception_handled;
    }
    goto __pyx_L4_except_error;

    /* "amplpy/dataframe.pxi":7
 * from numbers import Real
 * 
 * try:             # <<<<<<<<<<<<<<
 *     import pandas as pd
 * except ImportError:
 */
    __pyx_L4_except_error:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L3_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_4, __pyx_t_5);
    __pyx_L7_try_end:;
  }

  /* "amplpy/dataframe.pxi":11
 * except ImportError:
 *     pd = None
 * try:             # <<<<<<<<<<<<<<
 *     import numpy as np
 * except ImportError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_1);
    /*try:*/ {

      /* "amplpy/dataframe.pxi":12
 *     pd = None
 * try:
 *     import numpy as np             # <<<<<<<<<<<<<<
 * except ImportError:
 *     np = None
 */
      __pyx_t_7 = __Pyx_ImportDottedModule(__pyx_n_s_numpy, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 12, __pyx_L10_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_7) < 0) __PYX_ERR(0, 12, __pyx_L10_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "amplpy/dataframe.pxi":11
 * except ImportError:
 *     pd = None
 * try:             # <<<<<<<<<<<<<<
 *     import numpy as np
 * except ImportError:
 */
    }
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    goto __pyx_L15_try_end;
    __pyx_L10_error:;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "amplpy/dataframe.pxi":13
 * try:
 *     import numpy as np
 * except ImportError:             # <<<<<<<<<<<<<<
 *     np = None
 * 
 */
    __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError);
    if (__pyx_t_6) {
      __Pyx_AddTraceback("_amplpy", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_2, &__pyx_t_3) < 0) __PYX_ERR(0, 13, __pyx_L12_except_error)
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_2);
      __Pyx_XGOTREF(__pyx_t_3);

      /* "amplpy/dataframe.pxi":14
 *     import numpy as np
 * except ImportError:
 *     np = None             # <<<<<<<<<<<<<<
 * 
 * 
 */
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, Py_None) < 0) __PYX_ERR(0, 14, __pyx_L12_except_error)
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      goto __pyx_L11_exception_handled;
    }
    goto __pyx_L12_except_error;

    /* "amplpy/dataframe.pxi":11
 * except ImportError:
 *     pd = None
 * try:             # <<<<<<<<<<<<<<
 *     import numpy as np
 * except ImportError:
 */
    __pyx_L12_except_error:;
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_1);
    goto __pyx_L1_error;
    __pyx_L11_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_1);
    __pyx_L15_try_end:;
  }

  /* "amplpy/dataframe.pxi":42
 *         return to_py_variant(v)
 * 
 *     def to_string(self):             # <<<<<<<<<<<<<<
 *         return str(list(self))
 * 
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_3Row_7to_string, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Row_to_string, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__113)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 42, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Row, __pyx_n_s_to_string, __pyx_t_3) < 0) __PYX_ERR(0, 42, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Row);

  /* "amplpy/dataframe.pxi":46
 * 
 *     # Aliases
 *     toString = to_string             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_GetNameInClass(__pyx_t_3, (PyObject *)__pyx_ptype_7_amplpy_Row, __pyx_n_s_to_string); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 46, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Row, __pyx_n_s_toString, __pyx_t_3) < 0) __PYX_ERR(0, 46, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Row);

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._df cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_3Row_9__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Row___reduce_cython, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__114)); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_3) < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._df cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._df cannot be converted to a Python object for pickling"
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_3Row_11__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Row___setstate_cython, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__115)); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_3) < 0) __PYX_ERR(8, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "amplpy/dataframe.pxi":69
 *         return ColIterator.create(self._df, self._index)
 * 
 *     def to_string(self):             # <<<<<<<<<<<<<<
 *         return str(self.to_list())
 * 
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_6Column_5to_string, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Column_to_string, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__116)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 69, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Column, __pyx_n_s_to_string, __pyx_t_3) < 0) __PYX_ERR(0, 69, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Column);

  /* "amplpy/dataframe.pxi":72
 *         return str(self.to_list())
 * 
 *     def to_list(self):             # <<<<<<<<<<<<<<
 *         py_list = []
 *         cdef campl.AMPL_VARIANT* v
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_6Column_7to_list, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Column_to_list, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__118)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 72, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Column, __pyx_n_s_to_list, __pyx_t_3) < 0) __PYX_ERR(0, 72, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Column);

  /* "amplpy/dataframe.pxi":84
 * 
 *     # Aliases
 *     toString = to_string             # <<<<<<<<<<<<<<
 *     toList = to_list
 * 
 */
  __Pyx_GetNameInClass(__pyx_t_3, (PyObject *)__pyx_ptype_7_amplpy_Column, __pyx_n_s_to_string); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 84, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Column, __pyx_n_s_toString, __pyx_t_3) < 0) __PYX_ERR(0, 84, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Column);

  /* "amplpy/dataframe.pxi":85
 *     # Aliases
 *     toString = to_string
 *     toList = to_list             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_GetNameInClass(__pyx_t_3, (PyObject *)__pyx_ptype_7_amplpy_Column, __pyx_n_s_to_list); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 85, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Column, __pyx_n_s_toList, __pyx_t_3) < 0) __PYX_ERR(0, 85, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Column);

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._df cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_6Column_9__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Column___reduce_cython, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__119)); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_3) < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._df cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._df cannot be converted to a Python object for pickling"
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_6Column_11__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Column___setstate_cython, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__120)); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_3) < 0) __PYX_ERR(8, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "amplpy/dataframe.pxi":122
 *     cdef campl.AMPL_DATAFRAME* _c_df
 * 
 *     def __cinit__(self, index, columns=tuple(), **kwargs):             # <<<<<<<<<<<<<<
 *         """
 *         Create a new DataFrame with specifed index and column headers.
 */
  __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)(&PyTuple_Type))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 122, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_k__14 = __pyx_t_3;
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;

  /* "amplpy/dataframe.pxi":183
 *         campl.AMPL_DataFrameFree(&self._c_df)
 * 
 *     def to_string(self):             # <<<<<<<<<<<<<<
 *         cdef char* value_c
 *         PY_AMPL_CALL(campl.AMPL_DataFrameToString(self._c_df, &value_c))
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_9DataFrame_5to_string, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_DataFrame_to_string, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__122)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 183, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_DataFrame, __pyx_n_s_to_string, __pyx_t_3) < 0) __PYX_ERR(0, 183, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_DataFrame);

  /* "amplpy/dataframe.pxi":197
 *         return (self._get_row_by_index(i) for i in range(self._get_num_rows()))
 * 
 *     def _get_num_cols(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the total number of columns in this dataframe (indexarity + number
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_9DataFrame_11_get_num_cols, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_DataFrame__get_num_cols, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__124)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 197, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_DataFrame, __pyx_n_s_get_num_cols, __pyx_t_3) < 0) __PYX_ERR(0, 197, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_DataFrame);

  /* "amplpy/dataframe.pxi":209
 *         return int(num)
 * 
 *     def _get_num_rows(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the number of data rows in this dataframe.
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_9DataFrame_13_get_num_rows, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_DataFrame__get_num_rows, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__125)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 209, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_DataFrame, __pyx_n_s_get_num_rows, __pyx_t_3) < 0) __PYX_ERR(0, 209, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_DataFrame);

  /* "amplpy/dataframe.pxi":220
 *         return int(num)
 * 
 *     def _get_num_indices(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the number of indices (the indexarity) of this dataframe.
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_9DataFrame_15_get_num_indices, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_DataFrame__get_num_indices, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__126)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 220, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_DataFrame, __pyx_n_s_get_num_indices, __pyx_t_3) < 0) __PYX_ERR(0, 220, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_DataFrame);

  /* "amplpy/dataframe.pxi":231
 *         return int(num)
 * 
 *     def _add_row(self, *value):             # <<<<<<<<<<<<<<
 *         """
 *         Add a row to the DataFrame. The size of the tuple must be equal to the
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_9DataFrame_17_add_row, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_DataFrame__add_row, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__128)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 231, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_DataFrame, __pyx_n_s_add_row, __pyx_t_3) < 0) __PYX_ERR(0, 231, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_DataFrame);

  /* "amplpy/dataframe.pxi":248
 *         campl.AMPL_TupleFree(&tuple_c)
 * 
 *     def _add_column(self, header, values=None):             # <<<<<<<<<<<<<<
 *         """
 *         Add a new column with the corresponding header and values to the
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_9DataFrame_19_add_column, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_DataFrame__add_column, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__130)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 248, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__131);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_DataFrame, __pyx_n_s_add_column, __pyx_t_3) < 0) __PYX_ERR(0, 248, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_DataFrame);

  /* "amplpy/dataframe.pxi":289
 *                 raise NotImplementedError
 * 
 *     def _get_column(self, header):             # <<<<<<<<<<<<<<
 *         """
 *         Get the specified column as a view object.
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_9DataFrame_21_get_column, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_DataFrame__get_column, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__133)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 289, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_DataFrame, __pyx_n_s_get_column, __pyx_t_3) < 0) __PYX_ERR(0, 289, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_DataFrame);

  /* "amplpy/dataframe.pxi":300
 *         return Column.create(self._c_df, index)
 * 
 *     def _set_column(self, header, values):             # <<<<<<<<<<<<<<
 *         """
 *         Set the values of a column.
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_9DataFrame_23_set_column, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_DataFrame__set_column, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__135)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 300, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_DataFrame, __pyx_n_s_set_column, __pyx_t_3) < 0) __PYX_ERR(0, 300, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_DataFrame);

  /* "amplpy/dataframe.pxi":336
 *                 PY_AMPL_CALL(errorinfo)
 * 
 *     def _get_row(self, key):             # <<<<<<<<<<<<<<
 *         """
 *         Get a row by value of the indexing columns. If the index is not
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_9DataFrame_25_get_row, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_DataFrame__get_row, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__137)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 336, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_DataFrame, __pyx_n_s_get_row, __pyx_t_3) < 0) __PYX_ERR(0, 336, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_DataFrame);

  /* "amplpy/dataframe.pxi":353
 *         return Row.create(self._c_df, index)
 * 
 *     def _get_row_by_index(self, index):             # <<<<<<<<<<<<<<
 *         """
 *         Get row by numeric index.
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_9DataFrame_27_get_row_by_index, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_DataFrame__get_row_by_index, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__139)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 353, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_DataFrame, __pyx_n_s_get_row_by_index, __pyx_t_3) < 0) __PYX_ERR(0, 353, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_DataFrame);

  /* "amplpy/dataframe.pxi":365
 *         return Row.create(self._c_df, index)
 * 
 *     def _get_headers(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the headers of this DataFrame.
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_9DataFrame_29_get_headers, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_DataFrame__get_headers, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__141)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 365, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_DataFrame, __pyx_n_s_get_headers, __pyx_t_3) < 0) __PYX_ERR(0, 365, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_DataFrame);

  /* "amplpy/dataframe.pxi":381
 *         return headers_py
 * 
 *     def _set_values(self, values):             # <<<<<<<<<<<<<<
 *         """
 *         Set the values of a DataFrame from a dictionary.
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_9DataFrame_31_set_values, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_DataFrame__set_values, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__143)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 381, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_DataFrame, __pyx_n_s_set_values_2, __pyx_t_3) < 0) __PYX_ERR(0, 381, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_DataFrame);

  /* "amplpy/dataframe.pxi":406
 *             self._add_row(key + value)
 * 
 *     def to_dict(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return a dictionary with the DataFrame data.
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_9DataFrame_33to_dict, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_DataFrame_to_dict, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__145)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 406, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_DataFrame, __pyx_n_s_to_dict, __pyx_t_3) < 0) __PYX_ERR(0, 406, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_DataFrame);

  /* "amplpy/dataframe.pxi":430
 *         return d
 * 
 *     def to_list(self, skip_index=False):             # <<<<<<<<<<<<<<
 *         """
 *         Return a list with the DataFrame data.
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_9DataFrame_35to_list, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_DataFrame_to_list, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__147)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 430, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__148);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_DataFrame, __pyx_n_s_to_list, __pyx_t_3) < 0) __PYX_ERR(0, 430, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_DataFrame);

  /* "amplpy/dataframe.pxi":453
 *             return lst
 * 
 *     def to_pandas(self, multi_index=True):             # <<<<<<<<<<<<<<
 *         """
 *         Return a pandas.DataFrame with the DataFrame data.
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_9DataFrame_37to_pandas, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_DataFrame_to_pandas, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__150)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 453, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__151);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_DataFrame, __pyx_n_s_to_pandas, __pyx_t_3) < 0) __PYX_ERR(0, 453, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_DataFrame);

  /* "amplpy/dataframe.pxi":478
 *                 return pd.DataFrame(columns, index=index)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def from_dict(cls, dic, index_names=None, column_names=None):
 *         """
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_9DataFrame_39from_dict, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_DataFrame_from_dict, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__153)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 478, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__20);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_DataFrame, __pyx_n_s_from_dict, __pyx_t_3) < 0) __PYX_ERR(0, 478, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_DataFrame);
  __Pyx_GetNameInClass(__pyx_t_3, (PyObject *)__pyx_ptype_7_amplpy_DataFrame, __pyx_n_s_from_dict); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 478, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_Method_ClassMethod(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 478, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_DataFrame, __pyx_n_s_from_dict, __pyx_t_2) < 0) __PYX_ERR(0, 478, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_DataFrame);

  /* "amplpy/dataframe.pxi":520
 *         return cls(index=index, columns=columns)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def from_pandas(cls, df, index_names=None, indexarity=None):
 *         """
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_9DataFrame_41from_pandas, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_DataFrame_from_pandas, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__155)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 520, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__20);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_DataFrame, __pyx_n_s_from_pandas, __pyx_t_2) < 0) __PYX_ERR(0, 520, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_DataFrame);
  __Pyx_GetNameInClass(__pyx_t_2, (PyObject *)__pyx_ptype_7_amplpy_DataFrame, __pyx_n_s_from_pandas); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 520, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_Method_ClassMethod(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 520, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_DataFrame, __pyx_n_s_from_pandas, __pyx_t_3) < 0) __PYX_ERR(0, 520, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_DataFrame);

  /* "amplpy/dataframe.pxi":554
 *         return cls(index=index, columns=columns)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def from_numpy(cls, data):
 *         """
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_9DataFrame_43from_numpy, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_DataFrame_from_numpy, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__157)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 554, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_DataFrame, __pyx_n_s_from_numpy, __pyx_t_3) < 0) __PYX_ERR(0, 554, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_DataFrame);
  __Pyx_GetNameInClass(__pyx_t_3, (PyObject *)__pyx_ptype_7_amplpy_DataFrame, __pyx_n_s_from_numpy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 554, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_Method_ClassMethod(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 554, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_DataFrame, __pyx_n_s_from_numpy, __pyx_t_2) < 0) __PYX_ERR(0, 554, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_DataFrame);

  /* "amplpy/dataframe.pxi":572
 *         return cls(index=index, columns=columns)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def _from_data_frame_ref(cls, df_ref):
 *         return cls(None, None, _impl=df_ref)
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_9DataFrame_45_from_data_frame_ref, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_DataFrame__from_data_frame_ref, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__159)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 572, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_DataFrame, __pyx_n_s_from_data_frame_ref, __pyx_t_2) < 0) __PYX_ERR(0, 572, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_DataFrame);
  __Pyx_GetNameInClass(__pyx_t_2, (PyObject *)__pyx_ptype_7_amplpy_DataFrame, __pyx_n_s_from_data_frame_ref); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 572, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_Method_ClassMethod(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 572, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_DataFrame, __pyx_n_s_from_data_frame_ref, __pyx_t_3) < 0) __PYX_ERR(0, 572, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_DataFrame);

  /* "amplpy/dataframe.pxi":577
 * 
 *     # Aliases
 *     _addColumn = _add_column             # <<<<<<<<<<<<<<
 *     _addRow = _add_row
 *     _getColumn = _get_column
 */
  __Pyx_GetNameInClass(__pyx_t_3, (PyObject *)__pyx_ptype_7_amplpy_DataFrame, __pyx_n_s_add_column); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 577, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_DataFrame, __pyx_n_s_addColumn, __pyx_t_3) < 0) __PYX_ERR(0, 577, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_DataFrame);

  /* "amplpy/dataframe.pxi":578
 *     # Aliases
 *     _addColumn = _add_column
 *     _addRow = _add_row             # <<<<<<<<<<<<<<
 *     _getColumn = _get_column
 *     _getHeaders = _get_headers
 */
  __Pyx_GetNameInClass(__pyx_t_3, (PyObject *)__pyx_ptype_7_amplpy_DataFrame, __pyx_n_s_add_row); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 578, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_DataFrame, __pyx_n_s_addRow, __pyx_t_3) < 0) __PYX_ERR(0, 578, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_DataFrame);

  /* "amplpy/dataframe.pxi":579
 *     _addColumn = _add_column
 *     _addRow = _add_row
 *     _getColumn = _get_column             # <<<<<<<<<<<<<<
 *     _getHeaders = _get_headers
 *     _getNumCols = _get_num_cols
 */
  __Pyx_GetNameInClass(__pyx_t_3, (PyObject *)__pyx_ptype_7_amplpy_DataFrame, __pyx_n_s_get_column); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 579, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_DataFrame, __pyx_n_s_getColumn, __pyx_t_3) < 0) __PYX_ERR(0, 579, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_DataFrame);

  /* "amplpy/dataframe.pxi":580
 *     _addRow = _add_row
 *     _getColumn = _get_column
 *     _getHeaders = _get_headers             # <<<<<<<<<<<<<<
 *     _getNumCols = _get_num_cols
 *     _getNumIndices = _get_num_indices
 */
  __Pyx_GetNameInClass(__pyx_t_3, (PyObject *)__pyx_ptype_7_amplpy_DataFrame, __pyx_n_s_get_headers); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 580, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_DataFrame, __pyx_n_s_getHeaders, __pyx_t_3) < 0) __PYX_ERR(0, 580, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_DataFrame);

  /* "amplpy/dataframe.pxi":581
 *     _getColumn = _get_column
 *     _getHeaders = _get_headers
 *     _getNumCols = _get_num_cols             # <<<<<<<<<<<<<<
 *     _getNumIndices = _get_num_indices
 *     _getNumRows = _get_num_rows
 */
  __Pyx_GetNameInClass(__pyx_t_3, (PyObject *)__pyx_ptype_7_amplpy_DataFrame, __pyx_n_s_get_num_cols); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 581, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_DataFrame, __pyx_n_s_getNumCols, __pyx_t_3) < 0) __PYX_ERR(0, 581, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_DataFrame);

  /* "amplpy/dataframe.pxi":582
 *     _getHeaders = _get_headers
 *     _getNumCols = _get_num_cols
 *     _getNumIndices = _get_num_indices             # <<<<<<<<<<<<<<
 *     _getNumRows = _get_num_rows
 *     _getRow = _get_row
 */
  __Pyx_GetNameInClass(__pyx_t_3, (PyObject *)__pyx_ptype_7_amplpy_DataFrame, __pyx_n_s_get_num_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 582, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_DataFrame, __pyx_n_s_getNumIndices, __pyx_t_3) < 0) __PYX_ERR(0, 582, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_DataFrame);

  /* "amplpy/dataframe.pxi":583
 *     _getNumCols = _get_num_cols
 *     _getNumIndices = _get_num_indices
 *     _getNumRows = _get_num_rows             # <<<<<<<<<<<<<<
 *     _getRow = _get_row
 *     _getRowByIndex = _get_row_by_index
 */
  __Pyx_GetNameInClass(__pyx_t_3, (PyObject *)__pyx_ptype_7_amplpy_DataFrame, __pyx_n_s_get_num_rows); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 583, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_DataFrame, __pyx_n_s_getNumRows, __pyx_t_3) < 0) __PYX_ERR(0, 583, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_DataFrame);

  /* "amplpy/dataframe.pxi":584
 *     _getNumIndices = _get_num_indices
 *     _getNumRows = _get_num_rows
 *     _getRow = _get_row             # <<<<<<<<<<<<<<
 *     _getRowByIndex = _get_row_by_index
 *     _setColumn = _set_column
 */
  __Pyx_GetNameInClass(__pyx_t_3, (PyObject *)__pyx_ptype_7_amplpy_DataFrame, __pyx_n_s_get_row); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 584, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_DataFrame, __pyx_n_s_getRow, __pyx_t_3) < 0) __PYX_ERR(0, 584, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_DataFrame);

  /* "amplpy/dataframe.pxi":585
 *     _getNumRows = _get_num_rows
 *     _getRow = _get_row
 *     _getRowByIndex = _get_row_by_index             # <<<<<<<<<<<<<<
 *     _setColumn = _set_column
 *     _setValues = _set_values
 */
  __Pyx_GetNameInClass(__pyx_t_3, (PyObject *)__pyx_ptype_7_amplpy_DataFrame, __pyx_n_s_get_row_by_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 585, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_DataFrame, __pyx_n_s_getRowByIndex, __pyx_t_3) < 0) __PYX_ERR(0, 585, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_DataFrame);

  /* "amplpy/dataframe.pxi":586
 *     _getRow = _get_row
 *     _getRowByIndex = _get_row_by_index
 *     _setColumn = _set_column             # <<<<<<<<<<<<<<
 *     _setValues = _set_values
 *     fromDict = from_dict
 */
  __Pyx_GetNameInClass(__pyx_t_3, (PyObject *)__pyx_ptype_7_amplpy_DataFrame, __pyx_n_s_set_column); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 586, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_DataFrame, __pyx_n_s_setColumn, __pyx_t_3) < 0) __PYX_ERR(0, 586, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_DataFrame);

  /* "amplpy/dataframe.pxi":587
 *     _getRowByIndex = _get_row_by_index
 *     _setColumn = _set_column
 *     _setValues = _set_values             # <<<<<<<<<<<<<<
 *     fromDict = from_dict
 *     fromNumpy = from_numpy
 */
  __Pyx_GetNameInClass(__pyx_t_3, (PyObject *)__pyx_ptype_7_amplpy_DataFrame, __pyx_n_s_set_values_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 587, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_DataFrame, __pyx_n_s_setValues, __pyx_t_3) < 0) __PYX_ERR(0, 587, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_DataFrame);

  /* "amplpy/dataframe.pxi":588
 *     _setColumn = _set_column
 *     _setValues = _set_values
 *     fromDict = from_dict             # <<<<<<<<<<<<<<
 *     fromNumpy = from_numpy
 *     fromPandas = from_pandas
 */
  __Pyx_GetNameInClass(__pyx_t_3, (PyObject *)__pyx_ptype_7_amplpy_DataFrame, __pyx_n_s_from_dict); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 588, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_DataFrame, __pyx_n_s_fromDict, __pyx_t_3) < 0) __PYX_ERR(0, 588, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_DataFrame);

  /* "amplpy/dataframe.pxi":589
 *     _setValues = _set_values
 *     fromDict = from_dict
 *     fromNumpy = from_numpy             # <<<<<<<<<<<<<<
 *     fromPandas = from_pandas
 *     toDict = to_dict
 */
  __Pyx_GetNameInClass(__pyx_t_3, (PyObject *)__pyx_ptype_7_amplpy_DataFrame, __pyx_n_s_from_numpy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 589, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_DataFrame, __pyx_n_s_fromNumpy, __pyx_t_3) < 0) __PYX_ERR(0, 589, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_DataFrame);

  /* "amplpy/dataframe.pxi":590
 *     fromDict = from_dict
 *     fromNumpy = from_numpy
 *     fromPandas = from_pandas             # <<<<<<<<<<<<<<
 *     toDict = to_dict
 *     toList = to_list
 */
  __Pyx_GetNameInClass(__pyx_t_3, (PyObject *)__pyx_ptype_7_amplpy_DataFrame, __pyx_n_s_from_pandas); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 590, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_DataFrame, __pyx_n_s_fromPandas, __pyx_t_3) < 0) __PYX_ERR(0, 590, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_DataFrame);

  /* "amplpy/dataframe.pxi":591
 *     fromNumpy = from_numpy
 *     fromPandas = from_pandas
 *     toDict = to_dict             # <<<<<<<<<<<<<<
 *     toList = to_list
 *     toPandas = to_pandas
 */
  __Pyx_GetNameInClass(__pyx_t_3, (PyObject *)__pyx_ptype_7_amplpy_DataFrame, __pyx_n_s_to_dict); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 591, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_DataFrame, __pyx_n_s_toDict, __pyx_t_3) < 0) __PYX_ERR(0, 591, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_DataFrame);

  /* "amplpy/dataframe.pxi":592
 *     fromPandas = from_pandas
 *     toDict = to_dict
 *     toList = to_list             # <<<<<<<<<<<<<<
 *     toPandas = to_pandas
 *     toString = to_string
 */
  __Pyx_GetNameInClass(__pyx_t_3, (PyObject *)__pyx_ptype_7_amplpy_DataFrame, __pyx_n_s_to_list); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 592, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_DataFrame, __pyx_n_s_toList, __pyx_t_3) < 0) __PYX_ERR(0, 592, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_DataFrame);

  /* "amplpy/dataframe.pxi":593
 *     toDict = to_dict
 *     toList = to_list
 *     toPandas = to_pandas             # <<<<<<<<<<<<<<
 *     toString = to_string
 */
  __Pyx_GetNameInClass(__pyx_t_3, (PyObject *)__pyx_ptype_7_amplpy_DataFrame, __pyx_n_s_to_pandas); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 593, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_DataFrame, __pyx_n_s_toPandas, __pyx_t_3) < 0) __PYX_ERR(0, 593, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_DataFrame);

  /* "amplpy/dataframe.pxi":594
 *     toList = to_list
 *     toPandas = to_pandas
 *     toString = to_string             # <<<<<<<<<<<<<<
 */
  __Pyx_GetNameInClass(__pyx_t_3, (PyObject *)__pyx_ptype_7_amplpy_DataFrame, __pyx_n_s_to_string); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 594, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_DataFrame, __pyx_n_s_toString, __pyx_t_3) < 0) __PYX_ERR(0, 594, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_DataFrame);

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_9DataFrame_47__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_DataFrame___reduce_cython, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__160)); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_3) < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_9DataFrame_49__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_DataFrame___setstate_cython, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__161)); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_3) < 0) __PYX_ERR(8, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "amplpy/entity.pxi":6
 * 
 * 
 * try:             # <<<<<<<<<<<<<<
 *     import pandas as pd
 * except ImportError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "amplpy/entity.pxi":7
 * 
 * try:
 *     import pandas as pd             # <<<<<<<<<<<<<<
 * except ImportError:
 *     pd = None
 */
      __pyx_t_3 = __Pyx_ImportDottedModule(__pyx_n_s_pandas, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 7, __pyx_L18_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_pd, __pyx_t_3) < 0) __PYX_ERR(9, 7, __pyx_L18_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "amplpy/entity.pxi":6
 * 
 * 
 * try:             # <<<<<<<<<<<<<<
 *     import pandas as pd
 * except ImportError:
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L23_try_end;
    __pyx_L18_error:;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "amplpy/entity.pxi":8
 * try:
 *     import pandas as pd
 * except ImportError:             # <<<<<<<<<<<<<<
 *     pd = None
 * 
 */
    __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError);
    if (__pyx_t_6) {
      __Pyx_AddTraceback("_amplpy", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_2, &__pyx_t_7) < 0) __PYX_ERR(9, 8, __pyx_L20_except_error)
      __Pyx_XGOTREF(__pyx_t_3);
      __Pyx_XGOTREF(__pyx_t_2);
      __Pyx_XGOTREF(__pyx_t_7);

      /* "amplpy/entity.pxi":9
 *     import pandas as pd
 * except ImportError:
 *     pd = None             # <<<<<<<<<<<<<<
 * 
 * 
 */
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_pd, Py_None) < 0) __PYX_ERR(9, 9, __pyx_L20_except_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L19_exception_handled;
    }
    goto __pyx_L20_except_error;

    /* "amplpy/entity.pxi":6
 * 
 * 
 * try:             # <<<<<<<<<<<<<<
 *     import pandas as pd
 * except ImportError:
 */
    __pyx_L20_except_error:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L19_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_4, __pyx_t_5);
    __pyx_L23_try_end:;
  }

  /* "amplpy/entity.pxi":69
 *             campl.AMPL_StringFree(&self._name)
 * 
 *     def to_string(self):             # <<<<<<<<<<<<<<
 *         cdef char* output_c
 *         campl.AMPL_EntityGetDeclaration(self._c_ampl, self._name, &output_c)
 */
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_6Entity_3to_string, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Entity_to_string, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__163)); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 69, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Entity, __pyx_n_s_to_string, __pyx_t_7) < 0) __PYX_ERR(9, 69, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Entity);

  /* "amplpy/entity.pxi":90
 *         return create_entity(self.wrap_function, self._c_ampl, self._name, tuple_c, self)
 * 
 *     def get(self, *index):             # <<<<<<<<<<<<<<
 *         """
 *         Get the instance with the specified index.
 */
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_6Entity_11get, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Entity_get, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__165)); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 90, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Entity, __pyx_n_s_get, __pyx_t_7) < 0) __PYX_ERR(9, 90, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Entity);

  /* "amplpy/entity.pxi":115
 *                 return create_entity(self.wrap_function, self._c_ampl, self._name, tuple_c, self)
 * 
 *     def find(self, index):             # <<<<<<<<<<<<<<
 *         """
 *         Searches the current entity for an instance with the specified index.
 */
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_6Entity_13find, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Entity_find, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__167)); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 115, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Entity, __pyx_n_s_find, __pyx_t_7) < 0) __PYX_ERR(9, 115, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Entity);

  /* "amplpy/entity.pxi":140
 *         return None
 * 
 *     def instances(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get all the instances in this entity.
 */
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_6Entity_15instances, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Entity_instances, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__168)); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 140, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Entity, __pyx_n_s_instances, __pyx_t_7) < 0) __PYX_ERR(9, 140, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Entity);

  /* "amplpy/entity.pxi":146
 *         return InstanceIterator.create(self._c_ampl, self._name, self.wrap_function, self)
 * 
 *     def name(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the name of this entity.
 */
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_6Entity_17name, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Entity_name, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__169)); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 146, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Entity, __pyx_n_s_name, __pyx_t_7) < 0) __PYX_ERR(9, 146, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Entity);

  /* "amplpy/entity.pxi":152
 *         return self._name.decode('utf-8')
 * 
 *     def indexarity(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the indexarity of this entity (sum of the dimensions of the
 */
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_6Entity_19indexarity, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Entity_indexarity, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__171)); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 152, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Entity, __pyx_n_s_indexarity, __pyx_t_7) < 0) __PYX_ERR(9, 152, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Entity);

  /* "amplpy/entity.pxi":178
 *         return indexarity
 * 
 *     def is_scalar(self):             # <<<<<<<<<<<<<<
 *         """
 *         Check whether this entity is scalar. Equivalent to testing whether
 */
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_6Entity_21is_scalar, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Entity_is_scalar, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__172)); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 178, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Entity, __pyx_n_s_is_scalar, __pyx_t_7) < 0) __PYX_ERR(9, 178, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Entity);

  /* "amplpy/entity.pxi":191
 *             return True
 * 
 *     def num_instances(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the number of instances in this entity.
 */
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_6Entity_23num_instances, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Entity_num_instances, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__174)); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 191, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Entity, __pyx_n_s_num_instances, __pyx_t_7) < 0) __PYX_ERR(9, 191, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Entity);

  /* "amplpy/entity.pxi":199
 *         return int(size)
 * 
 *     def get_indexing_sets(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the AMPL string representation of the sets on which this entity is
 */
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_6Entity_25get_indexing_sets, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Entity_get_indexing_sets, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__176)); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 199, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Entity, __pyx_n_s_get_indexing_sets, __pyx_t_7) < 0) __PYX_ERR(9, 199, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Entity);

  /* "amplpy/entity.pxi":224
 *         return pylist
 * 
 *     def xref(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the names of all entities which depend on this one.
 */
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_6Entity_27xref, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Entity_xref, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__178)); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Entity, __pyx_n_s_xref, __pyx_t_7) < 0) __PYX_ERR(9, 224, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Entity);

  /* "amplpy/entity.pxi":244
 *         return pylist
 * 
 *     def get_values(self, suffixes=None):             # <<<<<<<<<<<<<<
 *         """
 *         If a list of suffixes is provided, get the specified suffixes value for
 */
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_6Entity_29get_values, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Entity_get_values, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__180)); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 244, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_tuple__131);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Entity, __pyx_n_s_get_values, __pyx_t_7) < 0) __PYX_ERR(9, 244, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Entity);

  /* "amplpy/entity.pxi":286
 *         return DataFrame.create(df_c)
 * 
 *     def to_pandas(self, **kwargs):             # <<<<<<<<<<<<<<
 *         """
 *         Equivalent to ``Entity.get_values().``:func:`~amplpy.DataFrame.to_pandas`.
 */
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_6Entity_31to_pandas, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Entity_to_pandas, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__182)); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 286, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Entity, __pyx_n_s_to_pandas, __pyx_t_7) < 0) __PYX_ERR(9, 286, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Entity);

  /* "amplpy/entity.pxi":292
 *         return self.get_values().to_pandas(**kwargs)
 * 
 *     def to_dict(self, **kwargs):             # <<<<<<<<<<<<<<
 *         """
 *         Equivalent to ``Entity.get_values().``:func:`~amplpy.DataFrame.to_dict`.
 */
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_6Entity_33to_dict, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Entity_to_dict, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__183)); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 292, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Entity, __pyx_n_s_to_dict, __pyx_t_7) < 0) __PYX_ERR(9, 292, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Entity);

  /* "amplpy/entity.pxi":298
 *         return self.get_values().to_dict(**kwargs)
 * 
 *     def to_list(self, **kwargs):             # <<<<<<<<<<<<<<
 *         """
 *         Equivalent to ``Entity.get_values().``:func:`~amplpy.DataFrame.to_list`.
 */
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_6Entity_35to_list, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Entity_to_list, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__184)); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 298, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Entity, __pyx_n_s_to_list, __pyx_t_7) < 0) __PYX_ERR(9, 298, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Entity);

  /* "amplpy/entity.pxi":304
 *         return self.get_values().to_list(**kwargs)
 * 
 *     def set_values(self, data):             # <<<<<<<<<<<<<<
 *         """
 *         Set the values of this entiy to the correponding values of a
 */
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_6Entity_37set_values, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Entity_set_values, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__186)); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 304, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Entity, __pyx_n_s_set_values, __pyx_t_7) < 0) __PYX_ERR(9, 304, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Entity);

  /* "amplpy/entity.pxi":349
 * 
 *     # Aliases
 *     toString = to_string             # <<<<<<<<<<<<<<
 *     getIndexingSets = get_indexing_sets
 *     getValues = get_values
 */
  __Pyx_GetNameInClass(__pyx_t_7, (PyObject *)__pyx_ptype_7_amplpy_Entity, __pyx_n_s_to_string); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 349, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Entity, __pyx_n_s_toString, __pyx_t_7) < 0) __PYX_ERR(9, 349, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Entity);

  /* "amplpy/entity.pxi":350
 *     # Aliases
 *     toString = to_string
 *     getIndexingSets = get_indexing_sets             # <<<<<<<<<<<<<<
 *     getValues = get_values
 *     isScalar = is_scalar
 */
  __Pyx_GetNameInClass(__pyx_t_7, (PyObject *)__pyx_ptype_7_amplpy_Entity, __pyx_n_s_get_indexing_sets); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 350, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Entity, __pyx_n_s_getIndexingSets, __pyx_t_7) < 0) __PYX_ERR(9, 350, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Entity);

  /* "amplpy/entity.pxi":351
 *     toString = to_string
 *     getIndexingSets = get_indexing_sets
 *     getValues = get_values             # <<<<<<<<<<<<<<
 *     isScalar = is_scalar
 *     numInstances = num_instances
 */
  __Pyx_GetNameInClass(__pyx_t_7, (PyObject *)__pyx_ptype_7_amplpy_Entity, __pyx_n_s_get_values); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 351, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Entity, __pyx_n_s_getValues, __pyx_t_7) < 0) __PYX_ERR(9, 351, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Entity);

  /* "amplpy/entity.pxi":352
 *     getIndexingSets = get_indexing_sets
 *     getValues = get_values
 *     isScalar = is_scalar             # <<<<<<<<<<<<<<
 *     numInstances = num_instances
 *     setValues = set_values
 */
  __Pyx_GetNameInClass(__pyx_t_7, (PyObject *)__pyx_ptype_7_amplpy_Entity, __pyx_n_s_is_scalar); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 352, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Entity, __pyx_n_s_isScalar, __pyx_t_7) < 0) __PYX_ERR(9, 352, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Entity);

  /* "amplpy/entity.pxi":353
 *     getValues = get_values
 *     isScalar = is_scalar
 *     numInstances = num_instances             # <<<<<<<<<<<<<<
 *     setValues = set_values
 */
  __Pyx_GetNameInClass(__pyx_t_7, (PyObject *)__pyx_ptype_7_amplpy_Entity, __pyx_n_s_num_instances); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 353, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Entity, __pyx_n_s_numInstances, __pyx_t_7) < 0) __PYX_ERR(9, 353, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Entity);

  /* "amplpy/entity.pxi":354
 *     isScalar = is_scalar
 *     numInstances = num_instances
 *     setValues = set_values             # <<<<<<<<<<<<<<
 */
  __Pyx_GetNameInClass(__pyx_t_7, (PyObject *)__pyx_ptype_7_amplpy_Entity, __pyx_n_s_set_values); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 354, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Entity, __pyx_n_s_setValues_2, __pyx_t_7) < 0) __PYX_ERR(9, 354, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Entity);

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._c_ampl,self._index cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_6Entity_39__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Entity___reduce_cython, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__187)); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_7) < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._c_ampl,self._index cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._c_ampl,self._index cannot be converted to a Python object for pickling"
 */
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_6Entity_41__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Entity___setstate_cython, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__188)); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_7) < 0) __PYX_ERR(8, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "amplpy/environment.pxi":2
 * # -*- coding: utf-8 -*-
 * import os             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_7 = __Pyx_ImportDottedModule(__pyx_n_s_os, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_os, __pyx_t_7) < 0) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "amplpy/environment.pxi":72
 *             return None
 * 
 *     def to_string(self):             # <<<<<<<<<<<<<<
 *         cdef const char* to_string_c
 *         campl.AMPL_EnvironmentToString(self._c_env, &to_string_c)
 */
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_11Environment_13to_string, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Environment_to_string, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__190)); if (unlikely(!__pyx_t_7)) __PYX_ERR(10, 72, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Environment, __pyx_n_s_to_string, __pyx_t_7) < 0) __PYX_ERR(10, 72, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Environment);

  /* "amplpy/environment.pxi":78
 *         return to_string
 * 
 *     def set_bin_dir(self, binary_directory):             # <<<<<<<<<<<<<<
 *         """
 *         Set the location where AMPL API will search for the AMPL executable.
 */
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_11Environment_15set_bin_dir, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Environment_set_bin_dir, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__192)); if (unlikely(!__pyx_t_7)) __PYX_ERR(10, 78, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Environment, __pyx_n_s_set_bin_dir, __pyx_t_7) < 0) __PYX_ERR(10, 78, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Environment);

  /* "amplpy/environment.pxi":87
 *         campl.AMPL_EnvironmentSetBinaryDirectory(self._c_env, binary_directory.encode('utf-8'))
 * 
 *     def get_bin_dir(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the location where AMPL API will search for the AMPL executable.
 */
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_11Environment_17get_bin_dir, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Environment_get_bin_dir, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__194)); if (unlikely(!__pyx_t_7)) __PYX_ERR(10, 87, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Environment, __pyx_n_s_get_bin_dir, __pyx_t_7) < 0) __PYX_ERR(10, 87, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Environment);

  /* "amplpy/environment.pxi":96
 *         return bin_dir
 * 
 *     def set_bin_name(self, binary_name):             # <<<<<<<<<<<<<<
 *         """
 *         Set the name of the AMPL executable.
 */
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_11Environment_19set_bin_name, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Environment_set_bin_name, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__196)); if (unlikely(!__pyx_t_7)) __PYX_ERR(10, 96, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Environment, __pyx_n_s_set_bin_name, __pyx_t_7) < 0) __PYX_ERR(10, 96, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Environment);

  /* "amplpy/environment.pxi":105
 *         campl.AMPL_EnvironmentSetBinaryName(self._c_env, binary_name.encode('utf-8'))
 * 
 *     def get_bin_name(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the name of the AMPL executable.
 */
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_11Environment_21get_bin_name, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Environment_get_bin_name, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__198)); if (unlikely(!__pyx_t_7)) __PYX_ERR(10, 105, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Environment, __pyx_n_s_get_bin_name, __pyx_t_7) < 0) __PYX_ERR(10, 105, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Environment);

  /* "amplpy/environment.pxi":115
 * 
 *     # Aliases
 *     toString = to_string             # <<<<<<<<<<<<<<
 *     getBinDir = get_bin_dir
 *     getBinName = get_bin_name
 */
  __Pyx_GetNameInClass(__pyx_t_7, (PyObject *)__pyx_ptype_7_amplpy_Environment, __pyx_n_s_to_string); if (unlikely(!__pyx_t_7)) __PYX_ERR(10, 115, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Environment, __pyx_n_s_toString, __pyx_t_7) < 0) __PYX_ERR(10, 115, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Environment);

  /* "amplpy/environment.pxi":116
 *     # Aliases
 *     toString = to_string
 *     getBinDir = get_bin_dir             # <<<<<<<<<<<<<<
 *     getBinName = get_bin_name
 *     setBinDir = set_bin_dir
 */
  __Pyx_GetNameInClass(__pyx_t_7, (PyObject *)__pyx_ptype_7_amplpy_Environment, __pyx_n_s_get_bin_dir); if (unlikely(!__pyx_t_7)) __PYX_ERR(10, 116, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Environment, __pyx_n_s_getBinDir, __pyx_t_7) < 0) __PYX_ERR(10, 116, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Environment);

  /* "amplpy/environment.pxi":117
 *     toString = to_string
 *     getBinDir = get_bin_dir
 *     getBinName = get_bin_name             # <<<<<<<<<<<<<<
 *     setBinDir = set_bin_dir
 *     setBinName = set_bin_name
 */
  __Pyx_GetNameInClass(__pyx_t_7, (PyObject *)__pyx_ptype_7_amplpy_Environment, __pyx_n_s_get_bin_name); if (unlikely(!__pyx_t_7)) __PYX_ERR(10, 117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Environment, __pyx_n_s_getBinName, __pyx_t_7) < 0) __PYX_ERR(10, 117, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Environment);

  /* "amplpy/environment.pxi":118
 *     getBinDir = get_bin_dir
 *     getBinName = get_bin_name
 *     setBinDir = set_bin_dir             # <<<<<<<<<<<<<<
 *     setBinName = set_bin_name
 */
  __Pyx_GetNameInClass(__pyx_t_7, (PyObject *)__pyx_ptype_7_amplpy_Environment, __pyx_n_s_set_bin_dir); if (unlikely(!__pyx_t_7)) __PYX_ERR(10, 118, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Environment, __pyx_n_s_setBinDir, __pyx_t_7) < 0) __PYX_ERR(10, 118, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Environment);

  /* "amplpy/environment.pxi":119
 *     getBinName = get_bin_name
 *     setBinDir = set_bin_dir
 *     setBinName = set_bin_name             # <<<<<<<<<<<<<<
 */
  __Pyx_GetNameInClass(__pyx_t_7, (PyObject *)__pyx_ptype_7_amplpy_Environment, __pyx_n_s_set_bin_name); if (unlikely(!__pyx_t_7)) __PYX_ERR(10, 119, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Environment, __pyx_n_s_setBinName, __pyx_t_7) < 0) __PYX_ERR(10, 119, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Environment);

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_11Environment_23__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Environment___reduce_cython, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__199)); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_7) < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_11Environment_25__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Environment___setstate_cython, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__200)); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_7) < 0) __PYX_ERR(8, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "amplpy/errorhandler.pxi":2
 * # -*- coding: utf-8 -*-
 * try:             # <<<<<<<<<<<<<<
 *     from .tools import _SUPPORT_MESSAGE
 * except Exception:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_1);
    /*try:*/ {

      /* "amplpy/errorhandler.pxi":3
 * # -*- coding: utf-8 -*-
 * try:
 *     from .tools import _SUPPORT_MESSAGE             # <<<<<<<<<<<<<<
 * except Exception:
 *     _SUPPORT_MESSAGE = ""
 */
      __pyx_t_7 = PyList_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(11, 3, __pyx_L26_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_n_s_SUPPORT_MESSAGE);
      __Pyx_GIVEREF(__pyx_n_s_SUPPORT_MESSAGE);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 0, __pyx_n_s_SUPPORT_MESSAGE)) __PYX_ERR(11, 3, __pyx_L26_error);
      __pyx_t_2 = __Pyx_Import(__pyx_n_s_tools, __pyx_t_7, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 3, __pyx_L26_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_SUPPORT_MESSAGE); if (unlikely(!__pyx_t_7)) __PYX_ERR(11, 3, __pyx_L26_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_SUPPORT_MESSAGE, __pyx_t_7) < 0) __PYX_ERR(11, 3, __pyx_L26_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "amplpy/errorhandler.pxi":2
 * # -*- coding: utf-8 -*-
 * try:             # <<<<<<<<<<<<<<
 *     from .tools import _SUPPORT_MESSAGE
 * except Exception:
 */
    }
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    goto __pyx_L31_try_end;
    __pyx_L26_error:;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "amplpy/errorhandler.pxi":4
 * try:
 *     from .tools import _SUPPORT_MESSAGE
 * except Exception:             # <<<<<<<<<<<<<<
 *     _SUPPORT_MESSAGE = ""
 * 
 */
    __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_6) {
      __Pyx_AddTraceback("_amplpy", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_7, &__pyx_t_3) < 0) __PYX_ERR(11, 4, __pyx_L28_except_error)
      __Pyx_XGOTREF(__pyx_t_2);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_3);

      /* "amplpy/errorhandler.pxi":5
 *     from .tools import _SUPPORT_MESSAGE
 * except Exception:
 *     _SUPPORT_MESSAGE = ""             # <<<<<<<<<<<<<<
 * 
 * def display_error_message(exception, error=True):
 */
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_SUPPORT_MESSAGE, __pyx_kp_u__22) < 0) __PYX_ERR(11, 5, __pyx_L28_except_error)
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      goto __pyx_L27_exception_handled;
    }
    goto __pyx_L28_except_error;

    /* "amplpy/errorhandler.pxi":2
 * # -*- coding: utf-8 -*-
 * try:             # <<<<<<<<<<<<<<
 *     from .tools import _SUPPORT_MESSAGE
 * except Exception:
 */
    __pyx_L28_except_error:;
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_1);
    goto __pyx_L1_error;
    __pyx_L27_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_1);
    __pyx_L31_try_end:;
  }

  /* "amplpy/errorhandler.pxi":7
 *     _SUPPORT_MESSAGE = ""
 * 
 * def display_error_message(exception, error=True):             # <<<<<<<<<<<<<<
 *     msg = "\t" + str(exception).replace("\n", "\n\t")
 *     if error:
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_1display_error_message, 0, __pyx_n_s_display_error_message, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__202)); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__151);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_display_error_message, __pyx_t_3) < 0) __PYX_ERR(11, 7, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "amplpy/errorhandler.pxi":25
 *     """
 * 
 *     def error(self, exception):             # <<<<<<<<<<<<<<
 *         """
 *         Receives notification of an error.
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_12ErrorHandler_1error, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ErrorHandler_error, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__204)); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_ErrorHandler, __pyx_n_s_error, __pyx_t_3) < 0) __PYX_ERR(11, 25, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_ErrorHandler);

  /* "amplpy/errorhandler.pxi":32
 *         raise exception
 * 
 *     def warning(self, exception):             # <<<<<<<<<<<<<<
 *         """
 *         Receives notification of a warning.
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_12ErrorHandler_3warning, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ErrorHandler_warning, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__205)); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_ErrorHandler, __pyx_n_s_warning, __pyx_t_3) < 0) __PYX_ERR(11, 32, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_ErrorHandler);

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_12ErrorHandler_5__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ErrorHandler___reduce_cython, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__207)); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_ErrorHandler, __pyx_n_s_reduce_cython, __pyx_t_3) < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_ErrorHandler);

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_ErrorHandler, (type(self), 0xe3b0c44, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_ErrorHandler__set_state(self, __pyx_state)
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_12ErrorHandler_7__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ErrorHandler___setstate_cython, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__208)); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_ErrorHandler, __pyx_n_s_setstate_cython, __pyx_t_3) < 0) __PYX_ERR(8, 16, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_ErrorHandler);

  /* "amplpy/exceptions.pxi":4
 * 
 * 
 * class AMPLException(Exception):             # <<<<<<<<<<<<<<
 *     """
 *     Represent an exception generated by AMPL.
 */
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]));
  __Pyx_GIVEREF((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]));
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])))) __PYX_ERR(1, 4, __pyx_L1_error);
  __pyx_t_7 = __Pyx_PEP560_update_bases(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_8 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_7, __pyx_n_s_AMPLException, __pyx_n_s_AMPLException, (PyObject *) NULL, __pyx_n_s_amplpy, __pyx_kp_s_Represent_an_exception_generate); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__pyx_t_7 != __pyx_t_3) {
    if (unlikely((PyDict_SetItemString(__pyx_t_8, "__orig_bases__", __pyx_t_3) < 0))) __PYX_ERR(1, 4, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "amplpy/exceptions.pxi":9
 *     """
 * 
 *     def __init__(self, source_name, line_number, offset, message):             # <<<<<<<<<<<<<<
 *         super(AMPLException, self).__init__()
 *         self.source_name = source_name
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_13AMPLException_1__init__, 0, __pyx_n_s_AMPLException___init, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__210)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_init, __pyx_t_3) < 0) __PYX_ERR(1, 9, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "amplpy/exceptions.pxi":16
 *         self.message = message
 * 
 *     def get_source_name(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the name of the file where the error was detected.
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_13AMPLException_3get_source_name, 0, __pyx_n_s_AMPLException_get_source_name, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__211)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_get_source_name, __pyx_t_3) < 0) __PYX_ERR(1, 16, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "amplpy/exceptions.pxi":22
 *         return self.source_name
 * 
 *     def get_line_number(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the row where the error is located.
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_13AMPLException_5get_line_number, 0, __pyx_n_s_AMPLException_get_line_number, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__212)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 22, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_get_line_number, __pyx_t_3) < 0) __PYX_ERR(1, 22, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "amplpy/exceptions.pxi":28
 *         return self.line_number
 * 
 *     def get_offset(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the offset where the error is located.
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_13AMPLException_7get_offset, 0, __pyx_n_s_AMPLException_get_offset, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__213)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 28, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_get_offset, __pyx_t_3) < 0) __PYX_ERR(1, 28, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "amplpy/exceptions.pxi":34
 *         return self.offset
 * 
 *     def get_message(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the error message.
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_13AMPLException_9get_message, 0, __pyx_n_s_AMPLException_get_message, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__214)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_get_message, __pyx_t_3) < 0) __PYX_ERR(1, 34, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "amplpy/exceptions.pxi":40
 *         return self.message
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return "file: " + self.source_name + self.message + _SUPPORT_MESSAGE #discuss with Filipe
 * 
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_13AMPLException_11__str__, 0, __pyx_n_s_AMPLException___str, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__215)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 40, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_str, __pyx_t_3) < 0) __PYX_ERR(1, 40, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "amplpy/exceptions.pxi":44
 * 
 *     # Aliases
 *     getLineNumber = get_line_number             # <<<<<<<<<<<<<<
 *     getMessage = get_message
 *     getOffset = get_offset
 */
  __pyx_t_3 = PyObject_GetItem(__pyx_t_8, __pyx_n_s_get_line_number);
  if (unlikely(!__pyx_t_3)) {
    PyErr_Clear();
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_get_line_number);
  }
  if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 44, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_getLineNumber, __pyx_t_3) < 0) __PYX_ERR(1, 44, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "amplpy/exceptions.pxi":45
 *     # Aliases
 *     getLineNumber = get_line_number
 *     getMessage = get_message             # <<<<<<<<<<<<<<
 *     getOffset = get_offset
 *     getSourceName = get_source_name
 */
  __pyx_t_3 = PyObject_GetItem(__pyx_t_8, __pyx_n_s_get_message);
  if (unlikely(!__pyx_t_3)) {
    PyErr_Clear();
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_get_message);
  }
  if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 45, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_getMessage, __pyx_t_3) < 0) __PYX_ERR(1, 45, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "amplpy/exceptions.pxi":46
 *     getLineNumber = get_line_number
 *     getMessage = get_message
 *     getOffset = get_offset             # <<<<<<<<<<<<<<
 *     getSourceName = get_source_name
 * 
 */
  __pyx_t_3 = PyObject_GetItem(__pyx_t_8, __pyx_n_s_get_offset);
  if (unlikely(!__pyx_t_3)) {
    PyErr_Clear();
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_get_offset);
  }
  if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 46, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_getOffset, __pyx_t_3) < 0) __PYX_ERR(1, 46, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "amplpy/exceptions.pxi":47
 *     getMessage = get_message
 *     getOffset = get_offset
 *     getSourceName = get_source_name             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_3 = PyObject_GetItem(__pyx_t_8, __pyx_n_s_get_source_name);
  if (unlikely(!__pyx_t_3)) {
    PyErr_Clear();
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_get_source_name);
  }
  if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 47, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_getSourceName, __pyx_t_3) < 0) __PYX_ERR(1, 47, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "amplpy/exceptions.pxi":4
 * 
 * 
 * class AMPLException(Exception):             # <<<<<<<<<<<<<<
 *     """
 *     Represent an exception generated by AMPL.
 */
  __pyx_t_3 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_AMPLException, __pyx_t_7, __pyx_t_8, NULL, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_AMPLException, __pyx_t_3) < 0) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "amplpy/exceptions.pxi":50
 * 
 * 
 * class PresolveException(RuntimeError):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
  __pyx_t_7 = __Pyx_PEP560_update_bases(__pyx_tuple__217); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 50, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 50, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_8 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_7, __pyx_n_s_PresolveException, __pyx_n_s_PresolveException, (PyObject *) NULL, __pyx_n_s_amplpy, (PyObject *) NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 50, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__pyx_t_7 != __pyx_tuple__217) {
    if (unlikely((PyDict_SetItemString(__pyx_t_8, "__orig_bases__", __pyx_tuple__217) < 0))) __PYX_ERR(1, 50, __pyx_L1_error)
  }
  __pyx_t_3 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_PresolveException, __pyx_t_7, __pyx_t_8, NULL, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 50, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_PresolveException, __pyx_t_3) < 0) __PYX_ERR(1, 50, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "amplpy/exceptions.pxi":54
 * 
 * 
 * class InfeasibilityException(RuntimeError):             # <<<<<<<<<<<<<<
 *     pass
 */
  __pyx_t_7 = __Pyx_PEP560_update_bases(__pyx_tuple__219); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 54, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 54, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_8 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_7, __pyx_n_s_InfeasibilityException, __pyx_n_s_InfeasibilityException, (PyObject *) NULL, __pyx_n_s_amplpy, (PyObject *) NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 54, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__pyx_t_7 != __pyx_tuple__219) {
    if (unlikely((PyDict_SetItemString(__pyx_t_8, "__orig_bases__", __pyx_tuple__219) < 0))) __PYX_ERR(1, 54, __pyx_L1_error)
  }
  __pyx_t_3 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_InfeasibilityException, __pyx_t_7, __pyx_t_8, NULL, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 54, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_InfeasibilityException, __pyx_t_3) < 0) __PYX_ERR(1, 54, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.begin,self.end,self.env_c,self.iterator cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_11EnvIterator_5__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_EnvIterator___reduce_cython, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__220)); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_7) < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self.begin,self.end,self.env_c,self.iterator cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.begin,self.end,self.env_c,self.iterator cannot be converted to a Python object for pickling"
 */
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_11EnvIterator_7__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_EnvIterator___setstate_cython, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__221)); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_7) < 0) __PYX_ERR(8, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "amplpy/iterators.pxi":111
 *         return create_entity(self.entity_class, self._c_ampl, name_c, NULL, None)
 * 
 *     def size(self):             # <<<<<<<<<<<<<<
 *         return int(self._size)
 * 
 */
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_9EntityMap_9size, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_EntityMap_size, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__222)); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 111, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_EntityMap, __pyx_n_s_size, __pyx_t_7) < 0) __PYX_ERR(6, 111, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_EntityMap);

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._c_ampl,self.begin,self.end cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_9EntityMap_13__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_EntityMap___reduce_cython, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__223)); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_7) < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._c_ampl,self.begin,self.end cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._c_ampl,self.begin,self.end cannot be converted to a Python object for pickling"
 */
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_9EntityMap_15__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_EntityMap___setstate_cython, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__224)); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_7) < 0) __PYX_ERR(8, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "amplpy/iterators.pxi":185
 *         return create_entity(self.entity_class, self._c_ampl, self._name, tuple_c, self._entity)
 * 
 *     def size(self):             # <<<<<<<<<<<<<<
 *         return int(self._size)
 * 
 */
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_16InstanceIterator_9size, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_InstanceIterator_size, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__225)); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 185, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_InstanceIterator, __pyx_n_s_size, __pyx_t_7) < 0) __PYX_ERR(6, 185, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_InstanceIterator);

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._c_ampl,self.begin,self.end cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_16InstanceIterator_13__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_InstanceIterator___reduce_cython, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__226)); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_7) < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._c_ampl,self.begin,self.end cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._c_ampl,self.begin,self.end cannot be converted to a Python object for pickling"
 */
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_16InstanceIterator_15__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_InstanceIterator___setstate_cyth, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__227)); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_7) < 0) __PYX_ERR(8, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "amplpy/iterators.pxi":237
 *             self.begin = NULL
 * 
 *     def size(self):             # <<<<<<<<<<<<<<
 *         return int(self._size)
 * 
 */
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_19MemberRangeIterator_3size, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_MemberRangeIterator_size, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__228)); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 237, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_MemberRangeIterator, __pyx_n_s_size, __pyx_t_7) < 0) __PYX_ERR(6, 237, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_MemberRangeIterator);

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._c_ampl,self._index,self.begin,self.end cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_19MemberRangeIterator_11__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_MemberRangeIterator___reduce_cyt, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__229)); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_7) < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._c_ampl,self._index,self.begin,self.end cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._c_ampl,self._index,self.begin,self.end cannot be converted to a Python object for pickling"
 */
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_19MemberRangeIterator_13__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_MemberRangeIterator___setstate_c, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__230)); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_7) < 0) __PYX_ERR(8, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._df cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_11ColIterator_5__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ColIterator___reduce_cython, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__231)); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_7) < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._df cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._df cannot be converted to a Python object for pickling"
 */
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_11ColIterator_7__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ColIterator___setstate_cython, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__232)); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_7) < 0) __PYX_ERR(8, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._df cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_11RowIterator_5__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_RowIterator___reduce_cython, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__233)); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_7) < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._df cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._df cannot be converted to a Python object for pickling"
 */
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_11RowIterator_7__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_RowIterator___setstate_cython, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__234)); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_7) < 0) __PYX_ERR(8, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "amplpy/objective.pxi":36
 *         return entity
 * 
 *     def value(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the value of the objective.
 */
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_9Objective_1value, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Objective_value, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__235)); if (unlikely(!__pyx_t_7)) __PYX_ERR(12, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Objective, __pyx_n_s_value, __pyx_t_7) < 0) __PYX_ERR(12, 36, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Objective);

  /* "amplpy/objective.pxi":44
 *         return value
 * 
 *     def astatus(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the AMPL status.
 */
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_9Objective_3astatus, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Objective_astatus, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__236)); if (unlikely(!__pyx_t_7)) __PYX_ERR(12, 44, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Objective, __pyx_n_s_astatus, __pyx_t_7) < 0) __PYX_ERR(12, 44, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Objective);

  /* "amplpy/objective.pxi":61
 *         return value
 * 
 *     def sstatus(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the solver status.
 */
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_9Objective_5sstatus, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Objective_sstatus, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__237)); if (unlikely(!__pyx_t_7)) __PYX_ERR(12, 61, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Objective, __pyx_n_s_sstatus, __pyx_t_7) < 0) __PYX_ERR(12, 61, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Objective);

  /* "amplpy/objective.pxi":78
 *         return value
 * 
 *     def exitcode(self):             # <<<<<<<<<<<<<<
 *         """
 *         Exit code returned by solver after most recent solve with this
 */
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_9Objective_7exitcode, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Objective_exitcode, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__238)); if (unlikely(!__pyx_t_7)) __PYX_ERR(12, 78, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Objective, __pyx_n_s_exitcode, __pyx_t_7) < 0) __PYX_ERR(12, 78, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Objective);

  /* "amplpy/objective.pxi":87
 *         return value
 * 
 *     def message(self):             # <<<<<<<<<<<<<<
 *         """
 *         Result message returned by solver after most recent solve with this
 */
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_9Objective_9message, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Objective_message, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__239)); if (unlikely(!__pyx_t_7)) __PYX_ERR(12, 87, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Objective, __pyx_n_s_message, __pyx_t_7) < 0) __PYX_ERR(12, 87, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Objective);

  /* "amplpy/objective.pxi":105
 *         return value
 * 
 *     def result(self):             # <<<<<<<<<<<<<<
 *         """
 *         Result string returned by solver after most recent solve with this
 */
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_9Objective_11result, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Objective_result, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__240)); if (unlikely(!__pyx_t_7)) __PYX_ERR(12, 105, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Objective, __pyx_n_s_result, __pyx_t_7) < 0) __PYX_ERR(12, 105, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Objective);

  /* "amplpy/objective.pxi":123
 *         return value
 * 
 *     def drop(self):             # <<<<<<<<<<<<<<
 *         """
 *         Drop this objective instance.
 */
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_9Objective_13drop, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Objective_drop, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__241)); if (unlikely(!__pyx_t_7)) __PYX_ERR(12, 123, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Objective, __pyx_n_s_drop, __pyx_t_7) < 0) __PYX_ERR(12, 123, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Objective);

  /* "amplpy/objective.pxi":129
 *         PY_AMPL_CALL(campl.AMPL_EntityDrop(self._c_ampl, self._name))
 * 
 *     def restore(self):             # <<<<<<<<<<<<<<
 *         """
 *         Restore this objective (if it had been dropped, no effect otherwise).
 */
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_9Objective_15restore, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Objective_restore, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__242)); if (unlikely(!__pyx_t_7)) __PYX_ERR(12, 129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Objective, __pyx_n_s_restore, __pyx_t_7) < 0) __PYX_ERR(12, 129, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Objective);

  /* "amplpy/objective.pxi":135
 *         PY_AMPL_CALL(campl.AMPL_EntityRestore(self._c_ampl, self._name))
 * 
 *     def minimization(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the sense of this objective. Returns True if minimize,
 */
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_9Objective_17minimization, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Objective_minimization, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__243)); if (unlikely(!__pyx_t_7)) __PYX_ERR(12, 135, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Objective, __pyx_n_s_minimization, __pyx_t_7) < 0) __PYX_ERR(12, 135, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Objective);

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._c_ampl,self._index cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_9Objective_19__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Objective___reduce_cython, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__244)); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_7) < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._c_ampl,self._index cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._c_ampl,self._index cannot be converted to a Python object for pickling"
 */
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_9Objective_21__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Objective___setstate_cython, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__245)); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_7) < 0) __PYX_ERR(8, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "amplpy/outputhandler.pxi":3
 * # -*- coding: utf-8 -*-
 * 
 * from enum import Enum             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_7 = PyList_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_INCREF(__pyx_n_s_Enum);
  __Pyx_GIVEREF(__pyx_n_s_Enum);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 0, __pyx_n_s_Enum)) __PYX_ERR(2, 3, __pyx_L1_error);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_enum, __pyx_t_7, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Enum); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Enum, __pyx_t_7) < 0) __PYX_ERR(2, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "amplpy/outputhandler.pxi":20
 *     """
 * 
 *     def output(self, kind, msg):             # <<<<<<<<<<<<<<
 *         """
 *         This method is called when AMPL sends some output derived from
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_13OutputHandler_1output, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_OutputHandler_output, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__247)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_OutputHandler, __pyx_n_s_output, __pyx_t_2) < 0) __PYX_ERR(2, 20, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_OutputHandler);

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_13OutputHandler_3__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_OutputHandler___reduce_cython, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__248)); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_OutputHandler, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_OutputHandler);

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_OutputHandler, (type(self), 0xe3b0c44, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_OutputHandler__set_state(self, __pyx_state)
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_13OutputHandler_5__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_OutputHandler___setstate_cython, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__249)); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_OutputHandler, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(8, 16, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_OutputHandler);

  /* "amplpy/outputhandler.pxi":36
 *     PyOutputHandler.output(kind, msg.decode('utf-8'))
 * 
 * class Kind(object):             # <<<<<<<<<<<<<<
 *     """
 *     Represents the type of the output coming from the interpreter.
 */
  __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_tuple__251); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_7 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = __Pyx_Py3MetaclassPrepare(__pyx_t_7, __pyx_t_2, __pyx_n_s_Kind, __pyx_n_s_Kind, (PyObject *) NULL, __pyx_n_s_amplpy, __pyx_kp_s_Represents_the_type_of_the_outp); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__pyx_t_2 != __pyx_tuple__251) {
    if (unlikely((PyDict_SetItemString(__pyx_t_8, "__orig_bases__", __pyx_tuple__251) < 0))) __PYX_ERR(2, 36, __pyx_L1_error)
  }

  /* "amplpy/outputhandler.pxi":41
 *     """
 * 
 *     WAITING = campl.AMPL_OUTPUT_WAITING             # <<<<<<<<<<<<<<
 *     """
 *     Output ``prompt2``, returned when incomplete statements are interpreted.
 */
  __pyx_t_3 = __Pyx_PyInt_From_AMPL_OUTPUTKIND(AMPL_OUTPUT_WAITING); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 41, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_WAITING, __pyx_t_3) < 0) __PYX_ERR(2, 41, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "amplpy/outputhandler.pxi":46
 *     """
 * 
 *     BREAK = campl.AMPL_OUTPUT_BREAK             # <<<<<<<<<<<<<<
 *     """
 *     Output ``break``, displayed when an operation is interrupted with SIGINT.
 */
  __pyx_t_3 = __Pyx_PyInt_From_AMPL_OUTPUTKIND(AMPL_OUTPUT_BREAK); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 46, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_BREAK, __pyx_t_3) < 0) __PYX_ERR(2, 46, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "amplpy/outputhandler.pxi":51
 *     """
 * 
 *     CD = campl.AMPL_OUTPUT_CD             # <<<<<<<<<<<<<<
 *     """
 *     Output ``cd``, returned by the ``cd`` function.
 */
  __pyx_t_3 = __Pyx_PyInt_From_AMPL_OUTPUTKIND(AMPL_OUTPUT_CD); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 51, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_CD, __pyx_t_3) < 0) __PYX_ERR(2, 51, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "amplpy/outputhandler.pxi":56
 *     """
 * 
 *     DISPLAY = campl.AMPL_OUTPUT_DISPLAY             # <<<<<<<<<<<<<<
 *     """
 *     Output ``display``, returned by the ``display`` function.
 */
  __pyx_t_3 = __Pyx_PyInt_From_AMPL_OUTPUTKIND(AMPL_OUTPUT_DISPLAY); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 56, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_DISPLAY, __pyx_t_3) < 0) __PYX_ERR(2, 56, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "amplpy/outputhandler.pxi":61
 *     """
 * 
 *     EXIT = campl.AMPL_OUTPUT_EXIT             # <<<<<<<<<<<<<<
 *     """
 *     Output ``exit``, returned as last message from AMPL before exiting the
 */
  __pyx_t_3 = __Pyx_PyInt_From_AMPL_OUTPUTKIND(AMPL_OUTPUT_EXIT); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 61, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_EXIT, __pyx_t_3) < 0) __PYX_ERR(2, 61, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "amplpy/outputhandler.pxi":67
 *     """
 * 
 *     EXPAND = campl.AMPL_OUTPUT_EXPAND             # <<<<<<<<<<<<<<
 *     """
 *     Output ``expand``, returned by the ``expand`` function.
 */
  __pyx_t_3 = __Pyx_PyInt_From_AMPL_OUTPUTKIND(AMPL_OUTPUT_EXPAND); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 67, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_EXPAND, __pyx_t_3) < 0) __PYX_ERR(2, 67, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "amplpy/outputhandler.pxi":72
 *     """
 * 
 *     LOAD = campl.AMPL_OUTPUT_LOAD             # <<<<<<<<<<<<<<
 *     """
 *     Output ``load``, returned by the ``load`` function when loading a library.
 */
  __pyx_t_3 = __Pyx_PyInt_From_AMPL_OUTPUTKIND(AMPL_OUTPUT_LOAD); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 72, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_LOAD, __pyx_t_3) < 0) __PYX_ERR(2, 72, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "amplpy/outputhandler.pxi":77
 *     """
 * 
 *     OPTION = campl.AMPL_OUTPUT_OPTION             # <<<<<<<<<<<<<<
 *     """
 *     Output ``option``, returned by the ``option`` function when getting the
 */
  __pyx_t_3 = __Pyx_PyInt_From_AMPL_OUTPUTKIND(AMPL_OUTPUT_OPTION); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 77, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_OPTION, __pyx_t_3) < 0) __PYX_ERR(2, 77, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "amplpy/outputhandler.pxi":83
 *     """
 * 
 *     PRINT = campl.AMPL_OUTPUT_PRINT             # <<<<<<<<<<<<<<
 *     """
 *     Output ``print``, returned by the ``print`` function when printing values
 */
  __pyx_t_3 = __Pyx_PyInt_From_AMPL_OUTPUTKIND(AMPL_OUTPUT_PRINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 83, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_PRINT, __pyx_t_3) < 0) __PYX_ERR(2, 83, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "amplpy/outputhandler.pxi":89
 *     """
 * 
 *     PROMPT = campl.AMPL_OUTPUT_PROMPT  # prompt1 and prompt3             # <<<<<<<<<<<<<<
 *     """
 *     Output ``prompt1``, normal AMPL prompt.
 */
  __pyx_t_3 = __Pyx_PyInt_From_AMPL_OUTPUTKIND(AMPL_OUTPUT_PROMPT); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 89, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_PROMPT, __pyx_t_3) < 0) __PYX_ERR(2, 89, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "amplpy/outputhandler.pxi":94
 *     """
 * 
 *     SOLUTION = campl.AMPL_OUTPUT_SOLUTION             # <<<<<<<<<<<<<<
 *     """
 *     Output ``solution``, returned when loading a solution with the command
 */
  __pyx_t_3 = __Pyx_PyInt_From_AMPL_OUTPUTKIND(AMPL_OUTPUT_SOLUTION); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 94, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_SOLUTION, __pyx_t_3) < 0) __PYX_ERR(2, 94, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "amplpy/outputhandler.pxi":100
 *     """
 * 
 *     SOLVE = campl.AMPL_OUTPUT_SOLVE             # <<<<<<<<<<<<<<
 *     """
 *     Output ``solve``, returned by the ``solve`` function, contains the solver
 */
  __pyx_t_3 = __Pyx_PyInt_From_AMPL_OUTPUTKIND(AMPL_OUTPUT_SOLVE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 100, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_SOLVE, __pyx_t_3) < 0) __PYX_ERR(2, 100, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "amplpy/outputhandler.pxi":106
 *     """
 * 
 *     SHOW = campl.AMPL_OUTPUT_SHOW             # <<<<<<<<<<<<<<
 *     """
 *     Output ``show``, returned by the ``show`` function.
 */
  __pyx_t_3 = __Pyx_PyInt_From_AMPL_OUTPUTKIND(AMPL_OUTPUT_SHOW); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 106, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_SHOW, __pyx_t_3) < 0) __PYX_ERR(2, 106, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "amplpy/outputhandler.pxi":111
 *     """
 * 
 *     XREF = campl.AMPL_OUTPUT_XREF             # <<<<<<<<<<<<<<
 *     """
 *     Output ``xref``, returned by the ``xref`` function.
 */
  __pyx_t_3 = __Pyx_PyInt_From_AMPL_OUTPUTKIND(AMPL_OUTPUT_XREF); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 111, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_XREF, __pyx_t_3) < 0) __PYX_ERR(2, 111, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "amplpy/outputhandler.pxi":116
 *     """
 * 
 *     SHELL_OUTPUT = campl.AMPL_OUTPUT_SHELL_OUTPUT             # <<<<<<<<<<<<<<
 *     """
 *     Output of the AMPL command ``shell``.
 */
  __pyx_t_3 = __Pyx_PyInt_From_AMPL_OUTPUTKIND(AMPL_OUTPUT_SHELL_OUTPUT); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 116, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_SHELL_OUTPUT, __pyx_t_3) < 0) __PYX_ERR(2, 116, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "amplpy/outputhandler.pxi":121
 *     """
 * 
 *     SHELL_MESSAGE = campl.AMPL_OUTPUT_SHELL_MESSAGE             # <<<<<<<<<<<<<<
 *     """
 *     Messages from the command ``shell``.
 */
  __pyx_t_3 = __Pyx_PyInt_From_AMPL_OUTPUTKIND(AMPL_OUTPUT_SHELL_MESSAGE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 121, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_SHELL_MESSAGE, __pyx_t_3) < 0) __PYX_ERR(2, 121, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "amplpy/outputhandler.pxi":126
 *     """
 * 
 *     MISC = campl.AMPL_OUTPUT_MISC             # <<<<<<<<<<<<<<
 *     """
 *     Output ``misc``.
 */
  __pyx_t_3 = __Pyx_PyInt_From_AMPL_OUTPUTKIND(AMPL_OUTPUT_MISC); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 126, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_MISC, __pyx_t_3) < 0) __PYX_ERR(2, 126, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "amplpy/outputhandler.pxi":131
 *     """
 * 
 *     WRITE_TABLE = campl.AMPL_OUTPUT_WRITE_TABLE             # <<<<<<<<<<<<<<
 *     """
 *     Messages from the command ``write table``.
 */
  __pyx_t_3 = __Pyx_PyInt_From_AMPL_OUTPUTKIND(AMPL_OUTPUT_WRITE_TABLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 131, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_WRITE_TABLE, __pyx_t_3) < 0) __PYX_ERR(2, 131, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "amplpy/outputhandler.pxi":136
 *     """
 * 
 *     READ_TABLE = campl.AMPL_OUTPUT_READ_TABLE             # <<<<<<<<<<<<<<
 *     """
 *     Messages from the command ``read table``.
 */
  __pyx_t_3 = __Pyx_PyInt_From_AMPL_OUTPUTKIND(AMPL_OUTPUT_READ_TABLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 136, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_READ_TABLE, __pyx_t_3) < 0) __PYX_ERR(2, 136, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "amplpy/outputhandler.pxi":141
 *     """
 * 
 *     _READTABLE = campl.AMPL_OUTPUT_READTABLE             # <<<<<<<<<<<<<<
 *     """
 *     Internal messages from the command ``read table``.
 */
  __pyx_t_3 = __Pyx_PyInt_From_AMPL_OUTPUTKIND(AMPL_OUTPUT_READTABLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 141, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_READTABLE, __pyx_t_3) < 0) __PYX_ERR(2, 141, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "amplpy/outputhandler.pxi":146
 *     """
 * 
 *     _WRITETABLE = campl.AMPL_OUTPUT_WRITETABLE             # <<<<<<<<<<<<<<
 *     """
 *     Internal messages from the command ``write table``.
 */
  __pyx_t_3 = __Pyx_PyInt_From_AMPL_OUTPUTKIND(AMPL_OUTPUT_WRITETABLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 146, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_WRITETABLE, __pyx_t_3) < 0) __PYX_ERR(2, 146, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "amplpy/outputhandler.pxi":151
 *     """
 * 
 *     BREAKPOINT = campl.AMPL_OUTPUT_BREAKPOINT             # <<<<<<<<<<<<<<
 *     """
 *     Breakpoint hit.
 */
  __pyx_t_3 = __Pyx_PyInt_From_AMPL_OUTPUTKIND(AMPL_OUTPUT_BREAKPOINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 151, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_BREAKPOINT, __pyx_t_3) < 0) __PYX_ERR(2, 151, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "amplpy/outputhandler.pxi":156
 *     """
 * 
 *     CALL = campl.AMPL_OUTPUT_CALL             # <<<<<<<<<<<<<<
 *     """
 *     Output of a script ``call``.
 */
  __pyx_t_3 = __Pyx_PyInt_From_AMPL_OUTPUTKIND(AMPL_OUTPUT_CALL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 156, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_CALL, __pyx_t_3) < 0) __PYX_ERR(2, 156, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "amplpy/outputhandler.pxi":161
 *     """
 * 
 *     CHECK = campl.AMPL_OUTPUT_CHECK             # <<<<<<<<<<<<<<
 *     """
 *     Output of a ``check`` operation.
 */
  __pyx_t_3 = __Pyx_PyInt_From_AMPL_OUTPUTKIND(AMPL_OUTPUT_CHECK); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 161, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_CHECK, __pyx_t_3) < 0) __PYX_ERR(2, 161, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "amplpy/outputhandler.pxi":166
 *     """
 * 
 *     CLOSE = campl.AMPL_OUTPUT_CLOSE             # <<<<<<<<<<<<<<
 *     """
 *     Output of a ``close`` command for output redirection.
 */
  __pyx_t_3 = __Pyx_PyInt_From_AMPL_OUTPUTKIND(AMPL_OUTPUT_CLOSE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 166, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_CLOSE, __pyx_t_3) < 0) __PYX_ERR(2, 166, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "amplpy/outputhandler.pxi":171
 *     """
 * 
 *     COMMANDS = campl.AMPL_OUTPUT_COMMANDS             # <<<<<<<<<<<<<<
 *     """
 *     Output of a ``commands`` call into another file.
 */
  __pyx_t_3 = __Pyx_PyInt_From_AMPL_OUTPUTKIND(AMPL_OUTPUT_COMMANDS); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 171, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_COMMANDS, __pyx_t_3) < 0) __PYX_ERR(2, 171, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "amplpy/outputhandler.pxi":176
 *     """
 * 
 *     CONTINUE = campl.AMPL_OUTPUT_CONTINUE             # <<<<<<<<<<<<<<
 *     """
 *     Issued when ``continue`` is encountered.
 */
  __pyx_t_3 = __Pyx_PyInt_From_AMPL_OUTPUTKIND(AMPL_OUTPUT_CONTINUE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 176, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_CONTINUE, __pyx_t_3) < 0) __PYX_ERR(2, 176, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "amplpy/outputhandler.pxi":181
 *     """
 * 
 *     DATA = campl.AMPL_OUTPUT_DATA             # <<<<<<<<<<<<<<
 *     """
 *     Output of a ``data`` command.
 */
  __pyx_t_3 = __Pyx_PyInt_From_AMPL_OUTPUTKIND(AMPL_OUTPUT_DATA); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 181, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_DATA, __pyx_t_3) < 0) __PYX_ERR(2, 181, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "amplpy/outputhandler.pxi":186
 *     """
 * 
 *     DELETECMD = campl.AMPL_OUTPUT_DELETECMD             # <<<<<<<<<<<<<<
 *     """
 *     Output of a ``delete`` command.
 */
  __pyx_t_3 = __Pyx_PyInt_From_AMPL_OUTPUTKIND(AMPL_OUTPUT_DELETECMD); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 186, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_DELETECMD, __pyx_t_3) < 0) __PYX_ERR(2, 186, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "amplpy/outputhandler.pxi":191
 *     """
 * 
 *     DROP = campl.AMPL_OUTPUT_DROP             # <<<<<<<<<<<<<<
 *     """
 *     Output of a ``drop`` command.
 */
  __pyx_t_3 = __Pyx_PyInt_From_AMPL_OUTPUTKIND(AMPL_OUTPUT_DROP); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 191, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_DROP, __pyx_t_3) < 0) __PYX_ERR(2, 191, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "amplpy/outputhandler.pxi":196
 *     """
 * 
 *     DROP_OR_RESTORE_ALL = campl.AMPL_OUTPUT_DROP_OR_RESTORE_ALL             # <<<<<<<<<<<<<<
 *     """
 *     Internal.
 */
  __pyx_t_3 = __Pyx_PyInt_From_AMPL_OUTPUTKIND(AMPL_OUTPUT_DROP_OR_RESTORE_ALL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 196, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_DROP_OR_RESTORE_ALL, __pyx_t_3) < 0) __PYX_ERR(2, 196, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "amplpy/outputhandler.pxi":201
 *     """
 * 
 *     _ELSE = campl.AMPL_OUTPUT_ELSE             # <<<<<<<<<<<<<<
 *     """
 *     Else block.
 */
  __pyx_t_3 = __Pyx_PyInt_From_AMPL_OUTPUTKIND(AMPL_OUTPUT_ELSE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 201, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_ELSE, __pyx_t_3) < 0) __PYX_ERR(2, 201, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "amplpy/outputhandler.pxi":206
 *     """
 * 
 *     ELSE_CHECK = campl.AMPL_OUTPUT_ELSE_CHECK             # <<<<<<<<<<<<<<
 *     """
 *     Internal.
 */
  __pyx_t_3 = __Pyx_PyInt_From_AMPL_OUTPUTKIND(AMPL_OUTPUT_ELSE_CHECK); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 206, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_ELSE_CHECK, __pyx_t_3) < 0) __PYX_ERR(2, 206, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "amplpy/outputhandler.pxi":211
 *     """
 * 
 *     ENDIF = campl.AMPL_OUTPUT_ENDIF             # <<<<<<<<<<<<<<
 *     """
 *     End of if block.
 */
  __pyx_t_3 = __Pyx_PyInt_From_AMPL_OUTPUTKIND(AMPL_OUTPUT_ENDIF); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 211, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_ENDIF, __pyx_t_3) < 0) __PYX_ERR(2, 211, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "amplpy/outputhandler.pxi":216
 *     """
 * 
 *     ENVIRON = campl.AMPL_OUTPUT_ENVIRON             # <<<<<<<<<<<<<<
 *     """
 *     Output of a ``environ`` command.
 */
  __pyx_t_3 = __Pyx_PyInt_From_AMPL_OUTPUTKIND(AMPL_OUTPUT_ENVIRON); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 216, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_ENVIRON, __pyx_t_3) < 0) __PYX_ERR(2, 216, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "amplpy/outputhandler.pxi":221
 *     """
 * 
 *     FIX = campl.AMPL_OUTPUT_FIX             # <<<<<<<<<<<<<<
 *     """
 *     Output of a ``fix`` command.
 */
  __pyx_t_3 = __Pyx_PyInt_From_AMPL_OUTPUTKIND(AMPL_OUTPUT_FIX); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 221, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_FIX, __pyx_t_3) < 0) __PYX_ERR(2, 221, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "amplpy/outputhandler.pxi":226
 *     """
 * 
 *     FOR = campl.AMPL_OUTPUT_FOR             # <<<<<<<<<<<<<<
 *     """
 *     Output of a ``for`` command.
 */
  __pyx_t_3 = __Pyx_PyInt_From_AMPL_OUTPUTKIND(AMPL_OUTPUT_FOR); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 226, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_FOR, __pyx_t_3) < 0) __PYX_ERR(2, 226, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "amplpy/outputhandler.pxi":231
 *     """
 * 
 *     _IF = campl.AMPL_OUTPUT_IF             # <<<<<<<<<<<<<<
 *     """
 *     Output of an ``if`` command.
 */
  __pyx_t_3 = __Pyx_PyInt_From_AMPL_OUTPUTKIND(AMPL_OUTPUT_IF); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 231, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_IF, __pyx_t_3) < 0) __PYX_ERR(2, 231, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "amplpy/outputhandler.pxi":236
 *     """
 * 
 *     LET = campl.AMPL_OUTPUT_LET             # <<<<<<<<<<<<<<
 *     """
 *     Output of a ``let`` command.
 */
  __pyx_t_3 = __Pyx_PyInt_From_AMPL_OUTPUTKIND(AMPL_OUTPUT_LET); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 236, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_LET, __pyx_t_3) < 0) __PYX_ERR(2, 236, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "amplpy/outputhandler.pxi":241
 *     """
 * 
 *     LOOPEND = campl.AMPL_OUTPUT_LOOPEND             # <<<<<<<<<<<<<<
 *     """
 *     End of loop.
 */
  __pyx_t_3 = __Pyx_PyInt_From_AMPL_OUTPUTKIND(AMPL_OUTPUT_LOOPEND); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 241, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_LOOPEND, __pyx_t_3) < 0) __PYX_ERR(2, 241, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "amplpy/outputhandler.pxi":246
 *     """
 * 
 *     OBJECTIVE = campl.AMPL_OUTPUT_OBJECTIVE             # <<<<<<<<<<<<<<
 *     """
 *     Output of an ``objective`` command.
 */
  __pyx_t_3 = __Pyx_PyInt_From_AMPL_OUTPUTKIND(AMPL_OUTPUT_OBJECTIVE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 246, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_OBJECTIVE, __pyx_t_3) < 0) __PYX_ERR(2, 246, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "amplpy/outputhandler.pxi":251
 *     """
 * 
 *     OPTION_RESET = campl.AMPL_OUTPUT_OPTION_RESET             # <<<<<<<<<<<<<<
 *     """
 *     Occurs when resetting option values.
 */
  __pyx_t_3 = __Pyx_PyInt_From_AMPL_OUTPUTKIND(AMPL_OUTPUT_OPTION_RESET); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 251, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_OPTION_RESET, __pyx_t_3) < 0) __PYX_ERR(2, 251, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "amplpy/outputhandler.pxi":256
 *     """
 * 
 *     PRINTF = campl.AMPL_OUTPUT_PRINTF             # <<<<<<<<<<<<<<
 *     """
 *     Output of a ``printf`` command.
 */
  __pyx_t_3 = __Pyx_PyInt_From_AMPL_OUTPUTKIND(AMPL_OUTPUT_PRINTF); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 256, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_PRINTF, __pyx_t_3) < 0) __PYX_ERR(2, 256, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "amplpy/outputhandler.pxi":261
 *     """
 * 
 *     PROBLEM = campl.AMPL_OUTPUT_PROBLEM             # <<<<<<<<<<<<<<
 *     """
 *     Output of a ``problem`` command.
 */
  __pyx_t_3 = __Pyx_PyInt_From_AMPL_OUTPUTKIND(AMPL_OUTPUT_PROBLEM); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 261, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_PROBLEM, __pyx_t_3) < 0) __PYX_ERR(2, 261, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "amplpy/outputhandler.pxi":266
 *     """
 * 
 *     PURGE = campl.AMPL_OUTPUT_PURGE             # <<<<<<<<<<<<<<
 *     """
 *     Output of a ``purge`` command.
 */
  __pyx_t_3 = __Pyx_PyInt_From_AMPL_OUTPUTKIND(AMPL_OUTPUT_PURGE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 266, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_PURGE, __pyx_t_3) < 0) __PYX_ERR(2, 266, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "amplpy/outputhandler.pxi":271
 *     """
 * 
 *     RBRACE = campl.AMPL_OUTPUT_RBRACE             # <<<<<<<<<<<<<<
 *     """
 *     Occurs when a right brace is encountered.
 */
  __pyx_t_3 = __Pyx_PyInt_From_AMPL_OUTPUTKIND(AMPL_OUTPUT_RBRACE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 271, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_RBRACE, __pyx_t_3) < 0) __PYX_ERR(2, 271, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "amplpy/outputhandler.pxi":276
 *     """
 * 
 *     READ = campl.AMPL_OUTPUT_READ             # <<<<<<<<<<<<<<
 *     """
 *     Output of a ``read`` command.
 */
  __pyx_t_3 = __Pyx_PyInt_From_AMPL_OUTPUTKIND(AMPL_OUTPUT_READ); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 276, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_READ, __pyx_t_3) < 0) __PYX_ERR(2, 276, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "amplpy/outputhandler.pxi":281
 *     """
 * 
 *     RELOAD = campl.AMPL_OUTPUT_RELOAD             # <<<<<<<<<<<<<<
 *     """
 *     Output of a ``reload`` command.
 */
  __pyx_t_3 = __Pyx_PyInt_From_AMPL_OUTPUTKIND(AMPL_OUTPUT_RELOAD); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 281, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_RELOAD, __pyx_t_3) < 0) __PYX_ERR(2, 281, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "amplpy/outputhandler.pxi":286
 *     """
 * 
 *     REMOVE = campl.AMPL_OUTPUT_REMOVE             # <<<<<<<<<<<<<<
 *     """
 *     Output of a ``remove`` command.
 */
  __pyx_t_3 = __Pyx_PyInt_From_AMPL_OUTPUTKIND(AMPL_OUTPUT_REMOVE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 286, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_REMOVE, __pyx_t_3) < 0) __PYX_ERR(2, 286, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "amplpy/outputhandler.pxi":291
 *     """
 * 
 *     REPEAT = campl.AMPL_OUTPUT_REPEAT             # <<<<<<<<<<<<<<
 *     """
 *     Beginning of a repeat loop.
 */
  __pyx_t_3 = __Pyx_PyInt_From_AMPL_OUTPUTKIND(AMPL_OUTPUT_REPEAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 291, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_REPEAT, __pyx_t_3) < 0) __PYX_ERR(2, 291, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "amplpy/outputhandler.pxi":296
 *     """
 * 
 *     REPEAT_END = campl.AMPL_OUTPUT_REPEAT_END             # <<<<<<<<<<<<<<
 *     """
 *     End of a repeat loop.
 */
  __pyx_t_3 = __Pyx_PyInt_From_AMPL_OUTPUTKIND(AMPL_OUTPUT_REPEAT_END); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 296, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_REPEAT_END, __pyx_t_3) < 0) __PYX_ERR(2, 296, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "amplpy/outputhandler.pxi":301
 *     """
 * 
 *     RESET = campl.AMPL_OUTPUT_RESET             # <<<<<<<<<<<<<<
 *     """
 *     Output of a ``reset`` command.
 */
  __pyx_t_3 = __Pyx_PyInt_From_AMPL_OUTPUTKIND(AMPL_OUTPUT_RESET); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 301, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_RESET, __pyx_t_3) < 0) __PYX_ERR(2, 301, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "amplpy/outputhandler.pxi":306
 *     """
 * 
 *     RESTORE = campl.AMPL_OUTPUT_RESTORE             # <<<<<<<<<<<<<<
 *     """
 *     Output of a ``restore`` command.
 */
  __pyx_t_3 = __Pyx_PyInt_From_AMPL_OUTPUTKIND(AMPL_OUTPUT_RESTORE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 306, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_RESTORE, __pyx_t_3) < 0) __PYX_ERR(2, 306, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "amplpy/outputhandler.pxi":311
 *     """
 * 
 *     RUN_ARGS = campl.AMPL_OUTPUT_RUN_ARGS             # <<<<<<<<<<<<<<
 *     """
 *     Internal.
 */
  __pyx_t_3 = __Pyx_PyInt_From_AMPL_OUTPUTKIND(AMPL_OUTPUT_RUN_ARGS); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 311, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_RUN_ARGS, __pyx_t_3) < 0) __PYX_ERR(2, 311, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "amplpy/outputhandler.pxi":316
 *     """
 * 
 *     SEMICOLON = campl.AMPL_OUTPUT_SEMICOLON             # <<<<<<<<<<<<<<
 *     """
 *     Internal.
 */
  __pyx_t_3 = __Pyx_PyInt_From_AMPL_OUTPUTKIND(AMPL_OUTPUT_SEMICOLON); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 316, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_SEMICOLON, __pyx_t_3) < 0) __PYX_ERR(2, 316, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "amplpy/outputhandler.pxi":321
 *     """
 * 
 *     SSTEP = campl.AMPL_OUTPUT_SSTEP             # <<<<<<<<<<<<<<
 *     """
 *     Internal.
 */
  __pyx_t_3 = __Pyx_PyInt_From_AMPL_OUTPUTKIND(AMPL_OUTPUT_SSTEP); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 321, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_SSTEP, __pyx_t_3) < 0) __PYX_ERR(2, 321, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "amplpy/outputhandler.pxi":326
 *     """
 * 
 *     THEN = campl.AMPL_OUTPUT_THEN             # <<<<<<<<<<<<<<
 *     """
 *     Beginning of the ``then`` part of an if statement.
 */
  __pyx_t_3 = __Pyx_PyInt_From_AMPL_OUTPUTKIND(AMPL_OUTPUT_THEN); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 326, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_THEN, __pyx_t_3) < 0) __PYX_ERR(2, 326, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "amplpy/outputhandler.pxi":331
 *     """
 * 
 *     UNFIX = campl.AMPL_OUTPUT_UNFIX             # <<<<<<<<<<<<<<
 *     """
 *     Output of an ``unfix`` command.
 */
  __pyx_t_3 = __Pyx_PyInt_From_AMPL_OUTPUTKIND(AMPL_OUTPUT_UNFIX); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 331, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_UNFIX, __pyx_t_3) < 0) __PYX_ERR(2, 331, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "amplpy/outputhandler.pxi":336
 *     """
 * 
 *     UNLOAD = campl.AMPL_OUTPUT_UNLOAD             # <<<<<<<<<<<<<<
 *     """
 *     Output of an ``unload`` command.
 */
  __pyx_t_3 = __Pyx_PyInt_From_AMPL_OUTPUTKIND(AMPL_OUTPUT_UNLOAD); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 336, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_UNLOAD, __pyx_t_3) < 0) __PYX_ERR(2, 336, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "amplpy/outputhandler.pxi":341
 *     """
 * 
 *     UPDATE = campl.AMPL_OUTPUT_UPDATE             # <<<<<<<<<<<<<<
 *     """
 *     Output of an ``update`` command.
 */
  __pyx_t_3 = __Pyx_PyInt_From_AMPL_OUTPUTKIND(AMPL_OUTPUT_UPDATE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 341, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_UPDATE, __pyx_t_3) < 0) __PYX_ERR(2, 341, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "amplpy/outputhandler.pxi":346
 *     """
 * 
 *     WRITE = campl.AMPL_OUTPUT_WRITE             # <<<<<<<<<<<<<<
 *     """
 *     Output of a ``write`` command.
 */
  __pyx_t_3 = __Pyx_PyInt_From_AMPL_OUTPUTKIND(AMPL_OUTPUT_WRITE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 346, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_WRITE, __pyx_t_3) < 0) __PYX_ERR(2, 346, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "amplpy/outputhandler.pxi":36
 *     PyOutputHandler.output(kind, msg.decode('utf-8'))
 * 
 * class Kind(object):             # <<<<<<<<<<<<<<
 *     """
 *     Represents the type of the output coming from the interpreter.
 */
  __pyx_t_3 = __Pyx_Py3ClassCreate(__pyx_t_7, __pyx_n_s_Kind, __pyx_t_2, __pyx_t_8, NULL, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Kind, __pyx_t_3) < 0) __PYX_ERR(2, 36, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "amplpy/parameter.pxi":2
 * # -*- coding: utf-8 -*-
 * from numbers import Real             # <<<<<<<<<<<<<<
 * from collections.abc import Iterable
 * 
 */
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_Real);
  __Pyx_GIVEREF(__pyx_n_s_Real);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_Real)) __PYX_ERR(13, 2, __pyx_L1_error);
  __pyx_t_7 = __Pyx_Import(__pyx_n_s_numbers, __pyx_t_2, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(13, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_7, __pyx_n_s_Real); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Real, __pyx_t_2) < 0) __PYX_ERR(13, 2, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "amplpy/parameter.pxi":3
 * # -*- coding: utf-8 -*-
 * from numbers import Real
 * from collections.abc import Iterable             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_7 = PyList_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(13, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_INCREF(__pyx_n_s_Iterable);
  __Pyx_GIVEREF(__pyx_n_s_Iterable);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 0, __pyx_n_s_Iterable)) __PYX_ERR(13, 3, __pyx_L1_error);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_collections_abc, __pyx_t_7, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Iterable); if (unlikely(!__pyx_t_7)) __PYX_ERR(13, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Iterable, __pyx_t_7) < 0) __PYX_ERR(13, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "amplpy/parameter.pxi":6
 * 
 * 
 * import itertools             # <<<<<<<<<<<<<<
 * 
 * try:
 */
  __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_itertools, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_itertools, __pyx_t_2) < 0) __PYX_ERR(13, 6, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "amplpy/parameter.pxi":8
 * import itertools
 * 
 * try:             # <<<<<<<<<<<<<<
 *     import pandas as pd
 * except ImportError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "amplpy/parameter.pxi":9
 * 
 * try:
 *     import pandas as pd             # <<<<<<<<<<<<<<
 * except ImportError:
 *     pd = None
 */
      __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_pandas, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 9, __pyx_L34_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_pd, __pyx_t_2) < 0) __PYX_ERR(13, 9, __pyx_L34_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "amplpy/parameter.pxi":8
 * import itertools
 * 
 * try:             # <<<<<<<<<<<<<<
 *     import pandas as pd
 * except ImportError:
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L39_try_end;
    __pyx_L34_error:;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "amplpy/parameter.pxi":10
 * try:
 *     import pandas as pd
 * except ImportError:             # <<<<<<<<<<<<<<
 *     pd = None
 * try:
 */
    __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError);
    if (__pyx_t_6) {
      __Pyx_AddTraceback("_amplpy", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(13, 10, __pyx_L36_except_error)
      __Pyx_XGOTREF(__pyx_t_2);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_8);

      /* "amplpy/parameter.pxi":11
 *     import pandas as pd
 * except ImportError:
 *     pd = None             # <<<<<<<<<<<<<<
 * try:
 *     import numpy as np
 */
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_pd, Py_None) < 0) __PYX_ERR(13, 11, __pyx_L36_except_error)
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      goto __pyx_L35_exception_handled;
    }
    goto __pyx_L36_except_error;

    /* "amplpy/parameter.pxi":8
 * import itertools
 * 
 * try:             # <<<<<<<<<<<<<<
 *     import pandas as pd
 * except ImportError:
 */
    __pyx_L36_except_error:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L35_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_4, __pyx_t_5);
    __pyx_L39_try_end:;
  }

  /* "amplpy/parameter.pxi":12
 * except ImportError:
 *     pd = None
 * try:             # <<<<<<<<<<<<<<
 *     import numpy as np
 * except ImportError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_1);
    /*try:*/ {

      /* "amplpy/parameter.pxi":13
 *     pd = None
 * try:
 *     import numpy as np             # <<<<<<<<<<<<<<
 * except ImportError:
 *     np = None
 */
      __pyx_t_8 = __Pyx_ImportDottedModule(__pyx_n_s_numpy, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(13, 13, __pyx_L42_error)
      __Pyx_GOTREF(__pyx_t_8);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_8) < 0) __PYX_ERR(13, 13, __pyx_L42_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "amplpy/parameter.pxi":12
 * except ImportError:
 *     pd = None
 * try:             # <<<<<<<<<<<<<<
 *     import numpy as np
 * except ImportError:
 */
    }
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    goto __pyx_L47_try_end;
    __pyx_L42_error:;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "amplpy/parameter.pxi":14
 * try:
 *     import numpy as np
 * except ImportError:             # <<<<<<<<<<<<<<
 *     np = None
 * 
 */
    __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError);
    if (__pyx_t_6) {
      __Pyx_AddTraceback("_amplpy", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_2) < 0) __PYX_ERR(13, 14, __pyx_L44_except_error)
      __Pyx_XGOTREF(__pyx_t_8);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_2);

      /* "amplpy/parameter.pxi":15
 *     import numpy as np
 * except ImportError:
 *     np = None             # <<<<<<<<<<<<<<
 * 
 * 
 */
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, Py_None) < 0) __PYX_ERR(13, 15, __pyx_L44_except_error)
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      goto __pyx_L43_exception_handled;
    }
    goto __pyx_L44_except_error;

    /* "amplpy/parameter.pxi":12
 * except ImportError:
 *     pd = None
 * try:             # <<<<<<<<<<<<<<
 *     import numpy as np
 * except ImportError:
 */
    __pyx_L44_except_error:;
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_1);
    goto __pyx_L1_error;
    __pyx_L43_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_1);
    __pyx_L47_try_end:;
  }

  /* "amplpy/parameter.pxi":46
 *         self.set(index, value)
 * 
 *     def is_symbolic(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns True if the parameter is declared as symbolic (can store both
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_9Parameter_3is_symbolic, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Parameter_is_symbolic, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__252)); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 46, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Parameter, __pyx_n_s_is_symbolic, __pyx_t_2) < 0) __PYX_ERR(13, 46, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Parameter);

  /* "amplpy/parameter.pxi":55
 *         return value
 * 
 *     def has_default(self):             # <<<<<<<<<<<<<<
 *         """
 *         Check if the parameter has a default initial value. In case of the
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_9Parameter_5has_default, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Parameter_has_default, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__253)); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 55, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Parameter, __pyx_n_s_has_default, __pyx_t_2) < 0) __PYX_ERR(13, 55, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Parameter);

  /* "amplpy/parameter.pxi":91
 *         return py_variant
 * 
 *     def value(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the value of this parameter. Valid only for non-indexed parameters.
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_9Parameter_9value, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Parameter_value, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__255)); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 91, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Parameter, __pyx_n_s_value, __pyx_t_2) < 0) __PYX_ERR(13, 91, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Parameter);

  /* "amplpy/parameter.pxi":101
 *         return py_variant
 * 
 *     def set(self, *args):             # <<<<<<<<<<<<<<
 *         """
 *         Set the value of a single instance of this parameter.
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_9Parameter_11set, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Parameter_set, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__257)); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 101, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Parameter, __pyx_n_s_set, __pyx_t_2) < 0) __PYX_ERR(13, 101, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Parameter);

  /* "amplpy/parameter.pxi":142
 *                 raise TypeError
 * 
 *     def set_values(self, values):             # <<<<<<<<<<<<<<
 *         """
 *         Assign the values (string or float) to the parameter instances with the
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_9Parameter_13set_values, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Parameter_set_values, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__259)); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 142, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Parameter, __pyx_n_s_set_values, __pyx_t_2) < 0) __PYX_ERR(13, 142, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Parameter);

  /* "amplpy/parameter.pxi":185
 * 
 *     # Aliases
 *     hasDefault = has_default             # <<<<<<<<<<<<<<
 *     isSymbolic = is_symbolic
 *     setValues = set_values
 */
  __Pyx_GetNameInClass(__pyx_t_2, (PyObject *)__pyx_ptype_7_amplpy_Parameter, __pyx_n_s_has_default); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 185, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Parameter, __pyx_n_s_hasDefault, __pyx_t_2) < 0) __PYX_ERR(13, 185, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Parameter);

  /* "amplpy/parameter.pxi":186
 *     # Aliases
 *     hasDefault = has_default
 *     isSymbolic = is_symbolic             # <<<<<<<<<<<<<<
 *     setValues = set_values
 */
  __Pyx_GetNameInClass(__pyx_t_2, (PyObject *)__pyx_ptype_7_amplpy_Parameter, __pyx_n_s_is_symbolic); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 186, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Parameter, __pyx_n_s_isSymbolic, __pyx_t_2) < 0) __PYX_ERR(13, 186, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Parameter);

  /* "amplpy/parameter.pxi":187
 *     hasDefault = has_default
 *     isSymbolic = is_symbolic
 *     setValues = set_values             # <<<<<<<<<<<<<<
 */
  __Pyx_GetNameInClass(__pyx_t_2, (PyObject *)__pyx_ptype_7_amplpy_Parameter, __pyx_n_s_set_values); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 187, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Parameter, __pyx_n_s_setValues_2, __pyx_t_2) < 0) __PYX_ERR(13, 187, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Parameter);

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._c_ampl,self._index cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_9Parameter_15__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Parameter___reduce_cython, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__260)); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._c_ampl,self._index cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._c_ampl,self._index cannot be converted to a Python object for pickling"
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_9Parameter_17__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Parameter___setstate_cython, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__261)); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(8, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "amplpy/set.pxi":2
 * # -*- coding: utf-8 -*-
 * from numbers import Real             # <<<<<<<<<<<<<<
 * from collections.abc import Iterable
 * 
 */
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_Real);
  __Pyx_GIVEREF(__pyx_n_s_Real);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_Real)) __PYX_ERR(14, 2, __pyx_L1_error);
  __pyx_t_7 = __Pyx_Import(__pyx_n_s_numbers, __pyx_t_2, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(14, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_7, __pyx_n_s_Real); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Real, __pyx_t_2) < 0) __PYX_ERR(14, 2, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "amplpy/set.pxi":3
 * # -*- coding: utf-8 -*-
 * from numbers import Real
 * from collections.abc import Iterable             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_7 = PyList_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(14, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_INCREF(__pyx_n_s_Iterable);
  __Pyx_GIVEREF(__pyx_n_s_Iterable);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 0, __pyx_n_s_Iterable)) __PYX_ERR(14, 3, __pyx_L1_error);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_collections_abc, __pyx_t_7, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Iterable); if (unlikely(!__pyx_t_7)) __PYX_ERR(14, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Iterable, __pyx_t_7) < 0) __PYX_ERR(14, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "amplpy/set.pxi":6
 * 
 * 
 * try:             # <<<<<<<<<<<<<<
 *     import numpy as np
 * except ImportError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "amplpy/set.pxi":7
 * 
 * try:
 *     import numpy as np             # <<<<<<<<<<<<<<
 * except ImportError:
 *     np = None
 */
      __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_numpy, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 7, __pyx_L50_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_2) < 0) __PYX_ERR(14, 7, __pyx_L50_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "amplpy/set.pxi":6
 * 
 * 
 * try:             # <<<<<<<<<<<<<<
 *     import numpy as np
 * except ImportError:
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L55_try_end;
    __pyx_L50_error:;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "amplpy/set.pxi":8
 * try:
 *     import numpy as np
 * except ImportError:             # <<<<<<<<<<<<<<
 *     np = None
 * 
 */
    __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError);
    if (__pyx_t_6) {
      __Pyx_AddTraceback("_amplpy", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(14, 8, __pyx_L52_except_error)
      __Pyx_XGOTREF(__pyx_t_2);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_8);

      /* "amplpy/set.pxi":9
 *     import numpy as np
 * except ImportError:
 *     np = None             # <<<<<<<<<<<<<<
 * 
 * 
 */
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, Py_None) < 0) __PYX_ERR(14, 9, __pyx_L52_except_error)
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      goto __pyx_L51_exception_handled;
    }
    goto __pyx_L52_except_error;

    /* "amplpy/set.pxi":6
 * 
 * 
 * try:             # <<<<<<<<<<<<<<
 *     import numpy as np
 * except ImportError:
 */
    __pyx_L52_except_error:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L51_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_4, __pyx_t_5);
    __pyx_L55_try_end:;
  }

  /* "amplpy/set.pxi":52
 *             return self.instances()
 * 
 *     def instances(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get an iterator to iterate over all the instances in a Set.
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_3Set_5instances, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Set_instances, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__262)); if (unlikely(!__pyx_t_8)) __PYX_ERR(14, 52, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Set, __pyx_n_s_instances, __pyx_t_8) < 0) __PYX_ERR(14, 52, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Set);

  /* "amplpy/set.pxi":58
 *         return Entity.instances(self)
 * 
 *     def arity(self):             # <<<<<<<<<<<<<<
 *         """
 *         The arity of the set, or number of components in each member of this
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_3Set_7arity, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Set_arity, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__264)); if (unlikely(!__pyx_t_8)) __PYX_ERR(14, 58, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Set, __pyx_n_s_arity, __pyx_t_8) < 0) __PYX_ERR(14, 58, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Set);

  /* "amplpy/set.pxi":67
 *         return int(arity)
 * 
 *     def get_values(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get values of this set in a DataFrame. Valid only for non-indexed sets.
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_3Set_9get_values, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Set_get_values, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__266)); if (unlikely(!__pyx_t_8)) __PYX_ERR(14, 67, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Set, __pyx_n_s_get_values, __pyx_t_8) < 0) __PYX_ERR(14, 67, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Set);

  /* "amplpy/set.pxi":75
 *         return DataFrame.create(df_c)
 * 
 *     def members(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get members (tuples) of this Set. Valid only for non-indexed sets.
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_3Set_11members, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Set_members, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__267)); if (unlikely(!__pyx_t_8)) __PYX_ERR(14, 75, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Set, __pyx_n_s_members, __pyx_t_8) < 0) __PYX_ERR(14, 75, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Set);

  /* "amplpy/set.pxi":81
 *         return MemberRangeIterator.create(self._c_ampl, self._name, self._index, self)
 * 
 *     def size(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the number of tuples in this set. Valid only for non-indexed sets.
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_3Set_13size, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Set_size, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__268)); if (unlikely(!__pyx_t_8)) __PYX_ERR(14, 81, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Set, __pyx_n_s_size, __pyx_t_8) < 0) __PYX_ERR(14, 81, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Set);

  /* "amplpy/set.pxi":89
 *         return int(size)
 * 
 *     def contains(self, t):             # <<<<<<<<<<<<<<
 *         """
 *         Check wether this set instance contains the specified Tuple.
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_3Set_15contains, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Set_contains, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__270)); if (unlikely(!__pyx_t_8)) __PYX_ERR(14, 89, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Set, __pyx_n_s_contains, __pyx_t_8) < 0) __PYX_ERR(14, 89, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Set);

  /* "amplpy/set.pxi":103
 *         return contains_c
 * 
 *     def set_values(self, values):             # <<<<<<<<<<<<<<
 *         """
 *         Set the tuples in this set. Valid only for non-indexed sets.
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_3Set_17set_values, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Set_set_values, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__272)); if (unlikely(!__pyx_t_8)) __PYX_ERR(14, 103, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Set, __pyx_n_s_set_values, __pyx_t_8) < 0) __PYX_ERR(14, 103, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Set);

  /* "amplpy/set.pxi":189
 * 
 *     # Aliases
 *     getValues = get_values             # <<<<<<<<<<<<<<
 *     setValues = set_values
 */
  __Pyx_GetNameInClass(__pyx_t_8, (PyObject *)__pyx_ptype_7_amplpy_Set, __pyx_n_s_get_values); if (unlikely(!__pyx_t_8)) __PYX_ERR(14, 189, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Set, __pyx_n_s_getValues, __pyx_t_8) < 0) __PYX_ERR(14, 189, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Set);

  /* "amplpy/set.pxi":190
 *     # Aliases
 *     getValues = get_values
 *     setValues = set_values             # <<<<<<<<<<<<<<
 */
  __Pyx_GetNameInClass(__pyx_t_8, (PyObject *)__pyx_ptype_7_amplpy_Set, __pyx_n_s_set_values); if (unlikely(!__pyx_t_8)) __PYX_ERR(14, 190, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Set, __pyx_n_s_setValues_2, __pyx_t_8) < 0) __PYX_ERR(14, 190, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Set);

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._c_ampl,self._index cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_3Set_19__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Set___reduce_cython, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__273)); if (unlikely(!__pyx_t_8)) __PYX_ERR(8, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_8) < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._c_ampl,self._index cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._c_ampl,self._index cannot be converted to a Python object for pickling"
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_3Set_21__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Set___setstate_cython, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__274)); if (unlikely(!__pyx_t_8)) __PYX_ERR(8, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_8) < 0) __PYX_ERR(8, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "amplpy/variable.pxi":38
 *         self.__getitem__(index).set_value(value)
 * 
 *     def value(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the current value of this variable.
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_8Variable_3value, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Variable_value, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__275)); if (unlikely(!__pyx_t_8)) __PYX_ERR(15, 38, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Variable, __pyx_n_s_value, __pyx_t_8) < 0) __PYX_ERR(15, 38, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Variable);

  /* "amplpy/variable.pxi":46
 *         return value
 * 
 *     def fix(self, value=None):             # <<<<<<<<<<<<<<
 *         """
 *         Fix all instances of this variable to a value if provided or to
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_8Variable_5fix, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Variable_fix, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__276)); if (unlikely(!__pyx_t_8)) __PYX_ERR(15, 46, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_8, __pyx_tuple__131);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Variable, __pyx_n_s_fix, __pyx_t_8) < 0) __PYX_ERR(15, 46, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Variable);

  /* "amplpy/variable.pxi":59
 *             PY_AMPL_CALL(campl.AMPL_VariableInstanceFixToValue(self._c_ampl, self._name, self._index, value))
 * 
 *     def unfix(self):             # <<<<<<<<<<<<<<
 *         """
 *         Unfix all instances of this variable.
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_8Variable_7unfix, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Variable_unfix, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__277)); if (unlikely(!__pyx_t_8)) __PYX_ERR(15, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Variable, __pyx_n_s_unfix, __pyx_t_8) < 0) __PYX_ERR(15, 59, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Variable);

  /* "amplpy/variable.pxi":65
 *         PY_AMPL_CALL(campl.AMPL_VariableInstanceUnfix(self._c_ampl, self._name, self._index))
 * 
 *     def set_value(self, value):             # <<<<<<<<<<<<<<
 *         """
 *         Set the current value of this variable (does not fix it),
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_8Variable_9set_value, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Variable_set_value, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__278)); if (unlikely(!__pyx_t_8)) __PYX_ERR(15, 65, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Variable, __pyx_n_s_set_value, __pyx_t_8) < 0) __PYX_ERR(15, 65, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Variable);

  /* "amplpy/variable.pxi":78
 *             PY_AMPL_CALL(campl.AMPL_VariableInstanceSetValue(self._c_ampl, self._name, self._index, float(value)))
 * 
 *     def astatus(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the AMPL status (fixed, presolved, or substituted out).
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_8Variable_11astatus, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Variable_astatus, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__279)); if (unlikely(!__pyx_t_8)) __PYX_ERR(15, 78, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Variable, __pyx_n_s_astatus, __pyx_t_8) < 0) __PYX_ERR(15, 78, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Variable);

  /* "amplpy/variable.pxi":95
 *         return value
 * 
 *     def defeqn(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the index in `_con` of "defining constraint" used to substitute
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_8Variable_13defeqn, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Variable_defeqn, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__280)); if (unlikely(!__pyx_t_8)) __PYX_ERR(15, 95, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Variable, __pyx_n_s_defeqn, __pyx_t_8) < 0) __PYX_ERR(15, 95, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Variable);

  /* "amplpy/variable.pxi":104
 *         return value
 * 
 *     def dual(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the dual value on defining constraint of variable substituted out.
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_8Variable_15dual, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Variable_dual, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__281)); if (unlikely(!__pyx_t_8)) __PYX_ERR(15, 104, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Variable, __pyx_n_s_dual, __pyx_t_8) < 0) __PYX_ERR(15, 104, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Variable);

  /* "amplpy/variable.pxi":112
 *         return value
 * 
 *     def init(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the current initial guess.
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_8Variable_17init, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Variable_init, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__282)); if (unlikely(!__pyx_t_8)) __PYX_ERR(15, 112, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Variable, __pyx_n_s_init_2, __pyx_t_8) < 0) __PYX_ERR(15, 112, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Variable);

  /* "amplpy/variable.pxi":120
 *         return value
 * 
 *     def init0(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the original initial guess (set by `:=` or`default` or by a data
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_8Variable_19init0, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Variable_init0, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__283)); if (unlikely(!__pyx_t_8)) __PYX_ERR(15, 120, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Variable, __pyx_n_s_init0, __pyx_t_8) < 0) __PYX_ERR(15, 120, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Variable);

  /* "amplpy/variable.pxi":129
 *         return value
 * 
 *     def lb(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the current lower bound.
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_8Variable_21lb, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Variable_lb, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__284)); if (unlikely(!__pyx_t_8)) __PYX_ERR(15, 129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Variable, __pyx_n_s_lb, __pyx_t_8) < 0) __PYX_ERR(15, 129, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Variable);

  /* "amplpy/variable.pxi":137
 *         return value
 * 
 *     def ub(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the current upper bound.
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_8Variable_23ub, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Variable_ub, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__285)); if (unlikely(!__pyx_t_8)) __PYX_ERR(15, 137, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Variable, __pyx_n_s_ub, __pyx_t_8) < 0) __PYX_ERR(15, 137, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Variable);

  /* "amplpy/variable.pxi":145
 *         return value
 * 
 *     def lb0(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the initial lower bounds, from the var declaration.
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_8Variable_25lb0, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Variable_lb0, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__286)); if (unlikely(!__pyx_t_8)) __PYX_ERR(15, 145, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Variable, __pyx_n_s_lb0, __pyx_t_8) < 0) __PYX_ERR(15, 145, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Variable);

  /* "amplpy/variable.pxi":153
 *         return value
 * 
 *     def ub0(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the initial upper bound, from the var declaration.
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_8Variable_27ub0, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Variable_ub0, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__287)); if (unlikely(!__pyx_t_8)) __PYX_ERR(15, 153, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Variable, __pyx_n_s_ub0, __pyx_t_8) < 0) __PYX_ERR(15, 153, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Variable);

  /* "amplpy/variable.pxi":161
 *         return value
 * 
 *     def lb1(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the weaker lower bound from AMPL's presolve phase.
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_8Variable_29lb1, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Variable_lb1, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__288)); if (unlikely(!__pyx_t_8)) __PYX_ERR(15, 161, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Variable, __pyx_n_s_lb1, __pyx_t_8) < 0) __PYX_ERR(15, 161, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Variable);

  /* "amplpy/variable.pxi":169
 *         return value
 * 
 *     def ub1(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the weaker upper bound from AMPL's presolve phase.
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_8Variable_31ub1, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Variable_ub1, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__289)); if (unlikely(!__pyx_t_8)) __PYX_ERR(15, 169, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Variable, __pyx_n_s_ub1, __pyx_t_8) < 0) __PYX_ERR(15, 169, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Variable);

  /* "amplpy/variable.pxi":177
 *         return value
 * 
 *     def lb2(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the stronger lower bound from AMPL's presolve phase.
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_8Variable_33lb2, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Variable_lb2, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__290)); if (unlikely(!__pyx_t_8)) __PYX_ERR(15, 177, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Variable, __pyx_n_s_lb2, __pyx_t_8) < 0) __PYX_ERR(15, 177, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Variable);

  /* "amplpy/variable.pxi":185
 *         return value
 * 
 *     def ub2(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the stronger upper bound from AMPL's presolve phase.
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_8Variable_35ub2, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Variable_ub2, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__291)); if (unlikely(!__pyx_t_8)) __PYX_ERR(15, 185, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Variable, __pyx_n_s_ub2, __pyx_t_8) < 0) __PYX_ERR(15, 185, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Variable);

  /* "amplpy/variable.pxi":193
 *         return value
 * 
 *     def lrc(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the reduced cost at lower bound.
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_8Variable_37lrc, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Variable_lrc, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__292)); if (unlikely(!__pyx_t_8)) __PYX_ERR(15, 193, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Variable, __pyx_n_s_lrc, __pyx_t_8) < 0) __PYX_ERR(15, 193, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Variable);

  /* "amplpy/variable.pxi":201
 *         return value
 * 
 *     def urc(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the reduced cost at upper bound.
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_8Variable_39urc, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Variable_urc, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__293)); if (unlikely(!__pyx_t_8)) __PYX_ERR(15, 201, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Variable, __pyx_n_s_urc, __pyx_t_8) < 0) __PYX_ERR(15, 201, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Variable);

  /* "amplpy/variable.pxi":209
 *         return value
 * 
 *     def lslack(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the slack at lower bound (``val - lb``).
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_8Variable_41lslack, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Variable_lslack, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__294)); if (unlikely(!__pyx_t_8)) __PYX_ERR(15, 209, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Variable, __pyx_n_s_lslack, __pyx_t_8) < 0) __PYX_ERR(15, 209, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Variable);

  /* "amplpy/variable.pxi":217
 *         return value
 * 
 *     def uslack(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the slack at upper bound (``ub - val``).
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_8Variable_43uslack, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Variable_uslack, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__295)); if (unlikely(!__pyx_t_8)) __PYX_ERR(15, 217, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Variable, __pyx_n_s_uslack, __pyx_t_8) < 0) __PYX_ERR(15, 217, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Variable);

  /* "amplpy/variable.pxi":225
 *         return value
 * 
 *     def rc(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the reduced cost (at the nearer bound).
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_8Variable_45rc, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Variable_rc, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__296)); if (unlikely(!__pyx_t_8)) __PYX_ERR(15, 225, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Variable, __pyx_n_s_rc, __pyx_t_8) < 0) __PYX_ERR(15, 225, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Variable);

  /* "amplpy/variable.pxi":233
 *         return value
 * 
 *     def slack(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the bound slack which is the lesser of
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_8Variable_47slack, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Variable_slack, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__297)); if (unlikely(!__pyx_t_8)) __PYX_ERR(15, 233, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Variable, __pyx_n_s_slack, __pyx_t_8) < 0) __PYX_ERR(15, 233, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Variable);

  /* "amplpy/variable.pxi":242
 *         return value
 * 
 *     def sstatus(self):             # <<<<<<<<<<<<<<
 *         """
 *         Solver status (basis status of variable).
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_8Variable_49sstatus, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Variable_sstatus, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__298)); if (unlikely(!__pyx_t_8)) __PYX_ERR(15, 242, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Variable, __pyx_n_s_sstatus, __pyx_t_8) < 0) __PYX_ERR(15, 242, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Variable);

  /* "amplpy/variable.pxi":258
 *         return value
 * 
 *     def status(self):             # <<<<<<<<<<<<<<
 *         """
 *         AMPL status if not `in`, otherwise solver status.
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_8Variable_51status, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Variable_status, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__299)); if (unlikely(!__pyx_t_8)) __PYX_ERR(15, 258, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Variable, __pyx_n_s_status, __pyx_t_8) < 0) __PYX_ERR(15, 258, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Variable);

  /* "amplpy/variable.pxi":275
 * 
 *     # Aliases
 *     setValue = set_value             # <<<<<<<<<<<<<<
 */
  __Pyx_GetNameInClass(__pyx_t_8, (PyObject *)__pyx_ptype_7_amplpy_Variable, __pyx_n_s_set_value); if (unlikely(!__pyx_t_8)) __PYX_ERR(15, 275, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_Variable, __pyx_n_s_setValue, __pyx_t_8) < 0) __PYX_ERR(15, 275, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_Variable);

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._c_ampl,self._index cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_8Variable_53__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Variable___reduce_cython, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__300)); if (unlikely(!__pyx_t_8)) __PYX_ERR(8, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_8) < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._c_ampl,self._index cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._c_ampl,self._index cannot be converted to a Python object for pickling"
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_8Variable_55__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Variable___setstate_cython, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__301)); if (unlikely(!__pyx_t_8)) __PYX_ERR(8, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_8) < 0) __PYX_ERR(8, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "amplpy/ampl.pyx":31
 * 
 * 
 * def nested_dict_of_suffixes(lst):             # <<<<<<<<<<<<<<
 *     nested = {}
 *     for name, value in lst:
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_3nested_dict_of_suffixes, 0, __pyx_n_s_nested_dict_of_suffixes, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__303)); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_nested_dict_of_suffixes, __pyx_t_8) < 0) __PYX_ERR(3, 31, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "amplpy/ampl.pyx":47
 * 
 * 
 * AMPL_NOT_FOUND_MESSAGE = """             # <<<<<<<<<<<<<<
 * Please make sure that the AMPL directory is in the system search path, or
 * add it before instantiating the AMPL object with:
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_AMPL_NOT_FOUND_MESSAGE, __pyx_kp_u_Please_make_sure_that_the_AMPL) < 0) __PYX_ERR(3, 47, __pyx_L1_error)

  /* "amplpy/ampl.pyx":151
 *         self.close()
 * 
 *     def get_data(self, *statements):             # <<<<<<<<<<<<<<
 *         """
 *         Get the data corresponding to the display statements. The statements
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_4AMPL_5get_data, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AMPL_get_data, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__305)); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 151, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_get_data, __pyx_t_8) < 0) __PYX_ERR(3, 151, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_AMPL);

  /* "amplpy/ampl.pyx":198
 *         return DataFrame.create(data)
 * 
 *     def get_entity(self, name):             # <<<<<<<<<<<<<<
 *         """
 *         Get entity corresponding to the specified name (looks for it in all
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_4AMPL_7get_entity, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AMPL_get_entity, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__307)); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 198, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_get_entity, __pyx_t_8) < 0) __PYX_ERR(3, 198, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_AMPL);

  /* "amplpy/ampl.pyx":215
 *         return Entity.create(self._c_ampl, name_c, NULL, None)
 * 
 *     def get_variable(self, name):             # <<<<<<<<<<<<<<
 *         """
 *         Get the variable with the corresponding name.
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_4AMPL_9get_variable, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AMPL_get_variable, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__309)); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 215, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_get_variable, __pyx_t_8) < 0) __PYX_ERR(3, 215, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_AMPL);

  /* "amplpy/ampl.pyx":239
 *         return Variable.create(self._c_ampl, name_c, NULL, None)
 * 
 *     def get_constraint(self, name):             # <<<<<<<<<<<<<<
 *         """
 *         Get the constraint with the corresponding name.
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_4AMPL_11get_constraint, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AMPL_get_constraint, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__310)); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 239, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_get_constraint, __pyx_t_8) < 0) __PYX_ERR(3, 239, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_AMPL);

  /* "amplpy/ampl.pyx":263
 *         return Constraint.create(self._c_ampl, name_c, NULL, None)
 * 
 *     def get_objective(self, name):             # <<<<<<<<<<<<<<
 *         """
 *         Get the objective with the corresponding name.
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_4AMPL_13get_objective, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AMPL_get_objective, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__311)); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 263, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_get_objective, __pyx_t_8) < 0) __PYX_ERR(3, 263, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_AMPL);

  /* "amplpy/ampl.pyx":287
 *         return Objective.create(self._c_ampl, name_c, NULL, None)
 * 
 *     def get_set(self, name):             # <<<<<<<<<<<<<<
 *         """
 *         Get the set with the corresponding name.
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_4AMPL_15get_set, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AMPL_get_set, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__312)); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 287, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_get_set, __pyx_t_8) < 0) __PYX_ERR(3, 287, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_AMPL);

  /* "amplpy/ampl.pyx":311
 *         return Set.create(self._c_ampl, name_c, NULL, None)
 * 
 *     def get_parameter(self, name):             # <<<<<<<<<<<<<<
 *         """
 *         Get the parameter with the corresponding name.
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_4AMPL_17get_parameter, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AMPL_get_parameter, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__313)); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 311, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_get_parameter, __pyx_t_8) < 0) __PYX_ERR(3, 311, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_AMPL);

  /* "amplpy/ampl.pyx":335
 *         return Parameter.create(self._c_ampl, name_c, NULL, None)
 * 
 *     def eval(self, statements):             # <<<<<<<<<<<<<<
 *         """
 *         Parses AMPL code and evaluates it as a possibly empty sequence of AMPL
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_4AMPL_19eval, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AMPL_eval, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__315)); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 335, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_eval, __pyx_t_8) < 0) __PYX_ERR(3, 335, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_AMPL);

  /* "amplpy/ampl.pyx":369
 *             raise RuntimeError(str(e))
 * 
 *     def get_output(self, statements):             # <<<<<<<<<<<<<<
 *         """
 *         Equivalent to :func:`~amplpy.AMPL.eval` but returns the output as a
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_4AMPL_21get_output, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AMPL_get_output, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__317)); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 369, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_get_output, __pyx_t_8) < 0) __PYX_ERR(3, 369, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_AMPL);

  /* "amplpy/ampl.pyx":390
 *         return output
 * 
 *     def reset(self):             # <<<<<<<<<<<<<<
 *         """
 *         Clears all entities in the underlying AMPL interpreter, clears all maps
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_4AMPL_23reset, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AMPL_reset, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__318)); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 390, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_reset, __pyx_t_8) < 0) __PYX_ERR(3, 390, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_AMPL);

  /* "amplpy/ampl.pyx":397
 *         PY_AMPL_CALL(campl.AMPL_Reset(self._c_ampl))
 * 
 *     def close(self):             # <<<<<<<<<<<<<<
 *         """
 *         Stops the underlying engine, and release all any further attempt to
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_4AMPL_25close, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AMPL_close, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__319)); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 397, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_close, __pyx_t_8) < 0) __PYX_ERR(3, 397, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_AMPL);

  /* "amplpy/ampl.pyx":408
 *             self._c_ampl = NULL
 * 
 *     def is_running(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns true if the underlying engine is running.
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_4AMPL_27is_running, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AMPL_is_running, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__321)); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 408, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_is_running, __pyx_t_8) < 0) __PYX_ERR(3, 408, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_AMPL);

  /* "amplpy/ampl.pyx":416
 *         return isrunning
 * 
 *     def solve(self, problem="", solver="", verbose=True, return_output=False, **kwargs):             # <<<<<<<<<<<<<<
 *         """
 *         Solve the current model or the problem specified by ``problem``.
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_4AMPL_29solve, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AMPL_solve, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__323)); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 416, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_8, __pyx_tuple__324);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_solve_2, __pyx_t_8) < 0) __PYX_ERR(3, 416, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_AMPL);

  /* "amplpy/ampl.pyx":446
 *             PY_AMPL_CALL(campl.AMPL_Solve(self._c_ampl, problem.encode('utf-8'), solver.encode('utf-8')))
 * 
 *     def cd(self, path=None):             # <<<<<<<<<<<<<<
 *         """
 *         Get or set the current working directory from the underlying
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_4AMPL_31cd, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AMPL_cd, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__326)); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 446, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_8, __pyx_tuple__131);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_cd, __pyx_t_8) < 0) __PYX_ERR(3, 446, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_AMPL);

  /* "amplpy/ampl.pyx":474
 *         return workdir
 * 
 *     def set_option(self, name, value):             # <<<<<<<<<<<<<<
 *         """
 *         Set an AMPL option to a specified value.
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_4AMPL_33set_option, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AMPL_set_option, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__327)); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 474, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_set_option, __pyx_t_8) < 0) __PYX_ERR(3, 474, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_AMPL);

  /* "amplpy/ampl.pyx":499
 *             raise TypeError
 * 
 *     def get_option(self, name):             # <<<<<<<<<<<<<<
 *         """
 *         Get the current value of the specified option. If the option does not
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_4AMPL_35get_option, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AMPL_get_option, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__329)); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 499, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_get_option, __pyx_t_8) < 0) __PYX_ERR(3, 499, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_AMPL);

  /* "amplpy/ampl.pyx":535
 *                     return value
 * 
 *     def read(self, filename):             # <<<<<<<<<<<<<<
 *         """
 *         Interprets the specified file (script or model or mixed) As a side
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_4AMPL_37read, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AMPL_read, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__331)); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 535, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_read, __pyx_t_8) < 0) __PYX_ERR(3, 535, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_AMPL);

  /* "amplpy/ampl.pyx":550
 *         PY_AMPL_CALL(campl.AMPL_Read(self._c_ampl, str(filename).encode('utf-8')))
 * 
 *     def read_data(self, filename):             # <<<<<<<<<<<<<<
 *         """
 *         Interprets the specified file as an AMPL data file. As a side effect,
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_4AMPL_39read_data, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AMPL_read_data, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__332)); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 550, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_read_data, __pyx_t_8) < 0) __PYX_ERR(3, 550, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_AMPL);

  /* "amplpy/ampl.pyx":566
 *         PY_AMPL_CALL(campl.AMPL_ReadData(self._c_ampl, str(filename).encode('utf-8')))
 * 
 *     def get_value(self, scalar_expression):             # <<<<<<<<<<<<<<
 *         """
 *         Get a scalar value from the underlying AMPL interpreter, as a double or
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_4AMPL_41get_value, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AMPL_get_value, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__334)); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 566, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_get_value, __pyx_t_8) < 0) __PYX_ERR(3, 566, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_AMPL);

  /* "amplpy/ampl.pyx":592
 *         return py_variant
 * 
 *     def set_data(self, data, set_name=None):             # <<<<<<<<<<<<<<
 *         """
 *         Assign the data in the dataframe to the AMPL entities with the names
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_4AMPL_43set_data, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AMPL_set_data, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__336)); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 592, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_8, __pyx_tuple__131);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_set_data, __pyx_t_8) < 0) __PYX_ERR(3, 592, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_AMPL);

  /* "amplpy/ampl.pyx":616
 *             PY_AMPL_CALL(campl.AMPL_SetData(self._c_ampl, data_c, set_name.encode('utf-8')))
 * 
 *     def read_table(self, table_name):             # <<<<<<<<<<<<<<
 *         """
 *         Read the table corresponding to the specified name, equivalent to the
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_4AMPL_45read_table, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AMPL_read_table, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__338)); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 616, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_read_table, __pyx_t_8) < 0) __PYX_ERR(3, 616, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_AMPL);

  /* "amplpy/ampl.pyx":630
 *         PY_AMPL_CALL(campl.AMPL_ReadTable(self._c_ampl, table_name.encode('utf-8')))
 * 
 *     def write_table(self, table_name):             # <<<<<<<<<<<<<<
 *         """
 *         Write the table corresponding to the specified name, equivalent to the
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_4AMPL_47write_table, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AMPL_write_table, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__339)); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 630, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_write_table, __pyx_t_8) < 0) __PYX_ERR(3, 630, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_AMPL);

  /* "amplpy/ampl.pyx":644
 *         PY_AMPL_CALL(campl.AMPL_WriteTable(self._c_ampl, table_name.encode('utf-8')))
 * 
 *     def display(self, *ampl_expressions):             # <<<<<<<<<<<<<<
 *         """
 *         Writes on the current OutputHandler the outcome of the AMPL statement.
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_4AMPL_49display, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AMPL_display, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__341)); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 644, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_display, __pyx_t_8) < 0) __PYX_ERR(3, 644, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_AMPL);

  /* "amplpy/ampl.pyx":677
 *             PY_AMPL_CALL(errorinfo)
 * 
 *     def set_output_handler(self, output_handler):             # <<<<<<<<<<<<<<
 *         """
 *         Sets a new output handler.
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_4AMPL_51set_output_handler, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AMPL_set_output_handler, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__343)); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 677, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_set_output_handler, __pyx_t_8) < 0) __PYX_ERR(3, 677, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_AMPL);

  /* "amplpy/ampl.pyx":688
 *         PY_AMPL_CALL(campl.AMPL_SetOutputHandler(self._c_ampl, PyOutput, <void*>output_handler))
 * 
 *     def set_error_handler(self, error_handler):             # <<<<<<<<<<<<<<
 *         """
 *         Sets a new error handler.
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_4AMPL_53set_error_handler, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AMPL_set_error_handler, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__345)); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 688, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_set_error_handler, __pyx_t_8) < 0) __PYX_ERR(3, 688, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_AMPL);

  /* "amplpy/ampl.pyx":698
 *         PY_AMPL_CALL(campl.AMPL_SetErrorHandler(self._c_ampl, <void*>error_handler, PyError))
 * 
 *     def get_output_handler(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the current output handler.
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_4AMPL_55get_output_handler, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AMPL_get_output_handler, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__346)); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 698, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_get_output_handler, __pyx_t_8) < 0) __PYX_ERR(3, 698, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_AMPL);

  /* "amplpy/ampl.pyx":709
 *         return <OutputHandler>output_handler
 * 
 *     def get_error_handler(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the current error handler.
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_4AMPL_57get_error_handler, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AMPL_get_error_handler, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__347)); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 709, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_get_error_handler, __pyx_t_8) < 0) __PYX_ERR(3, 709, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_AMPL);

  /* "amplpy/ampl.pyx":720
 *         return <ErrorHandler>error_handler
 * 
 *     def get_variables(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get all the variables declared.
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_4AMPL_59get_variables, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AMPL_get_variables, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__348)); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 720, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_get_variables, __pyx_t_8) < 0) __PYX_ERR(3, 720, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_AMPL);

  /* "amplpy/ampl.pyx":726
 *         return EntityMap.create(self._c_ampl, campl.AMPL_VARIABLE)
 * 
 *     def get_constraints(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get all the constraints declared.
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_4AMPL_61get_constraints, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AMPL_get_constraints, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__349)); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 726, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_get_constraints, __pyx_t_8) < 0) __PYX_ERR(3, 726, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_AMPL);

  /* "amplpy/ampl.pyx":732
 *         return EntityMap.create(self._c_ampl, campl.AMPL_CONSTRAINT)
 * 
 *     def get_objectives(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get all the objectives declared.
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_4AMPL_63get_objectives, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AMPL_get_objectives, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__350)); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 732, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_get_objectives, __pyx_t_8) < 0) __PYX_ERR(3, 732, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_AMPL);

  /* "amplpy/ampl.pyx":738
 *         return EntityMap.create(self._c_ampl, campl.AMPL_OBJECTIVE)
 * 
 *     def get_sets(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get all the sets declared.
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_4AMPL_65get_sets, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AMPL_get_sets, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__351)); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 738, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_get_sets, __pyx_t_8) < 0) __PYX_ERR(3, 738, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_AMPL);

  /* "amplpy/ampl.pyx":744
 *         return EntityMap.create(self._c_ampl, campl.AMPL_SET)
 * 
 *     def get_parameters(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get all the parameters declared.
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_4AMPL_67get_parameters, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AMPL_get_parameters, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__352)); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 744, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_get_parameters, __pyx_t_8) < 0) __PYX_ERR(3, 744, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_AMPL);

  /* "amplpy/ampl.pyx":750
 *         return EntityMap.create(self._c_ampl, campl.AMPL_PARAMETER)
 * 
 *     def get_current_objective(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the the current objective. Returns `None` if no objective is set.
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_4AMPL_69get_current_objective, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AMPL_get_current_objective, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__354)); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 750, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_get_current_objective, __pyx_t_8) < 0) __PYX_ERR(3, 750, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_AMPL);

  /* "amplpy/ampl.pyx":769
 *             return self.get_objective(objname)
 * 
 *     def _var(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get/Set a variable.
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_4AMPL_71_var, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AMPL__var, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__356)); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 769, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_var, __pyx_t_8) < 0) __PYX_ERR(3, 769, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_AMPL);

  /* "amplpy/ampl.pyx":792
 *         return Variables(self)
 * 
 *     def _con(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get/Set a constraint.
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_4AMPL_73_con, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AMPL__con, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__358)); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 792, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_con, __pyx_t_8) < 0) __PYX_ERR(3, 792, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_AMPL);

  /* "amplpy/ampl.pyx":816
 *         return Constraints(self)
 * 
 *     def _obj(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get an objective.
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_4AMPL_75_obj, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AMPL__obj, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__360)); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 816, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_obj, __pyx_t_8) < 0) __PYX_ERR(3, 816, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_AMPL);

  /* "amplpy/ampl.pyx":833
 *         return Objectives(self)
 * 
 *     def _set(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get/Set a set.
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_4AMPL_77_set, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AMPL__set, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__362)); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 833, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_set_2, __pyx_t_8) < 0) __PYX_ERR(3, 833, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_AMPL);

  /* "amplpy/ampl.pyx":853
 *         return Sets(self)
 * 
 *     def _param(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get/Set a parameter.
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_4AMPL_79_param, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AMPL__param, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__364)); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 853, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_param, __pyx_t_8) < 0) __PYX_ERR(3, 853, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_AMPL);

  /* "amplpy/ampl.pyx":876
 *         return Parameters(self)
 * 
 *     def _option(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get/Set an option.
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_4AMPL_81_option, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AMPL__option, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__366)); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 876, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_option_2, __pyx_t_8) < 0) __PYX_ERR(3, 876, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_AMPL);

  /* "amplpy/ampl.pyx":893
 *         return Options(self)
 * 
 *     var = property(_var)             # <<<<<<<<<<<<<<
 *     con = property(_con)
 *     obj = property(_obj)
 */
  __Pyx_GetNameInClass(__pyx_t_8, (PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_var); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 893, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_property, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 893, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_var_2, __pyx_t_7) < 0) __PYX_ERR(3, 893, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_AMPL);

  /* "amplpy/ampl.pyx":894
 * 
 *     var = property(_var)
 *     con = property(_con)             # <<<<<<<<<<<<<<
 *     obj = property(_obj)
 *     set = property(_set)
 */
  __Pyx_GetNameInClass(__pyx_t_7, (PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_con); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 894, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_property, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 894, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_con_2, __pyx_t_8) < 0) __PYX_ERR(3, 894, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_AMPL);

  /* "amplpy/ampl.pyx":895
 *     var = property(_var)
 *     con = property(_con)
 *     obj = property(_obj)             # <<<<<<<<<<<<<<
 *     set = property(_set)
 *     param = property(_param)
 */
  __Pyx_GetNameInClass(__pyx_t_8, (PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_obj); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 895, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_property, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 895, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_obj_2, __pyx_t_7) < 0) __PYX_ERR(3, 895, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_AMPL);

  /* "amplpy/ampl.pyx":896
 *     con = property(_con)
 *     obj = property(_obj)
 *     set = property(_set)             # <<<<<<<<<<<<<<
 *     param = property(_param)
 *     option = property(_option)
 */
  __Pyx_GetNameInClass(__pyx_t_7, (PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_set_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 896, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_property, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 896, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_set, __pyx_t_8) < 0) __PYX_ERR(3, 896, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_AMPL);

  /* "amplpy/ampl.pyx":897
 *     obj = property(_obj)
 *     set = property(_set)
 *     param = property(_param)             # <<<<<<<<<<<<<<
 *     option = property(_option)
 * 
 */
  __Pyx_GetNameInClass(__pyx_t_8, (PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_param); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 897, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_property, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 897, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_param_2, __pyx_t_7) < 0) __PYX_ERR(3, 897, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_AMPL);

  /* "amplpy/ampl.pyx":898
 *     set = property(_set)
 *     param = property(_param)
 *     option = property(_option)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_GetNameInClass(__pyx_t_7, (PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_option_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 898, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_property, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 898, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_option, __pyx_t_8) < 0) __PYX_ERR(3, 898, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_AMPL);

  /* "amplpy/ampl.pyx":901
 * 
 * 
 *     def export_model(self, filename=""):             # <<<<<<<<<<<<<<
 *         """
 *         Create a .mod file with the model that has been loaded.
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_4AMPL_83export_model, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AMPL_export_model, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__368)); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 901, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_8, __pyx_tuple__369);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_export_model, __pyx_t_8) < 0) __PYX_ERR(3, 901, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_AMPL);

  /* "amplpy/ampl.pyx":922
 *         return output
 * 
 *     def export_data(self, filename=""):             # <<<<<<<<<<<<<<
 *         """
 *         Create a .dat file with the data that has been loaded.
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_4AMPL_85export_data, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AMPL_export_data, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__370)); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 922, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_8, __pyx_tuple__369);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_export_data, __pyx_t_8) < 0) __PYX_ERR(3, 922, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_AMPL);

  /* "amplpy/ampl.pyx":943
 *         return output
 * 
 *     def snapshot(self, filename="", model=True, data=True, options=True):             # <<<<<<<<<<<<<<
 *         """
 *         Create a snapshot file that replicates the current session.
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_4AMPL_87snapshot, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AMPL_snapshot, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__372)); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 943, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_8, __pyx_tuple__373);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_snapshot, __pyx_t_8) < 0) __PYX_ERR(3, 943, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_AMPL);

  /* "amplpy/ampl.pyx":973
 *         return output
 * 
 *     def write(self, filename, auxfiles=""):             # <<<<<<<<<<<<<<
 *         """
 *         Invoke write command with filename as argument and
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_4AMPL_89write, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AMPL_write, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__375)); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 973, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_8, __pyx_tuple__369);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_write, __pyx_t_8) < 0) __PYX_ERR(3, 973, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_AMPL);

  /* "amplpy/ampl.pyx":1034
 *         return self.get_value("solve_result_num")
 * 
 *     def get_iis(self, flat=True):             # <<<<<<<<<<<<<<
 *         """
 *         Get IIS attributes for all variables and constraints.
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_4AMPL_91get_iis, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AMPL_get_iis, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__377)); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1034, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_8, __pyx_tuple__151);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_get_iis, __pyx_t_8) < 0) __PYX_ERR(3, 1034, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_AMPL);

  /* "amplpy/ampl.pyx":1078
 *         return iis_var, iis_con
 * 
 *     def get_solution(self, flat=True, zeros=False):             # <<<<<<<<<<<<<<
 *         """
 *         Get solution values for all variables.
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_4AMPL_93get_solution, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AMPL_get_solution, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__379)); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1078, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_8, __pyx_tuple__380);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_get_solution, __pyx_t_8) < 0) __PYX_ERR(3, 1078, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_AMPL);

  /* "amplpy/ampl.pyx":1107
 *         return nested_dict_of_suffixes(lst_solution)
 * 
 *     def _start_recording(self, filename):             # <<<<<<<<<<<<<<
 *         """
 *         Start recording the session to a file for debug purposes.
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_4AMPL_95_start_recording, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AMPL__start_recording, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__381)); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1107, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_start_recording, __pyx_t_8) < 0) __PYX_ERR(3, 1107, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_AMPL);

  /* "amplpy/ampl.pyx":1116
 *         PY_AMPL_CALL(campl.AMPL_SetDblOption(self._c_ampl, "_log", 1))
 * 
 *     def _stop_recording(self):             # <<<<<<<<<<<<<<
 *         """
 *         Stop recording the session.
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_4AMPL_97_stop_recording, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AMPL__stop_recording, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__382)); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1116, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_stop_recording, __pyx_t_8) < 0) __PYX_ERR(3, 1116, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_AMPL);

  /* "amplpy/ampl.pyx":1122
 *         PY_AMPL_CALL(campl.AMPL_SetDblOption(self._c_ampl, "_log", 0))
 * 
 *     def _load_session(self, filename):             # <<<<<<<<<<<<<<
 *         """
 *         Load a recorded session.
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_4AMPL_99_load_session, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AMPL__load_session, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__384)); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1122, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_load_session, __pyx_t_8) < 0) __PYX_ERR(3, 1122, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_AMPL);

  /* "amplpy/ampl.pyx":1133
 * 
 *     # Aliases
 *     _loadSession = _load_session             # <<<<<<<<<<<<<<
 *     _startRecording = _start_recording
 *     _stopRecording = _stop_recording
 */
  __Pyx_GetNameInClass(__pyx_t_8, (PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_load_session); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1133, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_loadSession, __pyx_t_8) < 0) __PYX_ERR(3, 1133, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_AMPL);

  /* "amplpy/ampl.pyx":1134
 *     # Aliases
 *     _loadSession = _load_session
 *     _startRecording = _start_recording             # <<<<<<<<<<<<<<
 *     _stopRecording = _stop_recording
 *     exportData = export_data
 */
  __Pyx_GetNameInClass(__pyx_t_8, (PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_start_recording); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1134, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_startRecording, __pyx_t_8) < 0) __PYX_ERR(3, 1134, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_AMPL);

  /* "amplpy/ampl.pyx":1135
 *     _loadSession = _load_session
 *     _startRecording = _start_recording
 *     _stopRecording = _stop_recording             # <<<<<<<<<<<<<<
 *     exportData = export_data
 *     exportModel = export_model
 */
  __Pyx_GetNameInClass(__pyx_t_8, (PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_stop_recording); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1135, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_stopRecording, __pyx_t_8) < 0) __PYX_ERR(3, 1135, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_AMPL);

  /* "amplpy/ampl.pyx":1136
 *     _startRecording = _start_recording
 *     _stopRecording = _stop_recording
 *     exportData = export_data             # <<<<<<<<<<<<<<
 *     exportModel = export_model
 *     getConstraint = get_constraint
 */
  __Pyx_GetNameInClass(__pyx_t_8, (PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_export_data); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1136, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_exportData, __pyx_t_8) < 0) __PYX_ERR(3, 1136, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_AMPL);

  /* "amplpy/ampl.pyx":1137
 *     _stopRecording = _stop_recording
 *     exportData = export_data
 *     exportModel = export_model             # <<<<<<<<<<<<<<
 *     getConstraint = get_constraint
 *     getConstraints = get_constraints
 */
  __Pyx_GetNameInClass(__pyx_t_8, (PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_export_model); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1137, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_exportModel, __pyx_t_8) < 0) __PYX_ERR(3, 1137, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_AMPL);

  /* "amplpy/ampl.pyx":1138
 *     exportData = export_data
 *     exportModel = export_model
 *     getConstraint = get_constraint             # <<<<<<<<<<<<<<
 *     getConstraints = get_constraints
 *     getCurrentObjective = get_current_objective
 */
  __Pyx_GetNameInClass(__pyx_t_8, (PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_get_constraint); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_getConstraint, __pyx_t_8) < 0) __PYX_ERR(3, 1138, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_AMPL);

  /* "amplpy/ampl.pyx":1139
 *     exportModel = export_model
 *     getConstraint = get_constraint
 *     getConstraints = get_constraints             # <<<<<<<<<<<<<<
 *     getCurrentObjective = get_current_objective
 *     getData = get_data
 */
  __Pyx_GetNameInClass(__pyx_t_8, (PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_get_constraints); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1139, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_getConstraints, __pyx_t_8) < 0) __PYX_ERR(3, 1139, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_AMPL);

  /* "amplpy/ampl.pyx":1140
 *     getConstraint = get_constraint
 *     getConstraints = get_constraints
 *     getCurrentObjective = get_current_objective             # <<<<<<<<<<<<<<
 *     getData = get_data
 *     getEntity = get_entity
 */
  __Pyx_GetNameInClass(__pyx_t_8, (PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_get_current_objective); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1140, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_getCurrentObjective, __pyx_t_8) < 0) __PYX_ERR(3, 1140, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_AMPL);

  /* "amplpy/ampl.pyx":1141
 *     getConstraints = get_constraints
 *     getCurrentObjective = get_current_objective
 *     getData = get_data             # <<<<<<<<<<<<<<
 *     getEntity = get_entity
 *     getErrorHandler = get_error_handler
 */
  __Pyx_GetNameInClass(__pyx_t_8, (PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_get_data); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1141, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_getData, __pyx_t_8) < 0) __PYX_ERR(3, 1141, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_AMPL);

  /* "amplpy/ampl.pyx":1142
 *     getCurrentObjective = get_current_objective
 *     getData = get_data
 *     getEntity = get_entity             # <<<<<<<<<<<<<<
 *     getErrorHandler = get_error_handler
 *     getObjective = get_objective
 */
  __Pyx_GetNameInClass(__pyx_t_8, (PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_get_entity); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1142, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_getEntity, __pyx_t_8) < 0) __PYX_ERR(3, 1142, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_AMPL);

  /* "amplpy/ampl.pyx":1143
 *     getData = get_data
 *     getEntity = get_entity
 *     getErrorHandler = get_error_handler             # <<<<<<<<<<<<<<
 *     getObjective = get_objective
 *     getObjectives = get_objectives
 */
  __Pyx_GetNameInClass(__pyx_t_8, (PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_get_error_handler); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1143, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_getErrorHandler, __pyx_t_8) < 0) __PYX_ERR(3, 1143, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_AMPL);

  /* "amplpy/ampl.pyx":1144
 *     getEntity = get_entity
 *     getErrorHandler = get_error_handler
 *     getObjective = get_objective             # <<<<<<<<<<<<<<
 *     getObjectives = get_objectives
 *     getOption = get_option
 */
  __Pyx_GetNameInClass(__pyx_t_8, (PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_get_objective); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1144, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_getObjective, __pyx_t_8) < 0) __PYX_ERR(3, 1144, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_AMPL);

  /* "amplpy/ampl.pyx":1145
 *     getErrorHandler = get_error_handler
 *     getObjective = get_objective
 *     getObjectives = get_objectives             # <<<<<<<<<<<<<<
 *     getOption = get_option
 *     getOutput = get_output
 */
  __Pyx_GetNameInClass(__pyx_t_8, (PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_get_objectives); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1145, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_getObjectives, __pyx_t_8) < 0) __PYX_ERR(3, 1145, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_AMPL);

  /* "amplpy/ampl.pyx":1146
 *     getObjective = get_objective
 *     getObjectives = get_objectives
 *     getOption = get_option             # <<<<<<<<<<<<<<
 *     getOutput = get_output
 *     getOutputHandler = get_output_handler
 */
  __Pyx_GetNameInClass(__pyx_t_8, (PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_get_option); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1146, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_getOption, __pyx_t_8) < 0) __PYX_ERR(3, 1146, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_AMPL);

  /* "amplpy/ampl.pyx":1147
 *     getObjectives = get_objectives
 *     getOption = get_option
 *     getOutput = get_output             # <<<<<<<<<<<<<<
 *     getOutputHandler = get_output_handler
 *     getParameter = get_parameter
 */
  __Pyx_GetNameInClass(__pyx_t_8, (PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_get_output); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1147, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_getOutput, __pyx_t_8) < 0) __PYX_ERR(3, 1147, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_AMPL);

  /* "amplpy/ampl.pyx":1148
 *     getOption = get_option
 *     getOutput = get_output
 *     getOutputHandler = get_output_handler             # <<<<<<<<<<<<<<
 *     getParameter = get_parameter
 *     getParameters = get_parameters
 */
  __Pyx_GetNameInClass(__pyx_t_8, (PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_get_output_handler); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_getOutputHandler, __pyx_t_8) < 0) __PYX_ERR(3, 1148, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_AMPL);

  /* "amplpy/ampl.pyx":1149
 *     getOutput = get_output
 *     getOutputHandler = get_output_handler
 *     getParameter = get_parameter             # <<<<<<<<<<<<<<
 *     getParameters = get_parameters
 *     getSet = get_set
 */
  __Pyx_GetNameInClass(__pyx_t_8, (PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_get_parameter); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1149, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_getParameter, __pyx_t_8) < 0) __PYX_ERR(3, 1149, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_AMPL);

  /* "amplpy/ampl.pyx":1150
 *     getOutputHandler = get_output_handler
 *     getParameter = get_parameter
 *     getParameters = get_parameters             # <<<<<<<<<<<<<<
 *     getSet = get_set
 *     getSets = get_sets
 */
  __Pyx_GetNameInClass(__pyx_t_8, (PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_get_parameters); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1150, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_getParameters, __pyx_t_8) < 0) __PYX_ERR(3, 1150, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_AMPL);

  /* "amplpy/ampl.pyx":1151
 *     getParameter = get_parameter
 *     getParameters = get_parameters
 *     getSet = get_set             # <<<<<<<<<<<<<<
 *     getSets = get_sets
 *     getValue = get_value
 */
  __Pyx_GetNameInClass(__pyx_t_8, (PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_get_set); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1151, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_getSet, __pyx_t_8) < 0) __PYX_ERR(3, 1151, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_AMPL);

  /* "amplpy/ampl.pyx":1152
 *     getParameters = get_parameters
 *     getSet = get_set
 *     getSets = get_sets             # <<<<<<<<<<<<<<
 *     getValue = get_value
 *     getVariable = get_variable
 */
  __Pyx_GetNameInClass(__pyx_t_8, (PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_get_sets); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1152, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_getSets, __pyx_t_8) < 0) __PYX_ERR(3, 1152, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_AMPL);

  /* "amplpy/ampl.pyx":1153
 *     getSet = get_set
 *     getSets = get_sets
 *     getValue = get_value             # <<<<<<<<<<<<<<
 *     getVariable = get_variable
 *     getVariables = get_variables
 */
  __Pyx_GetNameInClass(__pyx_t_8, (PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_get_value); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1153, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_getValue, __pyx_t_8) < 0) __PYX_ERR(3, 1153, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_AMPL);

  /* "amplpy/ampl.pyx":1154
 *     getSets = get_sets
 *     getValue = get_value
 *     getVariable = get_variable             # <<<<<<<<<<<<<<
 *     getVariables = get_variables
 *     isRunning = is_running
 */
  __Pyx_GetNameInClass(__pyx_t_8, (PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_get_variable); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1154, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_getVariable, __pyx_t_8) < 0) __PYX_ERR(3, 1154, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_AMPL);

  /* "amplpy/ampl.pyx":1155
 *     getValue = get_value
 *     getVariable = get_variable
 *     getVariables = get_variables             # <<<<<<<<<<<<<<
 *     isRunning = is_running
 *     readData = read_data
 */
  __Pyx_GetNameInClass(__pyx_t_8, (PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_get_variables); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1155, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_getVariables, __pyx_t_8) < 0) __PYX_ERR(3, 1155, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_AMPL);

  /* "amplpy/ampl.pyx":1156
 *     getVariable = get_variable
 *     getVariables = get_variables
 *     isRunning = is_running             # <<<<<<<<<<<<<<
 *     readData = read_data
 *     readTable = read_table
 */
  __Pyx_GetNameInClass(__pyx_t_8, (PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_is_running); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1156, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_isRunning, __pyx_t_8) < 0) __PYX_ERR(3, 1156, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_AMPL);

  /* "amplpy/ampl.pyx":1157
 *     getVariables = get_variables
 *     isRunning = is_running
 *     readData = read_data             # <<<<<<<<<<<<<<
 *     readTable = read_table
 *     setData = set_data
 */
  __Pyx_GetNameInClass(__pyx_t_8, (PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_read_data); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1157, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_readData, __pyx_t_8) < 0) __PYX_ERR(3, 1157, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_AMPL);

  /* "amplpy/ampl.pyx":1158
 *     isRunning = is_running
 *     readData = read_data
 *     readTable = read_table             # <<<<<<<<<<<<<<
 *     setData = set_data
 *     setErrorHandler = set_error_handler
 */
  __Pyx_GetNameInClass(__pyx_t_8, (PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_read_table); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1158, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_readTable, __pyx_t_8) < 0) __PYX_ERR(3, 1158, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_AMPL);

  /* "amplpy/ampl.pyx":1159
 *     readData = read_data
 *     readTable = read_table
 *     setData = set_data             # <<<<<<<<<<<<<<
 *     setErrorHandler = set_error_handler
 *     setOption = set_option
 */
  __Pyx_GetNameInClass(__pyx_t_8, (PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_set_data); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1159, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_setData, __pyx_t_8) < 0) __PYX_ERR(3, 1159, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_AMPL);

  /* "amplpy/ampl.pyx":1160
 *     readTable = read_table
 *     setData = set_data
 *     setErrorHandler = set_error_handler             # <<<<<<<<<<<<<<
 *     setOption = set_option
 *     setOutputHandler = set_output_handler
 */
  __Pyx_GetNameInClass(__pyx_t_8, (PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_set_error_handler); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1160, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_setErrorHandler, __pyx_t_8) < 0) __PYX_ERR(3, 1160, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_AMPL);

  /* "amplpy/ampl.pyx":1161
 *     setData = set_data
 *     setErrorHandler = set_error_handler
 *     setOption = set_option             # <<<<<<<<<<<<<<
 *     setOutputHandler = set_output_handler
 *     writeTable = write_table
 */
  __Pyx_GetNameInClass(__pyx_t_8, (PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_set_option); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1161, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_setOption, __pyx_t_8) < 0) __PYX_ERR(3, 1161, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_AMPL);

  /* "amplpy/ampl.pyx":1162
 *     setErrorHandler = set_error_handler
 *     setOption = set_option
 *     setOutputHandler = set_output_handler             # <<<<<<<<<<<<<<
 *     writeTable = write_table
 */
  __Pyx_GetNameInClass(__pyx_t_8, (PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_set_output_handler); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1162, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_setOutputHandler, __pyx_t_8) < 0) __PYX_ERR(3, 1162, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_AMPL);

  /* "amplpy/ampl.pyx":1163
 *     setOption = set_option
 *     setOutputHandler = set_output_handler
 *     writeTable = write_table             # <<<<<<<<<<<<<<
 */
  __Pyx_GetNameInClass(__pyx_t_8, (PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_write_table); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1163, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7_amplpy_AMPL, __pyx_n_s_writeTable, __pyx_t_8) < 0) __PYX_ERR(3, 1163, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  PyType_Modified(__pyx_ptype_7_amplpy_AMPL);

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._c_ampl cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_4AMPL_101__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AMPL___reduce_cython, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__385)); if (unlikely(!__pyx_t_8)) __PYX_ERR(8, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_8) < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._c_ampl cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._c_ampl cannot be converted to a Python object for pickling"
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_4AMPL_103__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AMPL___setstate_cython, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__386)); if (unlikely(!__pyx_t_8)) __PYX_ERR(8, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_8) < 0) __PYX_ERR(8, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "(tree fragment)":1
 * def __pyx_unpickle_ErrorHandler(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_5__pyx_unpickle_ErrorHandler, 0, __pyx_n_s_pyx_unpickle_ErrorHandler, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__388)); if (unlikely(!__pyx_t_8)) __PYX_ERR(8, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_ErrorHandler, __pyx_t_8) < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "(tree fragment)":11
 *         __pyx_unpickle_ErrorHandler__set_state(<ErrorHandler> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_ErrorHandler__set_state(ErrorHandler __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[0])
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7_amplpy_7__pyx_unpickle_OutputHandler, 0, __pyx_n_s_pyx_unpickle_OutputHandler, NULL, __pyx_n_s_amplpy, __pyx_d, ((PyObject *)__pyx_codeobj__389)); if (unlikely(!__pyx_t_8)) __PYX_ERR(8, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_OutputHandler, __pyx_t_8) < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "amplpy/ampl.pyx":1
 * # https://cython.readthedocs.io/en/latest/src/tutorial/clibraries.html             # <<<<<<<<<<<<<<
 * import sys
 * 
 */
  __pyx_t_8 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_8) < 0) __PYX_ERR(3, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

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

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  if (__pyx_m) {
    if (__pyx_d && stringtab_initialized) {
      __Pyx_AddTraceback("init _amplpy", __pyx_clineno, __pyx_lineno, __pyx_filename);
    }
    #if !CYTHON_USE_MODULE_STATE
    Py_CLEAR(__pyx_m);
    #else
    Py_DECREF(__pyx_m);
    if (pystate_addmodule_run) {
      PyObject *tp, *value, *tb;
      PyErr_Fetch(&tp, &value, &tb);
      PyState_RemoveModule(&__pyx_moduledef);
      PyErr_Restore(tp, value, tb);
    }
    #endif
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init _amplpy");
  }
  __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
}
/* #### Code section: cleanup_globals ### */
/* #### Code section: cleanup_module ### */
/* #### Code section: main_method ### */
/* #### Code section: utility_code_pragmas ### */
#ifdef _MSC_VER
#pragma warning( push )
/* Warning 4127: conditional expression is constant
 * Cython uses constant conditional expressions to allow in inline functions to be optimized at
 * compile-time, so this warning is not useful
 */
#pragma warning( disable : 4127 )
#endif



/* #### Code section: utility_code_def ### */

/* --- 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(modname);
    if (!m) goto end;
    p = PyObject_GetAttrString(m, "RefNannyAPI");
    if (!p) goto end;
    r = PyLong_AsVoidPtr(p);
end:
    Py_XDECREF(p);
    Py_XDECREF(m);
    return (__Pyx_RefNannyAPIStruct *)r;
}
#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) {
    int result;
    PyObject *exc_type;
#if PY_VERSION_HEX >= 0x030C00A6
    PyObject *current_exception = tstate->current_exception;
    if (unlikely(!current_exception)) return 0;
    exc_type = (PyObject*) Py_TYPE(current_exception);
    if (exc_type == err) return 1;
#else
    exc_type = tstate->curexc_type;
    if (exc_type == err) return 1;
    if (unlikely(!exc_type)) return 0;
#endif
    #if CYTHON_AVOID_BORROWED_REFS
    Py_INCREF(exc_type);
    #endif
    if (unlikely(PyTuple_Check(err))) {
        result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
    } else {
        result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
    }
    #if CYTHON_AVOID_BORROWED_REFS
    Py_DECREF(exc_type);
    #endif
    return result;
}
#endif

/* PyErrFetchRestore */
#if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
#if PY_VERSION_HEX >= 0x030C00A6
    PyObject *tmp_value;
    assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value)));
    if (value) {
        #if CYTHON_COMPILING_IN_CPYTHON
        if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb))
        #endif
            PyException_SetTraceback(value, tb);
    }
    tmp_value = tstate->current_exception;
    tstate->current_exception = value;
    Py_XDECREF(tmp_value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
#else
    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);
#endif
}
static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
#if PY_VERSION_HEX >= 0x030C00A6
    PyObject* exc_value;
    exc_value = tstate->current_exception;
    tstate->current_exception = 0;
    *value = exc_value;
    *type = NULL;
    *tb = NULL;
    if (exc_value) {
        *type = (PyObject*) Py_TYPE(exc_value);
        Py_INCREF(*type);
        #if CYTHON_COMPILING_IN_CPYTHON
        *tb = ((PyBaseExceptionObject*) exc_value)->traceback;
        Py_XINCREF(*tb);
        #else
        *tb = PyException_GetTraceback(exc_value);
        #endif
    }
#else
    *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
}
#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

/* PyObjectGetAttrStrNoError */
#if __PYX_LIMITED_VERSION_HEX < 0x030d00A1
static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
        __Pyx_PyErr_Clear();
}
#endif
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
    PyObject *result;
#if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1
    (void) PyObject_GetOptionalAttr(obj, attr_name, &result);
    return result;
#else
#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
        return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
    }
#endif
    result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
    if (unlikely(!result)) {
        __Pyx_PyObject_GetAttrStr_ClearAttributeError();
    }
    return result;
#endif
}

/* GetBuiltinName */
static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
    PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name);
    if (unlikely(!result) && !PyErr_Occurred()) {
        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;
}

/* PyDictVersioning */
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
    PyObject *dict = Py_TYPE(obj)->tp_dict;
    return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
}
static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
    PyObject **dictptr = NULL;
    Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
    if (offset) {
#if CYTHON_COMPILING_IN_CPYTHON
        dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
#else
        dictptr = _PyObject_GetDictPtr(obj);
#endif
    }
    return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
}
static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
    PyObject *dict = Py_TYPE(obj)->tp_dict;
    if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
        return 0;
    return obj_dict_version == __Pyx_get_object_dict_version(obj);
}
#endif

/* GetModuleGlobalName */
#if CYTHON_USE_DICT_VERSIONS
static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
#else
static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
#endif
{
    PyObject *result;
#if !CYTHON_AVOID_BORROWED_REFS
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000
    result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
    __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
    if (likely(result)) {
        return __Pyx_NewRef(result);
    } else if (unlikely(PyErr_Occurred())) {
        return NULL;
    }
#elif CYTHON_COMPILING_IN_LIMITED_API
    if (unlikely(!__pyx_m)) {
        return NULL;
    }
    result = PyObject_GetAttr(__pyx_m, name);
    if (likely(result)) {
        return result;
    }
#else
    result = PyDict_GetItem(__pyx_d, name);
    __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
    if (likely(result)) {
        return __Pyx_NewRef(result);
    }
#endif
#else
    result = PyObject_GetItem(__pyx_d, name);
    __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
    if (likely(result)) {
        return __Pyx_NewRef(result);
    }
    PyErr_Clear();
#endif
    return __Pyx_GetBuiltinName(name);
}

/* decode_c_string */
static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
         const char* cstring, Py_ssize_t start, Py_ssize_t stop,
         const char* encoding, const char* errors,
         PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
    Py_ssize_t length;
    if (unlikely((start < 0) | (stop < 0))) {
        size_t slen = strlen(cstring);
        if (unlikely(slen > (size_t) PY_SSIZE_T_MAX)) {
            PyErr_SetString(PyExc_OverflowError,
                            "c-string too long to convert to Python");
            return NULL;
        }
        length = (Py_ssize_t) slen;
        if (start < 0) {
            start += length;
            if (start < 0)
                start = 0;
        }
        if (stop < 0)
            stop += length;
    }
    if (unlikely(stop <= start))
        return __Pyx_NewRef(__pyx_empty_unicode);
    length = stop - start;
    cstring += start;
    if (decode_func) {
        return decode_func(cstring, length, errors);
    } else {
        return PyUnicode_Decode(cstring, length, encoding, errors);
    }
}

/* PyFunctionFastCall */
#if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL
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 = __Pyx_PyFrame_GetLocalsplus(f);
    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;
}
static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t 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_MAJOR_VERSION < 3
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) {
        return NULL;
    }
    #else
    if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) {
        return NULL;
    }
    #endif
    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, (int)nargs,
                               k, (int)nk,
                               d, (int)nd, kwdefs, closure);
#else
    result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
                               args, (int)nargs,
                               k, (int)nk,
                               d, (int)nd, closure);
#endif
    Py_XDECREF(kwtuple);
done:
    Py_LeaveRecursiveCall();
    return result;
}
#endif

/* PyObjectCall */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    PyObject *result;
    ternaryfunc call = Py_TYPE(func)->tp_call;
    if (unlikely(!call))
        return PyObject_Call(func, arg, kw);
    #if PY_MAJOR_VERSION < 3
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
        return NULL;
    #else
    if (unlikely(Py_EnterRecursiveCall(" while calling a Python object")))
        return NULL;
    #endif
    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

/* PyObjectCallMethO */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
    PyObject *self, *result;
    PyCFunction cfunc;
    cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func);
    self = __Pyx_CyOrPyCFunction_GET_SELF(func);
    #if PY_MAJOR_VERSION < 3
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
        return NULL;
    #else
    if (unlikely(Py_EnterRecursiveCall(" while calling a Python object")))
        return NULL;
    #endif
    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

/* PyObjectFastCall */
#if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API
static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) {
    PyObject *argstuple;
    PyObject *result = 0;
    size_t i;
    argstuple = PyTuple_New((Py_ssize_t)nargs);
    if (unlikely(!argstuple)) return NULL;
    for (i = 0; i < nargs; i++) {
        Py_INCREF(args[i]);
        if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad;
    }
    result = __Pyx_PyObject_Call(func, argstuple, kwargs);
  bad:
    Py_DECREF(argstuple);
    return result;
}
#endif
static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) {
    Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs);
#if CYTHON_COMPILING_IN_CPYTHON
    if (nargs == 0 && kwargs == NULL) {
        if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS))
            return __Pyx_PyObject_CallMethO(func, NULL);
    }
    else if (nargs == 1 && kwargs == NULL) {
        if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O))
            return __Pyx_PyObject_CallMethO(func, args[0]);
    }
#endif
    #if PY_VERSION_HEX < 0x030800B1
    #if CYTHON_FAST_PYCCALL
    if (PyCFunction_Check(func)) {
        if (kwargs) {
            return _PyCFunction_FastCallDict(func, args, nargs, kwargs);
        } else {
            return _PyCFunction_FastCallKeywords(func, args, nargs, NULL);
        }
    }
    #if PY_VERSION_HEX >= 0x030700A1
    if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) {
        return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL);
    }
    #endif
    #endif
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(func)) {
        return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs);
    }
    #endif
    #endif
    if (kwargs == NULL) {
        #if CYTHON_VECTORCALL
        #if PY_VERSION_HEX < 0x03090000
        vectorcallfunc f = _PyVectorcall_Function(func);
        #else
        vectorcallfunc f = PyVectorcall_Function(func);
        #endif
        if (f) {
            return f(func, args, (size_t)nargs, NULL);
        }
        #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL
        if (__Pyx_CyFunction_CheckExact(func)) {
            __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func);
            if (f) return f(func, args, (size_t)nargs, NULL);
        }
        #endif
    }
    if (nargs == 0) {
        return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs);
    }
    #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API
    return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs);
    #else
    return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs);
    #endif
}

/* RaiseException */
#if PY_MAJOR_VERSION < 3
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
    __Pyx_PyThreadState_declare
    CYTHON_UNUSED_VAR(cause);
    Py_XINCREF(type);
    if (!value || value == Py_None)
        value = NULL;
    else
        Py_INCREF(value);
    if (!tb || tb == Py_None)
        tb = NULL;
    else {
        Py_INCREF(tb);
        if (!PyTraceBack_Check(tb)) {
            PyErr_SetString(PyExc_TypeError,
                "raise: arg 3 must be a traceback or None");
            goto raise_error;
        }
    }
    if (PyType_Check(type)) {
#if CYTHON_COMPILING_IN_PYPY
        if (!value) {
            Py_INCREF(Py_None);
            value = Py_None;
        }
#endif
        PyErr_NormalizeException(&type, &value, &tb);
    } else {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto raise_error;
        }
        value = type;
        type = (PyObject*) Py_TYPE(type);
        Py_INCREF(type);
        if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
            PyErr_SetString(PyExc_TypeError,
                "raise: exception class must be a subclass of BaseException");
            goto raise_error;
        }
    }
    __Pyx_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 PY_VERSION_HEX >= 0x030C00A6
        PyException_SetTraceback(value, tb);
      #elif CYTHON_FAST_THREAD_STATE
        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);
        }
#else
        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);
#endif
    }
bad:
    Py_XDECREF(owned_instance);
    return;
}
#endif

/* PyObjectCallOneArg */
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject *args[2] = {NULL, arg};
    return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
}

/* GetItemInt */
static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
    PyObject *r;
    if (unlikely(!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(__Pyx_is_valid_index(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(__Pyx_is_valid_index(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(__Pyx_is_valid_index(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(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
            PyObject *r = PyTuple_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    } else {
        PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping;
        PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence;
        if (mm && mm->mp_subscript) {
            PyObject *r, *key = PyInt_FromSsize_t(i);
            if (unlikely(!key)) return NULL;
            r = mm->mp_subscript(o, key);
            Py_DECREF(key);
            return r;
        }
        if (likely(sm && sm->sq_item)) {
            if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) {
                Py_ssize_t l = sm->sq_length(o);
                if (likely(l >= 0)) {
                    i += l;
                } else {
                    if (!PyErr_ExceptionMatches(PyExc_OverflowError))
                        return NULL;
                    PyErr_Clear();
                }
            }
            return sm->sq_item(o, i);
        }
    }
#else
    if (is_list || !PyMapping_Check(o)) {
        return PySequence_GetItem(o, i);
    }
#endif
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
}

/* ModFloat[double] */
static CYTHON_INLINE double __Pyx_mod_double(double a, double b) {
    double r = fmod(a, b);
    r += ((r != 0) & ((r < 0) ^ (b < 0))) * b;
    return r;
}

/* PyIntFromDouble */
#if PY_MAJOR_VERSION < 3
static CYTHON_INLINE PyObject* __Pyx_PyInt_FromDouble(double value) {
    if (value >= (double)LONG_MIN && value <= (double)LONG_MAX) {
        return PyInt_FromLong((long)value);
    }
    return PyLong_FromDouble(value);
}
#endif

/* PyObjectCallNoArg */
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
    PyObject *arg[2] = {NULL, NULL};
    return __Pyx_PyObject_FastCall(func, arg + 1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
}

/* TupleAndListFromArray */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) {
    PyObject *v;
    Py_ssize_t i;
    for (i = 0; i < length; i++) {
        v = dest[i] = src[i];
        Py_INCREF(v);
    }
}
static CYTHON_INLINE PyObject *
__Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n)
{
    PyObject *res;
    if (n <= 0) {
        Py_INCREF(__pyx_empty_tuple);
        return __pyx_empty_tuple;
    }
    res = PyTuple_New(n);
    if (unlikely(res == NULL)) return NULL;
    __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n);
    return res;
}
static CYTHON_INLINE PyObject *
__Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n)
{
    PyObject *res;
    if (n <= 0) {
        return PyList_New(0);
    }
    res = PyList_New(n);
    if (unlikely(res == NULL)) return NULL;
    __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n);
    return res;
}
#endif

/* BytesEquals */
static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API
    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_VERSION_HEX < 0x030B0000)
            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 || CYTHON_COMPILING_IN_LIMITED_API
    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
}

/* fastcall */
#if CYTHON_METH_FASTCALL
static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s)
{
    Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames);
    for (i = 0; i < n; i++)
    {
        if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i];
    }
    for (i = 0; i < n; i++)
    {
        int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ);
        if (unlikely(eq != 0)) {
            if (unlikely(eq < 0)) return NULL;
            return kwvalues[i];
        }
    }
    return NULL;
}
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000
CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) {
    Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames);
    PyObject *dict;
    dict = PyDict_New();
    if (unlikely(!dict))
        return NULL;
    for (i=0; i<nkwargs; i++) {
        PyObject *key = PyTuple_GET_ITEM(kwnames, i);
        if (unlikely(PyDict_SetItem(dict, key, kwvalues[i]) < 0))
            goto bad;
    }
    return dict;
bad:
    Py_DECREF(dict);
    return NULL;
}
#endif
#endif

/* RaiseArgTupleInvalid */
static void __Pyx_RaiseArgtupleInvalid(
    const char* func_name,
    int exact,
    Py_ssize_t num_min,
    Py_ssize_t num_max,
    Py_ssize_t num_found)
{
    Py_ssize_t num_expected;
    const char *more_or_less;
    if (num_found < num_min) {
        num_expected = num_min;
        more_or_less = "at least";
    } else {
        num_expected = num_max;
        more_or_less = "at most";
    }
    if (exact) {
        more_or_less = "exactly";
    }
    PyErr_Format(PyExc_TypeError,
                 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
                 func_name, more_or_less, num_expected,
                 (num_expected == 1) ? "" : "s", num_found);
}

/* KeywordStringCheck */
static int __Pyx_CheckKeywordStrings(
    PyObject *kw,
    const char* function_name,
    int kw_allowed)
{
    PyObject* key = 0;
    Py_ssize_t pos = 0;
#if CYTHON_COMPILING_IN_PYPY
    if (!kw_allowed && PyDict_Next(kw, &pos, &key, 0))
        goto invalid_keyword;
    return 1;
#else
    if (CYTHON_METH_FASTCALL && likely(PyTuple_Check(kw))) {
        Py_ssize_t kwsize;
#if CYTHON_ASSUME_SAFE_MACROS
        kwsize = PyTuple_GET_SIZE(kw);
#else
        kwsize = PyTuple_Size(kw);
        if (kwsize < 0) return 0;
#endif
        if (unlikely(kwsize == 0))
            return 1;
        if (!kw_allowed) {
#if CYTHON_ASSUME_SAFE_MACROS
            key = PyTuple_GET_ITEM(kw, 0);
#else
            key = PyTuple_GetItem(kw, pos);
            if (!key) return 0;
#endif
            goto invalid_keyword;
        }
#if PY_VERSION_HEX < 0x03090000
        for (pos = 0; pos < kwsize; pos++) {
#if CYTHON_ASSUME_SAFE_MACROS
            key = PyTuple_GET_ITEM(kw, pos);
#else
            key = PyTuple_GetItem(kw, pos);
            if (!key) return 0;
#endif
            if (unlikely(!PyUnicode_Check(key)))
                goto invalid_keyword_type;
        }
#endif
        return 1;
    }
    while (PyDict_Next(kw, &pos, &key, 0)) {
        #if PY_MAJOR_VERSION < 3
        if (unlikely(!PyString_Check(key)))
        #endif
            if (unlikely(!PyUnicode_Check(key)))
                goto invalid_keyword_type;
    }
    if (!kw_allowed && unlikely(key))
        goto invalid_keyword;
    return 1;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%.200s() keywords must be strings", function_name);
    return 0;
#endif
invalid_keyword:
    #if PY_MAJOR_VERSION < 3
    PyErr_Format(PyExc_TypeError,
        "%.200s() got an unexpected keyword argument '%.200s'",
        function_name, PyString_AsString(key));
    #else
    PyErr_Format(PyExc_TypeError,
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
    return 0;
}

/* GetTopmostException */
#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE
static _PyErr_StackItem *
__Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
{
    _PyErr_StackItem *exc_info = tstate->exc_info;
    while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) &&
           exc_info->previous_item != NULL)
    {
        exc_info = exc_info->previous_item;
    }
    return exc_info;
}
#endif

/* SaveResetException */
#if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
  #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
    _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
    PyObject *exc_value = exc_info->exc_value;
    if (exc_value == NULL || exc_value == Py_None) {
        *value = NULL;
        *type = NULL;
        *tb = NULL;
    } else {
        *value = exc_value;
        Py_INCREF(*value);
        *type = (PyObject*) Py_TYPE(exc_value);
        Py_INCREF(*type);
        *tb = PyException_GetTraceback(exc_value);
    }
  #elif CYTHON_USE_EXC_INFO_STACK
    _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
    *type = exc_info->exc_type;
    *value = exc_info->exc_value;
    *tb = exc_info->exc_traceback;
    Py_XINCREF(*type);
    Py_XINCREF(*value);
    Py_XINCREF(*tb);
  #else
    *type = tstate->exc_type;
    *value = tstate->exc_value;
    *tb = tstate->exc_traceback;
    Py_XINCREF(*type);
    Py_XINCREF(*value);
    Py_XINCREF(*tb);
  #endif
}
static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
  #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
    _PyErr_StackItem *exc_info = tstate->exc_info;
    PyObject *tmp_value = exc_info->exc_value;
    exc_info->exc_value = value;
    Py_XDECREF(tmp_value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
  #else
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    #if CYTHON_USE_EXC_INFO_STACK
    _PyErr_StackItem *exc_info = tstate->exc_info;
    tmp_type = exc_info->exc_type;
    tmp_value = exc_info->exc_value;
    tmp_tb = exc_info->exc_traceback;
    exc_info->exc_type = type;
    exc_info->exc_value = value;
    exc_info->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
}
#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 = NULL, *local_value, *local_tb = NULL;
#if CYTHON_FAST_THREAD_STATE
    PyObject *tmp_type, *tmp_value, *tmp_tb;
  #if PY_VERSION_HEX >= 0x030C00A6
    local_value = tstate->current_exception;
    tstate->current_exception = 0;
    if (likely(local_value)) {
        local_type = (PyObject*) Py_TYPE(local_value);
        Py_INCREF(local_type);
        local_tb = PyException_GetTraceback(local_value);
    }
  #else
    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;
  #endif
#else
    PyErr_Fetch(&local_type, &local_value, &local_tb);
#endif
    PyErr_NormalizeException(&local_type, &local_value, &local_tb);
#if CYTHON_FAST_THREAD_STATE && PY_VERSION_HEX >= 0x030C00A6
    if (unlikely(tstate->current_exception))
#elif 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 CYTHON_USE_EXC_INFO_STACK
    {
        _PyErr_StackItem *exc_info = tstate->exc_info;
      #if PY_VERSION_HEX >= 0x030B00a4
        tmp_value = exc_info->exc_value;
        exc_info->exc_value = local_value;
        tmp_type = NULL;
        tmp_tb = NULL;
        Py_XDECREF(local_type);
        Py_XDECREF(local_tb);
      #else
        tmp_type = exc_info->exc_type;
        tmp_value = exc_info->exc_value;
        tmp_tb = exc_info->exc_traceback;
        exc_info->exc_type = local_type;
        exc_info->exc_value = local_value;
        exc_info->exc_traceback = local_tb;
      #endif
    }
    #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;
}

/* 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 *const *kwvalues,
    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;
    int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds));
    while (1) {
        Py_XDECREF(key); key = NULL;
        Py_XDECREF(value); value = NULL;
        if (kwds_is_tuple) {
            Py_ssize_t size;
#if CYTHON_ASSUME_SAFE_MACROS
            size = PyTuple_GET_SIZE(kwds);
#else
            size = PyTuple_Size(kwds);
            if (size < 0) goto bad;
#endif
            if (pos >= size) break;
#if CYTHON_AVOID_BORROWED_REFS
            key = __Pyx_PySequence_ITEM(kwds, pos);
            if (!key) goto bad;
#elif CYTHON_ASSUME_SAFE_MACROS
            key = PyTuple_GET_ITEM(kwds, pos);
#else
            key = PyTuple_GetItem(kwds, pos);
            if (!key) goto bad;
#endif
            value = kwvalues[pos];
            pos++;
        }
        else
        {
            if (!PyDict_Next(kwds, &pos, &key, &value)) break;
#if CYTHON_AVOID_BORROWED_REFS
            Py_INCREF(key);
#endif
        }
        name = first_kw_arg;
        while (*name && (**name != key)) name++;
        if (*name) {
            values[name-argnames] = value;
#if CYTHON_AVOID_BORROWED_REFS
            Py_INCREF(value);
            Py_DECREF(key);
#endif
            key = NULL;
            value = NULL;
            continue;
        }
#if !CYTHON_AVOID_BORROWED_REFS
        Py_INCREF(key);
#endif
        Py_INCREF(value);
        name = first_kw_arg;
        #if PY_MAJOR_VERSION < 3
        if (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;
#if CYTHON_AVOID_BORROWED_REFS
                    value = NULL;
#endif
                    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 = (
                #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                    (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
                #endif
                    PyUnicode_Compare(**name, key)
                );
                if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
                if (cmp == 0) {
                    values[name-argnames] = value;
#if CYTHON_AVOID_BORROWED_REFS
                    value = NULL;
#endif
                    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
                        (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(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;
        }
    }
    Py_XDECREF(key);
    Py_XDECREF(value);
    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:
    #if PY_MAJOR_VERSION < 3
    PyErr_Format(PyExc_TypeError,
        "%.200s() got an unexpected keyword argument '%.200s'",
        function_name, PyString_AsString(key));
    #else
    PyErr_Format(PyExc_TypeError,
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
bad:
    Py_XDECREF(key);
    Py_XDECREF(value);
    return -1;
}

/* pybytes_as_double */
static double __Pyx_SlowPyString_AsDouble(PyObject *obj) {
    PyObject *float_value;
#if PY_MAJOR_VERSION >= 3
    float_value = PyFloat_FromString(obj);
#else
    float_value = PyFloat_FromString(obj, 0);
#endif
    if (likely(float_value)) {
#if CYTHON_ASSUME_SAFE_MACROS
        double value = PyFloat_AS_DOUBLE(float_value);
#else
        double value = PyFloat_AsDouble(float_value);
#endif
        Py_DECREF(float_value);
        return value;
    }
    return (double)-1;
}
static const char* __Pyx__PyBytes_AsDouble_Copy(const char* start, char* buffer, Py_ssize_t length) {
    int last_was_punctuation = 1;
    Py_ssize_t i;
    for (i=0; i < length; i++) {
        char chr = start[i];
        int is_punctuation = (chr == '_') | (chr == '.') | (chr == 'e') | (chr == 'E');
        *buffer = chr;
        buffer += (chr != '_');
        if (unlikely(last_was_punctuation & is_punctuation)) goto parse_failure;
        last_was_punctuation = is_punctuation;
    }
    if (unlikely(last_was_punctuation)) goto parse_failure;
    *buffer = '\0';
    return buffer;
parse_failure:
    return NULL;
}
static double __Pyx__PyBytes_AsDouble_inf_nan(const char* start, Py_ssize_t length) {
    int matches = 1;
    char sign = start[0];
    int is_signed = (sign == '+') | (sign == '-');
    start += is_signed;
    length -= is_signed;
    switch (start[0]) {
        #ifdef Py_NAN
        case 'n':
        case 'N':
            if (unlikely(length != 3)) goto parse_failure;
            matches &= (start[1] == 'a' || start[1] == 'A');
            matches &= (start[2] == 'n' || start[2] == 'N');
            if (unlikely(!matches)) goto parse_failure;
            return (sign == '-') ? -Py_NAN : Py_NAN;
        #endif
        case 'i':
        case 'I':
            if (unlikely(length < 3)) goto parse_failure;
            matches &= (start[1] == 'n' || start[1] == 'N');
            matches &= (start[2] == 'f' || start[2] == 'F');
            if (likely(length == 3 && matches))
                return (sign == '-') ? -Py_HUGE_VAL : Py_HUGE_VAL;
            if (unlikely(length != 8)) goto parse_failure;
            matches &= (start[3] == 'i' || start[3] == 'I');
            matches &= (start[4] == 'n' || start[4] == 'N');
            matches &= (start[5] == 'i' || start[5] == 'I');
            matches &= (start[6] == 't' || start[6] == 'T');
            matches &= (start[7] == 'y' || start[7] == 'Y');
            if (unlikely(!matches)) goto parse_failure;
            return (sign == '-') ? -Py_HUGE_VAL : Py_HUGE_VAL;
        case '.': case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9':
            break;
        default:
            goto parse_failure;
    }
    return 0.0;
parse_failure:
    return -1.0;
}
static CYTHON_INLINE int __Pyx__PyBytes_AsDouble_IsSpace(char ch) {
    return (ch == 0x20) | !((ch < 0x9) | (ch > 0xd));
}
CYTHON_UNUSED static double __Pyx__PyBytes_AsDouble(PyObject *obj, const char* start, Py_ssize_t length) {
    double value;
    Py_ssize_t i, digits;
    const char *last = start + length;
    char *end;
    while (__Pyx__PyBytes_AsDouble_IsSpace(*start))
        start++;
    while (start < last - 1 && __Pyx__PyBytes_AsDouble_IsSpace(last[-1]))
        last--;
    length = last - start;
    if (unlikely(length <= 0)) goto fallback;
    value = __Pyx__PyBytes_AsDouble_inf_nan(start, length);
    if (unlikely(value == -1.0)) goto fallback;
    if (value != 0.0) return value;
    digits = 0;
    for (i=0; i < length; digits += start[i++] != '_');
    if (likely(digits == length)) {
        value = PyOS_string_to_double(start, &end, NULL);
    } else if (digits < 40) {
        char number[40];
        last = __Pyx__PyBytes_AsDouble_Copy(start, number, length);
        if (unlikely(!last)) goto fallback;
        value = PyOS_string_to_double(number, &end, NULL);
    } else {
        char *number = (char*) PyMem_Malloc((digits + 1) * sizeof(char));
        if (unlikely(!number)) goto fallback;
        last = __Pyx__PyBytes_AsDouble_Copy(start, number, length);
        if (unlikely(!last)) {
            PyMem_Free(number);
            goto fallback;
        }
        value = PyOS_string_to_double(number, &end, NULL);
        PyMem_Free(number);
    }
    if (likely(end == last) || (value == (double)-1 && PyErr_Occurred())) {
        return value;
    }
fallback:
    return __Pyx_SlowPyString_AsDouble(obj);
}

/* pyobject_as_double */
static double __Pyx__PyObject_AsDouble(PyObject* obj) {
    if (PyUnicode_CheckExact(obj)) {
        return __Pyx_PyUnicode_AsDouble(obj);
    } else if (PyBytes_CheckExact(obj)) {
        return __Pyx_PyBytes_AsDouble(obj);
    } else if (PyByteArray_CheckExact(obj)) {
        return __Pyx_PyByteArray_AsDouble(obj);
    } else {
        PyObject* float_value;
#if !CYTHON_USE_TYPE_SLOTS
        float_value = PyNumber_Float(obj);  if ((0)) goto bad;
        (void)__Pyx_PyObject_CallOneArg;
#else
        PyNumberMethods *nb = Py_TYPE(obj)->tp_as_number;
        if (likely(nb) && likely(nb->nb_float)) {
            float_value = nb->nb_float(obj);
            if (likely(float_value) && unlikely(!PyFloat_Check(float_value))) {
                __Pyx_TypeName float_value_type_name = __Pyx_PyType_GetName(Py_TYPE(float_value));
                PyErr_Format(PyExc_TypeError,
                    "__float__ returned non-float (type " __Pyx_FMT_TYPENAME ")",
                    float_value_type_name);
                __Pyx_DECREF_TypeName(float_value_type_name);
                Py_DECREF(float_value);
                goto bad;
            }
        } else {
            float_value = __Pyx_PyObject_CallOneArg((PyObject*)&PyFloat_Type, obj);
        }
#endif
        if (likely(float_value)) {
            double value = PyFloat_AS_DOUBLE(float_value);
            Py_DECREF(float_value);
            return value;
        }
    }
bad:
    return (double)-1;
}

/* ObjectGetItem */
#if CYTHON_USE_TYPE_SLOTS
static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject *index) {
    PyObject *runerr = NULL;
    Py_ssize_t key_value;
    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)) {
        __Pyx_TypeName index_type_name = __Pyx_PyType_GetName(Py_TYPE(index));
        PyErr_Clear();
        PyErr_Format(PyExc_IndexError,
            "cannot fit '" __Pyx_FMT_TYPENAME "' into an index-sized integer", index_type_name);
        __Pyx_DECREF_TypeName(index_type_name);
    }
    return NULL;
}
static PyObject *__Pyx_PyObject_GetItem_Slow(PyObject *obj, PyObject *key) {
    __Pyx_TypeName obj_type_name;
    if (likely(PyType_Check(obj))) {
        PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(obj, __pyx_n_s_class_getitem);
        if (!meth) {
            PyErr_Clear();
        } else {
            PyObject *result = __Pyx_PyObject_CallOneArg(meth, key);
            Py_DECREF(meth);
            return result;
        }
    }
    obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj));
    PyErr_Format(PyExc_TypeError,
        "'" __Pyx_FMT_TYPENAME "' object is not subscriptable", obj_type_name);
    __Pyx_DECREF_TypeName(obj_type_name);
    return NULL;
}
static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key) {
    PyTypeObject *tp = Py_TYPE(obj);
    PyMappingMethods *mm = tp->tp_as_mapping;
    PySequenceMethods *sm = tp->tp_as_sequence;
    if (likely(mm && mm->mp_subscript)) {
        return mm->mp_subscript(obj, key);
    }
    if (likely(sm && sm->sq_item)) {
        return __Pyx_PyObject_GetIndex(obj, key);
    }
    return __Pyx_PyObject_GetItem_Slow(obj, key);
}
#endif

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

/* RaiseClosureNameError */
static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname) {
    PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname);
}

/* pep479 */
static void __Pyx_Generator_Replace_StopIteration(int in_async_gen) {
    PyObject *exc, *val, *tb, *cur_exc;
    __Pyx_PyThreadState_declare
    #ifdef __Pyx_StopAsyncIteration_USED
    int is_async_stopiteration = 0;
    #endif
    CYTHON_MAYBE_UNUSED_VAR(in_async_gen);
    cur_exc = PyErr_Occurred();
    if (likely(!__Pyx_PyErr_GivenExceptionMatches(cur_exc, PyExc_StopIteration))) {
        #ifdef __Pyx_StopAsyncIteration_USED
        if (in_async_gen && unlikely(__Pyx_PyErr_GivenExceptionMatches(cur_exc, __Pyx_PyExc_StopAsyncIteration))) {
            is_async_stopiteration = 1;
        } else
        #endif
            return;
    }
    __Pyx_PyThreadState_assign
    __Pyx_GetException(&exc, &val, &tb);
    Py_XDECREF(exc);
    Py_XDECREF(val);
    Py_XDECREF(tb);
    PyErr_SetString(PyExc_RuntimeError,
        #ifdef __Pyx_StopAsyncIteration_USED
        is_async_stopiteration ? "async generator raised StopAsyncIteration" :
        in_async_gen ? "async generator raised StopIteration" :
        #endif
        "generator raised StopIteration");
}

/* FixUpExtensionType */
#if CYTHON_USE_TYPE_SPECS
static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) {
#if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
    CYTHON_UNUSED_VAR(spec);
    CYTHON_UNUSED_VAR(type);
#else
    const PyType_Slot *slot = spec->slots;
    while (slot && slot->slot && slot->slot != Py_tp_members)
        slot++;
    if (slot && slot->slot == Py_tp_members) {
        int changed = 0;
#if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON)
        const
#endif
            PyMemberDef *memb = (PyMemberDef*) slot->pfunc;
        while (memb && memb->name) {
            if (memb->name[0] == '_' && memb->name[1] == '_') {
#if PY_VERSION_HEX < 0x030900b1
                if (strcmp(memb->name, "__weaklistoffset__") == 0) {
                    assert(memb->type == T_PYSSIZET);
                    assert(memb->flags == READONLY);
                    type->tp_weaklistoffset = memb->offset;
                    changed = 1;
                }
                else if (strcmp(memb->name, "__dictoffset__") == 0) {
                    assert(memb->type == T_PYSSIZET);
                    assert(memb->flags == READONLY);
                    type->tp_dictoffset = memb->offset;
                    changed = 1;
                }
#if CYTHON_METH_FASTCALL
                else if (strcmp(memb->name, "__vectorcalloffset__") == 0) {
                    assert(memb->type == T_PYSSIZET);
                    assert(memb->flags == READONLY);
#if PY_VERSION_HEX >= 0x030800b4
                    type->tp_vectorcall_offset = memb->offset;
#else
                    type->tp_print = (printfunc) memb->offset;
#endif
                    changed = 1;
                }
#endif
#else
                if ((0));
#endif
#if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON
                else if (strcmp(memb->name, "__module__") == 0) {
                    PyObject *descr;
                    assert(memb->type == T_OBJECT);
                    assert(memb->flags == 0 || memb->flags == READONLY);
                    descr = PyDescr_NewMember(type, memb);
                    if (unlikely(!descr))
                        return -1;
                    if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) {
                        Py_DECREF(descr);
                        return -1;
                    }
                    Py_DECREF(descr);
                    changed = 1;
                }
#endif
            }
            memb++;
        }
        if (changed)
            PyType_Modified(type);
    }
#endif
    return 0;
}
#endif

/* FetchSharedCythonModule */
static PyObject *__Pyx_FetchSharedCythonABIModule(void) {
    return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME);
}

/* FetchCommonType */
static int __Pyx_VerifyCachedType(PyObject *cached_type,
                               const char *name,
                               Py_ssize_t basicsize,
                               Py_ssize_t expected_basicsize) {
    if (!PyType_Check(cached_type)) {
        PyErr_Format(PyExc_TypeError,
            "Shared Cython type %.200s is not a type object", name);
        return -1;
    }
    if (basicsize != expected_basicsize) {
        PyErr_Format(PyExc_TypeError,
            "Shared Cython type %.200s has the wrong size, try recompiling",
            name);
        return -1;
    }
    return 0;
}
#if !CYTHON_USE_TYPE_SPECS
static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
    PyObject* abi_module;
    const char* object_name;
    PyTypeObject *cached_type = NULL;
    abi_module = __Pyx_FetchSharedCythonABIModule();
    if (!abi_module) return NULL;
    object_name = strrchr(type->tp_name, '.');
    object_name = object_name ? object_name+1 : type->tp_name;
    cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name);
    if (cached_type) {
        if (__Pyx_VerifyCachedType(
              (PyObject *)cached_type,
              object_name,
              cached_type->tp_basicsize,
              type->tp_basicsize) < 0) {
            goto bad;
        }
        goto done;
    }
    if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
    PyErr_Clear();
    if (PyType_Ready(type) < 0) goto bad;
    if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0)
        goto bad;
    Py_INCREF(type);
    cached_type = type;
done:
    Py_DECREF(abi_module);
    return cached_type;
bad:
    Py_XDECREF(cached_type);
    cached_type = NULL;
    goto done;
}
#else
static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) {
    PyObject *abi_module, *cached_type = NULL;
    const char* object_name = strrchr(spec->name, '.');
    object_name = object_name ? object_name+1 : spec->name;
    abi_module = __Pyx_FetchSharedCythonABIModule();
    if (!abi_module) return NULL;
    cached_type = PyObject_GetAttrString(abi_module, object_name);
    if (cached_type) {
        Py_ssize_t basicsize;
#if CYTHON_COMPILING_IN_LIMITED_API
        PyObject *py_basicsize;
        py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__");
        if (unlikely(!py_basicsize)) goto bad;
        basicsize = PyLong_AsSsize_t(py_basicsize);
        Py_DECREF(py_basicsize);
        py_basicsize = 0;
        if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
#else
        basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1;
#endif
        if (__Pyx_VerifyCachedType(
              cached_type,
              object_name,
              basicsize,
              spec->basicsize) < 0) {
            goto bad;
        }
        goto done;
    }
    if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
    PyErr_Clear();
    CYTHON_UNUSED_VAR(module);
    cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases);
    if (unlikely(!cached_type)) goto bad;
    if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad;
    if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad;
done:
    Py_DECREF(abi_module);
    assert(cached_type == NULL || PyType_Check(cached_type));
    return (PyTypeObject *) cached_type;
bad:
    Py_XDECREF(cached_type);
    cached_type = NULL;
    goto done;
}
#endif

/* PyVectorcallFastCallDict */
#if CYTHON_METH_FASTCALL
static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw)
{
    PyObject *res = NULL;
    PyObject *kwnames;
    PyObject **newargs;
    PyObject **kwvalues;
    Py_ssize_t i, pos;
    size_t j;
    PyObject *key, *value;
    unsigned long keys_are_strings;
    Py_ssize_t nkw = PyDict_GET_SIZE(kw);
    newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0]));
    if (unlikely(newargs == NULL)) {
        PyErr_NoMemory();
        return NULL;
    }
    for (j = 0; j < nargs; j++) newargs[j] = args[j];
    kwnames = PyTuple_New(nkw);
    if (unlikely(kwnames == NULL)) {
        PyMem_Free(newargs);
        return NULL;
    }
    kwvalues = newargs + nargs;
    pos = i = 0;
    keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS;
    while (PyDict_Next(kw, &pos, &key, &value)) {
        keys_are_strings &= Py_TYPE(key)->tp_flags;
        Py_INCREF(key);
        Py_INCREF(value);
        PyTuple_SET_ITEM(kwnames, i, key);
        kwvalues[i] = value;
        i++;
    }
    if (unlikely(!keys_are_strings)) {
        PyErr_SetString(PyExc_TypeError, "keywords must be strings");
        goto cleanup;
    }
    res = vc(func, newargs, nargs, kwnames);
cleanup:
    Py_DECREF(kwnames);
    for (i = 0; i < nkw; i++)
        Py_DECREF(kwvalues[i]);
    PyMem_Free(newargs);
    return res;
}
static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw)
{
    if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) {
        return vc(func, args, nargs, NULL);
    }
    return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw);
}
#endif

/* CythonFunctionShared */
#if CYTHON_COMPILING_IN_LIMITED_API
static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) {
    if (__Pyx_CyFunction_Check(func)) {
        return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc;
    } else if (PyCFunction_Check(func)) {
        return PyCFunction_GetFunction(func) == (PyCFunction) cfunc;
    }
    return 0;
}
#else
static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) {
    return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
}
#endif
static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) {
#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
    __Pyx_Py_XDECREF_SET(
        __Pyx_CyFunction_GetClassObj(f),
            ((classobj) ? __Pyx_NewRef(classobj) : NULL));
#else
    __Pyx_Py_XDECREF_SET(
        ((PyCMethodObject *) (f))->mm_class,
        (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL));
#endif
}
static PyObject *
__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure)
{
    CYTHON_UNUSED_VAR(closure);
    if (unlikely(op->func_doc == NULL)) {
#if CYTHON_COMPILING_IN_LIMITED_API
        op->func_doc = PyObject_GetAttrString(op->func, "__doc__");
        if (unlikely(!op->func_doc)) return NULL;
#else
        if (((PyCFunctionObject*)op)->m_ml->ml_doc) {
#if PY_MAJOR_VERSION >= 3
            op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc);
#else
            op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc);
#endif
            if (unlikely(op->func_doc == NULL))
                return NULL;
        } else {
            Py_INCREF(Py_None);
            return Py_None;
        }
#endif
    }
    Py_INCREF(op->func_doc);
    return op->func_doc;
}
static int
__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context)
{
    CYTHON_UNUSED_VAR(context);
    if (value == NULL) {
        value = Py_None;
    }
    Py_INCREF(value);
    __Pyx_Py_XDECREF_SET(op->func_doc, value);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context)
{
    CYTHON_UNUSED_VAR(context);
    if (unlikely(op->func_name == NULL)) {
#if CYTHON_COMPILING_IN_LIMITED_API
        op->func_name = PyObject_GetAttrString(op->func, "__name__");
#elif PY_MAJOR_VERSION >= 3
        op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name);
#else
        op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->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, void *context)
{
    CYTHON_UNUSED_VAR(context);
#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;
    }
    Py_INCREF(value);
    __Pyx_Py_XDECREF_SET(op->func_name, value);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context)
{
    CYTHON_UNUSED_VAR(context);
    Py_INCREF(op->func_qualname);
    return op->func_qualname;
}
static int
__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context)
{
    CYTHON_UNUSED_VAR(context);
#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;
    }
    Py_INCREF(value);
    __Pyx_Py_XDECREF_SET(op->func_qualname, value);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context)
{
    CYTHON_UNUSED_VAR(context);
    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, void *context)
{
    CYTHON_UNUSED_VAR(context);
    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;
    }
    Py_INCREF(value);
    __Pyx_Py_XDECREF_SET(op->func_dict, value);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context)
{
    CYTHON_UNUSED_VAR(context);
    Py_INCREF(op->func_globals);
    return op->func_globals;
}
static PyObject *
__Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context)
{
    CYTHON_UNUSED_VAR(op);
    CYTHON_UNUSED_VAR(context);
    Py_INCREF(Py_None);
    return Py_None;
}
static PyObject *
__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context)
{
    PyObject* result = (op->func_code) ? op->func_code : Py_None;
    CYTHON_UNUSED_VAR(context);
    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 = __Pyx_PySequence_ITEM(res, 0);
    if (unlikely(!op->defaults_tuple)) result = -1;
    else {
        op->defaults_kwdict = __Pyx_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, void *context) {
    CYTHON_UNUSED_VAR(context);
    if (!value) {
        value = Py_None;
    } else if (unlikely(value != Py_None && !PyTuple_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
                        "__defaults__ must be set to a tuple object");
        return -1;
    }
    PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not "
                 "currently affect the values used in function calls", 1);
    Py_INCREF(value);
    __Pyx_Py_XDECREF_SET(op->defaults_tuple, value);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) {
    PyObject* result = op->defaults_tuple;
    CYTHON_UNUSED_VAR(context);
    if (unlikely(!result)) {
        if (op->defaults_getter) {
            if (unlikely(__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, void *context) {
    CYTHON_UNUSED_VAR(context);
    if (!value) {
        value = Py_None;
    } else if (unlikely(value != Py_None && !PyDict_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
                        "__kwdefaults__ must be set to a dict object");
        return -1;
    }
    PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not "
                 "currently affect the values used in function calls", 1);
    Py_INCREF(value);
    __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) {
    PyObject* result = op->defaults_kwdict;
    CYTHON_UNUSED_VAR(context);
    if (unlikely(!result)) {
        if (op->defaults_getter) {
            if (unlikely(__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, void *context) {
    CYTHON_UNUSED_VAR(context);
    if (!value || value == Py_None) {
        value = NULL;
    } else if (unlikely(!PyDict_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
                        "__annotations__ must be set to a dict object");
        return -1;
    }
    Py_XINCREF(value);
    __Pyx_Py_XDECREF_SET(op->func_annotations, value);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) {
    PyObject* result = op->func_annotations;
    CYTHON_UNUSED_VAR(context);
    if (unlikely(!result)) {
        result = PyDict_New();
        if (unlikely(!result)) return NULL;
        op->func_annotations = result;
    }
    Py_INCREF(result);
    return result;
}
static PyObject *
__Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) {
    int is_coroutine;
    CYTHON_UNUSED_VAR(context);
    if (op->func_is_coroutine) {
        return __Pyx_NewRef(op->func_is_coroutine);
    }
    is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE;
#if PY_VERSION_HEX >= 0x03050000
    if (is_coroutine) {
        PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine;
        fromlist = PyList_New(1);
        if (unlikely(!fromlist)) return NULL;
        Py_INCREF(marker);
#if CYTHON_ASSUME_SAFE_MACROS
        PyList_SET_ITEM(fromlist, 0, marker);
#else
        if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) {
            Py_DECREF(marker);
            Py_DECREF(fromlist);
            return NULL;
        }
#endif
        module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0);
        Py_DECREF(fromlist);
        if (unlikely(!module)) goto ignore;
        op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker);
        Py_DECREF(module);
        if (likely(op->func_is_coroutine)) {
            return __Pyx_NewRef(op->func_is_coroutine);
        }
ignore:
        PyErr_Clear();
    }
#endif
    op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine);
    return __Pyx_NewRef(op->func_is_coroutine);
}
#if CYTHON_COMPILING_IN_LIMITED_API
static PyObject *
__Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) {
    CYTHON_UNUSED_VAR(context);
    return PyObject_GetAttrString(op->func, "__module__");
}
static int
__Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
    CYTHON_UNUSED_VAR(context);
    return PyObject_SetAttrString(op->func, "__module__", value);
}
#endif
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 *) "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},
    {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0},
#if CYTHON_COMPILING_IN_LIMITED_API
    {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0},
#endif
    {0, 0, 0, 0, 0}
};
static PyMemberDef __pyx_CyFunction_members[] = {
#if !CYTHON_COMPILING_IN_LIMITED_API
    {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0},
#endif
#if CYTHON_USE_TYPE_SPECS
    {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0},
#if CYTHON_METH_FASTCALL
#if CYTHON_BACKPORT_VECTORCALL
    {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0},
#else
#if !CYTHON_COMPILING_IN_LIMITED_API
    {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0},
#endif
#endif
#endif
#if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API
    {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0},
#else
    {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0},
#endif
#endif
    {0, 0, 0,  0, 0}
};
static PyObject *
__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args)
{
    CYTHON_UNUSED_VAR(args);
#if PY_MAJOR_VERSION >= 3
    Py_INCREF(m->func_qualname);
    return m->func_qualname;
#else
    return PyString_FromString(((PyCFunctionObject*)m)->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 || CYTHON_COMPILING_IN_LIMITED_API
#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
#else
#define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist)
#endif
static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname,
                                       PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
#if !CYTHON_COMPILING_IN_LIMITED_API
    PyCFunctionObject *cf = (PyCFunctionObject*) op;
#endif
    if (unlikely(op == NULL))
        return NULL;
#if CYTHON_COMPILING_IN_LIMITED_API
    op->func = PyCFunction_NewEx(ml, (PyObject*)op, module);
    if (unlikely(!op->func)) return NULL;
#endif
    op->flags = flags;
    __Pyx_CyFunction_weakreflist(op) = NULL;
#if !CYTHON_COMPILING_IN_LIMITED_API
    cf->m_ml = ml;
    cf->m_self = (PyObject *) op;
#endif
    Py_XINCREF(closure);
    op->func_closure = closure;
#if !CYTHON_COMPILING_IN_LIMITED_API
    Py_XINCREF(module);
    cf->m_module = module;
#endif
    op->func_dict = NULL;
    op->func_name = NULL;
    Py_INCREF(qualname);
    op->func_qualname = qualname;
    op->func_doc = NULL;
#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
    op->func_classobj = NULL;
#else
    ((PyCMethodObject*)op)->mm_class = NULL;
#endif
    op->func_globals = globals;
    Py_INCREF(op->func_globals);
    Py_XINCREF(code);
    op->func_code = code;
    op->defaults_pyobjects = 0;
    op->defaults_size = 0;
    op->defaults = NULL;
    op->defaults_tuple = NULL;
    op->defaults_kwdict = NULL;
    op->defaults_getter = NULL;
    op->func_annotations = NULL;
    op->func_is_coroutine = NULL;
#if CYTHON_METH_FASTCALL
    switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) {
    case METH_NOARGS:
        __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS;
        break;
    case METH_O:
        __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O;
        break;
    case METH_METHOD | METH_FASTCALL | METH_KEYWORDS:
        __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD;
        break;
    case METH_FASTCALL | METH_KEYWORDS:
        __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS;
        break;
    case METH_VARARGS | METH_KEYWORDS:
        __Pyx_CyFunction_func_vectorcall(op) = NULL;
        break;
    default:
        PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction");
        Py_DECREF(op);
        return NULL;
    }
#endif
    return (PyObject *) op;
}
static int
__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
{
    Py_CLEAR(m->func_closure);
#if CYTHON_COMPILING_IN_LIMITED_API
    Py_CLEAR(m->func);
#else
    Py_CLEAR(((PyCFunctionObject*)m)->m_module);
#endif
    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);
#if !CYTHON_COMPILING_IN_LIMITED_API
#if PY_VERSION_HEX < 0x030900B1
    Py_CLEAR(__Pyx_CyFunction_GetClassObj(m));
#else
    {
        PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class;
        ((PyCMethodObject *) (m))->mm_class = NULL;
        Py_XDECREF(cls);
    }
#endif
#endif
    Py_CLEAR(m->defaults_tuple);
    Py_CLEAR(m->defaults_kwdict);
    Py_CLEAR(m->func_annotations);
    Py_CLEAR(m->func_is_coroutine);
    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);
    __Pyx_PyHeapTypeObject_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);
#if CYTHON_COMPILING_IN_LIMITED_API
    Py_VISIT(m->func);
#else
    Py_VISIT(((PyCFunctionObject*)m)->m_module);
#endif
    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);
#if !CYTHON_COMPILING_IN_LIMITED_API
    Py_VISIT(__Pyx_CyFunction_GetClassObj(m));
#endif
    Py_VISIT(m->defaults_tuple);
    Py_VISIT(m->defaults_kwdict);
    Py_VISIT(m->func_is_coroutine);
    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_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) {
#if CYTHON_COMPILING_IN_LIMITED_API
    PyObject *f = ((__pyx_CyFunctionObject*)func)->func;
    PyObject *py_name = NULL;
    PyCFunction meth;
    int flags;
    meth = PyCFunction_GetFunction(f);
    if (unlikely(!meth)) return NULL;
    flags = PyCFunction_GetFlags(f);
    if (unlikely(flags < 0)) return NULL;
#else
    PyCFunctionObject* f = (PyCFunctionObject*)func;
    PyCFunction meth = f->m_ml->ml_meth;
    int flags = f->m_ml->ml_flags;
#endif
    Py_ssize_t size;
    switch (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)(void*)meth)(self, arg, kw);
    case METH_NOARGS:
        if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
#if CYTHON_ASSUME_SAFE_MACROS
            size = PyTuple_GET_SIZE(arg);
#else
            size = PyTuple_Size(arg);
            if (unlikely(size < 0)) return NULL;
#endif
            if (likely(size == 0))
                return (*meth)(self, NULL);
#if CYTHON_COMPILING_IN_LIMITED_API
            py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL);
            if (!py_name) return NULL;
            PyErr_Format(PyExc_TypeError,
                "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
                py_name, size);
            Py_DECREF(py_name);
#else
            PyErr_Format(PyExc_TypeError,
                "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
                f->m_ml->ml_name, size);
#endif
            return NULL;
        }
        break;
    case METH_O:
        if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
#if CYTHON_ASSUME_SAFE_MACROS
            size = PyTuple_GET_SIZE(arg);
#else
            size = PyTuple_Size(arg);
            if (unlikely(size < 0)) return NULL;
#endif
            if (likely(size == 1)) {
                PyObject *result, *arg0;
                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                arg0 = PyTuple_GET_ITEM(arg, 0);
                #else
                arg0 = __Pyx_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;
            }
#if CYTHON_COMPILING_IN_LIMITED_API
            py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL);
            if (!py_name) return NULL;
            PyErr_Format(PyExc_TypeError,
                "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
                py_name, size);
            Py_DECREF(py_name);
#else
            PyErr_Format(PyExc_TypeError,
                "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
                f->m_ml->ml_name, size);
#endif
            return NULL;
        }
        break;
    default:
        PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction");
        return NULL;
    }
#if CYTHON_COMPILING_IN_LIMITED_API
    py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL);
    if (!py_name) return NULL;
    PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments",
                 py_name);
    Py_DECREF(py_name);
#else
    PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
                 f->m_ml->ml_name);
#endif
    return NULL;
}
static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    PyObject *self, *result;
#if CYTHON_COMPILING_IN_LIMITED_API
    self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func);
    if (unlikely(!self) && PyErr_Occurred()) return NULL;
#else
    self = ((PyCFunctionObject*)func)->m_self;
#endif
    result = __Pyx_CyFunction_CallMethod(func, self, arg, kw);
    return result;
}
static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
    PyObject *result;
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
#if CYTHON_METH_FASTCALL
     __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc);
    if (vc) {
#if CYTHON_ASSUME_SAFE_MACROS
        return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw);
#else
        (void) &__Pyx_PyVectorcall_FastCallDict;
        return PyVectorcall_Call(func, args, kw);
#endif
    }
#endif
    if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
        Py_ssize_t argc;
        PyObject *new_args;
        PyObject *self;
#if CYTHON_ASSUME_SAFE_MACROS
        argc = PyTuple_GET_SIZE(args);
#else
        argc = PyTuple_Size(args);
        if (unlikely(!argc) < 0) return NULL;
#endif
        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);
#if PY_MAJOR_VERSION > 2
            PyErr_Format(PyExc_TypeError,
                         "unbound method %.200S() needs an argument",
                         cyfunc->func_qualname);
#else
            PyErr_SetString(PyExc_TypeError,
                            "unbound method needs an argument");
#endif
            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;
}
#if CYTHON_METH_FASTCALL
static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames)
{
    int ret = 0;
    if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
        if (unlikely(nargs < 1)) {
            PyErr_Format(PyExc_TypeError, "%.200s() needs an argument",
                         ((PyCFunctionObject*)cyfunc)->m_ml->ml_name);
            return -1;
        }
        ret = 1;
    }
    if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) {
        PyErr_Format(PyExc_TypeError,
                     "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name);
        return -1;
    }
    return ret;
}
static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
{
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
    PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml;
#if CYTHON_BACKPORT_VECTORCALL
    Py_ssize_t nargs = (Py_ssize_t)nargsf;
#else
    Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
#endif
    PyObject *self;
    switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) {
    case 1:
        self = args[0];
        args += 1;
        nargs -= 1;
        break;
    case 0:
        self = ((PyCFunctionObject*)cyfunc)->m_self;
        break;
    default:
        return NULL;
    }
    if (unlikely(nargs != 0)) {
        PyErr_Format(PyExc_TypeError,
            "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
            def->ml_name, nargs);
        return NULL;
    }
    return def->ml_meth(self, NULL);
}
static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
{
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
    PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml;
#if CYTHON_BACKPORT_VECTORCALL
    Py_ssize_t nargs = (Py_ssize_t)nargsf;
#else
    Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
#endif
    PyObject *self;
    switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) {
    case 1:
        self = args[0];
        args += 1;
        nargs -= 1;
        break;
    case 0:
        self = ((PyCFunctionObject*)cyfunc)->m_self;
        break;
    default:
        return NULL;
    }
    if (unlikely(nargs != 1)) {
        PyErr_Format(PyExc_TypeError,
            "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
            def->ml_name, nargs);
        return NULL;
    }
    return def->ml_meth(self, args[0]);
}
static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
{
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
    PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml;
#if CYTHON_BACKPORT_VECTORCALL
    Py_ssize_t nargs = (Py_ssize_t)nargsf;
#else
    Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
#endif
    PyObject *self;
    switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) {
    case 1:
        self = args[0];
        args += 1;
        nargs -= 1;
        break;
    case 0:
        self = ((PyCFunctionObject*)cyfunc)->m_self;
        break;
    default:
        return NULL;
    }
    return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames);
}
static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
{
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
    PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml;
    PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc);
#if CYTHON_BACKPORT_VECTORCALL
    Py_ssize_t nargs = (Py_ssize_t)nargsf;
#else
    Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
#endif
    PyObject *self;
    switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) {
    case 1:
        self = args[0];
        args += 1;
        nargs -= 1;
        break;
    case 0:
        self = ((PyCFunctionObject*)cyfunc)->m_self;
        break;
    default:
        return NULL;
    }
    return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames);
}
#endif
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_CyFunctionType_slots[] = {
    {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc},
    {Py_tp_repr, (void *)__Pyx_CyFunction_repr},
    {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod},
    {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse},
    {Py_tp_clear, (void *)__Pyx_CyFunction_clear},
    {Py_tp_methods, (void *)__pyx_CyFunction_methods},
    {Py_tp_members, (void *)__pyx_CyFunction_members},
    {Py_tp_getset, (void *)__pyx_CyFunction_getsets},
    {Py_tp_descr_get, (void *)__Pyx_PyMethod_New},
    {0, 0},
};
static PyType_Spec __pyx_CyFunctionType_spec = {
    __PYX_TYPE_MODULE_PREFIX "cython_function_or_method",
    sizeof(__pyx_CyFunctionObject),
    0,
#ifdef Py_TPFLAGS_METHOD_DESCRIPTOR
    Py_TPFLAGS_METHOD_DESCRIPTOR |
#endif
#if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL)
    _Py_TPFLAGS_HAVE_VECTORCALL |
#endif
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE,
    __pyx_CyFunctionType_slots
};
#else
static PyTypeObject __pyx_CyFunctionType_type = {
    PyVarObject_HEAD_INIT(0, 0)
    __PYX_TYPE_MODULE_PREFIX "cython_function_or_method",
    sizeof(__pyx_CyFunctionObject),
    0,
    (destructor) __Pyx_CyFunction_dealloc,
#if !CYTHON_METH_FASTCALL
    0,
#elif CYTHON_BACKPORT_VECTORCALL
    (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall),
#else
    offsetof(PyCFunctionObject, vectorcall),
#endif
    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,
#ifdef Py_TPFLAGS_METHOD_DESCRIPTOR
    Py_TPFLAGS_METHOD_DESCRIPTOR |
#endif
#if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL
    _Py_TPFLAGS_HAVE_VECTORCALL |
#endif
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE,
    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_PyMethod_New,
    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
#if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
    0,
#endif
#if __PYX_NEED_TP_PRINT_SLOT
    0,
#endif
#if PY_VERSION_HEX >= 0x030C0000
    0,
#endif
#if PY_VERSION_HEX >= 0x030d00A4
    0,
#endif
#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
    0,
#endif
};
#endif
static int __pyx_CyFunction_init(PyObject *module) {
#if CYTHON_USE_TYPE_SPECS
    __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL);
#else
    CYTHON_UNUSED_VAR(module);
    __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
#endif
    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;
    m->defaults_size = size;
    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);
}

/* CythonFunction */
static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname,
                                      PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
    PyObject *op = __Pyx_CyFunction_Init(
        PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType),
        ml, flags, qualname, closure, module, globals, code
    );
    if (likely(op)) {
        PyObject_GC_Track(op);
    }
    return op;
}

/* IterFinish */
static CYTHON_INLINE int __Pyx_IterFinish(void) {
    PyObject* exc_type;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    exc_type = __Pyx_PyErr_CurrentExceptionType();
    if (unlikely(exc_type)) {
        if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))
            return -1;
        __Pyx_PyErr_Clear();
        return 0;
    }
    return 0;
}

/* PyObjectGetMethod */
static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) {
    PyObject *attr;
#if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP
    __Pyx_TypeName type_name;
    PyTypeObject *tp = Py_TYPE(obj);
    PyObject *descr;
    descrgetfunc f = NULL;
    PyObject **dictptr, *dict;
    int meth_found = 0;
    assert (*method == NULL);
    if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) {
        attr = __Pyx_PyObject_GetAttrStr(obj, name);
        goto try_unpack;
    }
    if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) {
        return 0;
    }
    descr = _PyType_Lookup(tp, name);
    if (likely(descr != NULL)) {
        Py_INCREF(descr);
#if defined(Py_TPFLAGS_METHOD_DESCRIPTOR) && Py_TPFLAGS_METHOD_DESCRIPTOR
        if (__Pyx_PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR))
#elif PY_MAJOR_VERSION >= 3
        #ifdef __Pyx_CyFunction_USED
        if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr)))
        #else
        if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type)))
        #endif
#else
        #ifdef __Pyx_CyFunction_USED
        if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr)))
        #else
        if (likely(PyFunction_Check(descr)))
        #endif
#endif
        {
            meth_found = 1;
        } else {
            f = Py_TYPE(descr)->tp_descr_get;
            if (f != NULL && PyDescr_IsData(descr)) {
                attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
                Py_DECREF(descr);
                goto try_unpack;
            }
        }
    }
    dictptr = _PyObject_GetDictPtr(obj);
    if (dictptr != NULL && (dict = *dictptr) != NULL) {
        Py_INCREF(dict);
        attr = __Pyx_PyDict_GetItemStr(dict, name);
        if (attr != NULL) {
            Py_INCREF(attr);
            Py_DECREF(dict);
            Py_XDECREF(descr);
            goto try_unpack;
        }
        Py_DECREF(dict);
    }
    if (meth_found) {
        *method = descr;
        return 1;
    }
    if (f != NULL) {
        attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
        Py_DECREF(descr);
        goto try_unpack;
    }
    if (likely(descr != NULL)) {
        *method = descr;
        return 0;
    }
    type_name = __Pyx_PyType_GetName(tp);
    PyErr_Format(PyExc_AttributeError,
#if PY_MAJOR_VERSION >= 3
                 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'",
                 type_name, name);
#else
                 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'",
                 type_name, PyString_AS_STRING(name));
#endif
    __Pyx_DECREF_TypeName(type_name);
    return 0;
#else
    attr = __Pyx_PyObject_GetAttrStr(obj, name);
    goto try_unpack;
#endif
try_unpack:
#if CYTHON_UNPACK_METHODS
    if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) {
        PyObject *function = PyMethod_GET_FUNCTION(attr);
        Py_INCREF(function);
        Py_DECREF(attr);
        *method = function;
        return 1;
    }
#endif
    *method = attr;
    return 0;
}

/* PyObjectCallMethod0 */
static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
    PyObject *method = NULL, *result = NULL;
    int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
    if (likely(is_method)) {
        result = __Pyx_PyObject_CallOneArg(method, obj);
        Py_DECREF(method);
        return result;
    }
    if (unlikely(!method)) goto bad;
    result = __Pyx_PyObject_CallNoArg(method);
    Py_DECREF(method);
bad:
    return result;
}

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

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

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

/* 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 = __Pyx_PyObject_GetIterNextFunc(iter);
    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 */
#if CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
#include <string.h>
#endif
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;
}

/* PyIntCompare */
static CYTHON_INLINE int __Pyx_PyInt_BoolEqObjC(PyObject *op1, PyObject *op2, long intval, long inplace) {
    CYTHON_MAYBE_UNUSED_VAR(intval);
    CYTHON_UNUSED_VAR(inplace);
    if (op1 == op2) {
        return 1;
    }
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long a = PyInt_AS_LONG(op1);
        return (a == b);
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        int unequal;
        unsigned long uintval;
        Py_ssize_t size = __Pyx_PyLong_DigitCount(op1);
        const digit* digits = __Pyx_PyLong_Digits(op1);
        if (intval == 0) {
            return (__Pyx_PyLong_IsZero(op1) == 1);
        } else if (intval < 0) {
            if (__Pyx_PyLong_IsNonNeg(op1))
                return 0;
            intval = -intval;
        } else {
            if (__Pyx_PyLong_IsNeg(op1))
                return 0;
        }
        uintval = (unsigned long) intval;
#if PyLong_SHIFT * 4 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 4)) {
            unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 3 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 3)) {
            unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 2 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 2)) {
            unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 1 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 1)) {
            unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
            unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK));
        return (unequal == 0);
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
#if CYTHON_COMPILING_IN_LIMITED_API
        double a = __pyx_PyFloat_AsDouble(op1);
#else
        double a = PyFloat_AS_DOUBLE(op1);
#endif
        return ((double)a == (double)b);
    }
    return __Pyx_PyObject_IsTrueAndDecref(
        PyObject_RichCompare(op1, op2, Py_EQ));
}

/* 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, int wraparound) {
    __Pyx_TypeName obj_type_name;
#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);
    }
#else
    CYTHON_UNUSED_VAR(wraparound);
#endif
    mp = Py_TYPE(obj)->tp_as_mapping;
    if (likely(mp && mp->mp_subscript))
#else
    CYTHON_UNUSED_VAR(wraparound);
#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;
    }
    obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj));
    PyErr_Format(PyExc_TypeError,
        "'" __Pyx_FMT_TYPENAME "' object is unsliceable", obj_type_name);
    __Pyx_DECREF_TypeName(obj_type_name);
bad:
    return NULL;
}

/* CIntToDigits */
static const char DIGIT_PAIRS_10[2*10*10+1] = {
    "00010203040506070809"
    "10111213141516171819"
    "20212223242526272829"
    "30313233343536373839"
    "40414243444546474849"
    "50515253545556575859"
    "60616263646566676869"
    "70717273747576777879"
    "80818283848586878889"
    "90919293949596979899"
};
static const char DIGIT_PAIRS_8[2*8*8+1] = {
    "0001020304050607"
    "1011121314151617"
    "2021222324252627"
    "3031323334353637"
    "4041424344454647"
    "5051525354555657"
    "6061626364656667"
    "7071727374757677"
};
static const char DIGITS_HEX[2*16+1] = {
    "0123456789abcdef"
    "0123456789ABCDEF"
};

/* BuildPyUnicode */
static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength, char* chars, int clength,
                                                int prepend_sign, char padding_char) {
    PyObject *uval;
    Py_ssize_t uoffset = ulength - clength;
#if CYTHON_USE_UNICODE_INTERNALS
    Py_ssize_t i;
#if CYTHON_PEP393_ENABLED
    void *udata;
    uval = PyUnicode_New(ulength, 127);
    if (unlikely(!uval)) return NULL;
    udata = PyUnicode_DATA(uval);
#else
    Py_UNICODE *udata;
    uval = PyUnicode_FromUnicode(NULL, ulength);
    if (unlikely(!uval)) return NULL;
    udata = PyUnicode_AS_UNICODE(uval);
#endif
    if (uoffset > 0) {
        i = 0;
        if (prepend_sign) {
            __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, 0, '-');
            i++;
        }
        for (; i < uoffset; i++) {
            __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, i, padding_char);
        }
    }
    for (i=0; i < clength; i++) {
        __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, uoffset+i, chars[i]);
    }
#else
    {
        PyObject *sign = NULL, *padding = NULL;
        uval = NULL;
        if (uoffset > 0) {
            prepend_sign = !!prepend_sign;
            if (uoffset > prepend_sign) {
                padding = PyUnicode_FromOrdinal(padding_char);
                if (likely(padding) && uoffset > prepend_sign + 1) {
                    PyObject *tmp;
                    PyObject *repeat = PyInt_FromSsize_t(uoffset - prepend_sign);
                    if (unlikely(!repeat)) goto done_or_error;
                    tmp = PyNumber_Multiply(padding, repeat);
                    Py_DECREF(repeat);
                    Py_DECREF(padding);
                    padding = tmp;
                }
                if (unlikely(!padding)) goto done_or_error;
            }
            if (prepend_sign) {
                sign = PyUnicode_FromOrdinal('-');
                if (unlikely(!sign)) goto done_or_error;
            }
        }
        uval = PyUnicode_DecodeASCII(chars, clength, NULL);
        if (likely(uval) && padding) {
            PyObject *tmp = PyNumber_Add(padding, uval);
            Py_DECREF(uval);
            uval = tmp;
        }
        if (likely(uval) && sign) {
            PyObject *tmp = PyNumber_Add(sign, uval);
            Py_DECREF(uval);
            uval = tmp;
        }
done_or_error:
        Py_XDECREF(padding);
        Py_XDECREF(sign);
    }
#endif
    return uval;
}

/* CIntToPyUnicode */
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width, char padding_char, char format_char) {
    char digits[sizeof(Py_ssize_t)*3+2];
    char *dpos, *end = digits + sizeof(Py_ssize_t)*3+2;
    const char *hex_digits = DIGITS_HEX;
    Py_ssize_t length, ulength;
    int prepend_sign, last_one_off;
    Py_ssize_t remaining;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const Py_ssize_t neg_one = (Py_ssize_t) -1, const_zero = (Py_ssize_t) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (format_char == 'X') {
        hex_digits += 16;
        format_char = 'x';
    }
    remaining = value;
    last_one_off = 0;
    dpos = end;
    do {
        int digit_pos;
        switch (format_char) {
        case 'o':
            digit_pos = abs((int)(remaining % (8*8)));
            remaining = (Py_ssize_t) (remaining / (8*8));
            dpos -= 2;
            memcpy(dpos, DIGIT_PAIRS_8 + digit_pos * 2, 2);
            last_one_off = (digit_pos < 8);
            break;
        case 'd':
            digit_pos = abs((int)(remaining % (10*10)));
            remaining = (Py_ssize_t) (remaining / (10*10));
            dpos -= 2;
            memcpy(dpos, DIGIT_PAIRS_10 + digit_pos * 2, 2);
            last_one_off = (digit_pos < 10);
            break;
        case 'x':
            *(--dpos) = hex_digits[abs((int)(remaining % 16))];
            remaining = (Py_ssize_t) (remaining / 16);
            break;
        default:
            assert(0);
            break;
        }
    } while (unlikely(remaining != 0));
    assert(!last_one_off || *dpos == '0');
    dpos += last_one_off;
    length = end - dpos;
    ulength = length;
    prepend_sign = 0;
    if (!is_unsigned && value <= neg_one) {
        if (padding_char == ' ' || width <= length + 1) {
            *(--dpos) = '-';
            ++length;
        } else {
            prepend_sign = 1;
        }
        ++ulength;
    }
    if (width > ulength) {
        ulength = width;
    }
    if (ulength == 1) {
        return PyUnicode_FromOrdinal(*dpos);
    }
    return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (int) length, prepend_sign, padding_char);
}

/* PyIntBinop */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(intval);
    CYTHON_MAYBE_UNUSED_VAR(inplace);
    CYTHON_UNUSED_VAR(zerodivision_check);
    #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 + (unsigned long)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
        if (unlikely(__Pyx_PyLong_IsZero(op1))) {
            return __Pyx_NewRef(op2);
        }
        if (likely(__Pyx_PyLong_IsCompact(op1))) {
            a = __Pyx_PyLong_CompactValue(op1);
        } else {
            const digit* digits = __Pyx_PyLong_Digits(op1);
            const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1);
            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;
#if CYTHON_COMPILING_IN_LIMITED_API
        double a = __pyx_PyFloat_AsDouble(op1);
#else
        double a = PyFloat_AS_DOUBLE(op1);
#endif
            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

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

/* SetItemInt */
static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) {
    int r;
    if (unlikely(!j)) return -1;
    r = PyObject_SetItem(o, j, v);
    Py_DECREF(j);
    return r;
}
static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, int is_list,
                                               CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
    if (is_list || PyList_CheckExact(o)) {
        Py_ssize_t n = (!wraparound) ? i : ((likely(i >= 0)) ? i : i + PyList_GET_SIZE(o));
        if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o)))) {
            PyObject* old = PyList_GET_ITEM(o, n);
            Py_INCREF(v);
            PyList_SET_ITEM(o, n, v);
            Py_DECREF(old);
            return 1;
        }
    } else {
        PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping;
        PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence;
        if (mm && mm->mp_ass_subscript) {
            int r;
            PyObject *key = PyInt_FromSsize_t(i);
            if (unlikely(!key)) return -1;
            r = mm->mp_ass_subscript(o, key, v);
            Py_DECREF(key);
            return r;
        }
        if (likely(sm && sm->sq_ass_item)) {
            if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) {
                Py_ssize_t l = sm->sq_length(o);
                if (likely(l >= 0)) {
                    i += l;
                } else {
                    if (!PyErr_ExceptionMatches(PyExc_OverflowError))
                        return -1;
                    PyErr_Clear();
                }
            }
            return sm->sq_ass_item(o, i, v);
        }
    }
#else
    if (is_list || !PyMapping_Check(o))
    {
        return PySequence_SetItem(o, i, v);
    }
#endif
    return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v);
}

/* PyIntCompare */
static CYTHON_INLINE PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, long intval, long inplace) {
    CYTHON_MAYBE_UNUSED_VAR(intval);
    CYTHON_UNUSED_VAR(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))) {
        int unequal;
        unsigned long uintval;
        Py_ssize_t size = __Pyx_PyLong_DigitCount(op1);
        const digit* digits = __Pyx_PyLong_Digits(op1);
        if (intval == 0) {
            if (__Pyx_PyLong_IsZero(op1) == 1) Py_RETURN_TRUE; else Py_RETURN_FALSE;
        } else if (intval < 0) {
            if (__Pyx_PyLong_IsNonNeg(op1))
                Py_RETURN_FALSE;
            intval = -intval;
        } else {
            if (__Pyx_PyLong_IsNeg(op1))
                Py_RETURN_FALSE;
        }
        uintval = (unsigned long) intval;
#if PyLong_SHIFT * 4 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 4)) {
            unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 3 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 3)) {
            unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 2 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 2)) {
            unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 1 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 1)) {
            unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
            unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK));
        if (unequal == 0) Py_RETURN_TRUE; else Py_RETURN_FALSE;
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
#if CYTHON_COMPILING_IN_LIMITED_API
        double a = __pyx_PyFloat_AsDouble(op1);
#else
        double a = PyFloat_AS_DOUBLE(op1);
#endif
        if ((double)a == (double)b) Py_RETURN_TRUE; else Py_RETURN_FALSE;
    }
    return (
        PyObject_RichCompare(op1, op2, Py_EQ));
}

/* ExtTypeTest */
static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
    __Pyx_TypeName obj_type_name;
    __Pyx_TypeName type_name;
    if (unlikely(!type)) {
        PyErr_SetString(PyExc_SystemError, "Missing type object");
        return 0;
    }
    if (likely(__Pyx_TypeCheck(obj, type)))
        return 1;
    obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj));
    type_name = __Pyx_PyType_GetName(type);
    PyErr_Format(PyExc_TypeError,
                 "Cannot convert " __Pyx_FMT_TYPENAME " to " __Pyx_FMT_TYPENAME,
                 obj_type_name, type_name);
    __Pyx_DECREF_TypeName(obj_type_name);
    __Pyx_DECREF_TypeName(type_name);
    return 0;
}

/* JoinPyUnicode */
static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength,
                                      Py_UCS4 max_char) {
#if CYTHON_USE_UNICODE_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    PyObject *result_uval;
    int result_ukind, kind_shift;
    Py_ssize_t i, char_pos;
    void *result_udata;
    CYTHON_MAYBE_UNUSED_VAR(max_char);
#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;
    kind_shift = (result_ukind == PyUnicode_4BYTE_KIND) ? 2 : result_ukind - 1;
    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);
    kind_shift = (result_ukind == 4) ? 2 : result_ukind - 1;
    result_udata = PyUnicode_AS_UNICODE(result_uval);
#endif
    assert(kind_shift == 2 || kind_shift == 1 || kind_shift == 0);
    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((PY_SSIZE_T_MAX >> kind_shift) - ulength < char_pos))
            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 << kind_shift), udata, (size_t) (ulength << kind_shift));
        } else {
            #if PY_VERSION_HEX >= 0x030d0000
            if (unlikely(PyUnicode_CopyCharacters(result_uval, char_pos, uval, 0, ulength) < 0)) goto bad;
            #elif 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
    CYTHON_UNUSED_VAR(max_char);
    CYTHON_UNUSED_VAR(result_ulength);
    CYTHON_UNUSED_VAR(value_count);
    return PyUnicode_Join(__pyx_empty_unicode, value_tuple);
#endif
}

/* GetAttr3 */
#if __PYX_LIMITED_VERSION_HEX < 0x030d00A1
static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
        return NULL;
    __Pyx_PyErr_Clear();
    Py_INCREF(d);
    return d;
}
#endif
static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
    PyObject *r;
#if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1
    int res = PyObject_GetOptionalAttr(o, n, &r);
    return (res != 0) ? r : __Pyx_NewRef(d);
#else
  #if CYTHON_USE_TYPE_SLOTS
    if (likely(PyString_Check(n))) {
        r = __Pyx_PyObject_GetAttrStrNoError(o, n);
        if (unlikely(!r) && likely(!PyErr_Occurred())) {
            r = __Pyx_NewRef(d);
        }
        return r;
    }
  #endif
    r = PyObject_GetAttr(o, n);
    return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
#endif
}

/* RaiseUnexpectedTypeError */
static int
__Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj)
{
    __Pyx_TypeName obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj));
    PyErr_Format(PyExc_TypeError, "Expected %s, got " __Pyx_FMT_TYPENAME,
                 expected, obj_type_name);
    __Pyx_DECREF_TypeName(obj_type_name);
    return 0;
}

/* pynumber_float */
static CYTHON_INLINE PyObject* __Pyx__PyNumber_Float(PyObject* obj) {
    double val;
    if (PyLong_CheckExact(obj)) {
#if CYTHON_USE_PYLONG_INTERNALS
        if (likely(__Pyx_PyLong_IsCompact(obj))) {
            val = (double) __Pyx_PyLong_CompactValue(obj);
            goto no_error;
        }
#endif
        val = PyLong_AsDouble(obj);
    } else if (PyUnicode_CheckExact(obj)) {
        val = __Pyx_PyUnicode_AsDouble(obj);
    } else if (PyBytes_CheckExact(obj)) {
        val = __Pyx_PyBytes_AsDouble(obj);
    } else if (PyByteArray_CheckExact(obj)) {
        val = __Pyx_PyByteArray_AsDouble(obj);
    } else {
        return PyNumber_Float(obj);
    }
    if (unlikely(val == -1 && PyErr_Occurred())) {
        return NULL;
    }
#if CYTHON_USE_PYLONG_INTERNALS
no_error:
#endif
    return PyFloat_FromDouble(val);
}

/* DictGetItem */
#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
    PyObject *value;
    value = PyDict_GetItemWithError(d, key);
    if (unlikely(!value)) {
        if (!PyErr_Occurred()) {
            if (unlikely(PyTuple_Check(key))) {
                PyObject* args = PyTuple_Pack(1, key);
                if (likely(args)) {
                    PyErr_SetObject(PyExc_KeyError, args);
                    Py_DECREF(args);
                }
            } else {
                PyErr_SetObject(PyExc_KeyError, key);
            }
        }
        return NULL;
    }
    Py_INCREF(value);
    return value;
}
#endif

/* unicode_tailmatch */
static int __Pyx_PyUnicode_TailmatchTuple(PyObject* s, PyObject* substrings,
                                          Py_ssize_t start, Py_ssize_t end, int direction) {
    Py_ssize_t i, count = PyTuple_GET_SIZE(substrings);
    for (i = 0; i < count; i++) {
        Py_ssize_t result;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        result = PyUnicode_Tailmatch(s, PyTuple_GET_ITEM(substrings, i),
                                     start, end, direction);
#else
        PyObject* sub = PySequence_ITEM(substrings, i);
        if (unlikely(!sub)) return -1;
        result = PyUnicode_Tailmatch(s, sub, start, end, direction);
        Py_DECREF(sub);
#endif
        if (result) {
            return (int) result;
        }
    }
    return 0;
}
static int __Pyx_PyUnicode_Tailmatch(PyObject* s, PyObject* substr,
                                     Py_ssize_t start, Py_ssize_t end, int direction) {
    if (unlikely(PyTuple_Check(substr))) {
        return __Pyx_PyUnicode_TailmatchTuple(s, substr, start, end, direction);
    }
    return (int) PyUnicode_Tailmatch(s, substr, start, end, direction);
}

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

/* 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 CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
    _PyErr_StackItem *exc_info = tstate->exc_info;
    tmp_value = exc_info->exc_value;
    exc_info->exc_value = *value;
    if (tmp_value == NULL || tmp_value == Py_None) {
        Py_XDECREF(tmp_value);
        tmp_value = NULL;
        tmp_type = NULL;
        tmp_tb = NULL;
    } else {
        tmp_type = (PyObject*) Py_TYPE(tmp_value);
        Py_INCREF(tmp_type);
        #if CYTHON_COMPILING_IN_CPYTHON
        tmp_tb = ((PyBaseExceptionObject*) tmp_value)->traceback;
        Py_XINCREF(tmp_tb);
        #else
        tmp_tb = PyException_GetTraceback(tmp_value);
        #endif
    }
  #elif CYTHON_USE_EXC_INFO_STACK
    _PyErr_StackItem *exc_info = tstate->exc_info;
    tmp_type = exc_info->exc_type;
    tmp_value = exc_info->exc_value;
    tmp_tb = exc_info->exc_traceback;
    exc_info->exc_type = *type;
    exc_info->exc_value = *value;
    exc_info->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

/* WriteUnraisableException */
static void __Pyx_WriteUnraisable(const char *name, int clineno,
                                  int lineno, const char *filename,
                                  int full_traceback, int nogil) {
    PyObject *old_exc, *old_val, *old_tb;
    PyObject *ctx;
    __Pyx_PyThreadState_declare
#ifdef WITH_THREAD
    PyGILState_STATE state;
    if (nogil)
        state = PyGILState_Ensure();
    else state = (PyGILState_STATE)0;
#endif
    CYTHON_UNUSED_VAR(clineno);
    CYTHON_UNUSED_VAR(lineno);
    CYTHON_UNUSED_VAR(filename);
    CYTHON_MAYBE_UNUSED_VAR(nogil);
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
    if (full_traceback) {
        Py_XINCREF(old_exc);
        Py_XINCREF(old_val);
        Py_XINCREF(old_tb);
        __Pyx_ErrRestore(old_exc, old_val, old_tb);
        PyErr_PrintEx(0);
    }
    #if PY_MAJOR_VERSION < 3
    ctx = PyString_FromString(name);
    #else
    ctx = PyUnicode_FromString(name);
    #endif
    __Pyx_ErrRestore(old_exc, old_val, old_tb);
    if (!ctx) {
        PyErr_WriteUnraisable(Py_None);
    } else {
        PyErr_WriteUnraisable(ctx);
        Py_DECREF(ctx);
    }
#ifdef WITH_THREAD
    if (nogil)
        PyGILState_Release(state);
#endif
}

/* Py3UpdateBases */
static PyObject*
__Pyx_PEP560_update_bases(PyObject *bases)
{
    Py_ssize_t i, j, size_bases;
    PyObject *base, *meth, *new_base, *result, *new_bases = NULL;
    size_bases = PyTuple_GET_SIZE(bases);
    for (i = 0; i < size_bases; i++) {
        base  = PyTuple_GET_ITEM(bases, i);
        if (PyType_Check(base)) {
            if (new_bases) {
                if (PyList_Append(new_bases, base) < 0) {
                    goto error;
                }
            }
            continue;
        }
        meth = __Pyx_PyObject_GetAttrStrNoError(base, __pyx_n_s_mro_entries);
        if (!meth && PyErr_Occurred()) {
            goto error;
        }
        if (!meth) {
            if (new_bases) {
                if (PyList_Append(new_bases, base) < 0) {
                    goto error;
                }
            }
            continue;
        }
        new_base = __Pyx_PyObject_CallOneArg(meth, bases);
        Py_DECREF(meth);
        if (!new_base) {
            goto error;
        }
        if (!PyTuple_Check(new_base)) {
            PyErr_SetString(PyExc_TypeError,
                            "__mro_entries__ must return a tuple");
            Py_DECREF(new_base);
            goto error;
        }
        if (!new_bases) {
            if (!(new_bases = PyList_New(i))) {
                goto error;
            }
            for (j = 0; j < i; j++) {
                base = PyTuple_GET_ITEM(bases, j);
                PyList_SET_ITEM(new_bases, j, base);
                Py_INCREF(base);
            }
        }
        j = PyList_GET_SIZE(new_bases);
        if (PyList_SetSlice(new_bases, j, j, new_base) < 0) {
            goto error;
        }
        Py_DECREF(new_base);
    }
    if (!new_bases) {
        Py_INCREF(bases);
        return bases;
    }
    result = PyList_AsTuple(new_bases);
    Py_DECREF(new_bases);
    return result;
error:
    Py_XDECREF(new_bases);
    return NULL;
}

/* CalculateMetaclass */
static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
    Py_ssize_t i, nbases;
#if CYTHON_ASSUME_SAFE_MACROS
    nbases = PyTuple_GET_SIZE(bases);
#else
    nbases = PyTuple_Size(bases);
    if (nbases < 0) return NULL;
#endif
    for (i=0; i < nbases; i++) {
        PyTypeObject *tmptype;
#if CYTHON_ASSUME_SAFE_MACROS
        PyObject *tmp = PyTuple_GET_ITEM(bases, i);
#else
        PyObject *tmp = PyTuple_GetItem(bases, i);
        if (!tmp) return NULL;
#endif
        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;
}

/* PyObjectCall2Args */
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
    PyObject *args[3] = {NULL, arg1, arg2};
    return __Pyx_PyObject_FastCall(function, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
}

/* PyObjectLookupSpecial */
#if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error) {
    PyObject *res;
    PyTypeObject *tp = Py_TYPE(obj);
#if PY_MAJOR_VERSION < 3
    if (unlikely(PyInstance_Check(obj)))
        return with_error ? __Pyx_PyObject_GetAttrStr(obj, attr_name) : __Pyx_PyObject_GetAttrStrNoError(obj, attr_name);
#endif
    res = _PyType_Lookup(tp, attr_name);
    if (likely(res)) {
        descrgetfunc f = Py_TYPE(res)->tp_descr_get;
        if (!f) {
            Py_INCREF(res);
        } else {
            res = f(res, obj, (PyObject *)tp);
        }
    } else if (with_error) {
        PyErr_SetObject(PyExc_AttributeError, attr_name);
    }
    return res;
}
#endif

/* 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_GetAttrStrNoError(metaclass, __pyx_n_s_prepare);
        if (prep) {
            PyObject *pargs[3] = {NULL, name, bases};
            ns = __Pyx_PyObject_FastCallDict(prep, pargs+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, mkw);
            Py_DECREF(prep);
        } else {
            if (unlikely(PyErr_Occurred()))
                return NULL;
            ns = PyDict_New();
        }
    } else {
        ns = PyDict_New();
    }
    if (unlikely(!ns))
        return NULL;
    if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad;
#if PY_VERSION_HEX >= 0x03030000
    if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad;
#else
    CYTHON_MAYBE_UNUSED_VAR(qualname);
#endif
    if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad;
    return ns;
bad:
    Py_DECREF(ns);
    return NULL;
}
#if PY_VERSION_HEX < 0x030600A4 && CYTHON_PEP487_INIT_SUBCLASS
static int __Pyx_SetNamesPEP487(PyObject *type_obj) {
    PyTypeObject *type = (PyTypeObject*) type_obj;
    PyObject *names_to_set, *key, *value, *set_name, *tmp;
    Py_ssize_t i = 0;
#if CYTHON_USE_TYPE_SLOTS
    names_to_set = PyDict_Copy(type->tp_dict);
#else
    {
        PyObject *d = PyObject_GetAttr(type_obj, __pyx_n_s_dict);
        names_to_set = NULL;
        if (likely(d)) {
            PyObject *names_to_set = PyDict_New();
            int ret = likely(names_to_set) ? PyDict_Update(names_to_set, d) : -1;
            Py_DECREF(d);
            if (unlikely(ret < 0))
                Py_CLEAR(names_to_set);
        }
    }
#endif
    if (unlikely(names_to_set == NULL))
        goto bad;
    while (PyDict_Next(names_to_set, &i, &key, &value)) {
        set_name = __Pyx_PyObject_LookupSpecialNoError(value, __pyx_n_s_set_name_2);
        if (unlikely(set_name != NULL)) {
            tmp = __Pyx_PyObject_Call2Args(set_name, type_obj, key);
            Py_DECREF(set_name);
            if (unlikely(tmp == NULL)) {
                __Pyx_TypeName value_type_name =
                    __Pyx_PyType_GetName(Py_TYPE(value));
                __Pyx_TypeName type_name = __Pyx_PyType_GetName(type);
                PyErr_Format(PyExc_RuntimeError,
#if PY_MAJOR_VERSION >= 3
                    "Error calling __set_name__ on '" __Pyx_FMT_TYPENAME "' instance %R " "in '" __Pyx_FMT_TYPENAME "'",
                    value_type_name, key, type_name);
#else
                    "Error calling __set_name__ on '" __Pyx_FMT_TYPENAME "' instance %.100s in '" __Pyx_FMT_TYPENAME "'",
                    value_type_name,
                    PyString_Check(key) ? PyString_AS_STRING(key) : "?",
                    type_name);
#endif
                goto bad;
            } else {
                Py_DECREF(tmp);
            }
        }
        else if (unlikely(PyErr_Occurred())) {
            goto bad;
        }
    }
    Py_DECREF(names_to_set);
    return 0;
bad:
    Py_XDECREF(names_to_set);
    return -1;
}
static PyObject *__Pyx_InitSubclassPEP487(PyObject *type_obj, PyObject *mkw) {
#if CYTHON_USE_TYPE_SLOTS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    PyTypeObject *type = (PyTypeObject*) type_obj;
    PyObject *mro = type->tp_mro;
    Py_ssize_t i, nbases;
    if (unlikely(!mro)) goto done;
    (void) &__Pyx_GetBuiltinName;
    Py_INCREF(mro);
    nbases = PyTuple_GET_SIZE(mro);
    assert(PyTuple_GET_ITEM(mro, 0) == type_obj);
    for (i = 1; i < nbases-1; i++) {
        PyObject *base, *dict, *meth;
        base = PyTuple_GET_ITEM(mro, i);
        dict = ((PyTypeObject *)base)->tp_dict;
        meth = __Pyx_PyDict_GetItemStrWithError(dict, __pyx_n_s_init_subclass);
        if (unlikely(meth)) {
            descrgetfunc f = Py_TYPE(meth)->tp_descr_get;
            PyObject *res;
            Py_INCREF(meth);
            if (likely(f)) {
                res = f(meth, NULL, type_obj);
                Py_DECREF(meth);
                if (unlikely(!res)) goto bad;
                meth = res;
            }
            res = __Pyx_PyObject_FastCallDict(meth, NULL, 0, mkw);
            Py_DECREF(meth);
            if (unlikely(!res)) goto bad;
            Py_DECREF(res);
            goto done;
        } else if (unlikely(PyErr_Occurred())) {
            goto bad;
        }
    }
done:
    Py_XDECREF(mro);
    return type_obj;
bad:
    Py_XDECREF(mro);
    Py_DECREF(type_obj);
    return NULL;
#else
    PyObject *super_type, *super, *func, *res;
#if CYTHON_COMPILING_IN_PYPY && !defined(PySuper_Type)
    super_type = __Pyx_GetBuiltinName(__pyx_n_s_super);
#else
    super_type = (PyObject*) &PySuper_Type;
    (void) &__Pyx_GetBuiltinName;
#endif
    super = likely(super_type) ? __Pyx_PyObject_Call2Args(super_type, type_obj, type_obj) : NULL;
#if CYTHON_COMPILING_IN_PYPY && !defined(PySuper_Type)
    Py_XDECREF(super_type);
#endif
    if (unlikely(!super)) {
        Py_CLEAR(type_obj);
        goto done;
    }
    func = __Pyx_PyObject_GetAttrStrNoError(super, __pyx_n_s_init_subclass);
    Py_DECREF(super);
    if (likely(!func)) {
        if (unlikely(PyErr_Occurred()))
            Py_CLEAR(type_obj);
        goto done;
    }
    res = __Pyx_PyObject_FastCallDict(func, NULL, 0, mkw);
    Py_DECREF(func);
    if (unlikely(!res))
        Py_CLEAR(type_obj);
    Py_XDECREF(res);
done:
    return type_obj;
#endif
}
#endif
static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases,
                                      PyObject *dict, PyObject *mkw,
                                      int calculate_metaclass, int allow_py2_metaclass) {
    PyObject *result;
    PyObject *owned_metaclass = NULL;
    PyObject *margs[4] = {NULL, name, bases, dict};
    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;
    }
    result = __Pyx_PyObject_FastCallDict(metaclass, margs+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET,
#if PY_VERSION_HEX < 0x030600A4
        (metaclass == (PyObject*)&PyType_Type) ? NULL : mkw
#else
        mkw
#endif
    );
    Py_XDECREF(owned_metaclass);
#if PY_VERSION_HEX < 0x030600A4 && CYTHON_PEP487_INIT_SUBCLASS
    if (likely(result) && likely(PyType_Check(result))) {
        if (unlikely(__Pyx_SetNamesPEP487(result) < 0)) {
            Py_CLEAR(result);
        } else {
            result = __Pyx_InitSubclassPEP487(result, mkw);
        }
    }
#else
    (void) &__Pyx_GetBuiltinName;
#endif
    return result;
}

/* Import */
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
    PyObject *module = 0;
    PyObject *empty_dict = 0;
    PyObject *empty_list = 0;
    #if PY_MAJOR_VERSION < 3
    PyObject *py_import;
    py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
    if (unlikely(!py_import))
        goto bad;
    if (!from_list) {
        empty_list = PyList_New(0);
        if (unlikely(!empty_list))
            goto bad;
        from_list = empty_list;
    }
    #endif
    empty_dict = PyDict_New();
    if (unlikely(!empty_dict))
        goto bad;
    {
        #if PY_MAJOR_VERSION >= 3
        if (level == -1) {
            if (strchr(__Pyx_MODULE_NAME, '.') != NULL) {
                module = PyImport_ImportModuleLevelObject(
                    name, __pyx_d, empty_dict, from_list, 1);
                if (unlikely(!module)) {
                    if (unlikely(!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 (unlikely(!py_level))
                goto bad;
            module = PyObject_CallFunctionObjArgs(py_import,
                name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL);
            Py_DECREF(py_level);
            #else
            module = PyImport_ImportModuleLevelObject(
                name, __pyx_d, empty_dict, from_list, level);
            #endif
        }
    }
bad:
    Py_XDECREF(empty_dict);
    Py_XDECREF(empty_list);
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(py_import);
    #endif
    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)) {
        const char* module_name_str = 0;
        PyObject* module_name = 0;
        PyObject* module_dot = 0;
        PyObject* full_name = 0;
        PyErr_Clear();
        module_name_str = PyModule_GetName(module);
        if (unlikely(!module_name_str)) { goto modbad; }
        module_name = PyUnicode_FromString(module_name_str);
        if (unlikely(!module_name)) { goto modbad; }
        module_dot = PyUnicode_Concat(module_name, __pyx_kp_u__21);
        if (unlikely(!module_dot)) { goto modbad; }
        full_name = PyUnicode_Concat(module_dot, name);
        if (unlikely(!full_name)) { goto modbad; }
        #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM  < 0x07030400)
        {
            PyObject *modules = PyImport_GetModuleDict();
            if (unlikely(!modules))
                goto modbad;
            value = PyObject_GetItem(modules, full_name);
        }
        #else
        value = PyImport_GetModule(full_name);
        #endif
      modbad:
        Py_XDECREF(full_name);
        Py_XDECREF(module_dot);
        Py_XDECREF(module_name);
    }
    if (unlikely(!value)) {
        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;
}

/* GetAttr */
static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
#if CYTHON_USE_TYPE_SLOTS
#if PY_MAJOR_VERSION >= 3
    if (likely(PyUnicode_Check(n)))
#else
    if (likely(PyString_Check(n)))
#endif
        return __Pyx_PyObject_GetAttrStr(o, n);
#endif
    return PyObject_GetAttr(o, n);
}

/* HasAttr */
static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
    PyObject *r;
    if (unlikely(!__Pyx_PyBaseString_Check(n))) {
        PyErr_SetString(PyExc_TypeError,
                        "hasattr(): attribute name must be string");
        return -1;
    }
    r = __Pyx_GetAttr(o, n);
    if (!r) {
        PyErr_Clear();
        return 0;
    } else {
        Py_DECREF(r);
        return 1;
    }
}

/* ValidateBasesTuple */
#if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS
static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases) {
    Py_ssize_t i, n;
#if CYTHON_ASSUME_SAFE_MACROS
    n = PyTuple_GET_SIZE(bases);
#else
    n = PyTuple_Size(bases);
    if (n < 0) return -1;
#endif
    for (i = 1; i < n; i++)
    {
#if CYTHON_AVOID_BORROWED_REFS
        PyObject *b0 = PySequence_GetItem(bases, i);
        if (!b0) return -1;
#elif CYTHON_ASSUME_SAFE_MACROS
        PyObject *b0 = PyTuple_GET_ITEM(bases, i);
#else
        PyObject *b0 = PyTuple_GetItem(bases, i);
        if (!b0) return -1;
#endif
        PyTypeObject *b;
#if PY_MAJOR_VERSION < 3
        if (PyClass_Check(b0))
        {
            PyErr_Format(PyExc_TypeError, "base class '%.200s' is an old-style class",
                         PyString_AS_STRING(((PyClassObject*)b0)->cl_name));
#if CYTHON_AVOID_BORROWED_REFS
            Py_DECREF(b0);
#endif
            return -1;
        }
#endif
        b = (PyTypeObject*) b0;
        if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE))
        {
            __Pyx_TypeName b_name = __Pyx_PyType_GetName(b);
            PyErr_Format(PyExc_TypeError,
                "base class '" __Pyx_FMT_TYPENAME "' is not a heap type", b_name);
            __Pyx_DECREF_TypeName(b_name);
#if CYTHON_AVOID_BORROWED_REFS
            Py_DECREF(b0);
#endif
            return -1;
        }
        if (dictoffset == 0)
        {
            Py_ssize_t b_dictoffset = 0;
#if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
            b_dictoffset = b->tp_dictoffset;
#else
            PyObject *py_b_dictoffset = PyObject_GetAttrString((PyObject*)b, "__dictoffset__");
            if (!py_b_dictoffset) goto dictoffset_return;
            b_dictoffset = PyLong_AsSsize_t(py_b_dictoffset);
            Py_DECREF(py_b_dictoffset);
            if (b_dictoffset == -1 && PyErr_Occurred()) goto dictoffset_return;
#endif
            if (b_dictoffset) {
                {
                    __Pyx_TypeName b_name = __Pyx_PyType_GetName(b);
                    PyErr_Format(PyExc_TypeError,
                        "extension type '%.200s' has no __dict__ slot, "
                        "but base type '" __Pyx_FMT_TYPENAME "' has: "
                        "either add 'cdef dict __dict__' to the extension type "
                        "or add '__slots__ = [...]' to the base type",
                        type_name, b_name);
                    __Pyx_DECREF_TypeName(b_name);
                }
#if !(CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY)
              dictoffset_return:
#endif
#if CYTHON_AVOID_BORROWED_REFS
                Py_DECREF(b0);
#endif
                return -1;
            }
        }
#if CYTHON_AVOID_BORROWED_REFS
        Py_DECREF(b0);
#endif
    }
    return 0;
}
#endif

/* PyType_Ready */
static int __Pyx_PyType_Ready(PyTypeObject *t) {
#if CYTHON_USE_TYPE_SPECS || !(CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API) || defined(PYSTON_MAJOR_VERSION)
    (void)__Pyx_PyObject_CallMethod0;
#if CYTHON_USE_TYPE_SPECS
    (void)__Pyx_validate_bases_tuple;
#endif
    return PyType_Ready(t);
#else
    int r;
    PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*);
    if (bases && unlikely(__Pyx_validate_bases_tuple(t->tp_name, t->tp_dictoffset, bases) == -1))
        return -1;
#if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION)
    {
        int gc_was_enabled;
    #if PY_VERSION_HEX >= 0x030A00b1
        gc_was_enabled = PyGC_Disable();
        (void)__Pyx_PyObject_CallMethod0;
    #else
        PyObject *ret, *py_status;
        PyObject *gc = NULL;
        #if PY_VERSION_HEX >= 0x030700a1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400)
        gc = PyImport_GetModule(__pyx_kp_u_gc);
        #endif
        if (unlikely(!gc)) gc = PyImport_Import(__pyx_kp_u_gc);
        if (unlikely(!gc)) return -1;
        py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_isenabled);
        if (unlikely(!py_status)) {
            Py_DECREF(gc);
            return -1;
        }
        gc_was_enabled = __Pyx_PyObject_IsTrue(py_status);
        Py_DECREF(py_status);
        if (gc_was_enabled > 0) {
            ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_disable);
            if (unlikely(!ret)) {
                Py_DECREF(gc);
                return -1;
            }
            Py_DECREF(ret);
        } else if (unlikely(gc_was_enabled == -1)) {
            Py_DECREF(gc);
            return -1;
        }
    #endif
        t->tp_flags |= Py_TPFLAGS_HEAPTYPE;
#if PY_VERSION_HEX >= 0x030A0000
        t->tp_flags |= Py_TPFLAGS_IMMUTABLETYPE;
#endif
#else
        (void)__Pyx_PyObject_CallMethod0;
#endif
    r = PyType_Ready(t);
#if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION)
        t->tp_flags &= ~Py_TPFLAGS_HEAPTYPE;
    #if PY_VERSION_HEX >= 0x030A00b1
        if (gc_was_enabled)
            PyGC_Enable();
    #else
        if (gc_was_enabled) {
            PyObject *tp, *v, *tb;
            PyErr_Fetch(&tp, &v, &tb);
            ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_enable);
            if (likely(ret || r == -1)) {
                Py_XDECREF(ret);
                PyErr_Restore(tp, v, tb);
            } else {
                Py_XDECREF(tp);
                Py_XDECREF(v);
                Py_XDECREF(tb);
                r = -1;
            }
        }
        Py_DECREF(gc);
    #endif
    }
#endif
    return r;
#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) {
    __Pyx_TypeName type_name = __Pyx_PyType_GetName(tp);
    PyErr_Format(PyExc_AttributeError,
#if PY_MAJOR_VERSION >= 3
                 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'",
                 type_name, attr_name);
#else
                 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'",
                 type_name, PyString_AS_STRING(attr_name));
#endif
    __Pyx_DECREF_TypeName(type_name);
    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

/* PyObject_GenericGetAttr */
#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
    if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
        return PyObject_GenericGetAttr(obj, attr_name);
    }
    return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
}
#endif

/* SetVTable */
static int __Pyx_SetVtable(PyTypeObject *type, void *vtable) {
    PyObject *ob = PyCapsule_New(vtable, 0, 0);
    if (unlikely(!ob))
        goto bad;
#if CYTHON_COMPILING_IN_LIMITED_API
    if (unlikely(PyObject_SetAttr((PyObject *) type, __pyx_n_s_pyx_vtable, ob) < 0))
#else
    if (unlikely(PyDict_SetItem(type->tp_dict, __pyx_n_s_pyx_vtable, ob) < 0))
#endif
        goto bad;
    Py_DECREF(ob);
    return 0;
bad:
    Py_XDECREF(ob);
    return -1;
}

/* GetVTable */
static void* __Pyx_GetVtable(PyTypeObject *type) {
    void* ptr;
#if CYTHON_COMPILING_IN_LIMITED_API
    PyObject *ob = PyObject_GetAttr((PyObject *)type, __pyx_n_s_pyx_vtable);
#else
    PyObject *ob = PyObject_GetItem(type->tp_dict, __pyx_n_s_pyx_vtable);
#endif
    if (!ob)
        goto bad;
    ptr = PyCapsule_GetPointer(ob, 0);
    if (!ptr && !PyErr_Occurred())
        PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type");
    Py_DECREF(ob);
    return ptr;
bad:
    Py_XDECREF(ob);
    return NULL;
}

/* MergeVTables */
#if !CYTHON_COMPILING_IN_LIMITED_API
static int __Pyx_MergeVtables(PyTypeObject *type) {
    int i;
    void** base_vtables;
    __Pyx_TypeName tp_base_name;
    __Pyx_TypeName base_name;
    void* unknown = (void*)-1;
    PyObject* bases = type->tp_bases;
    int base_depth = 0;
    {
        PyTypeObject* base = type->tp_base;
        while (base) {
            base_depth += 1;
            base = base->tp_base;
        }
    }
    base_vtables = (void**) malloc(sizeof(void*) * (size_t)(base_depth + 1));
    base_vtables[0] = unknown;
    for (i = 1; i < PyTuple_GET_SIZE(bases); i++) {
        void* base_vtable = __Pyx_GetVtable(((PyTypeObject*)PyTuple_GET_ITEM(bases, i)));
        if (base_vtable != NULL) {
            int j;
            PyTypeObject* base = type->tp_base;
            for (j = 0; j < base_depth; j++) {
                if (base_vtables[j] == unknown) {
                    base_vtables[j] = __Pyx_GetVtable(base);
                    base_vtables[j + 1] = unknown;
                }
                if (base_vtables[j] == base_vtable) {
                    break;
                } else if (base_vtables[j] == NULL) {
                    goto bad;
                }
                base = base->tp_base;
            }
        }
    }
    PyErr_Clear();
    free(base_vtables);
    return 0;
bad:
    tp_base_name = __Pyx_PyType_GetName(type->tp_base);
    base_name = __Pyx_PyType_GetName((PyTypeObject*)PyTuple_GET_ITEM(bases, i));
    PyErr_Format(PyExc_TypeError,
        "multiple bases have vtable conflict: '" __Pyx_FMT_TYPENAME "' and '" __Pyx_FMT_TYPENAME "'", tp_base_name, base_name);
    __Pyx_DECREF_TypeName(tp_base_name);
    __Pyx_DECREF_TypeName(base_name);
    free(base_vtables);
    return -1;
}
#endif

/* SetupReduce */
#if !CYTHON_COMPILING_IN_LIMITED_API
static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
  int ret;
  PyObject *name_attr;
  name_attr = __Pyx_PyObject_GetAttrStrNoError(meth, __pyx_n_s_name_2);
  if (likely(name_attr)) {
      ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
  } else {
      ret = -1;
  }
  if (unlikely(ret < 0)) {
      PyErr_Clear();
      ret = 0;
  }
  Py_XDECREF(name_attr);
  return ret;
}
static int __Pyx_setup_reduce(PyObject* type_obj) {
    int ret = 0;
    PyObject *object_reduce = NULL;
    PyObject *object_getstate = NULL;
    PyObject *object_reduce_ex = NULL;
    PyObject *reduce = NULL;
    PyObject *reduce_ex = NULL;
    PyObject *reduce_cython = NULL;
    PyObject *setstate = NULL;
    PyObject *setstate_cython = NULL;
    PyObject *getstate = NULL;
#if CYTHON_USE_PYTYPE_LOOKUP
    getstate = _PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate);
#else
    getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_getstate);
    if (!getstate && PyErr_Occurred()) {
        goto __PYX_BAD;
    }
#endif
    if (getstate) {
#if CYTHON_USE_PYTYPE_LOOKUP
        object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_getstate);
#else
        object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_n_s_getstate);
        if (!object_getstate && PyErr_Occurred()) {
            goto __PYX_BAD;
        }
#endif
        if (object_getstate != getstate) {
            goto __PYX_GOOD;
        }
    }
#if CYTHON_USE_PYTYPE_LOOKUP
    object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
#else
    object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
#endif
    reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD;
    if (reduce_ex == object_reduce_ex) {
#if CYTHON_USE_PYTYPE_LOOKUP
        object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
#else
        object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
#endif
        reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD;
        if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
            reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython);
            if (likely(reduce_cython)) {
                ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
                ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
            } else if (reduce == object_reduce || PyErr_Occurred()) {
                goto __PYX_BAD;
            }
            setstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate);
            if (!setstate) PyErr_Clear();
            if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
                setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython);
                if (likely(setstate_cython)) {
                    ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
                    ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
                } else if (!setstate || PyErr_Occurred()) {
                    goto __PYX_BAD;
                }
            }
            PyType_Modified((PyTypeObject*)type_obj);
        }
    }
    goto __PYX_GOOD;
__PYX_BAD:
    if (!PyErr_Occurred()) {
        __Pyx_TypeName type_obj_name =
            __Pyx_PyType_GetName((PyTypeObject*)type_obj);
        PyErr_Format(PyExc_RuntimeError,
            "Unable to initialize pickling for " __Pyx_FMT_TYPENAME, type_obj_name);
        __Pyx_DECREF_TypeName(type_obj_name);
    }
    ret = -1;
__PYX_GOOD:
#if !CYTHON_USE_PYTYPE_LOOKUP
    Py_XDECREF(object_reduce);
    Py_XDECREF(object_reduce_ex);
    Py_XDECREF(object_getstate);
    Py_XDECREF(getstate);
#endif
    Py_XDECREF(reduce);
    Py_XDECREF(reduce_ex);
    Py_XDECREF(reduce_cython);
    Py_XDECREF(setstate);
    Py_XDECREF(setstate_cython);
    return ret;
}
#endif

/* TypeImport */
#ifndef __PYX_HAVE_RT_ImportType_3_0_11
#define __PYX_HAVE_RT_ImportType_3_0_11
static PyTypeObject *__Pyx_ImportType_3_0_11(PyObject *module, const char *module_name, const char *class_name,
    size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_11 check_size)
{
    PyObject *result = 0;
    char warning[200];
    Py_ssize_t basicsize;
    Py_ssize_t itemsize;
#if CYTHON_COMPILING_IN_LIMITED_API
    PyObject *py_basicsize;
    PyObject *py_itemsize;
#endif
    result = PyObject_GetAttrString(module, class_name);
    if (!result)
        goto bad;
    if (!PyType_Check(result)) {
        PyErr_Format(PyExc_TypeError,
            "%.200s.%.200s is not a type object",
            module_name, class_name);
        goto bad;
    }
#if !CYTHON_COMPILING_IN_LIMITED_API
    basicsize = ((PyTypeObject *)result)->tp_basicsize;
    itemsize = ((PyTypeObject *)result)->tp_itemsize;
#else
    py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
    if (!py_basicsize)
        goto bad;
    basicsize = PyLong_AsSsize_t(py_basicsize);
    Py_DECREF(py_basicsize);
    py_basicsize = 0;
    if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
        goto bad;
    py_itemsize = PyObject_GetAttrString(result, "__itemsize__");
    if (!py_itemsize)
        goto bad;
    itemsize = PyLong_AsSsize_t(py_itemsize);
    Py_DECREF(py_itemsize);
    py_itemsize = 0;
    if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred())
        goto bad;
#endif
    if (itemsize) {
        if (size % alignment) {
            alignment = size % alignment;
        }
        if (itemsize < (Py_ssize_t)alignment)
            itemsize = (Py_ssize_t)alignment;
    }
    if ((size_t)(basicsize + itemsize) < size) {
        PyErr_Format(PyExc_ValueError,
            "%.200s.%.200s size changed, may indicate binary incompatibility. "
            "Expected %zd from C header, got %zd from PyObject",
            module_name, class_name, size, basicsize+itemsize);
        goto bad;
    }
    if (check_size == __Pyx_ImportType_CheckSize_Error_3_0_11 &&
            ((size_t)basicsize > size || (size_t)(basicsize + itemsize) < size)) {
        PyErr_Format(PyExc_ValueError,
            "%.200s.%.200s size changed, may indicate binary incompatibility. "
            "Expected %zd from C header, got %zd-%zd from PyObject",
            module_name, class_name, size, basicsize, basicsize+itemsize);
        goto bad;
    }
    else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_0_11 && (size_t)basicsize > size) {
        PyOS_snprintf(warning, sizeof(warning),
            "%s.%s size changed, may indicate binary incompatibility. "
            "Expected %zd from C header, got %zd from PyObject",
            module_name, class_name, size, basicsize);
        if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
    }
    return (PyTypeObject *)result;
bad:
    Py_XDECREF(result);
    return NULL;
}
#endif

/* ImportDottedModule */
#if PY_MAJOR_VERSION >= 3
static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) {
    PyObject *partial_name = NULL, *slice = NULL, *sep = NULL;
    if (unlikely(PyErr_Occurred())) {
        PyErr_Clear();
    }
    if (likely(PyTuple_GET_SIZE(parts_tuple) == count)) {
        partial_name = name;
    } else {
        slice = PySequence_GetSlice(parts_tuple, 0, count);
        if (unlikely(!slice))
            goto bad;
        sep = PyUnicode_FromStringAndSize(".", 1);
        if (unlikely(!sep))
            goto bad;
        partial_name = PyUnicode_Join(sep, slice);
    }
    PyErr_Format(
#if PY_MAJOR_VERSION < 3
        PyExc_ImportError,
        "No module named '%s'", PyString_AS_STRING(partial_name));
#else
#if PY_VERSION_HEX >= 0x030600B1
        PyExc_ModuleNotFoundError,
#else
        PyExc_ImportError,
#endif
        "No module named '%U'", partial_name);
#endif
bad:
    Py_XDECREF(sep);
    Py_XDECREF(slice);
    Py_XDECREF(partial_name);
    return NULL;
}
#endif
#if PY_MAJOR_VERSION >= 3
static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) {
    PyObject *imported_module;
#if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM  < 0x07030400)
    PyObject *modules = PyImport_GetModuleDict();
    if (unlikely(!modules))
        return NULL;
    imported_module = __Pyx_PyDict_GetItemStr(modules, name);
    Py_XINCREF(imported_module);
#else
    imported_module = PyImport_GetModule(name);
#endif
    return imported_module;
}
#endif
#if PY_MAJOR_VERSION >= 3
static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple) {
    Py_ssize_t i, nparts;
    nparts = PyTuple_GET_SIZE(parts_tuple);
    for (i=1; i < nparts && module; i++) {
        PyObject *part, *submodule;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        part = PyTuple_GET_ITEM(parts_tuple, i);
#else
        part = PySequence_ITEM(parts_tuple, i);
#endif
        submodule = __Pyx_PyObject_GetAttrStrNoError(module, part);
#if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
        Py_DECREF(part);
#endif
        Py_DECREF(module);
        module = submodule;
    }
    if (unlikely(!module)) {
        return __Pyx__ImportDottedModule_Error(name, parts_tuple, i);
    }
    return module;
}
#endif
static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) {
#if PY_MAJOR_VERSION < 3
    PyObject *module, *from_list, *star = __pyx_n_s__84;
    CYTHON_UNUSED_VAR(parts_tuple);
    from_list = PyList_New(1);
    if (unlikely(!from_list))
        return NULL;
    Py_INCREF(star);
    PyList_SET_ITEM(from_list, 0, star);
    module = __Pyx_Import(name, from_list, 0);
    Py_DECREF(from_list);
    return module;
#else
    PyObject *imported_module;
    PyObject *module = __Pyx_Import(name, NULL, 0);
    if (!parts_tuple || unlikely(!module))
        return module;
    imported_module = __Pyx__ImportDottedModule_Lookup(name);
    if (likely(imported_module)) {
        Py_DECREF(module);
        return imported_module;
    }
    PyErr_Clear();
    return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple);
#endif
}
static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) {
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030400B1
    PyObject *module = __Pyx__ImportDottedModule_Lookup(name);
    if (likely(module)) {
        PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_n_s_spec);
        if (likely(spec)) {
            PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_n_s_initializing);
            if (likely(!unsafe || !__Pyx_PyObject_IsTrue(unsafe))) {
                Py_DECREF(spec);
                spec = NULL;
            }
            Py_XDECREF(unsafe);
        }
        if (likely(!spec)) {
            PyErr_Clear();
            return module;
        }
        Py_DECREF(spec);
        Py_DECREF(module);
    } else if (PyErr_Occurred()) {
        PyErr_Clear();
    }
#endif
    return __Pyx__ImportDottedModule(name, parts_tuple);
}

/* GetNameInClass */
static PyObject *__Pyx__GetNameInClass(PyObject *nmspace, PyObject *name) {
    PyObject *result;
    PyObject *dict;
    assert(PyType_Check(nmspace));
#if CYTHON_USE_TYPE_SLOTS
    dict = ((PyTypeObject*)nmspace)->tp_dict;
    Py_XINCREF(dict);
#else
    dict = PyObject_GetAttr(nmspace, __pyx_n_s_dict);
#endif
    if (likely(dict)) {
        result = PyObject_GetItem(dict, name);
        Py_DECREF(dict);
        if (result) {
            return result;
        }
    }
    PyErr_Clear();
    __Pyx_GetModuleGlobalNameUncached(result, name);
    return result;
}

/* ClassMethod */
static PyObject* __Pyx_Method_ClassMethod(PyObject *method) {
#if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM <= 0x05080000
    if (PyObject_TypeCheck(method, &PyWrapperDescr_Type)) {
        return PyClassMethod_New(method);
    }
#else
#if CYTHON_COMPILING_IN_PYPY
    if (PyMethodDescr_Check(method))
#else
    #if PY_MAJOR_VERSION == 2
    static PyTypeObject *methoddescr_type = NULL;
    if (unlikely(methoddescr_type == NULL)) {
       PyObject *meth = PyObject_GetAttrString((PyObject*)&PyList_Type, "append");
       if (unlikely(!meth)) return NULL;
       methoddescr_type = Py_TYPE(meth);
       Py_DECREF(meth);
    }
    #else
    PyTypeObject *methoddescr_type = &PyMethodDescr_Type;
    #endif
    if (__Pyx_TypeCheck(method, methoddescr_type))
#endif
    {
        PyMethodDescrObject *descr = (PyMethodDescrObject *)method;
        #if PY_VERSION_HEX < 0x03020000
        PyTypeObject *d_type = descr->d_type;
        #else
        PyTypeObject *d_type = descr->d_common.d_type;
        #endif
        return PyDescr_NewClassMethod(d_type, descr->d_method);
    }
#endif
    else if (PyMethod_Check(method)) {
        return PyClassMethod_New(PyMethod_GET_FUNCTION(method));
    }
    else {
        return PyClassMethod_New(method);
    }
}

/* CLineInTraceback */
#ifndef CYTHON_CLINE_IN_TRACEBACK
static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) {
    PyObject *use_cline;
    PyObject *ptype, *pvalue, *ptraceback;
#if CYTHON_COMPILING_IN_CPYTHON
    PyObject **cython_runtime_dict;
#endif
    CYTHON_MAYBE_UNUSED_VAR(tstate);
    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)) {
        __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
            use_cline, *cython_runtime_dict,
            __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
    } else
#endif
    {
      PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__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;
        (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
    }
    else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
        c_line = 0;
    }
    __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
    return c_line;
}
#endif

/* CodeObjectCache */
#if !CYTHON_COMPILING_IN_LIMITED_API
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);
}
#endif

/* AddTraceback */
#include "compile.h"
#include "frameobject.h"
#include "traceback.h"
#if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API
  #ifndef Py_BUILD_CORE
    #define Py_BUILD_CORE 1
  #endif
  #include "internal/pycore_frame.h"
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict,
                                                       PyObject *firstlineno, PyObject *name) {
    PyObject *replace = NULL;
    if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL;
    if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL;
    replace = PyObject_GetAttrString(code, "replace");
    if (likely(replace)) {
        PyObject *result;
        result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict);
        Py_DECREF(replace);
        return result;
    }
    PyErr_Clear();
    #if __PYX_LIMITED_VERSION_HEX < 0x030780000
    {
        PyObject *compiled = NULL, *result = NULL;
        if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL;
        if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL;
        compiled = Py_CompileString(
            "out = type(code)(\n"
            "  code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n"
            "  code.co_flags, code.co_code, code.co_consts, code.co_names,\n"
            "  code.co_varnames, code.co_filename, co_name, co_firstlineno,\n"
            "  code.co_lnotab)\n", "<dummy>", Py_file_input);
        if (!compiled) return NULL;
        result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict);
        Py_DECREF(compiled);
        if (!result) PyErr_Print();
        Py_DECREF(result);
        result = PyDict_GetItemString(scratch_dict, "out");
        if (result) Py_INCREF(result);
        return result;
    }
    #else
    return NULL;
    #endif
}
static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename) {
    PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL;
    PyObject *replace = NULL, *getframe = NULL, *frame = NULL;
    PyObject *exc_type, *exc_value, *exc_traceback;
    int success = 0;
    if (c_line) {
        (void) __pyx_cfilenm;
        (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line);
    }
    PyErr_Fetch(&exc_type, &exc_value, &exc_traceback);
    code_object = Py_CompileString("_getframe()", filename, Py_eval_input);
    if (unlikely(!code_object)) goto bad;
    py_py_line = PyLong_FromLong(py_line);
    if (unlikely(!py_py_line)) goto bad;
    py_funcname = PyUnicode_FromString(funcname);
    if (unlikely(!py_funcname)) goto bad;
    dict = PyDict_New();
    if (unlikely(!dict)) goto bad;
    {
        PyObject *old_code_object = code_object;
        code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname);
        Py_DECREF(old_code_object);
    }
    if (unlikely(!code_object)) goto bad;
    getframe = PySys_GetObject("_getframe");
    if (unlikely(!getframe)) goto bad;
    if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad;
    frame = PyEval_EvalCode(code_object, dict, dict);
    if (unlikely(!frame) || frame == Py_None) goto bad;
    success = 1;
  bad:
    PyErr_Restore(exc_type, exc_value, exc_traceback);
    Py_XDECREF(code_object);
    Py_XDECREF(py_py_line);
    Py_XDECREF(py_funcname);
    Py_XDECREF(dict);
    Py_XDECREF(replace);
    if (success) {
        PyTraceBack_Here(
            (struct _frame*)frame);
    }
    Py_XDECREF(frame);
}
#else
static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
            const char *funcname, int c_line,
            int py_line, const char *filename) {
    PyCodeObject *py_code = NULL;
    PyObject *py_funcname = NULL;
    #if PY_MAJOR_VERSION < 3
    PyObject *py_srcfile = NULL;
    py_srcfile = PyString_FromString(filename);
    if (!py_srcfile) goto bad;
    #endif
    if (c_line) {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        if (!py_funcname) goto bad;
        #else
        py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        if (!py_funcname) goto bad;
        funcname = PyUnicode_AsUTF8(py_funcname);
        if (!funcname) goto bad;
        #endif
    }
    else {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromString(funcname);
        if (!py_funcname) goto bad;
        #endif
    }
    #if PY_MAJOR_VERSION < 3
    py_code = __Pyx_PyCode_New(
        0,
        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);
    #else
    py_code = PyCode_NewEmpty(filename, funcname, py_line);
    #endif
    Py_XDECREF(py_funcname);
    return py_code;
bad:
    Py_XDECREF(py_funcname);
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(py_srcfile);
    #endif
    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;
    PyObject *ptype, *pvalue, *ptraceback;
    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) {
        __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
        py_code = __Pyx_CreateCodeObjectForTraceback(
            funcname, c_line, py_line, filename);
        if (!py_code) {
            /* If the code object creation fails, then we should clear the
               fetched exception references and propagate the new exception */
            Py_XDECREF(ptype);
            Py_XDECREF(pvalue);
            Py_XDECREF(ptraceback);
            goto bad;
        }
        __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
        __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);
}
#endif

/* CIntFromPyVerify */
#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
    __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
    __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
    {\
        func_type value = func_value;\
        if (sizeof(target_type) < sizeof(func_type)) {\
            if (unlikely(value != (func_type) (target_type) value)) {\
                func_type zero = 0;\
                if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
                    return (target_type) -1;\
                if (is_unsigned && unlikely(value < zero))\
                    goto raise_neg_overflow;\
                else\
                    goto raise_overflow;\
            }\
        }\
        return (target_type) value;\
    }

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_AMPL_OUTPUTKIND(AMPL_OUTPUTKIND value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const AMPL_OUTPUTKIND neg_one = (AMPL_OUTPUTKIND) -1, const_zero = (AMPL_OUTPUTKIND) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(AMPL_OUTPUTKIND) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(AMPL_OUTPUTKIND) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(AMPL_OUTPUTKIND) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(AMPL_OUTPUTKIND) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(AMPL_OUTPUTKIND) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        unsigned char *bytes = (unsigned char *)&value;
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
        if (is_unsigned) {
            return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
        } else {
            return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
        }
#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
        int one = 1; int little = (int)*(unsigned char *)&one;
        return _PyLong_FromByteArray(bytes, sizeof(AMPL_OUTPUTKIND),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *from_bytes, *result = NULL;
        PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL;
        from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
        if (!from_bytes) return NULL;
        py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(AMPL_OUTPUTKIND));
        if (!py_bytes) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        arg_tuple = PyTuple_Pack(2, py_bytes, order_str);
        if (!arg_tuple) goto limited_bad;
        if (!is_unsigned) {
            kwds = PyDict_New();
            if (!kwds) goto limited_bad;
            if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad;
        }
        result = PyObject_Call(from_bytes, arg_tuple, kwds);
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(arg_tuple);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes);
        return result;
#endif
    }
}

/* CIntFromPy */
static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const long neg_one = (long) -1, const_zero = (long) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    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;
        }
    }
#endif
    if (unlikely(!PyLong_Check(x))) {
        long val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (long) -1;
        val = __Pyx_PyInt_As_long(tmp);
        Py_DECREF(tmp);
        return val;
    }
    if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
        if (unlikely(__Pyx_PyLong_IsNeg(x))) {
            goto raise_neg_overflow;
        } else if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_DigitCount(x)) {
                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 && PY_VERSION_HEX < 0x030C00A7
        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
        if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_SignedDigitCount(x)) {
                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
        }
    }
    {
        long val;
        int ret = -1;
#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
        Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
            x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
        if (unlikely(bytes_copied == -1)) {
        } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
            goto raise_overflow;
        } else {
            ret = 0;
        }
#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
        int one = 1; int is_little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        ret = _PyLong_AsByteArray((PyLongObject *)x,
                                    bytes, sizeof(val),
                                    is_little, !is_unsigned);
#else
        PyObject *v;
        PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
        int bits, remaining_bits, is_negative = 0;
        int chunk_size = (sizeof(long) < 8) ? 30 : 62;
        if (likely(PyLong_CheckExact(x))) {
            v = __Pyx_NewRef(x);
        } else {
            v = PyNumber_Long(x);
            if (unlikely(!v)) return (long) -1;
            assert(PyLong_CheckExact(v));
        }
        {
            int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
            if (unlikely(result < 0)) {
                Py_DECREF(v);
                return (long) -1;
            }
            is_negative = result == 1;
        }
        if (is_unsigned && unlikely(is_negative)) {
            Py_DECREF(v);
            goto raise_neg_overflow;
        } else if (is_negative) {
            stepval = PyNumber_Invert(v);
            Py_DECREF(v);
            if (unlikely(!stepval))
                return (long) -1;
        } else {
            stepval = v;
        }
        v = NULL;
        val = (long) 0;
        mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
        shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
        for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) {
            PyObject *tmp, *digit;
            long idigit;
            digit = PyNumber_And(stepval, mask);
            if (unlikely(!digit)) goto done;
            idigit = PyLong_AsLong(digit);
            Py_DECREF(digit);
            if (unlikely(idigit < 0)) goto done;
            val |= ((long) idigit) << bits;
            tmp = PyNumber_Rshift(stepval, shift);
            if (unlikely(!tmp)) goto done;
            Py_DECREF(stepval); stepval = tmp;
        }
        Py_DECREF(shift); shift = NULL;
        Py_DECREF(mask); mask = NULL;
        {
            long idigit = PyLong_AsLong(stepval);
            if (unlikely(idigit < 0)) goto done;
            remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1);
            if (unlikely(idigit >= (1L << remaining_bits)))
                goto raise_overflow;
            val |= ((long) idigit) << bits;
        }
        if (!is_unsigned) {
            if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1))))
                goto raise_overflow;
            if (is_negative)
                val = ~val;
        }
        ret = 0;
    done:
        Py_XDECREF(shift);
        Py_XDECREF(mask);
        Py_XDECREF(stepval);
#endif
        if (unlikely(ret))
            return (long) -1;
        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 size_t __Pyx_PyInt_As_size_t(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const size_t neg_one = (size_t) -1, const_zero = (size_t) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if ((sizeof(size_t) < sizeof(long))) {
            __PYX_VERIFY_RETURN_INT(size_t, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (size_t) val;
        }
    }
#endif
    if (unlikely(!PyLong_Check(x))) {
        size_t val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (size_t) -1;
        val = __Pyx_PyInt_As_size_t(tmp);
        Py_DECREF(tmp);
        return val;
    }
    if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
        if (unlikely(__Pyx_PyLong_IsNeg(x))) {
            goto raise_neg_overflow;
        } else if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(size_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_DigitCount(x)) {
                case 2:
                    if ((8 * sizeof(size_t) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(size_t) >= 2 * PyLong_SHIFT)) {
                            return (size_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(size_t) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(size_t) >= 3 * PyLong_SHIFT)) {
                            return (size_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(size_t) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(size_t) >= 4 * PyLong_SHIFT)) {
                            return (size_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
                        }
                    }
                    break;
            }
        }
#endif
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
        if (unlikely(Py_SIZE(x) < 0)) {
            goto raise_neg_overflow;
        }
#else
        {
            int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
            if (unlikely(result < 0))
                return (size_t) -1;
            if (unlikely(result == 1))
                goto raise_neg_overflow;
        }
#endif
        if ((sizeof(size_t) <= sizeof(unsigned long))) {
            __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
        } else if ((sizeof(size_t) <= sizeof(unsigned PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
        }
    } else {
#if CYTHON_USE_PYLONG_INTERNALS
        if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(size_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_SignedDigitCount(x)) {
                case -2:
                    if ((8 * sizeof(size_t) - 1 > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT)) {
                            return (size_t) (((size_t)-1)*(((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if ((8 * sizeof(size_t) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT)) {
                            return (size_t) ((((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if ((8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT)) {
                            return (size_t) (((size_t)-1)*(((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(size_t) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT)) {
                            return (size_t) ((((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if ((8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT)) {
                            return (size_t) (((size_t)-1)*(((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(size_t) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT)) {
                            return (size_t) ((((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                        }
                    }
                    break;
            }
        }
#endif
        if ((sizeof(size_t) <= sizeof(long))) {
            __PYX_VERIFY_RETURN_INT_EXC(size_t, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
        } else if ((sizeof(size_t) <= sizeof(PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(size_t, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
        }
    }
    {
        size_t val;
        int ret = -1;
#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
        Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
            x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
        if (unlikely(bytes_copied == -1)) {
        } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
            goto raise_overflow;
        } else {
            ret = 0;
        }
#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
        int one = 1; int is_little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        ret = _PyLong_AsByteArray((PyLongObject *)x,
                                    bytes, sizeof(val),
                                    is_little, !is_unsigned);
#else
        PyObject *v;
        PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
        int bits, remaining_bits, is_negative = 0;
        int chunk_size = (sizeof(long) < 8) ? 30 : 62;
        if (likely(PyLong_CheckExact(x))) {
            v = __Pyx_NewRef(x);
        } else {
            v = PyNumber_Long(x);
            if (unlikely(!v)) return (size_t) -1;
            assert(PyLong_CheckExact(v));
        }
        {
            int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
            if (unlikely(result < 0)) {
                Py_DECREF(v);
                return (size_t) -1;
            }
            is_negative = result == 1;
        }
        if (is_unsigned && unlikely(is_negative)) {
            Py_DECREF(v);
            goto raise_neg_overflow;
        } else if (is_negative) {
            stepval = PyNumber_Invert(v);
            Py_DECREF(v);
            if (unlikely(!stepval))
                return (size_t) -1;
        } else {
            stepval = v;
        }
        v = NULL;
        val = (size_t) 0;
        mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
        shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
        for (bits = 0; bits < (int) sizeof(size_t) * 8 - chunk_size; bits += chunk_size) {
            PyObject *tmp, *digit;
            long idigit;
            digit = PyNumber_And(stepval, mask);
            if (unlikely(!digit)) goto done;
            idigit = PyLong_AsLong(digit);
            Py_DECREF(digit);
            if (unlikely(idigit < 0)) goto done;
            val |= ((size_t) idigit) << bits;
            tmp = PyNumber_Rshift(stepval, shift);
            if (unlikely(!tmp)) goto done;
            Py_DECREF(stepval); stepval = tmp;
        }
        Py_DECREF(shift); shift = NULL;
        Py_DECREF(mask); mask = NULL;
        {
            long idigit = PyLong_AsLong(stepval);
            if (unlikely(idigit < 0)) goto done;
            remaining_bits = ((int) sizeof(size_t) * 8) - bits - (is_unsigned ? 0 : 1);
            if (unlikely(idigit >= (1L << remaining_bits)))
                goto raise_overflow;
            val |= ((size_t) idigit) << bits;
        }
        if (!is_unsigned) {
            if (unlikely(val & (((size_t) 1) << (sizeof(size_t) * 8 - 1))))
                goto raise_overflow;
            if (is_negative)
                val = ~val;
        }
        ret = 0;
    done:
        Py_XDECREF(shift);
        Py_XDECREF(mask);
        Py_XDECREF(stepval);
#endif
        if (unlikely(ret))
            return (size_t) -1;
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to size_t");
    return (size_t) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to size_t");
    return (size_t) -1;
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const int neg_one = (int) -1, const_zero = (int) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(int) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(int) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(int) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        unsigned char *bytes = (unsigned char *)&value;
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
        if (is_unsigned) {
            return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
        } else {
            return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
        }
#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
        int one = 1; int little = (int)*(unsigned char *)&one;
        return _PyLong_FromByteArray(bytes, sizeof(int),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *from_bytes, *result = NULL;
        PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL;
        from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
        if (!from_bytes) return NULL;
        py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int));
        if (!py_bytes) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        arg_tuple = PyTuple_Pack(2, py_bytes, order_str);
        if (!arg_tuple) goto limited_bad;
        if (!is_unsigned) {
            kwds = PyDict_New();
            if (!kwds) goto limited_bad;
            if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad;
        }
        result = PyObject_Call(from_bytes, arg_tuple, kwds);
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(arg_tuple);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes);
        return result;
#endif
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const long neg_one = (long) -1, const_zero = (long) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    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
        }
    }
    {
        unsigned char *bytes = (unsigned char *)&value;
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
        if (is_unsigned) {
            return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
        } else {
            return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
        }
#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
        int one = 1; int little = (int)*(unsigned char *)&one;
        return _PyLong_FromByteArray(bytes, sizeof(long),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *from_bytes, *result = NULL;
        PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL;
        from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
        if (!from_bytes) return NULL;
        py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long));
        if (!py_bytes) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        arg_tuple = PyTuple_Pack(2, py_bytes, order_str);
        if (!arg_tuple) goto limited_bad;
        if (!is_unsigned) {
            kwds = PyDict_New();
            if (!kwds) goto limited_bad;
            if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad;
        }
        result = PyObject_Call(from_bytes, arg_tuple, kwds);
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(arg_tuple);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes);
        return result;
#endif
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_AMPL_ENTITYTYPE(AMPL_ENTITYTYPE value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const AMPL_ENTITYTYPE neg_one = (AMPL_ENTITYTYPE) -1, const_zero = (AMPL_ENTITYTYPE) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(AMPL_ENTITYTYPE) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(AMPL_ENTITYTYPE) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(AMPL_ENTITYTYPE) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(AMPL_ENTITYTYPE) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(AMPL_ENTITYTYPE) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        unsigned char *bytes = (unsigned char *)&value;
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
        if (is_unsigned) {
            return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
        } else {
            return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
        }
#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
        int one = 1; int little = (int)*(unsigned char *)&one;
        return _PyLong_FromByteArray(bytes, sizeof(AMPL_ENTITYTYPE),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *from_bytes, *result = NULL;
        PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL;
        from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
        if (!from_bytes) return NULL;
        py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(AMPL_ENTITYTYPE));
        if (!py_bytes) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        arg_tuple = PyTuple_Pack(2, py_bytes, order_str);
        if (!arg_tuple) goto limited_bad;
        if (!is_unsigned) {
            kwds = PyDict_New();
            if (!kwds) goto limited_bad;
            if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad;
        }
        result = PyObject_Call(from_bytes, arg_tuple, kwds);
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(arg_tuple);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes);
        return result;
#endif
    }
}

/* CIntFromPy */
static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const int neg_one = (int) -1, const_zero = (int) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    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;
        }
    }
#endif
    if (unlikely(!PyLong_Check(x))) {
        int val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (int) -1;
        val = __Pyx_PyInt_As_int(tmp);
        Py_DECREF(tmp);
        return val;
    }
    if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
        if (unlikely(__Pyx_PyLong_IsNeg(x))) {
            goto raise_neg_overflow;
        } else if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_DigitCount(x)) {
                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 && PY_VERSION_HEX < 0x030C00A7
        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
        if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_SignedDigitCount(x)) {
                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
        }
    }
    {
        int val;
        int ret = -1;
#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
        Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
            x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
        if (unlikely(bytes_copied == -1)) {
        } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
            goto raise_overflow;
        } else {
            ret = 0;
        }
#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
        int one = 1; int is_little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        ret = _PyLong_AsByteArray((PyLongObject *)x,
                                    bytes, sizeof(val),
                                    is_little, !is_unsigned);
#else
        PyObject *v;
        PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
        int bits, remaining_bits, is_negative = 0;
        int chunk_size = (sizeof(long) < 8) ? 30 : 62;
        if (likely(PyLong_CheckExact(x))) {
            v = __Pyx_NewRef(x);
        } else {
            v = PyNumber_Long(x);
            if (unlikely(!v)) return (int) -1;
            assert(PyLong_CheckExact(v));
        }
        {
            int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
            if (unlikely(result < 0)) {
                Py_DECREF(v);
                return (int) -1;
            }
            is_negative = result == 1;
        }
        if (is_unsigned && unlikely(is_negative)) {
            Py_DECREF(v);
            goto raise_neg_overflow;
        } else if (is_negative) {
            stepval = PyNumber_Invert(v);
            Py_DECREF(v);
            if (unlikely(!stepval))
                return (int) -1;
        } else {
            stepval = v;
        }
        v = NULL;
        val = (int) 0;
        mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
        shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
        for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) {
            PyObject *tmp, *digit;
            long idigit;
            digit = PyNumber_And(stepval, mask);
            if (unlikely(!digit)) goto done;
            idigit = PyLong_AsLong(digit);
            Py_DECREF(digit);
            if (unlikely(idigit < 0)) goto done;
            val |= ((int) idigit) << bits;
            tmp = PyNumber_Rshift(stepval, shift);
            if (unlikely(!tmp)) goto done;
            Py_DECREF(stepval); stepval = tmp;
        }
        Py_DECREF(shift); shift = NULL;
        Py_DECREF(mask); mask = NULL;
        {
            long idigit = PyLong_AsLong(stepval);
            if (unlikely(idigit < 0)) goto done;
            remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1);
            if (unlikely(idigit >= (1L << remaining_bits)))
                goto raise_overflow;
            val |= ((int) idigit) << bits;
        }
        if (!is_unsigned) {
            if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1))))
                goto raise_overflow;
            if (is_negative)
                val = ~val;
        }
        ret = 0;
    done:
        Py_XDECREF(shift);
        Py_XDECREF(mask);
        Py_XDECREF(stepval);
#endif
        if (unlikely(ret))
            return (int) -1;
        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;
}

/* FormatTypeName */
#if CYTHON_COMPILING_IN_LIMITED_API
static __Pyx_TypeName
__Pyx_PyType_GetName(PyTypeObject* tp)
{
    PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp,
                                               __pyx_n_s_name_2);
    if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) {
        PyErr_Clear();
        Py_XDECREF(name);
        name = __Pyx_NewRef(__pyx_n_s__390);
    }
    return name;
}
#endif

/* FastTypeChecks */
#if CYTHON_COMPILING_IN_CPYTHON
static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
    while (a) {
        a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*);
        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);
}
static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) {
    PyObject *mro;
    if (cls == a || cls == b) return 1;
    mro = cls->tp_mro;
    if (likely(mro)) {
        Py_ssize_t i, n;
        n = PyTuple_GET_SIZE(mro);
        for (i = 0; i < n; i++) {
            PyObject *base = PyTuple_GET_ITEM(mro, i);
            if (base == (PyObject *)a || base == (PyObject *)b)
                return 1;
        }
        return 0;
    }
    return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, 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) {
    if (exc_type1) {
        return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2);
    } else {
        return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
    }
}
#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

/* PyObjectCallMethod1 */
#if !(CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C00A2)
static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) {
    PyObject *result = __Pyx_PyObject_CallOneArg(method, arg);
    Py_DECREF(method);
    return result;
}
#endif
static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
#if CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C00A2
    PyObject *args[2] = {obj, arg};
    (void) __Pyx_PyObject_GetMethod;
    (void) __Pyx_PyObject_CallOneArg;
    (void) __Pyx_PyObject_Call2Args;
    return PyObject_VectorcallMethod(method_name, args, 2 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
#else
    PyObject *method = NULL, *result;
    int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
    if (likely(is_method)) {
        result = __Pyx_PyObject_Call2Args(method, obj, arg);
        Py_DECREF(method);
        return result;
    }
    if (unlikely(!method)) return NULL;
    return __Pyx__PyObject_CallMethod1(method, arg);
#endif
}

/* CoroutineBase */
#include <frameobject.h>
#if PY_VERSION_HEX >= 0x030b00a6
  #ifndef Py_BUILD_CORE
    #define Py_BUILD_CORE 1
  #endif
  #include "internal/pycore_frame.h"
#endif
#define __Pyx_Coroutine_Undelegate(gen) Py_CLEAR((gen)->yieldfrom)
static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *__pyx_tstate, PyObject **pvalue) {
    PyObject *et, *ev, *tb;
    PyObject *value = NULL;
    CYTHON_UNUSED_VAR(__pyx_tstate);
    __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 (likely(__Pyx_IS_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_ExcInfoStruct *exc_state) {
#if PY_VERSION_HEX >= 0x030B00a4
    Py_CLEAR(exc_state->exc_value);
#else
    PyObject *t, *v, *tb;
    t = exc_state->exc_type;
    v = exc_state->exc_value;
    tb = exc_state->exc_traceback;
    exc_state->exc_type = NULL;
    exc_state->exc_value = NULL;
    exc_state->exc_traceback = NULL;
    Py_XDECREF(t);
    Py_XDECREF(v);
    Py_XDECREF(tb);
#endif
}
#define __Pyx_Coroutine_AlreadyRunningError(gen)  (__Pyx__Coroutine_AlreadyRunningError(gen), (PyObject*)NULL)
static void __Pyx__Coroutine_AlreadyRunningError(__pyx_CoroutineObject *gen) {
    const char *msg;
    CYTHON_MAYBE_UNUSED_VAR(gen);
    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(PyObject *gen) {
    const char *msg;
    CYTHON_MAYBE_UNUSED_VAR(gen);
    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(PyObject *gen, PyObject *value, int closing) {
    CYTHON_MAYBE_UNUSED_VAR(gen);
    CYTHON_MAYBE_UNUSED_VAR(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;
    __Pyx_ExcInfoStruct *exc_state;
    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
    exc_state = &self->gi_exc_state;
    if (exc_state->exc_value) {
        #if CYTHON_COMPILING_IN_PYPY
        #else
        PyObject *exc_tb;
        #if PY_VERSION_HEX >= 0x030B00a4 && !CYTHON_COMPILING_IN_CPYTHON
        exc_tb = PyException_GetTraceback(exc_state->exc_value);
        #elif PY_VERSION_HEX >= 0x030B00a4
        exc_tb = ((PyBaseExceptionObject*) exc_state->exc_value)->traceback;
        #else
        exc_tb = exc_state->exc_traceback;
        #endif
        if (exc_tb) {
            PyTracebackObject *tb = (PyTracebackObject *) exc_tb;
            PyFrameObject *f = tb->tb_frame;
            assert(f->f_back == NULL);
            #if PY_VERSION_HEX >= 0x030B00A1
            f->f_back = PyThreadState_GetFrame(tstate);
            #else
            Py_XINCREF(tstate->frame);
            f->f_back = tstate->frame;
            #endif
            #if PY_VERSION_HEX >= 0x030B00a4 && !CYTHON_COMPILING_IN_CPYTHON
            Py_DECREF(exc_tb);
            #endif
        }
        #endif
    }
#if CYTHON_USE_EXC_INFO_STACK
    exc_state->previous_item = tstate->exc_info;
    tstate->exc_info = exc_state;
#else
    if (exc_state->exc_type) {
        __Pyx_ExceptionSwap(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback);
    } else {
        __Pyx_Coroutine_ExceptionClear(exc_state);
        __Pyx_ExceptionSave(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback);
    }
#endif
    self->is_running = 1;
    retval = self->body(self, tstate, value);
    self->is_running = 0;
#if CYTHON_USE_EXC_INFO_STACK
    exc_state = &self->gi_exc_state;
    tstate->exc_info = exc_state->previous_item;
    exc_state->previous_item = NULL;
    __Pyx_Coroutine_ResetFrameBackpointer(exc_state);
#endif
    return retval;
}
static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state) {
#if CYTHON_COMPILING_IN_PYPY
    CYTHON_UNUSED_VAR(exc_state);
#else
    PyObject *exc_tb;
    #if PY_VERSION_HEX >= 0x030B00a4
    if (!exc_state->exc_value) return;
    exc_tb = PyException_GetTraceback(exc_state->exc_value);
    #else
    exc_tb = exc_state->exc_traceback;
    #endif
    if (likely(exc_tb)) {
        PyTracebackObject *tb = (PyTracebackObject *) exc_tb;
        PyFrameObject *f = tb->tb_frame;
        Py_CLEAR(f->f_back);
        #if PY_VERSION_HEX >= 0x030B00a4
        Py_DECREF(exc_tb);
        #endif
    }
#endif
}
static CYTHON_INLINE
PyObject *__Pyx_Coroutine_MethodReturn(PyObject* gen, PyObject *retval) {
    CYTHON_MAYBE_UNUSED_VAR(gen);
    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;
}
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
static CYTHON_INLINE
PyObject *__Pyx_PyGen_Send(PyGenObject *gen, PyObject *arg) {
#if PY_VERSION_HEX <= 0x030A00A1
    return _PyGen_Send(gen, arg);
#else
    PyObject *result;
    if (PyIter_Send((PyObject*)gen, arg ? arg : Py_None, &result) == PYGEN_RETURN) {
        if (PyAsyncGen_CheckExact(gen)) {
            assert(result == Py_None);
            PyErr_SetNone(PyExc_StopAsyncIteration);
        }
        else if (result == Py_None) {
            PyErr_SetNone(PyExc_StopIteration);
        }
        else {
#if PY_VERSION_HEX < 0x030d00A1
            _PyGen_SetStopIterationValue(result);
#else
            if (!PyTuple_Check(result) && !PyExceptionInstance_Check(result)) {
                PyErr_SetObject(PyExc_StopIteration, result);
            } else {
                PyObject *exc = __Pyx_PyObject_CallOneArg(PyExc_StopIteration, result);
                if (likely(exc != NULL)) {
                    PyErr_SetObject(PyExc_StopIteration, exc);
                    Py_DECREF(exc);
                }
            }
#endif
        }
        Py_DECREF(result);
        result = NULL;
    }
    return result;
#endif
}
#endif
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 = __Pyx_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 = __Pyx_PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
        } else
        #endif
        {
            if (value == Py_None)
                ret = __Pyx_PyObject_GetIterNextFunc(yf)(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, NULL);
        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_GetAttrStrNoError(yf, __pyx_n_s_close);
        if (unlikely(!meth)) {
            if (unlikely(PyErr_Occurred())) {
                PyErr_WriteUnraisable(yf);
            }
        } else {
            retval = __Pyx_PyObject_CallNoArg(meth);
            Py_DECREF(meth);
            if (unlikely(!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 = __Pyx_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 = __Pyx_PyObject_GetIterNextFunc(yf)(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_Method(PyObject *self, PyObject *arg) {
    CYTHON_UNUSED_VAR(arg);
    return __Pyx_Coroutine_Close(self);
}
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_GetAttrStrNoError(yf, __pyx_n_s_throw);
            if (unlikely(!meth)) {
                Py_DECREF(yf);
                if (unlikely(PyErr_Occurred())) {
                    gen->is_running = 0;
                    return NULL;
                }
                __Pyx_Coroutine_Undelegate(gen);
                gen->is_running = 0;
                goto throw_here;
            }
            if (likely(args)) {
                ret = __Pyx_PyObject_Call(meth, args, NULL);
            } else {
                PyObject *cargs[4] = {NULL, typ, val, tb};
                ret = __Pyx_PyObject_FastCall(meth, cargs+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
            }
            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 (unlikely(!PyArg_UnpackTuple(args, (char *)"throw", 1, 3, &typ, &val, &tb)))
        return NULL;
    return __Pyx__Coroutine_Throw(self, typ, val, tb, args, 1);
}
static CYTHON_INLINE int __Pyx_Coroutine_traverse_excstate(__Pyx_ExcInfoStruct *exc_state, visitproc visit, void *arg) {
#if PY_VERSION_HEX >= 0x030B00a4
    Py_VISIT(exc_state->exc_value);
#else
    Py_VISIT(exc_state->exc_type);
    Py_VISIT(exc_state->exc_value);
    Py_VISIT(exc_state->exc_traceback);
#endif
    return 0;
}
static int __Pyx_Coroutine_traverse(__pyx_CoroutineObject *gen, visitproc visit, void *arg) {
    Py_VISIT(gen->closure);
    Py_VISIT(gen->classobj);
    Py_VISIT(gen->yieldfrom);
    return __Pyx_Coroutine_traverse_excstate(&gen->gi_exc_state, visit, arg);
}
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);
    __Pyx_Coroutine_ExceptionClear(&gen->gi_exc_state);
#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_frame);
    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 (unlikely(PyObject_CallFinalizerFromDealloc(self)))
#else
        Py_TYPE(gen)->tp_del(self);
        if (unlikely(Py_REFCNT(self) > 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);
    __Pyx_PyHeapTypeObject_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);
    __Pyx_SET_REFCNT(self, 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(Py_REFCNT(self) > 0);
    if (likely(--self->ob_refcnt == 0)) {
        return;
    }
    {
        Py_ssize_t refcnt = Py_REFCNT(self);
        _Py_NewReference(self);
        __Pyx_SET_REFCNT(self, refcnt);
    }
#if CYTHON_COMPILING_IN_CPYTHON
    assert(PyType_IS_GC(Py_TYPE(self)) &&
           _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, void *context)
{
    PyObject *name = self->gi_name;
    CYTHON_UNUSED_VAR(context);
    if (unlikely(!name)) name = Py_None;
    Py_INCREF(name);
    return name;
}
static int
__Pyx_Coroutine_set_name(__pyx_CoroutineObject *self, PyObject *value, void *context)
{
    CYTHON_UNUSED_VAR(context);
#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;
    }
    Py_INCREF(value);
    __Pyx_Py_XDECREF_SET(self->gi_name, value);
    return 0;
}
static PyObject *
__Pyx_Coroutine_get_qualname(__pyx_CoroutineObject *self, void *context)
{
    PyObject *name = self->gi_qualname;
    CYTHON_UNUSED_VAR(context);
    if (unlikely(!name)) name = Py_None;
    Py_INCREF(name);
    return name;
}
static int
__Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *self, PyObject *value, void *context)
{
    CYTHON_UNUSED_VAR(context);
#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;
    }
    Py_INCREF(value);
    __Pyx_Py_XDECREF_SET(self->gi_qualname, value);
    return 0;
}
static PyObject *
__Pyx_Coroutine_get_frame(__pyx_CoroutineObject *self, void *context)
{
    PyObject *frame = self->gi_frame;
    CYTHON_UNUSED_VAR(context);
    if (!frame) {
        if (unlikely(!self->gi_code)) {
            Py_RETURN_NONE;
        }
        frame = (PyObject *) PyFrame_New(
            PyThreadState_Get(),            /*PyThreadState *tstate,*/
            (PyCodeObject*) self->gi_code,  /*PyCodeObject *code,*/
            __pyx_d,                 /*PyObject *globals,*/
            0                               /*PyObject *locals*/
        );
        if (unlikely(!frame))
            return NULL;
        self->gi_frame = frame;
    }
    Py_INCREF(frame);
    return frame;
}
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;
    #if PY_VERSION_HEX >= 0x030B00a4
    gen->gi_exc_state.exc_value = NULL;
    #else
    gen->gi_exc_state.exc_type = NULL;
    gen->gi_exc_state.exc_value = NULL;
    gen->gi_exc_state.exc_traceback = NULL;
    #endif
#if CYTHON_USE_EXC_INFO_STACK
    gen->gi_exc_state.previous_item = NULL;
#endif
    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;
    gen->gi_frame = NULL;
    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 (unlikely(!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_Method, 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},
    {(char *) "__module__", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_modulename), 0, 0},
#if CYTHON_USE_TYPE_SPECS
    {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CoroutineObject, gi_weakreflist), READONLY, 0},
#endif
    {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},
    {(char *) "gi_frame", (getter)__Pyx_Coroutine_get_frame, NULL,
     (char*) PyDoc_STR("Frame of the generator"), 0},
    {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_GeneratorType_slots[] = {
    {Py_tp_dealloc, (void *)__Pyx_Coroutine_dealloc},
    {Py_tp_traverse, (void *)__Pyx_Coroutine_traverse},
    {Py_tp_iter, (void *)PyObject_SelfIter},
    {Py_tp_iternext, (void *)__Pyx_Generator_Next},
    {Py_tp_methods, (void *)__pyx_Generator_methods},
    {Py_tp_members, (void *)__pyx_Generator_memberlist},
    {Py_tp_getset, (void *)__pyx_Generator_getsets},
    {Py_tp_getattro, (void *) __Pyx_PyObject_GenericGetAttrNoDict},
#if CYTHON_USE_TP_FINALIZE
    {Py_tp_finalize, (void *)__Pyx_Coroutine_del},
#endif
    {0, 0},
};
static PyType_Spec __pyx_GeneratorType_spec = {
    __PYX_TYPE_MODULE_PREFIX "generator",
    sizeof(__pyx_CoroutineObject),
    0,
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE,
    __pyx_GeneratorType_slots
};
#else
static PyTypeObject __pyx_GeneratorType_type = {
    PyVarObject_HEAD_INIT(0, 0)
    __PYX_TYPE_MODULE_PREFIX "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
#if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
    0,
#endif
#if __PYX_NEED_TP_PRINT_SLOT
    0,
#endif
#if PY_VERSION_HEX >= 0x030C0000
    0,
#endif
#if PY_VERSION_HEX >= 0x030d00A4
    0,
#endif
#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
    0,
#endif
};
#endif
static int __pyx_Generator_init(PyObject *module) {
#if CYTHON_USE_TYPE_SPECS
    __pyx_GeneratorType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_GeneratorType_spec, NULL);
#else
    CYTHON_UNUSED_VAR(module);
    __pyx_GeneratorType_type.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
    __pyx_GeneratorType_type.tp_iter = PyObject_SelfIter;
    __pyx_GeneratorType = __Pyx_FetchCommonType(&__pyx_GeneratorType_type);
#endif
    if (unlikely(!__pyx_GeneratorType)) {
        return -1;
    }
    return 0;
}

/* CheckBinaryVersion */
static unsigned long __Pyx_get_runtime_version(void) {
#if __PYX_LIMITED_VERSION_HEX >= 0x030B00A4
    return Py_Version & ~0xFFUL;
#else
    const char* rt_version = Py_GetVersion();
    unsigned long version = 0;
    unsigned long factor = 0x01000000UL;
    unsigned int digit = 0;
    int i = 0;
    while (factor) {
        while ('0' <= rt_version[i] && rt_version[i] <= '9') {
            digit = digit * 10 + (unsigned int) (rt_version[i] - '0');
            ++i;
        }
        version += factor * digit;
        if (rt_version[i] != '.')
            break;
        digit = 0;
        factor >>= 8;
        ++i;
    }
    return version;
#endif
}
static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) {
    const unsigned long MAJOR_MINOR = 0xFFFF0000UL;
    if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR))
        return 0;
    if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR)))
        return 1;
    {
        char message[200];
        PyOS_snprintf(message, sizeof(message),
                      "compile time Python version %d.%d "
                      "of module '%.100s' "
                      "%s "
                      "runtime version %d.%d",
                       (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF),
                       __Pyx_MODULE_NAME,
                       (allow_newer) ? "was newer than" : "does not match",
                       (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF)
       );
        return PyErr_WarnEx(NULL, message, 1);
    }
}

/* InitStrings */
#if PY_MAJOR_VERSION >= 3
static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) {
    if (t.is_unicode | t.is_str) {
        if (t.intern) {
            *str = PyUnicode_InternFromString(t.s);
        } else if (t.encoding) {
            *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL);
        } else {
            *str = PyUnicode_FromStringAndSize(t.s, t.n - 1);
        }
    } else {
        *str = PyBytes_FromStringAndSize(t.s, t.n - 1);
    }
    if (!*str)
        return -1;
    if (PyObject_Hash(*str) == -1)
        return -1;
    return 0;
}
#endif
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
    while (t->p) {
        #if PY_MAJOR_VERSION >= 3
        __Pyx_InitString(*t, t->p);
        #else
        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);
        }
        if (!*t->p)
            return -1;
        if (PyObject_Hash(*t->p) == -1)
            return -1;
        #endif
        ++t;
    }
    return 0;
}

#include <string.h>
static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) {
    size_t len = strlen(s);
    if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) {
        PyErr_SetString(PyExc_OverflowError, "byte string is too long");
        return -1;
    }
    return (Py_ssize_t) len;
}
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
    Py_ssize_t len = __Pyx_ssize_strlen(c_str);
    if (unlikely(len < 0)) return NULL;
    return __Pyx_PyUnicode_FromStringAndSize(c_str, len);
}
static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) {
    Py_ssize_t len = __Pyx_ssize_strlen(c_str);
    if (unlikely(len < 0)) return NULL;
    return PyByteArray_FromStringAndSize(c_str, len);
}
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 && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
    if (PyByteArray_Check(o)) {
        *length = PyByteArray_GET_SIZE(o);
        return PyByteArray_AS_STRING(o);
    } else
#endif
    {
        char* result;
        int r = PyBytes_AsStringAndSize(o, &result, length);
        if (unlikely(r < 0)) {
            return NULL;
        } else {
            return result;
        }
    }
}
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
   int is_true = x == Py_True;
   if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
   else return PyObject_IsTrue(x);
}
static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
    int retval;
    if (unlikely(!x)) return -1;
    retval = __Pyx_PyObject_IsTrue(x);
    Py_DECREF(x);
    return retval;
}
static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
    __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result));
#if PY_MAJOR_VERSION >= 3
    if (PyLong_Check(result)) {
        if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
                "__int__ returned non-int (type " __Pyx_FMT_TYPENAME ").  "
                "The ability to return an instance of a strict subclass of int is deprecated, "
                "and may be removed in a future version of Python.",
                result_type_name)) {
            __Pyx_DECREF_TypeName(result_type_name);
            Py_DECREF(result);
            return NULL;
        }
        __Pyx_DECREF_TypeName(result_type_name);
        return result;
    }
#endif
    PyErr_Format(PyExc_TypeError,
                 "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")",
                 type_name, type_name, result_type_name);
    __Pyx_DECREF_TypeName(result_type_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(b);
  }
#endif
  if (likely(PyLong_CheckExact(b))) {
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(__Pyx_PyLong_IsCompact(b))) {
        return __Pyx_PyLong_CompactValue(b);
    } else {
      const digit* digits = __Pyx_PyLong_Digits(b);
      const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b);
      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 Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
  if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) {
    return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
#if PY_MAJOR_VERSION < 3
  } else if (likely(PyInt_CheckExact(o))) {
    return PyInt_AS_LONG(o);
#endif
  } else {
    Py_ssize_t ival;
    PyObject *x;
    x = PyNumber_Index(o);
    if (!x) return -1;
    ival = PyInt_AsLong(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);
}


/* #### Code section: utility_code_pragmas_end ### */
#ifdef _MSC_VER
#pragma warning( pop )
#endif



/* #### Code section: end ### */
#endif /* Py_PYTHON_H */
