/* Generated by Cython 0.29.28 */

/* BEGIN: Cython Metadata
{
    "distutils": {
        "depends": [],
        "extra_compile_args": [
            "-std=c++17"
        ],
        "include_dirs": [
            "fstlib/cext"
        ],
        "language": "c++",
        "libraries": [
            "fst",
            "fstfar",
            "fstscript",
            "fstfarscript"
        ],
        "name": "fstlib.cext.pywrapfst",
        "sources": [
            "fstlib/cext/pywrapfst.pyx"
        ]
    },
    "module_name": "fstlib.cext.pywrapfst"
}
END: Cython Metadata */

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

#ifndef __cplusplus
  #error "Cython files generated with the C++ option must be compiled with a C++ compiler."
#endif
#ifndef CYTHON_INLINE
  #if defined(__clang__)
    #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
  #else
    #define CYTHON_INLINE inline
  #endif
#endif
template<typename T>
void __Pyx_call_destructor(T& x) {
    x.~T();
}
template<typename T>
class __Pyx_FakeReference {
  public:
    __Pyx_FakeReference() : ptr(NULL) { }
    __Pyx_FakeReference(const T& ref) : ptr(const_cast<T*>(&ref)) { }
    T *operator->() { return ptr; }
    T *operator&() { return ptr; }
    operator T&() { return *ptr; }
    template<typename U> bool operator ==(U other) { return *ptr == other; }
    template<typename U> bool operator !=(U other) { return *ptr != other; }
  private:
    T *ptr;
};

#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
  #define Py_OptimizeFlag 0
#endif
#define __PYX_BUILD_PY_SSIZE_T "n"
#define CYTHON_FORMAT_SSIZE_T "z"
#if PY_MAJOR_VERSION < 3
  #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
          PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
  #define __Pyx_DefaultClassType PyClass_Type
#else
  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
  #define __Pyx_DefaultClassType PyType_Type
#if PY_VERSION_HEX >= 0x030B00A1
    static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, 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 *kwds=NULL, *argcount=NULL, *posonlyargcount=NULL, *kwonlyargcount=NULL;
        PyObject *nlocals=NULL, *stacksize=NULL, *flags=NULL, *replace=NULL, *call_result=NULL, *empty=NULL;
        const char *fn_cstr=NULL;
        const char *name_cstr=NULL;
        PyCodeObject* co=NULL;
        PyObject *type, *value, *traceback;
        PyErr_Fetch(&type, &value, &traceback);
        if (!(kwds=PyDict_New())) goto end;
        if (!(argcount=PyLong_FromLong(a))) goto end;
        if (PyDict_SetItemString(kwds, "co_argcount", argcount) != 0) goto end;
        if (!(posonlyargcount=PyLong_FromLong(0))) goto end;
        if (PyDict_SetItemString(kwds, "co_posonlyargcount", posonlyargcount) != 0) goto end;
        if (!(kwonlyargcount=PyLong_FromLong(k))) goto end;
        if (PyDict_SetItemString(kwds, "co_kwonlyargcount", kwonlyargcount) != 0) goto end;
        if (!(nlocals=PyLong_FromLong(l))) goto end;
        if (PyDict_SetItemString(kwds, "co_nlocals", nlocals) != 0) goto end;
        if (!(stacksize=PyLong_FromLong(s))) goto end;
        if (PyDict_SetItemString(kwds, "co_stacksize", stacksize) != 0) goto end;
        if (!(flags=PyLong_FromLong(f))) goto end;
        if (PyDict_SetItemString(kwds, "co_flags", flags) != 0) goto end;
        if (PyDict_SetItemString(kwds, "co_code", code) != 0) goto end;
        if (PyDict_SetItemString(kwds, "co_consts", c) != 0) goto end;
        if (PyDict_SetItemString(kwds, "co_names", n) != 0) goto end;
        if (PyDict_SetItemString(kwds, "co_varnames", v) != 0) goto end;
        if (PyDict_SetItemString(kwds, "co_freevars", fv) != 0) goto end;
        if (PyDict_SetItemString(kwds, "co_cellvars", cell) != 0) goto end;
        if (PyDict_SetItemString(kwds, "co_linetable", lnos) != 0) goto end;
        if (!(fn_cstr=PyUnicode_AsUTF8AndSize(fn, NULL))) goto end;
        if (!(name_cstr=PyUnicode_AsUTF8AndSize(name, NULL))) goto end;
        if (!(co = PyCode_NewEmpty(fn_cstr, name_cstr, fline))) goto end;
        if (!(replace = PyObject_GetAttrString((PyObject*)co, "replace"))) goto cleanup_code_too;
        if (!(empty = PyTuple_New(0))) goto cleanup_code_too; // unfortunately __pyx_empty_tuple isn't available here
        if (!(call_result = PyObject_Call(replace, empty, kwds))) goto cleanup_code_too;
        Py_XDECREF((PyObject*)co);
        co = (PyCodeObject*)call_result;
        call_result = NULL;
        if (0) {
            cleanup_code_too:
            Py_XDECREF((PyObject*)co);
            co = NULL;
        }
        end:
        Py_XDECREF(kwds);
        Py_XDECREF(argcount);
        Py_XDECREF(posonlyargcount);
        Py_XDECREF(kwonlyargcount);
        Py_XDECREF(nlocals);
        Py_XDECREF(stacksize);
        Py_XDECREF(replace);
        Py_XDECREF(call_result);
        Py_XDECREF(empty);
        if (type) {
            PyErr_Restore(type, value, traceback);
        }
        return co;
    }
#else
  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
          PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
#endif
  #define __Pyx_DefaultClassType PyType_Type
#endif
#ifndef Py_TPFLAGS_CHECKTYPES
  #define Py_TPFLAGS_CHECKTYPES 0
#endif
#ifndef Py_TPFLAGS_HAVE_INDEX
  #define Py_TPFLAGS_HAVE_INDEX 0
#endif
#ifndef Py_TPFLAGS_HAVE_NEWBUFFER
  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
#endif
#ifndef Py_TPFLAGS_HAVE_FINALIZE
  #define Py_TPFLAGS_HAVE_FINALIZE 0
#endif
#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
  #define __Pyx_PyCFunctionFast _PyCFunctionFast
  #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
#endif
#if CYTHON_FAST_PYCCALL
#define __Pyx_PyFastCFunction_Check(func)\
    ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
#else
#define __Pyx_PyFastCFunction_Check(func) 0
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
  #define PyObject_Malloc(s)   PyMem_Malloc(s)
  #define PyObject_Free(p)     PyMem_Free(p)
  #define PyObject_Realloc(p)  PyMem_Realloc(p)
#endif
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
  #define PyMem_RawMalloc(n)           PyMem_Malloc(n)
  #define PyMem_RawRealloc(p, n)       PyMem_Realloc(p, n)
  #define PyMem_RawFree(p)             PyMem_Free(p)
#endif
#if CYTHON_COMPILING_IN_PYSTON
  #define __Pyx_PyCode_HasFreeVars(co)  PyCode_HasFreeVars(co)
  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
#else
  #define __Pyx_PyCode_HasFreeVars(co)  (PyCode_GetNumFree(co) > 0)
  #define __Pyx_PyFrame_SetLineNumber(frame, lineno)  (frame)->f_lineno = (lineno)
#endif
#if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
  #define __Pyx_PyThreadState_Current PyThreadState_GET()
#elif PY_VERSION_HEX >= 0x03060000
  #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
#elif PY_VERSION_HEX >= 0x03000000
  #define __Pyx_PyThreadState_Current PyThreadState_GET()
#else
  #define __Pyx_PyThreadState_Current _PyThreadState_Current
#endif
#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
#include "pythread.h"
#define Py_tss_NEEDS_INIT 0
typedef int Py_tss_t;
static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
  *key = PyThread_create_key();
  return 0;
}
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 CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
#define __Pyx_PyDict_NewPresized(n)  ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
#else
#define __Pyx_PyDict_NewPresized(n)  PyDict_New()
#endif
#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
#else
  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_Divide(x,y)
  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceDivide(x,y)
#endif
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
#define __Pyx_PyDict_GetItemStr(dict, name)  _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
#else
#define __Pyx_PyDict_GetItemStr(dict, name)  PyDict_GetItem(dict, name)
#endif
#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
  #define CYTHON_PEP393_ENABLED 1
  #if defined(PyUnicode_IS_READY)
  #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ?\
                                              0 : _PyUnicode_Ready((PyObject *)(op)))
  #else
  #define __Pyx_PyUnicode_READY(op)       (0)
  #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)         PyUnicode_KIND(u)
  #define __Pyx_PyUnicode_DATA(u)         PyUnicode_DATA(u)
  #define __Pyx_PyUnicode_READ(k, d, i)   PyUnicode_READ(k, d, i)
  #define __Pyx_PyUnicode_WRITE(k, d, i, ch)  PyUnicode_WRITE(k, d, i, ch)
  #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE)
  #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
  #else
  #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GET_LENGTH(u))
  #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) ? 65535 : 1114111)
  #define __Pyx_PyUnicode_KIND(u)         (sizeof(Py_UNICODE))
  #define __Pyx_PyUnicode_DATA(u)         ((void*)PyUnicode_AS_UNICODE(u))
  #define __Pyx_PyUnicode_READ(k, d, i)   ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
  #define __Pyx_PyUnicode_WRITE(k, d, i, ch)  (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
  #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GET_SIZE(u))
#endif
#if CYTHON_COMPILING_IN_PYPY
  #define __Pyx_PyUnicode_Concat(a, b)      PyNumber_Add(a, b)
  #define __Pyx_PyUnicode_ConcatSafe(a, b)  PyNumber_Add(a, b)
#else
  #define __Pyx_PyUnicode_Concat(a, b)      PyUnicode_Concat(a, b)
  #define __Pyx_PyUnicode_ConcatSafe(a, b)  ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
      PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
  #define PyUnicode_Contains(u, s)  PySequence_Contains(u, s)
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
  #define PyByteArray_Check(obj)  PyObject_TypeCheck(obj, &PyByteArray_Type)
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
  #define PyObject_Format(obj, fmt)  PyObject_CallMethod(obj, "__format__", "O", fmt)
#endif
#define __Pyx_PyString_FormatSafe(a, b)   ((unlikely((a) == Py_None || (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
#ifndef PySet_CheckExact
  #define PySet_CheckExact(obj)        (Py_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_SIZE(seq)  Py_SIZE(seq)
#else
  #define __Pyx_PySequence_SIZE(seq)  PySequence_Size(seq)
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyIntObject                  PyLongObject
  #define PyInt_Type                   PyLong_Type
  #define PyInt_Check(op)              PyLong_Check(op)
  #define PyInt_CheckExact(op)         PyLong_CheckExact(op)
  #define PyInt_FromString             PyLong_FromString
  #define PyInt_FromUnicode            PyLong_FromUnicode
  #define PyInt_FromLong               PyLong_FromLong
  #define PyInt_FromSize_t             PyLong_FromSize_t
  #define PyInt_FromSsize_t            PyLong_FromSsize_t
  #define PyInt_AsLong                 PyLong_AsLong
  #define PyInt_AS_LONG                PyLong_AS_LONG
  #define PyInt_AsSsize_t              PyLong_AsSsize_t
  #define PyInt_AsUnsignedLongMask     PyLong_AsUnsignedLongMask
  #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
  #define PyNumber_Int                 PyNumber_Long
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyBoolObject                 PyLongObject
#endif
#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
  #ifndef PyUnicode_InternFromString
    #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
  #endif
#endif
#if PY_VERSION_HEX < 0x030200A4
  typedef long Py_hash_t;
  #define __Pyx_PyInt_FromHash_t PyInt_FromLong
  #define __Pyx_PyInt_AsHash_t   __Pyx_PyIndex_AsHash_t
#else
  #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
  #define __Pyx_PyInt_AsHash_t   __Pyx_PyIndex_AsSsize_t
#endif
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func))
#else
  #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
#endif
#if CYTHON_USE_ASYNC_SLOTS
  #if PY_VERSION_HEX >= 0x030500B1
    #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
    #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
  #else
    #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
  #endif
#else
  #define __Pyx_PyType_AsAsync(obj) NULL
#endif
#ifndef __Pyx_PyAsyncMethodsStruct
    typedef struct {
        unaryfunc am_await;
        unaryfunc am_aiter;
        unaryfunc am_anext;
    } __Pyx_PyAsyncMethodsStruct;
#endif

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

#define __PYX_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; }

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

#define __PYX_HAVE__fstlib__cext__pywrapfst
#define __PYX_HAVE_API__fstlib__cext__pywrapfst
/* Early includes */
#include "ios"
#include "new"
#include "stdexcept"
#include "typeinfo"
#include <memory>
#include <string.h>
#include <string>
#include <utility>

    #if __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600)
    // move should be defined for these versions of MSVC, but __cplusplus isn't set usefully
    #include <type_traits>

    namespace cython_std {
    template <typename T> typename std::remove_reference<T>::type&& move(T& t) noexcept { return std::move(t); }
    template <typename T> typename std::remove_reference<T>::type&& move(T&& t) noexcept { return std::move(t); }
    }

    #endif
    
#include <vector>
#include <stdint.h>
#include <iostream>
#include <fstream>
#include <sstream>
#include <fst/util.h>
#include <fst/fstlib.h>
#include <fst/script/fstscript.h>
#include <fst/script/getters.h>
#include <fst/extensions/far/far.h>
#include <fst/extensions/far/getters.h>
#include <fst/extensions/far/far-class.h>
#include <stddef.h>
#include <time.h>
#include <fst/compat.h>

    #include <type_traits>
    #include <utility>

    namespace fst {

    template <typename T>
    inline typename std::remove_reference<T>::type &&move(T &t) {
        return std::move(t);
    }

    template <typename T>
    inline typename std::remove_reference<T>::type &&move(T &&t) {
        return std::move(t);
    }

    }  // namespace fst
    
#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 1
#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
#define __PYX_DEFAULT_STRING_ENCODING "utf8"
#define __Pyx_PyObject_FromString __Pyx_PyUnicode_FromString
#define __Pyx_PyObject_FromStringAndSize __Pyx_PyUnicode_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 const char* __Pyx_PyObject_AsString(PyObject*);
static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
#define __Pyx_PyBytes_FromString        PyBytes_FromString
#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
#if PY_MAJOR_VERSION < 3
    #define __Pyx_PyStr_FromString        __Pyx_PyBytes_FromString
    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
#else
    #define __Pyx_PyStr_FromString        __Pyx_PyUnicode_FromString
    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
#endif
#define __Pyx_PyBytes_AsWritableString(s)     ((char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsWritableSString(s)    ((signed char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsWritableUString(s)    ((unsigned char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsString(s)     ((const char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsSString(s)    ((const signed char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsUString(s)    ((const unsigned char*) PyBytes_AS_STRING(s))
#define __Pyx_PyObject_AsWritableString(s)    ((char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsWritableSString(s)    ((signed char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsWritableUString(s)    ((unsigned char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsSString(s)    ((const signed char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsUString(s)    ((const unsigned char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_FromCString(s)  __Pyx_PyObject_FromString((const char*)s)
#define __Pyx_PyBytes_FromCString(s)   __Pyx_PyBytes_FromString((const char*)s)
#define __Pyx_PyByteArray_FromCString(s)   __Pyx_PyByteArray_FromString((const char*)s)
#define __Pyx_PyStr_FromCString(s)     __Pyx_PyStr_FromString((const char*)s)
#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
    const Py_UNICODE *u_end = u;
    while (*u_end++) ;
    return (size_t)(u_end - u - 1);
}
#define __Pyx_PyUnicode_FromUnicode(u)       PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
#define __Pyx_PyUnicode_AsUnicode            PyUnicode_AsUnicode
#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
static CYTHON_INLINE 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
#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
static int __Pyx_sys_getdefaultencoding_not_ascii;
static int __Pyx_init_sys_getdefaultencoding_params(void) {
    PyObject* sys;
    PyObject* default_encoding = NULL;
    PyObject* ascii_chars_u = NULL;
    PyObject* ascii_chars_b = NULL;
    const char* default_encoding_c;
    sys = PyImport_ImportModule("sys");
    if (!sys) goto bad;
    default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
    Py_DECREF(sys);
    if (!default_encoding) goto bad;
    default_encoding_c = PyBytes_AsString(default_encoding);
    if (!default_encoding_c) goto bad;
    if (strcmp(default_encoding_c, "ascii") == 0) {
        __Pyx_sys_getdefaultencoding_not_ascii = 0;
    } else {
        char ascii_chars[128];
        int c;
        for (c = 0; c < 128; c++) {
            ascii_chars[c] = c;
        }
        __Pyx_sys_getdefaultencoding_not_ascii = 1;
        ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
        if (!ascii_chars_u) goto bad;
        ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
        if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
            PyErr_Format(
                PyExc_ValueError,
                "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
                default_encoding_c);
            goto bad;
        }
        Py_DECREF(ascii_chars_u);
        Py_DECREF(ascii_chars_b);
    }
    Py_DECREF(default_encoding);
    return 0;
bad:
    Py_XDECREF(default_encoding);
    Py_XDECREF(ascii_chars_u);
    Py_XDECREF(ascii_chars_b);
    return -1;
}
#endif
#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
#else
#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
static char* __PYX_DEFAULT_STRING_ENCODING;
static int __Pyx_init_sys_getdefaultencoding_params(void) {
    PyObject* sys;
    PyObject* default_encoding = NULL;
    char* default_encoding_c;
    sys = PyImport_ImportModule("sys");
    if (!sys) goto bad;
    default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
    Py_DECREF(sys);
    if (!default_encoding) goto bad;
    default_encoding_c = PyBytes_AsString(default_encoding);
    if (!default_encoding_c) goto bad;
    __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 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; }

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


static const char *__pyx_f[] = {
  "fstlib/cext/pywrapfst.pyx",
  "stringsource",
};

/*--- Type declarations ---*/
struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight;
struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView;
struct __pyx_obj_6fstlib_4cext_9pywrapfst__EncodeMapperSymbolTableView;
struct __pyx_obj_6fstlib_4cext_9pywrapfst__FstSymbolTableView;
struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableSymbolTable;
struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableFstSymbolTableView;
struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTable;
struct __pyx_obj_6fstlib_4cext_9pywrapfst__SymbolTableIterator;
struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper;
struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst;
struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst;
struct __pyx_obj_6fstlib_4cext_9pywrapfst_VectorFst;
struct __pyx_obj_6fstlib_4cext_9pywrapfst_Arc;
struct __pyx_obj_6fstlib_4cext_9pywrapfst__ArcIterator;
struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableArcIterator;
struct __pyx_obj_6fstlib_4cext_9pywrapfst__StateIterator;
struct __pyx_obj_6fstlib_4cext_9pywrapfst_Compiler;
struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarReader;
struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarWriter;
struct __pyx_obj_6fstlib_4cext_9pywrapfst___pyx_scope_struct____iter__;

/* "cpywrapfst.pxd":508
 * 
 * 
 * ctypedef pair[int64, const FstClass *] LabelFstClassPair             # <<<<<<<<<<<<<<
 * 
 * ctypedef pair[int64, int64] LabelPair
 */
typedef std::pair<int64,fst::script::FstClass const *>  __pyx_t_10cpywrapfst_LabelFstClassPair;

/* "cpywrapfst.pxd":510
 * ctypedef pair[int64, const FstClass *] LabelFstClassPair
 * 
 * ctypedef pair[int64, int64] LabelPair             # <<<<<<<<<<<<<<
 * 
 * 
 */
typedef std::pair<int64,int64>  __pyx_t_10cpywrapfst_LabelPair;
struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_19_MutableSymbolTable_add_symbol;
struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_3Fst_draw;
struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_3Fst_print;
struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_10MutableFst__arcsort;
struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_10MutableFst__closure;
struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_10MutableFst__delete_arcs;
struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_10MutableFst__delete_states;
struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_10MutableFst__minimize;
struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_10MutableFst__prune;
struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_10MutableFst__push;
struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_10MutableFst__relabel_pairs;
struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_10MutableFst__relabel_tables;
struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_10MutableFst__reweight;
struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_10MutableFst__rmepsilon;
struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_10MutableFst__set_final;
struct __pyx_opt_args_6fstlib_4cext_9pywrapfst__map;
struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_arcmap;
struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_compose;
struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_convert;
struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_determinize;
struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_difference;
struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_disambiguate;
struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_epsnormalize;
struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_equal;
struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_equivalent;
struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_intersect;
struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_isomorphic;
struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_prune;
struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_push;
struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_randequivalent;
struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_randgen;
struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_replace;
struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_reverse;
struct __pyx_opt_args_6fstlib_4cext_9pywrapfst__shortestdistance;
struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_shortestpath;

/* "fstlib/cext/pywrapfst.pxd":103
 * # SymbolTable.
 * 
 * ctypedef fst.SymbolTable * SymbolTable_ptr             # <<<<<<<<<<<<<<
 * ctypedef const fst.SymbolTable * const_SymbolTable_ptr
 * 
 */
typedef fst::SymbolTable *__pyx_t_6fstlib_4cext_9pywrapfst_SymbolTable_ptr;

/* "fstlib/cext/pywrapfst.pxd":104
 * 
 * ctypedef fst.SymbolTable * SymbolTable_ptr
 * ctypedef const fst.SymbolTable * const_SymbolTable_ptr             # <<<<<<<<<<<<<<
 * 
 * 
 */
typedef fst::SymbolTable const *__pyx_t_6fstlib_4cext_9pywrapfst_const_SymbolTable_ptr;

/* "fstlib/cext/pywrapfst.pxd":160
 *   cdef fst.SymbolTable *_mutable_raw_ptr_or_raise(self) except *
 * 
 *   cpdef int64 add_symbol(self, symbol, int64 key=?) except *             # <<<<<<<<<<<<<<
 * 
 *   cpdef void add_table(self, SymbolTableView syms) except *
 */
struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_19_MutableSymbolTable_add_symbol {
  int __pyx_n;
  int64 key;
};

/* "fstlib/cext/pywrapfst.pxd":207
 * 
 * 
 * ctypedef fst.EncodeMapperClass * EncodeMapperClass_ptr             # <<<<<<<<<<<<<<
 * 
 * 
 */
typedef fst::script::EncodeMapperClass *__pyx_t_6fstlib_4cext_9pywrapfst_EncodeMapperClass_ptr;

/* "fstlib/cext/pywrapfst.pxd":241
 * 
 * 
 * ctypedef fst.FstClass * FstClass_ptr             # <<<<<<<<<<<<<<
 * ctypedef const fst.FstClass * const_FstClass_ptr
 * ctypedef fst.MutableFstClass * MutableFstClass_ptr
 */
typedef fst::script::FstClass *__pyx_t_6fstlib_4cext_9pywrapfst_FstClass_ptr;

/* "fstlib/cext/pywrapfst.pxd":242
 * 
 * ctypedef fst.FstClass * FstClass_ptr
 * ctypedef const fst.FstClass * const_FstClass_ptr             # <<<<<<<<<<<<<<
 * ctypedef fst.MutableFstClass * MutableFstClass_ptr
 * ctypedef fst.VectorFstClass * VectorFstClass_ptr
 */
typedef fst::script::FstClass const *__pyx_t_6fstlib_4cext_9pywrapfst_const_FstClass_ptr;

/* "fstlib/cext/pywrapfst.pxd":243
 * ctypedef fst.FstClass * FstClass_ptr
 * ctypedef const fst.FstClass * const_FstClass_ptr
 * ctypedef fst.MutableFstClass * MutableFstClass_ptr             # <<<<<<<<<<<<<<
 * ctypedef fst.VectorFstClass * VectorFstClass_ptr
 * 
 */
typedef fst::script::MutableFstClass *__pyx_t_6fstlib_4cext_9pywrapfst_MutableFstClass_ptr;

/* "fstlib/cext/pywrapfst.pxd":244
 * ctypedef const fst.FstClass * const_FstClass_ptr
 * ctypedef fst.MutableFstClass * MutableFstClass_ptr
 * ctypedef fst.VectorFstClass * VectorFstClass_ptr             # <<<<<<<<<<<<<<
 * 
 * 
 */
typedef fst::script::VectorFstClass *__pyx_t_6fstlib_4cext_9pywrapfst_VectorFstClass_ptr;

/* "fstlib/cext/pywrapfst.pxd":260
 *   cpdef Fst copy(self)
 * 
 *   cpdef void draw(self,             # <<<<<<<<<<<<<<
 *                   source,
 *                   SymbolTableView isymbols=?,
 */
struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_3Fst_draw {
  int __pyx_n;
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *isymbols;
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *osymbols;
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *ssymbols;
  bool acceptor;
  PyObject *title;
  double width;
  double height;
  bool portrait;
  bool vertical;
  double ranksep;
  double nodesep;
  int32 fontsize;
  int32 precision;
  PyObject *float_format;
  bool show_weight_one;
};

/* "fstlib/cext/pywrapfst.pxd":292
 *   cpdef _FstSymbolTableView output_symbols(self)
 * 
 *   cpdef string print(self,             # <<<<<<<<<<<<<<
 *                     SymbolTableView isymbols=?,
 *                     SymbolTableView osymbols=?,
 */
struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_3Fst_print {
  int __pyx_n;
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *isymbols;
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *osymbols;
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *ssymbols;
  bool acceptor;
  bool show_weight_one;
  PyObject *missing_sym;
};

/* "fstlib/cext/pywrapfst.pxd":325
 *   cpdef void add_states(self, size_t)
 * 
 *   cdef void _arcsort(self, sort_type=?) except *             # <<<<<<<<<<<<<<
 * 
 *   cdef void _closure(self, bool closure_plus=?)
 */
struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_10MutableFst__arcsort {
  int __pyx_n;
  PyObject *sort_type;
};

/* "fstlib/cext/pywrapfst.pxd":327
 *   cdef void _arcsort(self, sort_type=?) except *
 * 
 *   cdef void _closure(self, bool closure_plus=?)             # <<<<<<<<<<<<<<
 * 
 *   cdef void _concat(self, Fst fst2) except *
 */
struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_10MutableFst__closure {
  int __pyx_n;
  bool closure_plus;
};

/* "fstlib/cext/pywrapfst.pxd":335
 *   cdef void _decode(self, EncodeMapper) except *
 * 
 *   cdef void _delete_arcs(self, int64 state, size_t n=?) except *             # <<<<<<<<<<<<<<
 * 
 *   cdef void _delete_states(self, states=?) except *
 */
struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_10MutableFst__delete_arcs {
  int __pyx_n;
  size_t n;
};

/* "fstlib/cext/pywrapfst.pxd":337
 *   cdef void _delete_arcs(self, int64 state, size_t n=?) except *
 * 
 *   cdef void _delete_states(self, states=?) except *             # <<<<<<<<<<<<<<
 * 
 *   cdef void _encode(self, EncodeMapper) except *
 */
struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_10MutableFst__delete_states {
  int __pyx_n;
  PyObject *states;
};

/* "fstlib/cext/pywrapfst.pxd":343
 *   cdef void _invert(self)
 * 
 *   cdef void _minimize(self, float delta=?, bool allow_nondet=?) except *             # <<<<<<<<<<<<<<
 * 
 *   cpdef _MutableArcIterator mutable_arcs(self, int64 state)
 */
struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_10MutableFst__minimize {
  int __pyx_n;
  float delta;
  bool allow_nondet;
};

/* "fstlib/cext/pywrapfst.pxd":351
 *   cdef void _project(self, project_type) except *
 * 
 *   cdef void _prune(self, float delta=?, int64 nstate=?, weight=?) except *             # <<<<<<<<<<<<<<
 * 
 *   cdef void _push(self,
 */
struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_10MutableFst__prune {
  int __pyx_n;
  float delta;
  int64 nstate;
  PyObject *weight;
};

/* "fstlib/cext/pywrapfst.pxd":353
 *   cdef void _prune(self, float delta=?, int64 nstate=?, weight=?) except *
 * 
 *   cdef void _push(self,             # <<<<<<<<<<<<<<
 *                   float delta=?,
 *                   bool remove_total_weight=?,
 */
struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_10MutableFst__push {
  int __pyx_n;
  float delta;
  bool remove_total_weight;
  bool to_final;
};

/* "fstlib/cext/pywrapfst.pxd":358
 *                   bool to_final=?)
 * 
 *   cdef void _relabel_pairs(self, ipairs=?, opairs=?) except *             # <<<<<<<<<<<<<<
 * 
 *   cdef void _relabel_tables(self,
 */
struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_10MutableFst__relabel_pairs {
  int __pyx_n;
  PyObject *ipairs;
  PyObject *opairs;
};

/* "fstlib/cext/pywrapfst.pxd":360
 *   cdef void _relabel_pairs(self, ipairs=?, opairs=?) except *
 * 
 *   cdef void _relabel_tables(self,             # <<<<<<<<<<<<<<
 *                             SymbolTableView old_isymbols=?,
 *                             SymbolTableView new_isymbols=?,
 */
struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_10MutableFst__relabel_tables {
  int __pyx_n;
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *old_isymbols;
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *new_isymbols;
  PyObject *unknown_isymbol;
  bool attach_new_isymbols;
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *old_osymbols;
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *new_osymbols;
  PyObject *unknown_osymbol;
  bool attach_new_osymbols;
};

/* "fstlib/cext/pywrapfst.pxd":374
 *   cdef void _reserve_states(self, int64 n)
 * 
 *   cdef void _reweight(self, potentials, bool to_final=?) except *             # <<<<<<<<<<<<<<
 * 
 *   cdef void _rmepsilon(self,
 */
struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_10MutableFst__reweight {
  int __pyx_n;
  bool to_final;
};

/* "fstlib/cext/pywrapfst.pxd":376
 *   cdef void _reweight(self, potentials, bool to_final=?) except *
 * 
 *   cdef void _rmepsilon(self,             # <<<<<<<<<<<<<<
 *                        queue_type=?,
 *                        bool connect=?,
 */
struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_10MutableFst__rmepsilon {
  int __pyx_n;
  PyObject *queue_type;
  bool connect;
  PyObject *weight;
  int64 nstate;
  float delta;
};

/* "fstlib/cext/pywrapfst.pxd":383
 *                        float delta=?) except *
 * 
 *   cdef void _set_final(self, int64 state, weight=?) except *             # <<<<<<<<<<<<<<
 * 
 *   cdef void _set_start(self, int64 state) except *
 */
struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_10MutableFst__set_final {
  int __pyx_n;
  PyObject *weight;
};

/* "fstlib/cext/pywrapfst.pxd":489
 * 
 * 
 * cdef Fst _map(Fst ifst, float delta=?, map_type=?, double power=?, weight=?)             # <<<<<<<<<<<<<<
 * 
 * cpdef Fst arcmap(Fst ifst, float delta=?, map_type=?, double power=?, weight=?)
 */
struct __pyx_opt_args_6fstlib_4cext_9pywrapfst__map {
  int __pyx_n;
  float delta;
  PyObject *map_type;
  double power;
  PyObject *weight;
};

/* "fstlib/cext/pywrapfst.pxd":491
 * cdef Fst _map(Fst ifst, float delta=?, map_type=?, double power=?, weight=?)
 * 
 * cpdef Fst arcmap(Fst ifst, float delta=?, map_type=?, double power=?, weight=?)             # <<<<<<<<<<<<<<
 * 
 * cpdef MutableFst compose(Fst ifst1,
 */
struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_arcmap {
  int __pyx_n;
  float delta;
  PyObject *map_type;
  double power;
  PyObject *weight;
};

/* "fstlib/cext/pywrapfst.pxd":493
 * cpdef Fst arcmap(Fst ifst, float delta=?, map_type=?, double power=?, weight=?)
 * 
 * cpdef MutableFst compose(Fst ifst1,             # <<<<<<<<<<<<<<
 *                          Fst ifst2,
 *                          compose_filter=?,
 */
struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_compose {
  int __pyx_n;
  PyObject *compose_filter;
  bool connect;
};

/* "fstlib/cext/pywrapfst.pxd":498
 *                          bool connect=?)
 * 
 * cpdef Fst convert(Fst ifst, fst_type=?)             # <<<<<<<<<<<<<<
 * 
 * cpdef MutableFst determinize(Fst ifst,
 */
struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_convert {
  int __pyx_n;
  PyObject *fst_type;
};

/* "fstlib/cext/pywrapfst.pxd":500
 * cpdef Fst convert(Fst ifst, fst_type=?)
 * 
 * cpdef MutableFst determinize(Fst ifst,             # <<<<<<<<<<<<<<
 *                              float delta=?,
 *                              det_type=?,
 */
struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_determinize {
  int __pyx_n;
  float delta;
  PyObject *det_type;
  int64 nstate;
  int64 subsequential_label;
  PyObject *weight;
  bool increment_subsequential_label;
};

/* "fstlib/cext/pywrapfst.pxd":508
 *                              bool increment_subsequential_label=?)
 * 
 * cpdef MutableFst difference(Fst ifst1,             # <<<<<<<<<<<<<<
 *                             Fst ifst2,
 *                             compose_filter=?,
 */
struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_difference {
  int __pyx_n;
  PyObject *compose_filter;
  bool connect;
};

/* "fstlib/cext/pywrapfst.pxd":513
 *                             bool connect=?)
 * 
 * cpdef MutableFst disambiguate(Fst ifst,             # <<<<<<<<<<<<<<
 *                               float delta=?,
 *                               int64 nstate=?,
 */
struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_disambiguate {
  int __pyx_n;
  float delta;
  int64 nstate;
  int64 subsequential_label;
  PyObject *weight;
};

/* "fstlib/cext/pywrapfst.pxd":519
 *                               weight=?)
 * 
 * cpdef MutableFst epsnormalize(Fst ifst, bool eps_norm_output=?)             # <<<<<<<<<<<<<<
 * 
 * cpdef bool equal(Fst ifst1, Fst ifst2, float delta=?)
 */
struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_epsnormalize {
  int __pyx_n;
  bool eps_norm_output;
};

/* "fstlib/cext/pywrapfst.pxd":521
 * cpdef MutableFst epsnormalize(Fst ifst, bool eps_norm_output=?)
 * 
 * cpdef bool equal(Fst ifst1, Fst ifst2, float delta=?)             # <<<<<<<<<<<<<<
 * 
 * cpdef bool equivalent(Fst ifst1, Fst ifst2, float delta=?) except *
 */
struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_equal {
  int __pyx_n;
  float delta;
};

/* "fstlib/cext/pywrapfst.pxd":523
 * cpdef bool equal(Fst ifst1, Fst ifst2, float delta=?)
 * 
 * cpdef bool equivalent(Fst ifst1, Fst ifst2, float delta=?) except *             # <<<<<<<<<<<<<<
 * 
 * cpdef MutableFst intersect(Fst ifst1,
 */
struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_equivalent {
  int __pyx_n;
  float delta;
};

/* "fstlib/cext/pywrapfst.pxd":525
 * cpdef bool equivalent(Fst ifst1, Fst ifst2, float delta=?) except *
 * 
 * cpdef MutableFst intersect(Fst ifst1,             # <<<<<<<<<<<<<<
 *                            Fst ifst2,
 *                            compose_filter=?,
 */
struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_intersect {
  int __pyx_n;
  PyObject *compose_filter;
  bool connect;
};

/* "fstlib/cext/pywrapfst.pxd":530
 *                            bool connect=?)
 * 
 * cpdef bool isomorphic(Fst ifst1, Fst ifst2, float delta=?)             # <<<<<<<<<<<<<<
 * 
 * cpdef MutableFst prune(Fst ifst,
 */
struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_isomorphic {
  int __pyx_n;
  float delta;
};

/* "fstlib/cext/pywrapfst.pxd":532
 * cpdef bool isomorphic(Fst ifst1, Fst ifst2, float delta=?)
 * 
 * cpdef MutableFst prune(Fst ifst,             # <<<<<<<<<<<<<<
 *                        float delta=?,
 *                        int64 nstate=?,
 */
struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_prune {
  int __pyx_n;
  float delta;
  int64 nstate;
  PyObject *weight;
};

/* "fstlib/cext/pywrapfst.pxd":537
 *                        weight=?)
 * 
 * cpdef MutableFst push(Fst ifst,             # <<<<<<<<<<<<<<
 *                       float delta=?,
 *                       bool push_weights=?,
 */
struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_push {
  int __pyx_n;
  float delta;
  bool push_weights;
  bool push_labels;
  bool remove_common_affix;
  bool remove_total_weight;
  bool to_final;
};

/* "fstlib/cext/pywrapfst.pxd":545
 *                       bool to_final=?)
 * 
 * cpdef bool randequivalent(Fst ifst1,             # <<<<<<<<<<<<<<
 *                           Fst ifst2,
 *                           int32 npath=?,
 */
struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_randequivalent {
  int __pyx_n;
  int32 npath;
  float delta;
  PyObject *select;
  int32 max_length;
  uint64 seed;
};

/* "fstlib/cext/pywrapfst.pxd":553
 *                           uint64 seed=?) except *
 * 
 * cpdef MutableFst randgen(Fst ifst,             # <<<<<<<<<<<<<<
 *                          int32 npath=?,
 *                          select=?,
 */
struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_randgen {
  int __pyx_n;
  int32 npath;
  PyObject *select;
  int32 max_length;
  bool remove_total_weight;
  bool weighted;
  uint64 seed;
};

/* "fstlib/cext/pywrapfst.pxd":561
 *                          uint64 seed=?)
 * 
 * cpdef MutableFst replace(pairs,             # <<<<<<<<<<<<<<
 *                          call_arc_labeling=?,
 *                          return_arc_labeling=?,
 */
struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_replace {
  int __pyx_n;
  PyObject *call_arc_labeling;
  PyObject *return_arc_labeling;
  bool epsilon_on_replace;
  int64 return_label;
};

/* "fstlib/cext/pywrapfst.pxd":567
 *                          int64 return_label=?)
 * 
 * cpdef MutableFst reverse(Fst ifst, bool require_superinitial=?)             # <<<<<<<<<<<<<<
 * 
 * cdef void _shortestdistance(Fst ifst,
 */
struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_reverse {
  int __pyx_n;
  bool require_superinitial;
};

/* "fstlib/cext/pywrapfst.pxd":569
 * cpdef MutableFst reverse(Fst ifst, bool require_superinitial=?)
 * 
 * cdef void _shortestdistance(Fst ifst,             # <<<<<<<<<<<<<<
 *                             vector[fst.WeightClass] *,
 *                             float delta=?,
 */
struct __pyx_opt_args_6fstlib_4cext_9pywrapfst__shortestdistance {
  int __pyx_n;
  float delta;
  int64 nstate;
  PyObject *queue_type;
  bool reverse;
};

/* "fstlib/cext/pywrapfst.pxd":576
 *                             bool reverse=?) except *
 * 
 * cpdef MutableFst shortestpath(Fst ifst,             # <<<<<<<<<<<<<<
 *                               float delta=?,
 *                               int32 nshortest=?,
 */
struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_shortestpath {
  int __pyx_n;
  float delta;
  int32 nshortest;
  int64 nstate;
  PyObject *queue_type;
  bool unique;
  PyObject *weight;
};

/* "fstlib/cext/pywrapfst.pxd":71
 * 
 * 
 * cdef class Weight:             # <<<<<<<<<<<<<<
 * 
 *   cdef unique_ptr[fst.WeightClass] _weight
 */
struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight {
  PyObject_HEAD
  struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_Weight *__pyx_vtab;
  std::unique_ptr<fst::script::WeightClass>  _weight;
};


/* "fstlib/cext/pywrapfst.pxd":107
 * 
 * 
 * cdef class SymbolTableView:             # <<<<<<<<<<<<<<
 * 
 *   cdef const fst.SymbolTable *_raw(self)
 */
struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView {
  PyObject_HEAD
  struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_vtab;
};


/* "fstlib/cext/pywrapfst.pxd":138
 * 
 * 
 * cdef class _EncodeMapperSymbolTableView(SymbolTableView):             # <<<<<<<<<<<<<<
 * 
 *   # Indicates whether this view is of an input or output SymbolTable
 */
struct __pyx_obj_6fstlib_4cext_9pywrapfst__EncodeMapperSymbolTableView {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView __pyx_base;
  bool _input_side;
  std::shared_ptr<fst::script::EncodeMapperClass>  _mapper;
};


/* "fstlib/cext/pywrapfst.pxd":146
 * 
 * 
 * cdef class _FstSymbolTableView(SymbolTableView):             # <<<<<<<<<<<<<<
 * 
 *   # Indicates whether this view is of an input or output SymbolTable
 */
struct __pyx_obj_6fstlib_4cext_9pywrapfst__FstSymbolTableView {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView __pyx_base;
  bool _input_side;
  std::shared_ptr<fst::script::FstClass>  _fst;
};


/* "fstlib/cext/pywrapfst.pxd":154
 * 
 * 
 * cdef class _MutableSymbolTable(SymbolTableView):             # <<<<<<<<<<<<<<
 * 
 *   cdef fst.SymbolTable *_mutable_raw(self)
 */
struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableSymbolTable {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView __pyx_base;
};


/* "fstlib/cext/pywrapfst.pxd":167
 * 
 * 
 * cdef class _MutableFstSymbolTableView(_MutableSymbolTable):             # <<<<<<<<<<<<<<
 * 
 *   # Indicates whether this view is of an input or output SymbolTable
 */
struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableFstSymbolTableView {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableSymbolTable __pyx_base;
  bool _input_side;
  std::shared_ptr<fst::script::MutableFstClass>  _mfst;
};


/* "fstlib/cext/pywrapfst.pxd":175
 * 
 * 
 * cdef class SymbolTable(_MutableSymbolTable):             # <<<<<<<<<<<<<<
 * 
 *   cdef unique_ptr[fst.SymbolTable] _smart_table
 */
struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTable {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableSymbolTable __pyx_base;
  std::unique_ptr<fst::SymbolTable>  _smart_table;
};


/* "fstlib/cext/pywrapfst.pxd":198
 * 
 * 
 * cdef class _SymbolTableIterator:             # <<<<<<<<<<<<<<
 * 
 *   cdef SymbolTableView _table
 */
struct __pyx_obj_6fstlib_4cext_9pywrapfst__SymbolTableIterator {
  PyObject_HEAD
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *_table;
  std::unique_ptr<fst::SymbolTable::iterator>  _siter;
};


/* "fstlib/cext/pywrapfst.pxd":210
 * 
 * 
 * cdef class EncodeMapper:             # <<<<<<<<<<<<<<
 * 
 *   cdef shared_ptr[fst.EncodeMapperClass] _mapper
 */
struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper {
  PyObject_HEAD
  struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_EncodeMapper *__pyx_vtab;
  std::shared_ptr<fst::script::EncodeMapperClass>  _mapper;
};


/* "fstlib/cext/pywrapfst.pxd":247
 * 
 * 
 * cdef class Fst:             # <<<<<<<<<<<<<<
 * 
 *   cdef shared_ptr[fst.FstClass] _fst
 */
struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst {
  PyObject_HEAD
  struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_Fst *__pyx_vtab;
  std::shared_ptr<fst::script::FstClass>  _fst;
};


/* "fstlib/cext/pywrapfst.pxd":313
 * 
 * 
 * cdef class MutableFst(Fst):             # <<<<<<<<<<<<<<
 * 
 *   cdef shared_ptr[fst.MutableFstClass] _mfst
 */
struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst __pyx_base;
  std::shared_ptr<fst::script::MutableFstClass>  _mfst;
};


/* "fstlib/cext/pywrapfst.pxd":394
 * 
 * 
 * cdef class VectorFst(MutableFst):             # <<<<<<<<<<<<<<
 * 
 *     pass
 */
struct __pyx_obj_6fstlib_4cext_9pywrapfst_VectorFst {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst __pyx_base;
};


/* "fstlib/cext/pywrapfst.pxd":416
 * 
 * 
 * cdef class Arc:             # <<<<<<<<<<<<<<
 * 
 *   cdef unique_ptr[fst.ArcClass] _arc
 */
struct __pyx_obj_6fstlib_4cext_9pywrapfst_Arc {
  PyObject_HEAD
  struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_Arc *__pyx_vtab;
  std::unique_ptr<fst::script::ArcClass>  _arc;
};


/* "fstlib/cext/pywrapfst.pxd":426
 * 
 * 
 * cdef class _ArcIterator:             # <<<<<<<<<<<<<<
 * 
 *   cdef shared_ptr[fst.FstClass] _fst
 */
struct __pyx_obj_6fstlib_4cext_9pywrapfst__ArcIterator {
  PyObject_HEAD
  struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst__ArcIterator *__pyx_vtab;
  std::shared_ptr<fst::script::FstClass>  _fst;
  std::unique_ptr<fst::script::ArcIteratorClass>  _aiter;
};


/* "fstlib/cext/pywrapfst.pxd":448
 * 
 * 
 * cdef class _MutableArcIterator:             # <<<<<<<<<<<<<<
 * 
 *   cdef shared_ptr[fst.MutableFstClass] _mfst
 */
struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableArcIterator {
  PyObject_HEAD
  struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst__MutableArcIterator *__pyx_vtab;
  std::shared_ptr<fst::script::MutableFstClass>  _mfst;
  std::unique_ptr<fst::script::MutableArcIteratorClass>  _aiter;
};


/* "fstlib/cext/pywrapfst.pxd":472
 * 
 * 
 * cdef class _StateIterator:             # <<<<<<<<<<<<<<
 * 
 *   cdef shared_ptr[fst.FstClass] _fst
 */
struct __pyx_obj_6fstlib_4cext_9pywrapfst__StateIterator {
  PyObject_HEAD
  struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst__StateIterator *__pyx_vtab;
  std::shared_ptr<fst::script::FstClass>  _fst;
  std::unique_ptr<fst::script::StateIteratorClass>  _siter;
};


/* "fstlib/cext/pywrapfst.pxd":592
 * 
 * 
 * cdef class Compiler:             # <<<<<<<<<<<<<<
 * 
 *   cdef unique_ptr[stringstream] _sstrm
 */
struct __pyx_obj_6fstlib_4cext_9pywrapfst_Compiler {
  PyObject_HEAD
  struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_Compiler *__pyx_vtab;
  std::unique_ptr<std::stringstream>  _sstrm;
  std::string _fst_type;
  std::string _arc_type;
  fst::SymbolTable const *_isymbols;
  fst::SymbolTable const *_osymbols;
  fst::SymbolTable const *_ssymbols;
  bool _acceptor;
  bool _keep_isymbols;
  bool _keep_osymbols;
  bool _keep_state_numbering;
  bool _allow_negative_labels;
};


/* "fstlib/cext/pywrapfst.pxd":613
 * # FarReader.
 * 
 * cdef class FarReader:             # <<<<<<<<<<<<<<
 * 
 *   cdef unique_ptr[fst.FarReaderClass] _reader
 */
struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarReader {
  PyObject_HEAD
  struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_FarReader *__pyx_vtab;
  std::unique_ptr<fst::script::FarReaderClass>  _reader;
};


/* "fstlib/cext/pywrapfst.pxd":638
 * # FarWriter.
 * 
 * cdef class FarWriter:             # <<<<<<<<<<<<<<
 * 
 *   cdef unique_ptr[fst.FarWriterClass] _writer
 */
struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarWriter {
  PyObject_HEAD
  struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_FarWriter *__pyx_vtab;
  std::unique_ptr<fst::script::FarWriterClass>  _writer;
};


/* "fstlib/cext/pywrapfst.pyx":3275
 * 
 *   # Magic method used to get a Pythonic Iterator API out of the C++ API.
 *   def __iter__(self):             # <<<<<<<<<<<<<<
 *     while not self.done():
 *       yield self.value()
 */
struct __pyx_obj_6fstlib_4cext_9pywrapfst___pyx_scope_struct____iter__ {
  PyObject_HEAD
  struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableArcIterator *__pyx_v_self;
};



/* "fstlib/cext/pywrapfst.pyx":405
 * 
 * 
 * cdef class Weight:             # <<<<<<<<<<<<<<
 * 
 *   """
 */

struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_Weight {
  void (*_check_weight)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *);
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *(*copy)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *, int __pyx_skip_dispatch);
  std::string (*to_string)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *, int __pyx_skip_dispatch);
  std::string (*type)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *, int __pyx_skip_dispatch);
  bool (*member)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_Weight *__pyx_vtabptr_6fstlib_4cext_9pywrapfst_Weight;


/* "fstlib/cext/pywrapfst.pyx":732
 * 
 * 
 * cdef class SymbolTableView:             # <<<<<<<<<<<<<<
 * 
 *   """
 */

struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_SymbolTableView {
  fst::SymbolTable const *(*_raw)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *);
  void (*_raise_nonexistent)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *);
  fst::SymbolTable const *(*_raw_ptr_or_raise)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *);
  int64 (*available_key)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *, int __pyx_skip_dispatch);
  PyObject *(*checksum)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *, int __pyx_skip_dispatch);
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTable *(*copy)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *, int __pyx_skip_dispatch);
  int64 (*get_nth_key)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *, Py_ssize_t, int __pyx_skip_dispatch);
  PyObject *(*labeled_checksum)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *, int __pyx_skip_dispatch);
  bool (*member)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *, PyObject *, int __pyx_skip_dispatch);
  std::string (*name)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *, int __pyx_skip_dispatch);
  size_t (*num_symbols)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *, int __pyx_skip_dispatch);
  void (*write)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *, PyObject *, int __pyx_skip_dispatch);
  void (*write_text)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*write_to_string)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_vtabptr_6fstlib_4cext_9pywrapfst_SymbolTableView;


/* "fstlib/cext/pywrapfst.pyx":935
 * 
 * 
 * cdef class _EncodeMapperSymbolTableView(SymbolTableView):             # <<<<<<<<<<<<<<
 * 
 *   """
 */

struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst__EncodeMapperSymbolTableView {
  struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_SymbolTableView __pyx_base;
};
static struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst__EncodeMapperSymbolTableView *__pyx_vtabptr_6fstlib_4cext_9pywrapfst__EncodeMapperSymbolTableView;


/* "fstlib/cext/pywrapfst.pyx":959
 * 
 * 
 * cdef class _FstSymbolTableView(SymbolTableView):             # <<<<<<<<<<<<<<
 * 
 *   """
 */

struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst__FstSymbolTableView {
  struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_SymbolTableView __pyx_base;
};
static struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst__FstSymbolTableView *__pyx_vtabptr_6fstlib_4cext_9pywrapfst__FstSymbolTableView;


/* "fstlib/cext/pywrapfst.pyx":982
 * 
 * 
 * cdef class _MutableSymbolTable(SymbolTableView):             # <<<<<<<<<<<<<<
 * 
 *   """
 */

struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst__MutableSymbolTable {
  struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_SymbolTableView __pyx_base;
  fst::SymbolTable *(*_mutable_raw)(struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableSymbolTable *);
  fst::SymbolTable *(*_mutable_raw_ptr_or_raise)(struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableSymbolTable *);
  int64 (*add_symbol)(struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableSymbolTable *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_19_MutableSymbolTable_add_symbol *__pyx_optional_args);
  void (*add_table)(struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableSymbolTable *, struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *, int __pyx_skip_dispatch);
  void (*set_name)(struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableSymbolTable *, PyObject *, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst__MutableSymbolTable *__pyx_vtabptr_6fstlib_4cext_9pywrapfst__MutableSymbolTable;


/* "fstlib/cext/pywrapfst.pyx":1054
 * 
 * 
 * cdef class _MutableFstSymbolTableView(_MutableSymbolTable):             # <<<<<<<<<<<<<<
 *   """
 *   (No constructor.)
 */

struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst__MutableFstSymbolTableView {
  struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst__MutableSymbolTable __pyx_base;
};
static struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst__MutableFstSymbolTableView *__pyx_vtabptr_6fstlib_4cext_9pywrapfst__MutableFstSymbolTableView;


/* "fstlib/cext/pywrapfst.pyx":1069
 * 
 * 
 * cdef class SymbolTable(_MutableSymbolTable):             # <<<<<<<<<<<<<<
 * 
 *   """
 */

struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_SymbolTable {
  struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst__MutableSymbolTable __pyx_base;
};
static struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_SymbolTable *__pyx_vtabptr_6fstlib_4cext_9pywrapfst_SymbolTable;


/* "fstlib/cext/pywrapfst.pyx":1297
 * 
 * 
 * cdef class EncodeMapper:             # <<<<<<<<<<<<<<
 * 
 *   """
 */

struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_EncodeMapper {
  std::string (*arc_type)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *, int __pyx_skip_dispatch);
  std::string (*weight_type)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *, int __pyx_skip_dispatch);
  uint8 (*flags)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *, int __pyx_skip_dispatch);
  void (*write)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*write_to_string)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *, int __pyx_skip_dispatch);
  struct __pyx_obj_6fstlib_4cext_9pywrapfst__EncodeMapperSymbolTableView *(*input_symbols)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *, int __pyx_skip_dispatch);
  struct __pyx_obj_6fstlib_4cext_9pywrapfst__EncodeMapperSymbolTableView *(*output_symbols)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *, int __pyx_skip_dispatch);
  void (*_set_input_symbols)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *, struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *);
  void (*_set_output_symbols)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *, struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *);
};
static struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_EncodeMapper *__pyx_vtabptr_6fstlib_4cext_9pywrapfst_EncodeMapper;


/* "fstlib/cext/pywrapfst.pyx":1564
 * 
 * 
 * cdef class Fst:             # <<<<<<<<<<<<<<
 * 
 *   """
 */

struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_Fst {
  std::string (*_local_render_svg)(std::string const &);
  std::string (*arc_type)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *, int __pyx_skip_dispatch);
  struct __pyx_obj_6fstlib_4cext_9pywrapfst__ArcIterator *(*arcs)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *, int64, int __pyx_skip_dispatch);
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *(*copy)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *, int __pyx_skip_dispatch);
  void (*draw)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_3Fst_draw *__pyx_optional_args);
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *(*final)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *, int64, int __pyx_skip_dispatch);
  std::string (*fst_type)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *, int __pyx_skip_dispatch);
  struct __pyx_obj_6fstlib_4cext_9pywrapfst__FstSymbolTableView *(*input_symbols)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *, int __pyx_skip_dispatch);
  size_t (*num_arcs)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *, int64, int __pyx_skip_dispatch);
  size_t (*num_input_epsilons)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *, int64, int __pyx_skip_dispatch);
  size_t (*num_output_epsilons)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *, int64, int __pyx_skip_dispatch);
  struct __pyx_obj_6fstlib_4cext_9pywrapfst__FstSymbolTableView *(*output_symbols)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *, int __pyx_skip_dispatch);
  std::string (*print)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *, int __pyx_skip_dispatch, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_3Fst_print *__pyx_optional_args);
  int64 (*start)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *, int __pyx_skip_dispatch);
  struct __pyx_obj_6fstlib_4cext_9pywrapfst__StateIterator *(*states)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *, int __pyx_skip_dispatch);
  bool (*verify)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *, int __pyx_skip_dispatch);
  std::string (*weight_type)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *, int __pyx_skip_dispatch);
  void (*write)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*write_to_string)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_Fst *__pyx_vtabptr_6fstlib_4cext_9pywrapfst_Fst;


/* "fstlib/cext/pywrapfst.pyx":2029
 * 
 * 
 * cdef class MutableFst(Fst):             # <<<<<<<<<<<<<<
 * 
 *   """
 */

struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_MutableFst {
  struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_Fst __pyx_base;
  void (*_check_mutating_imethod)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *);
  void (*_add_arc)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *, int64, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Arc *);
  int64 (*add_state)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *, int __pyx_skip_dispatch);
  void (*add_states)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *, size_t, int __pyx_skip_dispatch);
  void (*_arcsort)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_10MutableFst__arcsort *__pyx_optional_args);
  void (*_closure)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_10MutableFst__closure *__pyx_optional_args);
  void (*_concat)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *);
  void (*_connect)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *);
  void (*_decode)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *, struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *);
  void (*_delete_arcs)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *, int64, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_10MutableFst__delete_arcs *__pyx_optional_args);
  void (*_delete_states)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_10MutableFst__delete_states *__pyx_optional_args);
  void (*_encode)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *, struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *);
  void (*_invert)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *);
  void (*_minimize)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_10MutableFst__minimize *__pyx_optional_args);
  struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableArcIterator *(*mutable_arcs)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *, int64, int __pyx_skip_dispatch);
  int64 (*num_states)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *, int __pyx_skip_dispatch);
  void (*_project)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *, PyObject *);
  void (*_prune)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_10MutableFst__prune *__pyx_optional_args);
  void (*_push)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_10MutableFst__push *__pyx_optional_args);
  void (*_relabel_pairs)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_10MutableFst__relabel_pairs *__pyx_optional_args);
  void (*_relabel_tables)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_10MutableFst__relabel_tables *__pyx_optional_args);
  void (*_reserve_arcs)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *, int64, size_t);
  void (*_reserve_states)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *, int64);
  void (*_reweight)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *, PyObject *, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_10MutableFst__reweight *__pyx_optional_args);
  void (*_rmepsilon)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_10MutableFst__rmepsilon *__pyx_optional_args);
  void (*_set_final)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *, int64, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_10MutableFst__set_final *__pyx_optional_args);
  void (*_set_start)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *, int64);
  void (*_set_input_symbols)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *, struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *);
  void (*_set_output_symbols)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *, struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *);
  void (*_topsort)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *);
};
static struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_vtabptr_6fstlib_4cext_9pywrapfst_MutableFst;


/* "fstlib/cext/pywrapfst.pyx":2891
 * 
 * 
 * cdef class VectorFst(MutableFst):             # <<<<<<<<<<<<<<
 *   """
 *   VectorFst(arc_type="standard")
 */

struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_VectorFst {
  struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_MutableFst __pyx_base;
};
static struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_VectorFst *__pyx_vtabptr_6fstlib_4cext_9pywrapfst_VectorFst;


/* "fstlib/cext/pywrapfst.pyx":3074
 * 
 * 
 * cdef class Arc:             # <<<<<<<<<<<<<<
 * 
 *   """
 */

struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_Arc {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_Arc *(*copy)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Arc *, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_Arc *__pyx_vtabptr_6fstlib_4cext_9pywrapfst_Arc;


/* "fstlib/cext/pywrapfst.pyx":3144
 * 
 * 
 * cdef class _ArcIterator:             # <<<<<<<<<<<<<<
 * 
 *   """
 */

struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst__ArcIterator {
  bool (*done)(struct __pyx_obj_6fstlib_4cext_9pywrapfst__ArcIterator *, int __pyx_skip_dispatch);
  uint8 (*flags)(struct __pyx_obj_6fstlib_4cext_9pywrapfst__ArcIterator *, int __pyx_skip_dispatch);
  void (*next)(struct __pyx_obj_6fstlib_4cext_9pywrapfst__ArcIterator *, int __pyx_skip_dispatch);
  size_t (*position)(struct __pyx_obj_6fstlib_4cext_9pywrapfst__ArcIterator *, int __pyx_skip_dispatch);
  void (*reset)(struct __pyx_obj_6fstlib_4cext_9pywrapfst__ArcIterator *, int __pyx_skip_dispatch);
  void (*seek)(struct __pyx_obj_6fstlib_4cext_9pywrapfst__ArcIterator *, size_t, int __pyx_skip_dispatch);
  void (*set_flags)(struct __pyx_obj_6fstlib_4cext_9pywrapfst__ArcIterator *, uint8, uint8, int __pyx_skip_dispatch);
  PyObject *(*value)(struct __pyx_obj_6fstlib_4cext_9pywrapfst__ArcIterator *, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst__ArcIterator *__pyx_vtabptr_6fstlib_4cext_9pywrapfst__ArcIterator;


/* "fstlib/cext/pywrapfst.pyx":3255
 * 
 * 
 * cdef class _MutableArcIterator:             # <<<<<<<<<<<<<<
 * 
 *   """
 */

struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst__MutableArcIterator {
  bool (*done)(struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableArcIterator *, int __pyx_skip_dispatch);
  uint8 (*flags)(struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableArcIterator *, int __pyx_skip_dispatch);
  void (*next)(struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableArcIterator *, int __pyx_skip_dispatch);
  size_t (*position)(struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableArcIterator *, int __pyx_skip_dispatch);
  void (*reset)(struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableArcIterator *, int __pyx_skip_dispatch);
  void (*seek)(struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableArcIterator *, size_t, int __pyx_skip_dispatch);
  void (*set_flags)(struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableArcIterator *, uint8, uint8, int __pyx_skip_dispatch);
  void (*set_value)(struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableArcIterator *, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Arc *, int __pyx_skip_dispatch);
  PyObject *(*value)(struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableArcIterator *, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst__MutableArcIterator *__pyx_vtabptr_6fstlib_4cext_9pywrapfst__MutableArcIterator;


/* "fstlib/cext/pywrapfst.pyx":3383
 * 
 * 
 * cdef class _StateIterator:             # <<<<<<<<<<<<<<
 * 
 *   """
 */

struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst__StateIterator {
  bool (*done)(struct __pyx_obj_6fstlib_4cext_9pywrapfst__StateIterator *, int __pyx_skip_dispatch);
  void (*next)(struct __pyx_obj_6fstlib_4cext_9pywrapfst__StateIterator *, int __pyx_skip_dispatch);
  void (*reset)(struct __pyx_obj_6fstlib_4cext_9pywrapfst__StateIterator *, int __pyx_skip_dispatch);
  int64 (*value)(struct __pyx_obj_6fstlib_4cext_9pywrapfst__StateIterator *, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst__StateIterator *__pyx_vtabptr_6fstlib_4cext_9pywrapfst__StateIterator;


/* "fstlib/cext/pywrapfst.pyx":4293
 * 
 * 
 * cdef class Compiler:             # <<<<<<<<<<<<<<
 * 
 *   """
 */

struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_Compiler {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *(*compile)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Compiler *, int __pyx_skip_dispatch);
  void (*write)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Compiler *, PyObject *, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_Compiler *__pyx_vtabptr_6fstlib_4cext_9pywrapfst_Compiler;


/* "fstlib/cext/pywrapfst.pyx":4430
 * 
 * 
 * cdef class FarReader:             # <<<<<<<<<<<<<<
 * 
 *   """
 */

struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_FarReader {
  std::string (*arc_type)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarReader *, int __pyx_skip_dispatch);
  bool (*done)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarReader *, int __pyx_skip_dispatch);
  bool (*error)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarReader *, int __pyx_skip_dispatch);
  std::string (*far_type)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarReader *, int __pyx_skip_dispatch);
  bool (*find)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarReader *, PyObject *, int __pyx_skip_dispatch);
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *(*get_fst)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarReader *, int __pyx_skip_dispatch);
  std::string (*get_key)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarReader *, int __pyx_skip_dispatch);
  void (*next)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarReader *, int __pyx_skip_dispatch);
  void (*reset)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarReader *, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_FarReader *__pyx_vtabptr_6fstlib_4cext_9pywrapfst_FarReader;


/* "fstlib/cext/pywrapfst.pyx":4585
 * 
 * 
 * cdef class FarWriter:             # <<<<<<<<<<<<<<
 * 
 *   """
 */

struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_FarWriter {
  std::string (*arc_type)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarWriter *, int __pyx_skip_dispatch);
  void (*close)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarWriter *);
  void (*add)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarWriter *, PyObject *, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *, int __pyx_skip_dispatch);
  bool (*error)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarWriter *, int __pyx_skip_dispatch);
  std::string (*far_type)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarWriter *, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_FarWriter *__pyx_vtabptr_6fstlib_4cext_9pywrapfst_FarWriter;

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

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

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

/* 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_str(s) :\
        likely(PyFloat_CheckExact(s)) ? PyFloat_Type.tp_str(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

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

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

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

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

/* PyFunctionFastCall.proto */
#if CYTHON_FAST_PYCALL
#define __Pyx_PyFunction_FastCall(func, args, nargs)\
    __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
#if 1 || PY_VERSION_HEX < 0x030600B1
static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
#else
#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, 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_FAST_PYCALL
  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 // CYTHON_FAST_PYCALL
#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

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

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

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

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

/* 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)  {\
    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);\
}
#define __Pyx_GetModuleGlobalNameUncached(var, name)  {\
    PY_UINT64_T __pyx_dict_version;\
    PyObject *__pyx_dict_cached_value;\
    (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
}
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

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

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

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

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

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

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

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

/* ArgTypeTest.proto */
#define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
    ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
        __Pyx__ArgTypeTest(obj, type, name, exact))
static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);

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

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

/* GetTopmostException.proto */
#if CYTHON_USE_EXC_INFO_STACK
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

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

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

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

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

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

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

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

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

/* ListCompAppend.proto */
#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
    PyListObject* L = (PyListObject*) list;
    Py_ssize_t len = Py_SIZE(list);
    if (likely(L->allocated > len)) {
        Py_INCREF(x);
        PyList_SET_ITEM(list, len, x);
        __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

/* 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(PyObject *dict, void *vtable);

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

/* SetupReduce.proto */
static int __Pyx_setup_reduce(PyObject* type_obj);

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

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

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

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

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

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

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

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

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

/* Globals.proto */
static PyObject* __Pyx_Globals(void);

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

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

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

/* None.proto */
#include <new>

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

/* CppExceptionConversion.proto */
#ifndef __Pyx_CppExn2PyErr
#include <new>
#include <typeinfo>
#include <stdexcept>
#include <ios>
static void __Pyx_CppExn2PyErr() {
  try {
    if (PyErr_Occurred())
      ; // let the latest Python exn pass through and ignore the current one
    else
      throw;
  } catch (const std::bad_alloc& exn) {
    PyErr_SetString(PyExc_MemoryError, exn.what());
  } catch (const std::bad_cast& exn) {
    PyErr_SetString(PyExc_TypeError, exn.what());
  } catch (const std::bad_typeid& exn) {
    PyErr_SetString(PyExc_TypeError, exn.what());
  } catch (const std::domain_error& exn) {
    PyErr_SetString(PyExc_ValueError, exn.what());
  } catch (const std::invalid_argument& exn) {
    PyErr_SetString(PyExc_ValueError, exn.what());
  } catch (const std::ios_base::failure& exn) {
    PyErr_SetString(PyExc_IOError, exn.what());
  } catch (const std::out_of_range& exn) {
    PyErr_SetString(PyExc_IndexError, exn.what());
  } catch (const std::overflow_error& exn) {
    PyErr_SetString(PyExc_OverflowError, exn.what());
  } catch (const std::range_error& exn) {
    PyErr_SetString(PyExc_ArithmeticError, exn.what());
  } catch (const std::underflow_error& exn) {
    PyErr_SetString(PyExc_ArithmeticError, exn.what());
  } catch (const std::exception& exn) {
    PyErr_SetString(PyExc_RuntimeError, exn.what());
  }
  catch (...)
  {
    PyErr_SetString(PyExc_RuntimeError, "Unknown exception");
  }
}
#endif

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

/* CIntFromPy.proto */
static CYTHON_INLINE int64_t __Pyx_PyInt_As_int64_t(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE int32_t __Pyx_PyInt_As_int32_t(PyObject *);

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

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int64_t(int64_t value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint64_t(uint64_t value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value);

/* CIntFromPy.proto */
static CYTHON_INLINE uint8_t __Pyx_PyInt_As_uint8_t(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE uint64_t __Pyx_PyInt_As_uint64_t(PyObject *);

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

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int32_t(int32_t value);

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

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

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

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

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

/* CoroutineBase.proto */
typedef PyObject *(*__pyx_coroutine_body_t)(PyObject *, 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 {
    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
static PyTypeObject *__pyx_GeneratorType = 0;
#define __Pyx_Generator_CheckExact(obj) (Py_TYPE(obj) == __pyx_GeneratorType)
#define __Pyx_Generator_New(body, code, closure, name, qualname, module_name)\
    __Pyx__Coroutine_New(__pyx_GeneratorType, body, code, closure, name, qualname, module_name)
static PyObject *__Pyx_Generator_Next(PyObject *self);
static int __pyx_Generator_init(void);

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

/* FunctionExport.proto */
static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig);

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

static void __pyx_f_6fstlib_4cext_9pywrapfst_6Weight__check_weight(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__pyx_v_self); /* proto*/
static struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__pyx_f_6fstlib_4cext_9pywrapfst_6Weight_copy(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static std::string __pyx_f_6fstlib_4cext_9pywrapfst_6Weight_to_string(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static std::string __pyx_f_6fstlib_4cext_9pywrapfst_6Weight_type(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static bool __pyx_f_6fstlib_4cext_9pywrapfst_6Weight_member(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static __pyx_t_6fstlib_4cext_9pywrapfst_const_SymbolTable_ptr __pyx_f_6fstlib_4cext_9pywrapfst_15SymbolTableView__raw(CYTHON_UNUSED struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_self); /* proto*/
static void __pyx_f_6fstlib_4cext_9pywrapfst_15SymbolTableView__raise_nonexistent(CYTHON_UNUSED struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_self); /* proto*/
static __pyx_t_6fstlib_4cext_9pywrapfst_const_SymbolTable_ptr __pyx_f_6fstlib_4cext_9pywrapfst_15SymbolTableView__raw_ptr_or_raise(struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_self); /* proto*/
static int64 __pyx_f_6fstlib_4cext_9pywrapfst_15SymbolTableView_available_key(struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_6fstlib_4cext_9pywrapfst_15SymbolTableView_checksum(struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTable *__pyx_f_6fstlib_4cext_9pywrapfst_15SymbolTableView_copy(struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static int64 __pyx_f_6fstlib_4cext_9pywrapfst_15SymbolTableView_get_nth_key(struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_self, Py_ssize_t __pyx_v_pos, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_6fstlib_4cext_9pywrapfst_15SymbolTableView_labeled_checksum(struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static bool __pyx_f_6fstlib_4cext_9pywrapfst_15SymbolTableView_member(struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch); /* proto*/
static std::string __pyx_f_6fstlib_4cext_9pywrapfst_15SymbolTableView_name(struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static size_t __pyx_f_6fstlib_4cext_9pywrapfst_15SymbolTableView_num_symbols(struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_6fstlib_4cext_9pywrapfst_15SymbolTableView_write(struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_self, PyObject *__pyx_v_source, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_6fstlib_4cext_9pywrapfst_15SymbolTableView_write_text(struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_self, PyObject *__pyx_v_source, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_6fstlib_4cext_9pywrapfst_15SymbolTableView_write_to_string(struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static __pyx_t_6fstlib_4cext_9pywrapfst_const_SymbolTable_ptr __pyx_f_6fstlib_4cext_9pywrapfst_28_EncodeMapperSymbolTableView__raw(struct __pyx_obj_6fstlib_4cext_9pywrapfst__EncodeMapperSymbolTableView *__pyx_v_self); /* proto*/
static __pyx_t_6fstlib_4cext_9pywrapfst_const_SymbolTable_ptr __pyx_f_6fstlib_4cext_9pywrapfst_19_FstSymbolTableView__raw(struct __pyx_obj_6fstlib_4cext_9pywrapfst__FstSymbolTableView *__pyx_v_self); /* proto*/
static __pyx_t_6fstlib_4cext_9pywrapfst_const_SymbolTable_ptr __pyx_f_6fstlib_4cext_9pywrapfst_19_MutableSymbolTable__raw(struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableSymbolTable *__pyx_v_self); /* proto*/
static __pyx_t_6fstlib_4cext_9pywrapfst_SymbolTable_ptr __pyx_f_6fstlib_4cext_9pywrapfst_19_MutableSymbolTable__mutable_raw(CYTHON_UNUSED struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableSymbolTable *__pyx_v_self); /* proto*/
static __pyx_t_6fstlib_4cext_9pywrapfst_SymbolTable_ptr __pyx_f_6fstlib_4cext_9pywrapfst_19_MutableSymbolTable__mutable_raw_ptr_or_raise(struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableSymbolTable *__pyx_v_self); /* proto*/
static int64 __pyx_f_6fstlib_4cext_9pywrapfst_19_MutableSymbolTable_add_symbol(struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableSymbolTable *__pyx_v_self, PyObject *__pyx_v_symbol, int __pyx_skip_dispatch, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_19_MutableSymbolTable_add_symbol *__pyx_optional_args); /* proto*/
static void __pyx_f_6fstlib_4cext_9pywrapfst_19_MutableSymbolTable_add_table(struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableSymbolTable *__pyx_v_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_symbols, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_6fstlib_4cext_9pywrapfst_19_MutableSymbolTable_set_name(struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableSymbolTable *__pyx_v_self, PyObject *__pyx_v_new_name, int __pyx_skip_dispatch); /* proto*/
static __pyx_t_6fstlib_4cext_9pywrapfst_SymbolTable_ptr __pyx_f_6fstlib_4cext_9pywrapfst_26_MutableFstSymbolTableView__mutable_raw(struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableFstSymbolTableView *__pyx_v_self); /* proto*/
static __pyx_t_6fstlib_4cext_9pywrapfst_SymbolTable_ptr __pyx_f_6fstlib_4cext_9pywrapfst_11SymbolTable__mutable_raw(struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTable *__pyx_v_self); /* proto*/
static std::string __pyx_f_6fstlib_4cext_9pywrapfst_12EncodeMapper_arc_type(struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static std::string __pyx_f_6fstlib_4cext_9pywrapfst_12EncodeMapper_weight_type(struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static uint8 __pyx_f_6fstlib_4cext_9pywrapfst_12EncodeMapper_flags(struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_6fstlib_4cext_9pywrapfst_12EncodeMapper_write(struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *__pyx_v_self, PyObject *__pyx_v_source, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_6fstlib_4cext_9pywrapfst_12EncodeMapper_write_to_string(struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_6fstlib_4cext_9pywrapfst__EncodeMapperSymbolTableView *__pyx_f_6fstlib_4cext_9pywrapfst_12EncodeMapper_input_symbols(struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_6fstlib_4cext_9pywrapfst__EncodeMapperSymbolTableView *__pyx_f_6fstlib_4cext_9pywrapfst_12EncodeMapper_output_symbols(struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_6fstlib_4cext_9pywrapfst_12EncodeMapper__set_input_symbols(struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *__pyx_v_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_symbols); /* proto*/
static void __pyx_f_6fstlib_4cext_9pywrapfst_12EncodeMapper__set_output_symbols(struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *__pyx_v_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_symbols); /* proto*/
static std::string __pyx_f_6fstlib_4cext_9pywrapfst_3Fst__local_render_svg(std::string const &__pyx_v_dot); /* proto*/
static std::string __pyx_f_6fstlib_4cext_9pywrapfst_3Fst_arc_type(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_6fstlib_4cext_9pywrapfst__ArcIterator *__pyx_f_6fstlib_4cext_9pywrapfst_3Fst_arcs(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_self, int64 __pyx_v_state, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_f_6fstlib_4cext_9pywrapfst_3Fst_copy(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_6fstlib_4cext_9pywrapfst_3Fst_draw(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_self, PyObject *__pyx_v_source, int __pyx_skip_dispatch, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_3Fst_draw *__pyx_optional_args); /* proto*/
static struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__pyx_f_6fstlib_4cext_9pywrapfst_3Fst_final(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_self, int64 __pyx_v_state, int __pyx_skip_dispatch); /* proto*/
static std::string __pyx_f_6fstlib_4cext_9pywrapfst_3Fst_fst_type(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_6fstlib_4cext_9pywrapfst__FstSymbolTableView *__pyx_f_6fstlib_4cext_9pywrapfst_3Fst_input_symbols(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static size_t __pyx_f_6fstlib_4cext_9pywrapfst_3Fst_num_arcs(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_self, int64 __pyx_v_state, int __pyx_skip_dispatch); /* proto*/
static size_t __pyx_f_6fstlib_4cext_9pywrapfst_3Fst_num_input_epsilons(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_self, int64 __pyx_v_state, int __pyx_skip_dispatch); /* proto*/
static size_t __pyx_f_6fstlib_4cext_9pywrapfst_3Fst_num_output_epsilons(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_self, int64 __pyx_v_state, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_6fstlib_4cext_9pywrapfst__FstSymbolTableView *__pyx_f_6fstlib_4cext_9pywrapfst_3Fst_output_symbols(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static std::string __pyx_f_6fstlib_4cext_9pywrapfst_3Fst_print(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_3Fst_print *__pyx_optional_args); /* proto*/
static int64 __pyx_f_6fstlib_4cext_9pywrapfst_3Fst_start(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_6fstlib_4cext_9pywrapfst__StateIterator *__pyx_f_6fstlib_4cext_9pywrapfst_3Fst_states(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static bool __pyx_f_6fstlib_4cext_9pywrapfst_3Fst_verify(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static std::string __pyx_f_6fstlib_4cext_9pywrapfst_3Fst_weight_type(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_6fstlib_4cext_9pywrapfst_3Fst_write(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_self, PyObject *__pyx_v_source, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_6fstlib_4cext_9pywrapfst_3Fst_write_to_string(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_6fstlib_4cext_9pywrapfst_10MutableFst__check_mutating_imethod(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self); /* proto*/
static void __pyx_f_6fstlib_4cext_9pywrapfst_10MutableFst__add_arc(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, int64 __pyx_v_state, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Arc *__pyx_v_arc); /* proto*/
static int64 __pyx_f_6fstlib_4cext_9pywrapfst_10MutableFst_add_state(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_6fstlib_4cext_9pywrapfst_10MutableFst_add_states(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, size_t __pyx_v_n, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_6fstlib_4cext_9pywrapfst_10MutableFst__arcsort(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_10MutableFst__arcsort *__pyx_optional_args); /* proto*/
static void __pyx_f_6fstlib_4cext_9pywrapfst_10MutableFst__closure(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_10MutableFst__closure *__pyx_optional_args); /* proto*/
static void __pyx_f_6fstlib_4cext_9pywrapfst_10MutableFst__concat(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_fst2); /* proto*/
static void __pyx_f_6fstlib_4cext_9pywrapfst_10MutableFst__connect(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self); /* proto*/
static void __pyx_f_6fstlib_4cext_9pywrapfst_10MutableFst__decode(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *__pyx_v_mapper); /* proto*/
static void __pyx_f_6fstlib_4cext_9pywrapfst_10MutableFst__delete_arcs(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, int64 __pyx_v_state, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_10MutableFst__delete_arcs *__pyx_optional_args); /* proto*/
static void __pyx_f_6fstlib_4cext_9pywrapfst_10MutableFst__delete_states(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_10MutableFst__delete_states *__pyx_optional_args); /* proto*/
static void __pyx_f_6fstlib_4cext_9pywrapfst_10MutableFst__encode(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *__pyx_v_mapper); /* proto*/
static void __pyx_f_6fstlib_4cext_9pywrapfst_10MutableFst__invert(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self); /* proto*/
static void __pyx_f_6fstlib_4cext_9pywrapfst_10MutableFst__minimize(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_10MutableFst__minimize *__pyx_optional_args); /* proto*/
static struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableArcIterator *__pyx_f_6fstlib_4cext_9pywrapfst_10MutableFst_mutable_arcs(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, int64 __pyx_v_state, int __pyx_skip_dispatch); /* proto*/
static int64 __pyx_f_6fstlib_4cext_9pywrapfst_10MutableFst_num_states(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_6fstlib_4cext_9pywrapfst_10MutableFst__project(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, PyObject *__pyx_v_project_type); /* proto*/
static void __pyx_f_6fstlib_4cext_9pywrapfst_10MutableFst__prune(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_10MutableFst__prune *__pyx_optional_args); /* proto*/
static void __pyx_f_6fstlib_4cext_9pywrapfst_10MutableFst__push(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_10MutableFst__push *__pyx_optional_args); /* proto*/
static void __pyx_f_6fstlib_4cext_9pywrapfst_10MutableFst__relabel_pairs(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_10MutableFst__relabel_pairs *__pyx_optional_args); /* proto*/
static void __pyx_f_6fstlib_4cext_9pywrapfst_10MutableFst__relabel_tables(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_10MutableFst__relabel_tables *__pyx_optional_args); /* proto*/
static void __pyx_f_6fstlib_4cext_9pywrapfst_10MutableFst__reserve_arcs(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, int64 __pyx_v_state, size_t __pyx_v_n); /* proto*/
static void __pyx_f_6fstlib_4cext_9pywrapfst_10MutableFst__reserve_states(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, int64 __pyx_v_n); /* proto*/
static void __pyx_f_6fstlib_4cext_9pywrapfst_10MutableFst__reweight(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, PyObject *__pyx_v_potentials, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_10MutableFst__reweight *__pyx_optional_args); /* proto*/
static void __pyx_f_6fstlib_4cext_9pywrapfst_10MutableFst__rmepsilon(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_10MutableFst__rmepsilon *__pyx_optional_args); /* proto*/
static void __pyx_f_6fstlib_4cext_9pywrapfst_10MutableFst__set_final(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, int64 __pyx_v_state, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_10MutableFst__set_final *__pyx_optional_args); /* proto*/
static void __pyx_f_6fstlib_4cext_9pywrapfst_10MutableFst__set_input_symbols(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_symbols); /* proto*/
static void __pyx_f_6fstlib_4cext_9pywrapfst_10MutableFst__set_output_symbols(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_symbols); /* proto*/
static void __pyx_f_6fstlib_4cext_9pywrapfst_10MutableFst__set_start(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, int64 __pyx_v_state); /* proto*/
static void __pyx_f_6fstlib_4cext_9pywrapfst_10MutableFst__topsort(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self); /* proto*/
static struct __pyx_obj_6fstlib_4cext_9pywrapfst_Arc *__pyx_f_6fstlib_4cext_9pywrapfst_3Arc_copy(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Arc *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static bool __pyx_f_6fstlib_4cext_9pywrapfst_12_ArcIterator_done(struct __pyx_obj_6fstlib_4cext_9pywrapfst__ArcIterator *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static uint8 __pyx_f_6fstlib_4cext_9pywrapfst_12_ArcIterator_flags(struct __pyx_obj_6fstlib_4cext_9pywrapfst__ArcIterator *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_6fstlib_4cext_9pywrapfst_12_ArcIterator_next(struct __pyx_obj_6fstlib_4cext_9pywrapfst__ArcIterator *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static size_t __pyx_f_6fstlib_4cext_9pywrapfst_12_ArcIterator_position(struct __pyx_obj_6fstlib_4cext_9pywrapfst__ArcIterator *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_6fstlib_4cext_9pywrapfst_12_ArcIterator_reset(struct __pyx_obj_6fstlib_4cext_9pywrapfst__ArcIterator *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_6fstlib_4cext_9pywrapfst_12_ArcIterator_seek(struct __pyx_obj_6fstlib_4cext_9pywrapfst__ArcIterator *__pyx_v_self, size_t __pyx_v_a, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_6fstlib_4cext_9pywrapfst_12_ArcIterator_set_flags(struct __pyx_obj_6fstlib_4cext_9pywrapfst__ArcIterator *__pyx_v_self, uint8 __pyx_v_flags, uint8 __pyx_v_mask, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_6fstlib_4cext_9pywrapfst_12_ArcIterator_value(struct __pyx_obj_6fstlib_4cext_9pywrapfst__ArcIterator *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static bool __pyx_f_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_done(struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableArcIterator *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static uint8 __pyx_f_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_flags(struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableArcIterator *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_next(struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableArcIterator *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static size_t __pyx_f_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_position(struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableArcIterator *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_reset(struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableArcIterator *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_seek(struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableArcIterator *__pyx_v_self, size_t __pyx_v_a, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_set_flags(struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableArcIterator *__pyx_v_self, uint8 __pyx_v_flags, uint8 __pyx_v_mask, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_set_value(struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableArcIterator *__pyx_v_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Arc *__pyx_v_arc, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_value(struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableArcIterator *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static bool __pyx_f_6fstlib_4cext_9pywrapfst_14_StateIterator_done(struct __pyx_obj_6fstlib_4cext_9pywrapfst__StateIterator *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_6fstlib_4cext_9pywrapfst_14_StateIterator_next(struct __pyx_obj_6fstlib_4cext_9pywrapfst__StateIterator *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_6fstlib_4cext_9pywrapfst_14_StateIterator_reset(struct __pyx_obj_6fstlib_4cext_9pywrapfst__StateIterator *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static int64 __pyx_f_6fstlib_4cext_9pywrapfst_14_StateIterator_value(struct __pyx_obj_6fstlib_4cext_9pywrapfst__StateIterator *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_f_6fstlib_4cext_9pywrapfst_8Compiler_compile(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Compiler *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_6fstlib_4cext_9pywrapfst_8Compiler_write(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Compiler *__pyx_v_self, PyObject *__pyx_v_expression, int __pyx_skip_dispatch); /* proto*/
static std::string __pyx_f_6fstlib_4cext_9pywrapfst_9FarReader_arc_type(struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarReader *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static bool __pyx_f_6fstlib_4cext_9pywrapfst_9FarReader_done(struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarReader *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static bool __pyx_f_6fstlib_4cext_9pywrapfst_9FarReader_error(struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarReader *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static std::string __pyx_f_6fstlib_4cext_9pywrapfst_9FarReader_far_type(struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarReader *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static bool __pyx_f_6fstlib_4cext_9pywrapfst_9FarReader_find(struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarReader *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_f_6fstlib_4cext_9pywrapfst_9FarReader_get_fst(struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarReader *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static std::string __pyx_f_6fstlib_4cext_9pywrapfst_9FarReader_get_key(struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarReader *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_6fstlib_4cext_9pywrapfst_9FarReader_next(struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarReader *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_6fstlib_4cext_9pywrapfst_9FarReader_reset(struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarReader *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_6fstlib_4cext_9pywrapfst_9FarWriter_close(struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarWriter *__pyx_v_self); /* proto*/
static void __pyx_f_6fstlib_4cext_9pywrapfst_9FarWriter_add(struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarWriter *__pyx_v_self, PyObject *__pyx_v_key, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst, int __pyx_skip_dispatch); /* proto*/
static std::string __pyx_f_6fstlib_4cext_9pywrapfst_9FarWriter_arc_type(struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarWriter *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static bool __pyx_f_6fstlib_4cext_9pywrapfst_9FarWriter_error(struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarWriter *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static std::string __pyx_f_6fstlib_4cext_9pywrapfst_9FarWriter_far_type(struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarWriter *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/

/* Module declarations from 'libcpp' */

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

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

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

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

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

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

/* Module declarations from 'cintegral_types' */

/* Module declarations from 'cios' */

/* Module declarations from 'cpywrapfst' */

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

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

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

/* Module declarations from 'cmemory' */

/* Module declarations from 'cutility' */

/* Module declarations from 'fstlib.cext.pywrapfst' */
static PyTypeObject *__pyx_ptype_6fstlib_4cext_9pywrapfst_Weight = 0;
static PyTypeObject *__pyx_ptype_6fstlib_4cext_9pywrapfst_SymbolTableView = 0;
static PyTypeObject *__pyx_ptype_6fstlib_4cext_9pywrapfst__EncodeMapperSymbolTableView = 0;
static PyTypeObject *__pyx_ptype_6fstlib_4cext_9pywrapfst__FstSymbolTableView = 0;
static PyTypeObject *__pyx_ptype_6fstlib_4cext_9pywrapfst__MutableSymbolTable = 0;
static PyTypeObject *__pyx_ptype_6fstlib_4cext_9pywrapfst__MutableFstSymbolTableView = 0;
static PyTypeObject *__pyx_ptype_6fstlib_4cext_9pywrapfst_SymbolTable = 0;
static PyTypeObject *__pyx_ptype_6fstlib_4cext_9pywrapfst__SymbolTableIterator = 0;
static PyTypeObject *__pyx_ptype_6fstlib_4cext_9pywrapfst_EncodeMapper = 0;
static PyTypeObject *__pyx_ptype_6fstlib_4cext_9pywrapfst_Fst = 0;
static PyTypeObject *__pyx_ptype_6fstlib_4cext_9pywrapfst_MutableFst = 0;
static PyTypeObject *__pyx_ptype_6fstlib_4cext_9pywrapfst_VectorFst = 0;
static PyTypeObject *__pyx_ptype_6fstlib_4cext_9pywrapfst_Arc = 0;
static PyTypeObject *__pyx_ptype_6fstlib_4cext_9pywrapfst__ArcIterator = 0;
static PyTypeObject *__pyx_ptype_6fstlib_4cext_9pywrapfst__MutableArcIterator = 0;
static PyTypeObject *__pyx_ptype_6fstlib_4cext_9pywrapfst__StateIterator = 0;
static PyTypeObject *__pyx_ptype_6fstlib_4cext_9pywrapfst_Compiler = 0;
static PyTypeObject *__pyx_ptype_6fstlib_4cext_9pywrapfst_FarReader = 0;
static PyTypeObject *__pyx_ptype_6fstlib_4cext_9pywrapfst_FarWriter = 0;
static PyTypeObject *__pyx_ptype_6fstlib_4cext_9pywrapfst___pyx_scope_struct____iter__ = 0;
static std::string __pyx_f_6fstlib_4cext_9pywrapfst_tostring(PyObject *); /*proto*/
static std::string __pyx_f_6fstlib_4cext_9pywrapfst_weight_tostring(PyObject *); /*proto*/
static std::string __pyx_f_6fstlib_4cext_9pywrapfst_path_tostring(PyObject *); /*proto*/
static enum fst::ComposeFilter __pyx_f_6fstlib_4cext_9pywrapfst__get_compose_filter(std::string const &); /*proto*/
static enum fst::QueueType __pyx_f_6fstlib_4cext_9pywrapfst__get_queue_type(std::string const &); /*proto*/
static fst::script::RandArcSelection __pyx_f_6fstlib_4cext_9pywrapfst__get_rand_arc_selection(std::string const &); /*proto*/
static enum fst::ReplaceLabelType __pyx_f_6fstlib_4cext_9pywrapfst__get_replace_label_type(std::string const &, bool); /*proto*/
static fst::script::WeightClass __pyx_f_6fstlib_4cext_9pywrapfst__get_WeightClass_or_one(std::string const &, PyObject *); /*proto*/
static fst::script::WeightClass __pyx_f_6fstlib_4cext_9pywrapfst__get_WeightClass_or_zero(std::string const &, PyObject *); /*proto*/
static struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__pyx_f_6fstlib_4cext_9pywrapfst__zero(PyObject *); /*proto*/
static struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__pyx_f_6fstlib_4cext_9pywrapfst__one(PyObject *); /*proto*/
static struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__pyx_f_6fstlib_4cext_9pywrapfst__no_weight(PyObject *); /*proto*/
static struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__pyx_f_6fstlib_4cext_9pywrapfst__plus(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *); /*proto*/
static struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__pyx_f_6fstlib_4cext_9pywrapfst__times(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *); /*proto*/
static struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__pyx_f_6fstlib_4cext_9pywrapfst__divide(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *); /*proto*/
static struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__pyx_f_6fstlib_4cext_9pywrapfst__power(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *, size_t); /*proto*/
static struct __pyx_obj_6fstlib_4cext_9pywrapfst__EncodeMapperSymbolTableView *__pyx_f_6fstlib_4cext_9pywrapfst__init_EncodeMapperSymbolTableView(std::shared_ptr<fst::script::EncodeMapperClass> , bool); /*proto*/
static struct __pyx_obj_6fstlib_4cext_9pywrapfst__FstSymbolTableView *__pyx_f_6fstlib_4cext_9pywrapfst__init_FstSymbolTableView(std::shared_ptr<fst::script::FstClass> , bool); /*proto*/
static struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableFstSymbolTableView *__pyx_f_6fstlib_4cext_9pywrapfst__init_MutableFstSymbolTableView(std::shared_ptr<fst::script::MutableFstClass> , bool); /*proto*/
static struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTable *__pyx_f_6fstlib_4cext_9pywrapfst__init_SymbolTable(std::unique_ptr<fst::SymbolTable> ); /*proto*/
static struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTable *__pyx_f_6fstlib_4cext_9pywrapfst__read_SymbolTable_from_string(std::string, int __pyx_skip_dispatch); /*proto*/
static struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *__pyx_f_6fstlib_4cext_9pywrapfst__init_EncodeMapper(__pyx_t_6fstlib_4cext_9pywrapfst_EncodeMapperClass_ptr); /*proto*/
static struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *__pyx_f_6fstlib_4cext_9pywrapfst__read_EncodeMapper_from_string(std::string, int __pyx_skip_dispatch); /*proto*/
static struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_f_6fstlib_4cext_9pywrapfst__init_Fst(__pyx_t_6fstlib_4cext_9pywrapfst_FstClass_ptr); /*proto*/
static struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_f_6fstlib_4cext_9pywrapfst__init_MutableFst(__pyx_t_6fstlib_4cext_9pywrapfst_MutableFstClass_ptr); /*proto*/
static struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_f_6fstlib_4cext_9pywrapfst__init_XFst(__pyx_t_6fstlib_4cext_9pywrapfst_FstClass_ptr); /*proto*/
static struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_f_6fstlib_4cext_9pywrapfst__read_Fst(PyObject *, int __pyx_skip_dispatch); /*proto*/
static struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_f_6fstlib_4cext_9pywrapfst__read_Fst_from_string(std::string, int __pyx_skip_dispatch); /*proto*/
static struct __pyx_obj_6fstlib_4cext_9pywrapfst_Arc *__pyx_f_6fstlib_4cext_9pywrapfst__init_Arc(fst::script::ArcClass const &); /*proto*/
static struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_f_6fstlib_4cext_9pywrapfst__map(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst__map *__pyx_optional_args); /*proto*/
static struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_f_6fstlib_4cext_9pywrapfst_arcmap(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *, int __pyx_skip_dispatch, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_arcmap *__pyx_optional_args); /*proto*/
static struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_f_6fstlib_4cext_9pywrapfst_compose(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *, int __pyx_skip_dispatch, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_compose *__pyx_optional_args); /*proto*/
static struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_f_6fstlib_4cext_9pywrapfst_convert(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *, int __pyx_skip_dispatch, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_convert *__pyx_optional_args); /*proto*/
static struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_f_6fstlib_4cext_9pywrapfst_determinize(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *, int __pyx_skip_dispatch, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_determinize *__pyx_optional_args); /*proto*/
static struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_f_6fstlib_4cext_9pywrapfst_difference(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *, int __pyx_skip_dispatch, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_difference *__pyx_optional_args); /*proto*/
static struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_f_6fstlib_4cext_9pywrapfst_disambiguate(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *, int __pyx_skip_dispatch, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_disambiguate *__pyx_optional_args); /*proto*/
static struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_f_6fstlib_4cext_9pywrapfst_epsnormalize(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *, int __pyx_skip_dispatch, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_epsnormalize *__pyx_optional_args); /*proto*/
static bool __pyx_f_6fstlib_4cext_9pywrapfst_equal(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *, int __pyx_skip_dispatch, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_equal *__pyx_optional_args); /*proto*/
static bool __pyx_f_6fstlib_4cext_9pywrapfst_equivalent(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *, int __pyx_skip_dispatch, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_equivalent *__pyx_optional_args); /*proto*/
static struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_f_6fstlib_4cext_9pywrapfst_intersect(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *, int __pyx_skip_dispatch, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_intersect *__pyx_optional_args); /*proto*/
static bool __pyx_f_6fstlib_4cext_9pywrapfst_isomorphic(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *, int __pyx_skip_dispatch, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_isomorphic *__pyx_optional_args); /*proto*/
static struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_f_6fstlib_4cext_9pywrapfst_prune(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *, int __pyx_skip_dispatch, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_prune *__pyx_optional_args); /*proto*/
static struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_f_6fstlib_4cext_9pywrapfst_push(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *, int __pyx_skip_dispatch, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_push *__pyx_optional_args); /*proto*/
static bool __pyx_f_6fstlib_4cext_9pywrapfst_randequivalent(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *, int __pyx_skip_dispatch, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_randequivalent *__pyx_optional_args); /*proto*/
static struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_f_6fstlib_4cext_9pywrapfst_randgen(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *, int __pyx_skip_dispatch, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_randgen *__pyx_optional_args); /*proto*/
static struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_f_6fstlib_4cext_9pywrapfst_replace(PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_replace *__pyx_optional_args); /*proto*/
static struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_f_6fstlib_4cext_9pywrapfst_reverse(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *, int __pyx_skip_dispatch, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_reverse *__pyx_optional_args); /*proto*/
static void __pyx_f_6fstlib_4cext_9pywrapfst__shortestdistance(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *, std::vector<fst::script::WeightClass>  *, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst__shortestdistance *__pyx_optional_args); /*proto*/
static struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_f_6fstlib_4cext_9pywrapfst_shortestpath(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *, int __pyx_skip_dispatch, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_shortestpath *__pyx_optional_args); /*proto*/
static struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_f_6fstlib_4cext_9pywrapfst_statemap(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *, PyObject *, int __pyx_skip_dispatch); /*proto*/
static struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_f_6fstlib_4cext_9pywrapfst_synchronize(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *, int __pyx_skip_dispatch); /*proto*/
static fst::FarType __pyx_f_6fstlib_4cext_9pywrapfst__get_far_type(std::string const &); /*proto*/
static fst::ProjectType __pyx_f_6fstlib_4cext_9pywrapfst__get_project_type(std::string const &); /*proto*/
static struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTable *__pyx_f_6fstlib_4cext_9pywrapfst_compact_symbol_table(struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *, int __pyx_skip_dispatch); /*proto*/
static struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTable *__pyx_f_6fstlib_4cext_9pywrapfst_merge_symbol_table(struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *, struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *, int __pyx_skip_dispatch); /*proto*/
static std::string __pyx_convert_string_from_py_std__in_string(PyObject *); /*proto*/
static CYTHON_INLINE PyObject *__pyx_convert_PyObject_string_to_py_std__in_string(std::string const &); /*proto*/
static CYTHON_INLINE PyObject *__pyx_convert_PyUnicode_string_to_py_std__in_string(std::string const &); /*proto*/
static CYTHON_INLINE PyObject *__pyx_convert_PyStr_string_to_py_std__in_string(std::string const &); /*proto*/
static CYTHON_INLINE PyObject *__pyx_convert_PyBytes_string_to_py_std__in_string(std::string const &); /*proto*/
static CYTHON_INLINE PyObject *__pyx_convert_PyByteArray_string_to_py_std__in_string(std::string const &); /*proto*/
static std::vector<int64>  __pyx_convert_vector_from_py_int64(PyObject *); /*proto*/
static std::vector<std::string>  __pyx_convert_vector_from_py_std_3a__3a_string(PyObject *); /*proto*/
#define __Pyx_MODULE_NAME "fstlib.cext.pywrapfst"
extern int __pyx_module_is_main_fstlib__cext__pywrapfst;
int __pyx_module_is_main_fstlib__cext__pywrapfst = 0;

/* Implementation of 'fstlib.cext.pywrapfst' */
static PyObject *__pyx_builtin_ValueError;
static PyObject *__pyx_builtin_IndexError;
static PyObject *__pyx_builtin_IOError;
static PyObject *__pyx_builtin_RuntimeError;
static PyObject *__pyx_builtin_staticmethod;
static PyObject *__pyx_builtin_TypeError;
static PyObject *__pyx_builtin_id;
static PyObject *__pyx_builtin_NotImplementedError;
static PyObject *__pyx_builtin_StopIteration;
static PyObject *__pyx_builtin_KeyError;
static const char __pyx_k_[] = ": ";
static const char __pyx_k_g[] = "g";
static const char __pyx_k_n[] = "n";
static const char __pyx_k_w[] = "w";
static const char __pyx_k_x[] = "x";
static const char __pyx_k__2[] = "<";
static const char __pyx_k__3[] = ">";
static const char __pyx_k_id[] = "id";
static const char __pyx_k_os[] = "os";
static const char __pyx_k_Arc[] = "Arc";
static const char __pyx_k_Fst[] = "Fst";
static const char __pyx_k__11[] = "";
static const char __pyx_k_add[] = "add";
static const char __pyx_k_arc[] = "arc";
static const char __pyx_k_doc[] = "__doc__";
static const char __pyx_k_dot[] = "dot";
static const char __pyx_k_key[] = "key";
static const char __pyx_k_lhs[] = "lhs";
static const char __pyx_k_one[] = "one";
static const char __pyx_k_rhs[] = "rhs";
static const char __pyx_k_sys[] = "sys";
static const char __pyx_k_Flag[] = "Flag";
static const char __pyx_k_PIPE[] = "PIPE";
static const char __pyx_k_Tsvg[] = "-Tsvg";
static const char __pyx_k_arcs[] = "arcs";
static const char __pyx_k_args[] = "args";
static const char __pyx_k_auto[] = "auto";
static const char __pyx_k_copy[] = "copy";
static const char __pyx_k_done[] = "done";
static const char __pyx_k_draw[] = "draw";
static const char __pyx_k_enum[] = "enum";
static const char __pyx_k_find[] = "find";
static const char __pyx_k_ifst[] = "ifst";
static const char __pyx_k_iter[] = "__iter__";
static const char __pyx_k_main[] = "__main__";
static const char __pyx_k_mask[] = "mask";
static const char __pyx_k_name[] = "__name__";
static const char __pyx_k_next[] = "next";
static const char __pyx_k_open[] = "open";
static const char __pyx_k_plus[] = "plus";
static const char __pyx_k_read[] = "read";
static const char __pyx_k_seed[] = "seed";
static const char __pyx_k_seek[] = "seek";
static const char __pyx_k_send[] = "send";
static const char __pyx_k_test[] = "test";
static const char __pyx_k_type[] = "type";
static const char __pyx_k_zero[] = "zero";
static const char __pyx_k_ERROR[] = "ERROR";
static const char __pyx_k_Popen[] = "Popen";
static const char __pyx_k_at_0x[] = " at 0x";
static const char __pyx_k_class[] = "__class__";
static const char __pyx_k_close[] = "close";
static const char __pyx_k_delta[] = "delta";
static const char __pyx_k_error[] = "error";
static const char __pyx_k_final[] = "final";
static const char __pyx_k_flags[] = "flags";
static const char __pyx_k_ifst1[] = "ifst1";
static const char __pyx_k_ifst2[] = "ifst2";
static const char __pyx_k_input[] = "input";
static const char __pyx_k_items[] = "items";
static const char __pyx_k_npath[] = "npath";
static const char __pyx_k_pairs[] = "pairs";
static const char __pyx_k_power[] = "power";
static const char __pyx_k_print[] = "print";
static const char __pyx_k_props[] = "props";
static const char __pyx_k_reset[] = "reset";
static const char __pyx_k_start[] = "start";
static const char __pyx_k_state[] = "state";
static const char __pyx_k_stdin[] = "stdin";
static const char __pyx_k_throw[] = "throw";
static const char __pyx_k_times[] = "times";
static const char __pyx_k_title[] = "title";
static const char __pyx_k_value[] = "value";
static const char __pyx_k_width[] = "width";
static const char __pyx_k_write[] = "write";
static const char __pyx_k_CYCLIC[] = "CYCLIC";
static const char __pyx_k_Number[] = "Number";
static const char __pyx_k_STRING[] = "STRING";
static const char __pyx_k_Weight[] = " Weight ";
static const char __pyx_k_create[] = "create";
static const char __pyx_k_divide[] = "divide";
static const char __pyx_k_failed[] = " failed";
static const char __pyx_k_fspath[] = "fspath";
static const char __pyx_k_height[] = "height";
static const char __pyx_k_ilabel[] = "ilabel";
static const char __pyx_k_import[] = "__import__";
static const char __pyx_k_ipairs[] = "ipairs";
static const char __pyx_k_member[] = "member";
static const char __pyx_k_module[] = "__module__";
static const char __pyx_k_name_2[] = "name";
static const char __pyx_k_nstate[] = "nstate";
static const char __pyx_k_olabel[] = "olabel";
static const char __pyx_k_opairs[] = "opairs";
static const char __pyx_k_reduce[] = "__reduce__";
static const char __pyx_k_select[] = "select";
static const char __pyx_k_source[] = "source";
static const char __pyx_k_states[] = "states";
static const char __pyx_k_stdout[] = "stdout";
static const char __pyx_k_symbol[] = "symbol";
static const char __pyx_k_test_2[] = "__test__";
static const char __pyx_k_typing[] = "typing";
static const char __pyx_k_unique[] = "unique";
static const char __pyx_k_vector[] = "vector";
static const char __pyx_k_verify[] = "verify";
static const char __pyx_k_weight[] = "weight";
static const char __pyx_k_ACYCLIC[] = "ACYCLIC";
static const char __pyx_k_FarType[] = "FarType";
static const char __pyx_k_IOError[] = "IOError";
static const char __pyx_k_MUTABLE[] = "MUTABLE";
static const char __pyx_k_class_2[] = "_class__";
static const char __pyx_k_compile[] = "compile";
static const char __pyx_k_connect[] = "connect";
static const char __pyx_k_default[] = "default";
static const char __pyx_k_get_fst[] = "get_fst";
static const char __pyx_k_get_key[] = "get_key";
static const char __pyx_k_logging[] = "logging";
static const char __pyx_k_members[] = "__members__";
static const char __pyx_k_neither[] = "neither";
static const char __pyx_k_nodesep[] = "nodesep";
static const char __pyx_k_numbers[] = "numbers";
static const char __pyx_k_prepare[] = "__prepare__";
static const char __pyx_k_ranksep[] = "ranksep";
static const char __pyx_k_reverse[] = "reverse";
static const char __pyx_k_symbols[] = "symbols";
static const char __pyx_k_uniform[] = "uniform";
static const char __pyx_k_warning[] = "warning";
static const char __pyx_k_ACCEPTOR[] = "ACCEPTOR";
static const char __pyx_k_Compiler[] = "Compiler";
static const char __pyx_k_EPSILONS[] = "EPSILONS";
static const char __pyx_k_EXPANDED[] = "EXPANDED";
static const char __pyx_k_Expected[] = "Expected ";
static const char __pyx_k_FstError[] = "FstError";
static const char __pyx_k_KeyError[] = "KeyError";
static const char __pyx_k_NO_LABEL[] = "NO_LABEL";
static const char __pyx_k_SortType[] = "SortType";
static const char __pyx_k_WEIGHTED[] = "WEIGHTED";
static const char __pyx_k_Weight_2[] = "Weight";
static const char __pyx_k_acceptor[] = "acceptor";
static const char __pyx_k_arc_type[] = "arc_type";
static const char __pyx_k_checksum[] = "checksum";
static const char __pyx_k_det_type[] = "det_type";
static const char __pyx_k_distance[] = "_distance";
static const char __pyx_k_far_type[] = "far_type";
static const char __pyx_k_fontsize[] = "fontsize";
static const char __pyx_k_fst_type[] = "fst_type";
static const char __pyx_k_getstate[] = "__getstate__";
static const char __pyx_k_identity[] = "identity";
static const char __pyx_k_isymbols[] = "isymbols";
static const char __pyx_k_map_type[] = "map_type";
static const char __pyx_k_num_arcs[] = "num_arcs";
static const char __pyx_k_osymbols[] = "osymbols";
static const char __pyx_k_portrait[] = "portrait";
static const char __pyx_k_position[] = "position";
static const char __pyx_k_qualname[] = "__qualname__";
static const char __pyx_k_read_fst[] = "read_fst";
static const char __pyx_k_set_name[] = "set_name";
static const char __pyx_k_setstate[] = "__setstate__";
static const char __pyx_k_ssymbols[] = "ssymbols";
static const char __pyx_k_standard[] = "standard";
static const char __pyx_k_to_final[] = "to_final";
static const char __pyx_k_tropical[] = "tropical";
static const char __pyx_k_vertical[] = "vertical";
static const char __pyx_k_weight_2[] = "_weight";
static const char __pyx_k_weighted[] = "weighted";
static const char __pyx_k_ARC_FLAGS[] = "ARC_FLAGS";
static const char __pyx_k_Arc_at_0x[] = "<Arc at 0x";
static const char __pyx_k_FarReader[] = "FarReader";
static const char __pyx_k_FarWriter[] = "FarWriter";
static const char __pyx_k_Fst_at_0x[] = " Fst at 0x";
static const char __pyx_k_NO_SYMBOL[] = "NO_SYMBOL";
static const char __pyx_k_QueueType[] = "QueueType";
static const char __pyx_k_TypeError[] = "TypeError";
static const char __pyx_k_VectorFst[] = "VectorFst";
static const char __pyx_k_add_state[] = "add_state";
static const char __pyx_k_add_table[] = "add_table";
static const char __pyx_k_metaclass[] = "__metaclass__";
static const char __pyx_k_nextstate[] = "nextstate";
static const char __pyx_k_no_weight[] = "no_weight";
static const char __pyx_k_nshortest[] = "nshortest";
static const char __pyx_k_precision[] = "precision";
static const char __pyx_k_pywrapfst[] = "<pywrapfst>";
static const char __pyx_k_read_text[] = "read_text";
static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
static const char __pyx_k_set_flags[] = "set_flags";
static const char __pyx_k_set_value[] = "set_value";
static const char __pyx_k_sort_type[] = "sort_type";
static const char __pyx_k_to_string[] = "to_string";
static const char __pyx_k_ACCESSIBLE[] = "ACCESSIBLE";
static const char __pyx_k_ArcMapType[] = "ArcMapType";
static const char __pyx_k_FstIOError[] = "FstIOError";
static const char __pyx_k_FstOpError[] = "FstOpError";
static const char __pyx_k_I_EPSILONS[] = "I_EPSILONS";
static const char __pyx_k_IndexError[] = "IndexError";
static const char __pyx_k_MutableFst[] = "MutableFst";
static const char __pyx_k_NOT_STRING[] = "NOT_STRING";
static const char __pyx_k_O_EPSILONS[] = "O_EPSILONS";
static const char __pyx_k_TOP_SORTED[] = "TOP_SORTED";
static const char __pyx_k_UNWEIGHTED[] = "UNWEIGHTED";
static const char __pyx_k_ValueError[] = "ValueError";
static const char __pyx_k_WeightLike[] = "WeightLike";
static const char __pyx_k_add_states[] = "add_states";
static const char __pyx_k_add_symbol[] = "add_symbol";
static const char __pyx_k_functional[] = "functional";
static const char __pyx_k_max_length[] = "max_length";
static const char __pyx_k_num_states[] = "num_states";
static const char __pyx_k_potentials[] = "potentials";
static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
static const char __pyx_k_queue_type[] = "queue_type";
static const char __pyx_k_subprocess[] = "subprocess";
static const char __pyx_k_write_text[] = "write_text";
static const char __pyx_k_ArcIterator[] = "_ArcIterator";
static const char __pyx_k_FstArgError[] = "FstArgError";
static const char __pyx_k_NO_EPSILONS[] = "NO_EPSILONS";
static const char __pyx_k_NO_STATE_ID[] = "NO_STATE_ID";
static const char __pyx_k_Open_failed[] = "Open failed: ";
static const char __pyx_k_ProjectType[] = "ProjectType";
static const char __pyx_k_Read_failed[] = "Read failed: ";
static const char __pyx_k_SymbolTable[] = "<SymbolTable ";
static const char __pyx_k_communicate[] = "communicate";
static const char __pyx_k_get_nth_key[] = "get_nth_key";
static const char __pyx_k_input_table[] = "input_table";
static const char __pyx_k_missing_sym[] = "missing_sym";
static const char __pyx_k_num_symbols[] = "num_symbols";
static const char __pyx_k_push_labels[] = "push_labels";
static const char __pyx_k_unspecified[] = "<unspecified>";
static const char __pyx_k_weight_type[] = "weight_type";
static const char __pyx_k_ARC_NO_CACHE[] = "ARC_NO_CACHE";
static const char __pyx_k_COACCESSIBLE[] = "COACCESSIBLE";
static const char __pyx_k_ENCODE_FLAGS[] = "ENCODE_FLAGS";
static const char __pyx_k_EncodeMapper[] = "EncodeMapper";
static const char __pyx_k_NOT_ACCEPTOR[] = "NOT_ACCEPTOR";
static const char __pyx_k_RuntimeError[] = "RuntimeError";
static const char __pyx_k_StateMapType[] = "StateMapType";
static const char __pyx_k_Write_failed[] = "Write failed: ";
static const char __pyx_k_allow_nondet[] = "allow_nondet";
static const char __pyx_k_but_received[] = " but received ";
static const char __pyx_k_closure_plus[] = "closure_plus";
static const char __pyx_k_float_format[] = "float_format";
static const char __pyx_k_mutable_arcs[] = "mutable_arcs";
static const char __pyx_k_new_isymbols[] = "new_isymbols";
static const char __pyx_k_new_osymbols[] = "new_osymbols";
static const char __pyx_k_old_isymbols[] = "old_isymbols";
static const char __pyx_k_old_osymbols[] = "old_osymbols";
static const char __pyx_k_push_weights[] = "push_weights";
static const char __pyx_k_return_label[] = "return_label";
static const char __pyx_k_staticmethod[] = "staticmethod";
static const char __pyx_k_ComposeFilter[] = "ComposeFilter";
static const char __pyx_k_Conversion_to[] = "Conversion to ";
static const char __pyx_k_ENCODE_LABELS[] = "ENCODE_LABELS";
static const char __pyx_k_FstIndexError[] = "FstIndexError";
static const char __pyx_k_FstProperties[] = "FstProperties";
static const char __pyx_k_NO_I_EPSILONS[] = "NO_I_EPSILONS";
static const char __pyx_k_NO_O_EPSILONS[] = "NO_O_EPSILONS";
static const char __pyx_k_StateIterator[] = "_StateIterator";
static const char __pyx_k_StopIteration[] = "StopIteration";
static const char __pyx_k_SymbolTable_2[] = "SymbolTable";
static const char __pyx_k_available_key[] = "available_key";
static const char __pyx_k_encode_labels[] = "encode_labels";
static const char __pyx_k_input_symbols[] = "input_symbols";
static const char __pyx_k_keep_isymbols[] = "keep_isymbols";
static const char __pyx_k_keep_osymbols[] = "keep_osymbols";
static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
static const char __pyx_k_ENCODE_WEIGHTS[] = "ENCODE_WEIGHTS";
static const char __pyx_k_FST_PROPERTIES[] = "FST_PROPERTIES";
static const char __pyx_k_INITIAL_CYCLIC[] = "INITIAL_CYCLIC";
static const char __pyx_k_I_LABEL_SORTED[] = "I_LABEL_SORTED";
static const char __pyx_k_Invalid_weight[] = "Invalid weight";
static const char __pyx_k_NOT_ACCESSIBLE[] = "NOT_ACCESSIBLE";
static const char __pyx_k_NOT_TOP_SORTED[] = "NOT_TOP_SORTED";
static const char __pyx_k_O_LABEL_SORTED[] = "O_LABEL_SORTED";
static const char __pyx_k_compose_filter[] = "compose_filter";
static const char __pyx_k_encode_weights[] = "encode_weights";
static const char __pyx_k_output_symbols[] = "output_symbols";
static const char __pyx_k_ARC_VALUE_FLAGS[] = "ARC_VALUE_FLAGS";
static const char __pyx_k_COPY_PROPERTIES[] = "COPY_PROPERTIES";
static const char __pyx_k_DeterminizeType[] = "DeterminizeType";
static const char __pyx_k_DrawFloatFormat[] = "DrawFloatFormat";
static const char __pyx_k_FarReader_at_0x[] = " FarReader at 0x";
static const char __pyx_k_FarWriter_at_0x[] = " FarWriter at 0x";
static const char __pyx_k_INITIAL_ACYCLIC[] = "INITIAL_ACYCLIC";
static const char __pyx_k_I_DETERMINISTIC[] = "I_DETERMINISTIC";
static const char __pyx_k_NULL_PROPERTIES[] = "NULL_PROPERTIES";
static const char __pyx_k_O_DETERMINISTIC[] = "O_DETERMINISTIC";
static const char __pyx_k_SymbolTableView[] = "SymbolTableView";
static const char __pyx_k_WEIGHTED_CYCLES[] = "WEIGHTED_CYCLES";
static const char __pyx_k_eps_norm_output[] = "eps_norm_output";
static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
static const char __pyx_k_show_weight_one[] = "show_weight_one";
static const char __pyx_k_unknown_isymbol[] = "unknown_isymbol";
static const char __pyx_k_unknown_osymbol[] = "unknown_osymbol";
static const char __pyx_k_write_to_string[] = "write_to_string";
static const char __pyx_k_ARC_WEIGHT_VALUE[] = "ARC_WEIGHT_VALUE";
static const char __pyx_k_Cannot_construct[] = "Cannot construct ";
static const char __pyx_k_NOT_COACCESSIBLE[] = "NOT_COACCESSIBLE";
static const char __pyx_k_Operation_failed[] = "Operation failed";
static const char __pyx_k_RandArcSelection[] = "RandArcSelection";
static const char __pyx_k_ReplaceLabelType[] = "ReplaceLabelType";
static const char __pyx_k_Unknown_FAR_type[] = "Unknown FAR type: ";
static const char __pyx_k_Unknown_arc_type[] = "Unknown arc type: ";
static const char __pyx_k_Unknown_map_type[] = "Unknown map type: ";
static const char __pyx_k_labeled_checksum[] = "labeled_checksum";
static const char __pyx_k_read_from_string[] = "read_from_string";
static const char __pyx_k_shortestdistance[] = "shortestdistance";
static const char __pyx_k_ARC_I_LABEL_VALUE[] = "ARC_I_LABEL_VALUE";
static const char __pyx_k_ARC_O_LABEL_VALUE[] = "ARC_O_LABEL_VALUE";
static const char __pyx_k_ArcIterator_at_0x[] = "<_ArcIterator at 0x";
static const char __pyx_k_BINARY_PROPERTIES[] = "BINARY_PROPERTIES";
static const char __pyx_k_FstBadWeightError[] = "FstBadWeightError";
static const char __pyx_k_UNWEIGHTED_CYCLES[] = "UNWEIGHTED_CYCLES";
static const char __pyx_k_Unknown_sort_type[] = "Unknown sort type: ";
static const char __pyx_k_call_arc_labeling[] = "call_arc_labeling";
static const char __pyx_k_ADD_ARC_PROPERTIES[] = "ADD_ARC_PROPERTIES";
static const char __pyx_k_Compilation_failed[] = "Compilation failed";
static const char __pyx_k_EncodeMapper_at_0x[] = "<EncodeMapper at 0x";
static const char __pyx_k_FstSymbolTableView[] = "_FstSymbolTableView";
static const char __pyx_k_MutableArcIterator[] = "_MutableArcIterator";
static const char __pyx_k_MutableSymbolTable[] = "_MutableSymbolTable";
static const char __pyx_k_NOT_I_LABEL_SORTED[] = "NOT_I_LABEL_SORTED";
static const char __pyx_k_NOT_O_LABEL_SORTED[] = "NOT_O_LABEL_SORTED";
static const char __pyx_k_SET_ARC_PROPERTIES[] = "SET_ARC_PROPERTIES";
static const char __pyx_k_TRINARY_PROPERTIES[] = "TRINARY_PROPERTIES";
static const char __pyx_k_Unknown_queue_type[] = "Unknown queue type: ";
static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
static const char __pyx_k_epsilon_on_replace[] = "epsilon_on_replace";
static const char __pyx_k_num_input_epsilons[] = "num_input_epsilons";
static const char __pyx_k_ARC_SORT_PROPERTIES[] = "ARC_SORT_PROPERTIES";
static const char __pyx_k_Fst_SymbolTableView[] = "<Fst SymbolTableView ";
static const char __pyx_k_NON_I_DETERMINISTIC[] = "NON_I_DETERMINISTIC";
static const char __pyx_k_NON_O_DETERMINISTIC[] = "NON_O_DETERMINISTIC";
static const char __pyx_k_NotImplementedError[] = "NotImplementedError";
static const char __pyx_k_StateIterator_at_0x[] = "<_StateIterator at 0x";
static const char __pyx_k_SymbolTableIterator[] = "_SymbolTableIterator";
static const char __pyx_k_attach_new_isymbols[] = "attach_new_isymbols";
static const char __pyx_k_attach_new_osymbols[] = "attach_new_osymbols";
static const char __pyx_k_num_output_epsilons[] = "num_output_epsilons";
static const char __pyx_k_remove_common_affix[] = "remove_common_affix";
static const char __pyx_k_remove_total_weight[] = "remove_total_weight";
static const char __pyx_k_return_arc_labeling[] = "return_arc_labeling";
static const char __pyx_k_subsequential_label[] = "subsequential_label";
static const char __pyx_k_ADD_STATE_PROPERTIES[] = "ADD_STATE_PROPERTIES";
static const char __pyx_k_ARC_NEXT_STATE_VALUE[] = "ARC_NEXT_STATE_VALUE";
static const char __pyx_k_EXTRINSIC_PROPERTIES[] = "EXTRINSIC_PROPERTIES";
static const char __pyx_k_INTRINSIC_PROPERTIES[] = "INTRINSIC_PROPERTIES";
static const char __pyx_k_Read_from_FST_failed[] = "Read from FST failed: ";
static const char __pyx_k_SET_FINAL_PROPERTIES[] = "SET_FINAL_PROPERTIES";
static const char __pyx_k_SET_START_PROPERTIES[] = "SET_START_PROPERTIES";
static const char __pyx_k_keep_state_numbering[] = "keep_state_numbering";
static const char __pyx_k_read_Fst_from_string[] = "_read_Fst_from_string";
static const char __pyx_k_require_superinitial[] = "require_superinitial";
static const char __pyx_k_typing_Literal_e_f_g[] = "typing.Literal[\"e\", \"f\", \"g\"]";
static const char __pyx_k_DELETE_ARC_PROPERTIES[] = "DELETE_ARC_PROPERTIES";
static const char __pyx_k_STATE_SORT_PROPERTIES[] = "STATE_SORT_PROPERTIES";
static const char __pyx_k_Weight_type_not_found[] = "Weight type not found";
static const char __pyx_k_allow_negative_labels[] = "allow_negative_labels";
static const char __pyx_k_fstlib_cext_pywrapfst[] = "fstlib.cext.pywrapfst";
static const char __pyx_k_Dot_rendering_failed_s[] = "Dot rendering failed: %s";
static const char __pyx_k_NEG_TRINARY_PROPERTIES[] = "NEG_TRINARY_PROPERTIES";
static const char __pyx_k_POS_TRINARY_PROPERTIES[] = "POS_TRINARY_PROPERTIES";
static const char __pyx_k_Write_to_string_failed[] = "Write to string failed";
static const char __pyx_k_DELETE_STATE_PROPERTIES[] = "DELETE_STATE_PROPERTIES";
static const char __pyx_k_Read_from_string_failed[] = "Read from string failed";
static const char __pyx_k_Unknown_projection_type[] = "Unknown projection type: ";
static const char __pyx_k_MutableArcIterator_at_0x[] = "<_MutableArcIterator at 0x";
static const char __pyx_k_RM_SUPERFINAL_PROPERTIES[] = "RM_SUPERFINAL_PROPERTIES";
static const char __pyx_k_State_index_out_of_range[] = "State index out of range";
static const char __pyx_k_ADD_SUPERFINAL_PROPERTIES[] = "ADD_SUPERFINAL_PROPERTIES";
static const char __pyx_k_Cannot_topsort_cyclic_FST[] = "Cannot topsort cyclic FST";
static const char __pyx_k_MutableArcIterator___iter[] = "_MutableArcIterator.__iter__";
static const char __pyx_k_MutableFstSymbolTableView[] = "_MutableFstSymbolTableView";
static const char __pyx_k_SymbolTableIterator_at_0x[] = "<_SymbolTableIterator at 0x";
static const char __pyx_k_const_Fst_SymbolTableView[] = "<const Fst SymbolTableView ";
static const char __pyx_k_fstlib_cext_pywrapfst_pyx[] = "fstlib/cext/pywrapfst.pyx";
static const char __pyx_k_Unknown_replace_label_type[] = "Unknown replace label type: ";
static const char __pyx_k_EncodeMapperSymbolTableView[] = "_EncodeMapperSymbolTableView";
static const char __pyx_k_Unknown_compose_filter_type[] = "Unknown compose filter type: ";
static const char __pyx_k_WEIGHT_INVARIANT_PROPERTIES[] = "WEIGHT_INVARIANT_PROPERTIES";
static const char __pyx_k_typing_Literal_input_output[] = "typing.Literal[\"input\", \"output\"]";
static const char __pyx_k_I_LABEL_INVARIANT_PROPERTIES[] = "I_LABEL_INVARIANT_PROPERTIES";
static const char __pyx_k_O_LABEL_INVARIANT_PROPERTIES[] = "O_LABEL_INVARIANT_PROPERTIES";
static const char __pyx_k_SymbolTable_no_longer_exists[] = "SymbolTable no longer exists";
static const char __pyx_k_Unknown_determinization_type[] = "Unknown determinization type: ";
static const char __pyx_k_read_SymbolTable_from_string[] = "_read_SymbolTable_from_string";
static const char __pyx_k_typing_Literal_ilabel_olabel[] = "typing.Literal[\"ilabel\", \"olabel\"]";
static const char __pyx_k_No_new_SymbolTables_specified[] = "No new SymbolTables specified";
static const char __pyx_k_No_relabeling_pairs_specified[] = "No relabeling pairs specified";
static const char __pyx_k_increment_subsequential_label[] = "increment_subsequential_label";
static const char __pyx_k_read_EncodeMapper_from_string[] = "_read_EncodeMapper_from_string";
static const char __pyx_k_Incompatible_or_invalid_weight[] = "Incompatible or invalid weight";
static const char __pyx_k_const_EncodeMapper_SymbolTableV[] = "<const EncodeMapper SymbolTableView ";
static const char __pyx_k_self__aiter_self__fst_cannot_be[] = "self._aiter,self._fst cannot be converted to a Python object for pickling";
static const char __pyx_k_self__fst_self__siter_cannot_be[] = "self._fst,self._siter cannot be converted to a Python object for pickling";
static const char __pyx_k_self__siter_cannot_be_converted[] = "self._siter cannot be converted to a Python object for pickling";
static const char __pyx_k_typing_Literal_uniform_log_prob[] = "typing.Literal[\"uniform\", \"log_prob\", \"fast_log_prob\"]";
static const char __pyx_k_Incompatible_or_invalid_arc_type[] = "Incompatible or invalid arc type";
static const char __pyx_k_Incompatible_or_invalid_weight_t[] = "Incompatible or invalid weight type";
static const char __pyx_k_Python_interface_to_the_FST_scri[] = "Python interface to the FST scripting API.\n\nOperations which construct new FSTs are implemented as traditional functions, as\nare two-argument boolean functions like `equal` and `equivalent`. Destructive\noperations---those that mutate an FST, in place---are instance methods, as is\n`write`. Operator overloading is not used. The following example, based on\nMohri et al. 2002, shows the construction of an ASR system given a pronunciation\nlexicon L, grammar G, a transducer from context-dependent phones to\ncontext-independent phones C, and an HMM set H:\n\n  L = fst.Fst.read(\"L.fst\")\n  G = fst.Fst.read(\"G.fst\")\n  C = fst.Fst.read(\"C.fst\")\n  H = fst.Fst.read(\"H.fst\")\n  LG = fst.determinize(fst.compose(L, G))\n  CLG = fst.determinize(fst.compose(C, LG))\n  HCLG = fst.determinize(fst.compose(H, CLG))\n  HCLG.minimize()                                      # NB: works in-place.\n\nPython variables here use snake_case and constants are in all caps, minus the\nnormal `k` prefix.\n";
static const char __pyx_k_Unknown_random_arc_selection_typ[] = "Unknown random arc selection type: ";
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__aiter_self__mfst_cannot_be[] = "self._aiter,self._mfst cannot be converted to a Python object for pickling";
static const char __pyx_k_self__arc_cannot_be_converted_to[] = "self._arc cannot be converted to a Python object for pickling";
static const char __pyx_k_self__reader_cannot_be_converted[] = "self._reader cannot be converted to a Python object for pickling";
static const char __pyx_k_self__weight_cannot_be_converted[] = "self._weight cannot be converted to a Python object for pickling";
static const char __pyx_k_self__writer_cannot_be_converted[] = "self._writer cannot be converted to a Python object for pickling";
static const char __pyx_k_typing_Literal_alt_sequence_auto[] = "typing.Literal[\"alt_sequence\", \"auto\", \"match\", \"no_match\",\n                           \"null\", \"sequence\", \"trivial\"]";
static const char __pyx_k_typing_Literal_arc_sum_arc_uniqu[] = "typing.Literal[\"arc_sum\", \"arc_unique\", \"identity\"]";
static const char __pyx_k_typing_Literal_auto_fifo_lifo_sh[] = "typing.Literal[\"auto\", \"fifo\", \"lifo\", \"shortest\", \"state\",\n                              \"top\"]";
static const char __pyx_k_typing_Literal_fst_stlist_sttabl[] = "typing.Literal[\n  \"fst\",\n  \"stlist\",\n  \"sttable\",\n  \"default\"\n]";
static const char __pyx_k_typing_Literal_functional_nonfun[] = "typing.Literal[\"functional\", \"nonfunctional\",\n                                    \"disambiguate\"]";
static const char __pyx_k_typing_Literal_identity_input_ep[] = "typing.Literal[\"identity\", \"input_epsilon\", \"invert\",\n                               \"output_epsilon\", \"plus\", \"power\", \"quantize\",\n                               \"rmweight\", \"superfinal\", \"times\", \"to_log\",\n                               # NOTE: Both spellings of \"to_std\"\n                               \"to_log64\", \"to_std\", \"to_standard\"]";
static const char __pyx_k_typing_Literal_neither_input_out[] = "typing.Literal[\"neither\", \"input\", \"output\", \"both\"]";
static const char __pyx_k_typing_Union_Weight_typing_Union[] = "typing.Union[Weight, typing.Union[str, int, float]]";
static PyObject *__pyx_kp_u_;
static PyObject *__pyx_n_s_ACCEPTOR;
static PyObject *__pyx_n_s_ACCESSIBLE;
static PyObject *__pyx_n_s_ACYCLIC;
static PyObject *__pyx_n_s_ADD_ARC_PROPERTIES;
static PyObject *__pyx_n_s_ADD_STATE_PROPERTIES;
static PyObject *__pyx_n_s_ADD_SUPERFINAL_PROPERTIES;
static PyObject *__pyx_n_s_ARC_FLAGS;
static PyObject *__pyx_n_s_ARC_I_LABEL_VALUE;
static PyObject *__pyx_n_s_ARC_NEXT_STATE_VALUE;
static PyObject *__pyx_n_s_ARC_NO_CACHE;
static PyObject *__pyx_n_s_ARC_O_LABEL_VALUE;
static PyObject *__pyx_n_s_ARC_SORT_PROPERTIES;
static PyObject *__pyx_n_s_ARC_VALUE_FLAGS;
static PyObject *__pyx_n_s_ARC_WEIGHT_VALUE;
static PyObject *__pyx_n_s_Arc;
static PyObject *__pyx_n_s_ArcIterator;
static PyObject *__pyx_kp_u_ArcIterator_at_0x;
static PyObject *__pyx_n_s_ArcMapType;
static PyObject *__pyx_kp_u_Arc_at_0x;
static PyObject *__pyx_n_s_BINARY_PROPERTIES;
static PyObject *__pyx_n_s_COACCESSIBLE;
static PyObject *__pyx_n_s_COPY_PROPERTIES;
static PyObject *__pyx_n_s_CYCLIC;
static PyObject *__pyx_kp_u_Cannot_construct;
static PyObject *__pyx_kp_u_Cannot_topsort_cyclic_FST;
static PyObject *__pyx_kp_u_Compilation_failed;
static PyObject *__pyx_n_s_Compiler;
static PyObject *__pyx_n_s_ComposeFilter;
static PyObject *__pyx_kp_u_Conversion_to;
static PyObject *__pyx_n_s_DELETE_ARC_PROPERTIES;
static PyObject *__pyx_n_s_DELETE_STATE_PROPERTIES;
static PyObject *__pyx_n_s_DeterminizeType;
static PyObject *__pyx_kp_u_Dot_rendering_failed_s;
static PyObject *__pyx_n_s_DrawFloatFormat;
static PyObject *__pyx_n_s_ENCODE_FLAGS;
static PyObject *__pyx_n_s_ENCODE_LABELS;
static PyObject *__pyx_n_s_ENCODE_WEIGHTS;
static PyObject *__pyx_n_s_EPSILONS;
static PyObject *__pyx_n_s_ERROR;
static PyObject *__pyx_n_s_EXPANDED;
static PyObject *__pyx_n_s_EXTRINSIC_PROPERTIES;
static PyObject *__pyx_n_s_EncodeMapper;
static PyObject *__pyx_n_s_EncodeMapperSymbolTableView;
static PyObject *__pyx_kp_u_EncodeMapper_at_0x;
static PyObject *__pyx_kp_u_Expected;
static PyObject *__pyx_n_s_FST_PROPERTIES;
static PyObject *__pyx_n_s_FarReader;
static PyObject *__pyx_kp_u_FarReader_at_0x;
static PyObject *__pyx_n_s_FarType;
static PyObject *__pyx_n_s_FarWriter;
static PyObject *__pyx_kp_u_FarWriter_at_0x;
static PyObject *__pyx_n_s_Flag;
static PyObject *__pyx_n_s_Fst;
static PyObject *__pyx_n_s_FstArgError;
static PyObject *__pyx_n_s_FstBadWeightError;
static PyObject *__pyx_n_s_FstError;
static PyObject *__pyx_n_s_FstIOError;
static PyObject *__pyx_n_s_FstIndexError;
static PyObject *__pyx_n_s_FstOpError;
static PyObject *__pyx_n_s_FstProperties;
static PyObject *__pyx_n_s_FstSymbolTableView;
static PyObject *__pyx_kp_u_Fst_SymbolTableView;
static PyObject *__pyx_kp_u_Fst_at_0x;
static PyObject *__pyx_n_s_INITIAL_ACYCLIC;
static PyObject *__pyx_n_s_INITIAL_CYCLIC;
static PyObject *__pyx_n_s_INTRINSIC_PROPERTIES;
static PyObject *__pyx_n_s_IOError;
static PyObject *__pyx_n_s_I_DETERMINISTIC;
static PyObject *__pyx_n_s_I_EPSILONS;
static PyObject *__pyx_n_s_I_LABEL_INVARIANT_PROPERTIES;
static PyObject *__pyx_n_s_I_LABEL_SORTED;
static PyObject *__pyx_kp_u_Incompatible_or_invalid_arc_type;
static PyObject *__pyx_kp_u_Incompatible_or_invalid_weight;
static PyObject *__pyx_kp_u_Incompatible_or_invalid_weight_t;
static PyObject *__pyx_n_s_IndexError;
static PyObject *__pyx_kp_u_Invalid_weight;
static PyObject *__pyx_n_s_KeyError;
static PyObject *__pyx_n_s_MUTABLE;
static PyObject *__pyx_n_s_MutableArcIterator;
static PyObject *__pyx_n_s_MutableArcIterator___iter;
static PyObject *__pyx_kp_u_MutableArcIterator_at_0x;
static PyObject *__pyx_n_s_MutableFst;
static PyObject *__pyx_n_s_MutableFstSymbolTableView;
static PyObject *__pyx_n_s_MutableSymbolTable;
static PyObject *__pyx_n_s_NEG_TRINARY_PROPERTIES;
static PyObject *__pyx_n_s_NON_I_DETERMINISTIC;
static PyObject *__pyx_n_s_NON_O_DETERMINISTIC;
static PyObject *__pyx_n_s_NOT_ACCEPTOR;
static PyObject *__pyx_n_s_NOT_ACCESSIBLE;
static PyObject *__pyx_n_s_NOT_COACCESSIBLE;
static PyObject *__pyx_n_s_NOT_I_LABEL_SORTED;
static PyObject *__pyx_n_s_NOT_O_LABEL_SORTED;
static PyObject *__pyx_n_s_NOT_STRING;
static PyObject *__pyx_n_s_NOT_TOP_SORTED;
static PyObject *__pyx_n_s_NO_EPSILONS;
static PyObject *__pyx_n_s_NO_I_EPSILONS;
static PyObject *__pyx_n_s_NO_LABEL;
static PyObject *__pyx_n_s_NO_O_EPSILONS;
static PyObject *__pyx_n_s_NO_STATE_ID;
static PyObject *__pyx_n_s_NO_SYMBOL;
static PyObject *__pyx_n_s_NULL_PROPERTIES;
static PyObject *__pyx_kp_u_No_new_SymbolTables_specified;
static PyObject *__pyx_kp_u_No_relabeling_pairs_specified;
static PyObject *__pyx_n_s_NotImplementedError;
static PyObject *__pyx_n_s_Number;
static PyObject *__pyx_n_s_O_DETERMINISTIC;
static PyObject *__pyx_n_s_O_EPSILONS;
static PyObject *__pyx_n_s_O_LABEL_INVARIANT_PROPERTIES;
static PyObject *__pyx_n_s_O_LABEL_SORTED;
static PyObject *__pyx_kp_u_Open_failed;
static PyObject *__pyx_kp_u_Operation_failed;
static PyObject *__pyx_n_s_PIPE;
static PyObject *__pyx_n_s_POS_TRINARY_PROPERTIES;
static PyObject *__pyx_n_s_Popen;
static PyObject *__pyx_n_s_ProjectType;
static PyObject *__pyx_n_s_QueueType;
static PyObject *__pyx_n_s_RM_SUPERFINAL_PROPERTIES;
static PyObject *__pyx_n_s_RandArcSelection;
static PyObject *__pyx_kp_u_Read_failed;
static PyObject *__pyx_kp_u_Read_from_FST_failed;
static PyObject *__pyx_kp_u_Read_from_string_failed;
static PyObject *__pyx_n_s_ReplaceLabelType;
static PyObject *__pyx_n_s_RuntimeError;
static PyObject *__pyx_n_s_SET_ARC_PROPERTIES;
static PyObject *__pyx_n_s_SET_FINAL_PROPERTIES;
static PyObject *__pyx_n_s_SET_START_PROPERTIES;
static PyObject *__pyx_n_s_STATE_SORT_PROPERTIES;
static PyObject *__pyx_n_s_STRING;
static PyObject *__pyx_n_s_SortType;
static PyObject *__pyx_n_s_StateIterator;
static PyObject *__pyx_kp_u_StateIterator_at_0x;
static PyObject *__pyx_n_s_StateMapType;
static PyObject *__pyx_kp_u_State_index_out_of_range;
static PyObject *__pyx_n_s_StopIteration;
static PyObject *__pyx_kp_u_SymbolTable;
static PyObject *__pyx_n_s_SymbolTableIterator;
static PyObject *__pyx_kp_u_SymbolTableIterator_at_0x;
static PyObject *__pyx_n_s_SymbolTableView;
static PyObject *__pyx_n_s_SymbolTable_2;
static PyObject *__pyx_kp_u_SymbolTable_no_longer_exists;
static PyObject *__pyx_n_s_TOP_SORTED;
static PyObject *__pyx_n_s_TRINARY_PROPERTIES;
static PyObject *__pyx_kp_u_Tsvg;
static PyObject *__pyx_n_s_TypeError;
static PyObject *__pyx_n_s_UNWEIGHTED;
static PyObject *__pyx_n_s_UNWEIGHTED_CYCLES;
static PyObject *__pyx_kp_u_Unknown_FAR_type;
static PyObject *__pyx_kp_u_Unknown_arc_type;
static PyObject *__pyx_kp_u_Unknown_compose_filter_type;
static PyObject *__pyx_kp_u_Unknown_determinization_type;
static PyObject *__pyx_kp_u_Unknown_map_type;
static PyObject *__pyx_kp_u_Unknown_projection_type;
static PyObject *__pyx_kp_u_Unknown_queue_type;
static PyObject *__pyx_kp_u_Unknown_random_arc_selection_typ;
static PyObject *__pyx_kp_u_Unknown_replace_label_type;
static PyObject *__pyx_kp_u_Unknown_sort_type;
static PyObject *__pyx_n_s_ValueError;
static PyObject *__pyx_n_s_VectorFst;
static PyObject *__pyx_n_s_WEIGHTED;
static PyObject *__pyx_n_s_WEIGHTED_CYCLES;
static PyObject *__pyx_n_s_WEIGHT_INVARIANT_PROPERTIES;
static PyObject *__pyx_kp_u_Weight;
static PyObject *__pyx_n_s_WeightLike;
static PyObject *__pyx_n_s_Weight_2;
static PyObject *__pyx_kp_u_Weight_type_not_found;
static PyObject *__pyx_kp_u_Write_failed;
static PyObject *__pyx_kp_u_Write_to_string_failed;
static PyObject *__pyx_kp_u__11;
static PyObject *__pyx_kp_u__2;
static PyObject *__pyx_kp_u__3;
static PyObject *__pyx_n_s_acceptor;
static PyObject *__pyx_n_s_add;
static PyObject *__pyx_n_s_add_state;
static PyObject *__pyx_n_s_add_states;
static PyObject *__pyx_n_s_add_symbol;
static PyObject *__pyx_n_s_add_table;
static PyObject *__pyx_n_s_allow_negative_labels;
static PyObject *__pyx_n_s_allow_nondet;
static PyObject *__pyx_n_s_arc;
static PyObject *__pyx_n_s_arc_type;
static PyObject *__pyx_n_s_arcs;
static PyObject *__pyx_n_s_args;
static PyObject *__pyx_kp_u_at_0x;
static PyObject *__pyx_n_s_attach_new_isymbols;
static PyObject *__pyx_n_s_attach_new_osymbols;
static PyObject *__pyx_n_u_auto;
static PyObject *__pyx_n_s_available_key;
static PyObject *__pyx_kp_u_but_received;
static PyObject *__pyx_n_s_call_arc_labeling;
static PyObject *__pyx_n_s_checksum;
static PyObject *__pyx_n_s_class;
static PyObject *__pyx_n_s_class_2;
static PyObject *__pyx_n_s_cline_in_traceback;
static PyObject *__pyx_n_s_close;
static PyObject *__pyx_n_s_closure_plus;
static PyObject *__pyx_n_s_communicate;
static PyObject *__pyx_n_s_compile;
static PyObject *__pyx_n_s_compose_filter;
static PyObject *__pyx_n_s_connect;
static PyObject *__pyx_kp_u_const_EncodeMapper_SymbolTableV;
static PyObject *__pyx_kp_u_const_Fst_SymbolTableView;
static PyObject *__pyx_n_s_copy;
static PyObject *__pyx_n_s_create;
static PyObject *__pyx_n_u_default;
static PyObject *__pyx_n_s_delta;
static PyObject *__pyx_n_s_det_type;
static PyObject *__pyx_n_s_distance;
static PyObject *__pyx_n_s_divide;
static PyObject *__pyx_n_s_doc;
static PyObject *__pyx_n_s_done;
static PyObject *__pyx_n_u_dot;
static PyObject *__pyx_n_s_draw;
static PyObject *__pyx_n_s_encode_labels;
static PyObject *__pyx_n_s_encode_weights;
static PyObject *__pyx_n_s_enum;
static PyObject *__pyx_n_s_eps_norm_output;
static PyObject *__pyx_n_s_epsilon_on_replace;
static PyObject *__pyx_n_s_error;
static PyObject *__pyx_kp_u_failed;
static PyObject *__pyx_n_s_far_type;
static PyObject *__pyx_n_s_final;
static PyObject *__pyx_n_s_find;
static PyObject *__pyx_n_s_flags;
static PyObject *__pyx_n_s_float_format;
static PyObject *__pyx_n_s_fontsize;
static PyObject *__pyx_n_s_fspath;
static PyObject *__pyx_n_s_fst_type;
static PyObject *__pyx_n_s_fstlib_cext_pywrapfst;
static PyObject *__pyx_kp_s_fstlib_cext_pywrapfst_pyx;
static PyObject *__pyx_n_u_functional;
static PyObject *__pyx_n_u_g;
static PyObject *__pyx_n_s_get_fst;
static PyObject *__pyx_n_s_get_key;
static PyObject *__pyx_n_s_get_nth_key;
static PyObject *__pyx_n_s_getstate;
static PyObject *__pyx_n_s_height;
static PyObject *__pyx_n_s_id;
static PyObject *__pyx_n_u_identity;
static PyObject *__pyx_n_s_ifst;
static PyObject *__pyx_n_s_ifst1;
static PyObject *__pyx_n_s_ifst2;
static PyObject *__pyx_n_s_ilabel;
static PyObject *__pyx_n_u_ilabel;
static PyObject *__pyx_n_s_import;
static PyObject *__pyx_n_s_increment_subsequential_label;
static PyObject *__pyx_n_u_input;
static PyObject *__pyx_n_s_input_symbols;
static PyObject *__pyx_n_s_input_table;
static PyObject *__pyx_n_s_ipairs;
static PyObject *__pyx_n_s_isymbols;
static PyObject *__pyx_n_s_items;
static PyObject *__pyx_n_s_iter;
static PyObject *__pyx_n_s_keep_isymbols;
static PyObject *__pyx_n_s_keep_osymbols;
static PyObject *__pyx_n_s_keep_state_numbering;
static PyObject *__pyx_n_s_key;
static PyObject *__pyx_n_s_labeled_checksum;
static PyObject *__pyx_n_s_lhs;
static PyObject *__pyx_n_s_logging;
static PyObject *__pyx_n_s_main;
static PyObject *__pyx_n_s_map_type;
static PyObject *__pyx_n_s_mask;
static PyObject *__pyx_n_s_max_length;
static PyObject *__pyx_n_s_member;
static PyObject *__pyx_n_s_members;
static PyObject *__pyx_n_s_metaclass;
static PyObject *__pyx_n_s_missing_sym;
static PyObject *__pyx_n_s_module;
static PyObject *__pyx_n_s_mutable_arcs;
static PyObject *__pyx_n_s_n;
static PyObject *__pyx_n_s_name;
static PyObject *__pyx_n_s_name_2;
static PyObject *__pyx_n_u_neither;
static PyObject *__pyx_n_s_new_isymbols;
static PyObject *__pyx_n_s_new_osymbols;
static PyObject *__pyx_n_s_next;
static PyObject *__pyx_n_s_nextstate;
static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
static PyObject *__pyx_n_s_no_weight;
static PyObject *__pyx_n_s_nodesep;
static PyObject *__pyx_n_s_npath;
static PyObject *__pyx_n_s_nshortest;
static PyObject *__pyx_n_s_nstate;
static PyObject *__pyx_n_s_num_arcs;
static PyObject *__pyx_n_s_num_input_epsilons;
static PyObject *__pyx_n_s_num_output_epsilons;
static PyObject *__pyx_n_s_num_states;
static PyObject *__pyx_n_s_num_symbols;
static PyObject *__pyx_n_s_numbers;
static PyObject *__pyx_n_s_olabel;
static PyObject *__pyx_n_s_old_isymbols;
static PyObject *__pyx_n_s_old_osymbols;
static PyObject *__pyx_n_s_one;
static PyObject *__pyx_n_s_opairs;
static PyObject *__pyx_n_s_open;
static PyObject *__pyx_n_s_os;
static PyObject *__pyx_n_s_osymbols;
static PyObject *__pyx_n_s_output_symbols;
static PyObject *__pyx_n_s_pairs;
static PyObject *__pyx_n_s_plus;
static PyObject *__pyx_n_s_portrait;
static PyObject *__pyx_n_s_position;
static PyObject *__pyx_n_s_potentials;
static PyObject *__pyx_n_s_power;
static PyObject *__pyx_n_s_precision;
static PyObject *__pyx_n_s_prepare;
static PyObject *__pyx_n_s_print;
static PyObject *__pyx_n_s_props;
static PyObject *__pyx_n_s_push_labels;
static PyObject *__pyx_n_s_push_weights;
static PyObject *__pyx_n_s_pyx_vtable;
static PyObject *__pyx_n_s_qualname;
static PyObject *__pyx_n_s_queue_type;
static PyObject *__pyx_n_s_ranksep;
static PyObject *__pyx_n_s_read;
static PyObject *__pyx_n_s_read_EncodeMapper_from_string;
static PyObject *__pyx_n_s_read_Fst_from_string;
static PyObject *__pyx_n_s_read_SymbolTable_from_string;
static PyObject *__pyx_n_s_read_from_string;
static PyObject *__pyx_n_s_read_fst;
static PyObject *__pyx_n_s_read_text;
static PyObject *__pyx_n_s_reduce;
static PyObject *__pyx_n_s_reduce_cython;
static PyObject *__pyx_n_s_reduce_ex;
static PyObject *__pyx_n_s_remove_common_affix;
static PyObject *__pyx_n_s_remove_total_weight;
static PyObject *__pyx_n_s_require_superinitial;
static PyObject *__pyx_n_s_reset;
static PyObject *__pyx_n_s_return_arc_labeling;
static PyObject *__pyx_n_s_return_label;
static PyObject *__pyx_n_s_reverse;
static PyObject *__pyx_n_s_rhs;
static PyObject *__pyx_n_s_seed;
static PyObject *__pyx_n_s_seek;
static PyObject *__pyx_n_s_select;
static PyObject *__pyx_kp_s_self__aiter_self__fst_cannot_be;
static PyObject *__pyx_kp_s_self__aiter_self__mfst_cannot_be;
static PyObject *__pyx_kp_s_self__arc_cannot_be_converted_to;
static PyObject *__pyx_kp_s_self__fst_self__siter_cannot_be;
static PyObject *__pyx_kp_s_self__reader_cannot_be_converted;
static PyObject *__pyx_kp_s_self__siter_cannot_be_converted;
static PyObject *__pyx_kp_s_self__weight_cannot_be_converted;
static PyObject *__pyx_kp_s_self__writer_cannot_be_converted;
static PyObject *__pyx_n_s_send;
static PyObject *__pyx_n_s_set_flags;
static PyObject *__pyx_n_s_set_name;
static PyObject *__pyx_n_s_set_value;
static PyObject *__pyx_n_s_setstate;
static PyObject *__pyx_n_s_setstate_cython;
static PyObject *__pyx_n_s_shortestdistance;
static PyObject *__pyx_n_s_show_weight_one;
static PyObject *__pyx_n_s_sort_type;
static PyObject *__pyx_n_s_source;
static PyObject *__pyx_n_s_ssymbols;
static PyObject *__pyx_n_u_standard;
static PyObject *__pyx_n_s_start;
static PyObject *__pyx_n_s_state;
static PyObject *__pyx_n_s_states;
static PyObject *__pyx_n_s_staticmethod;
static PyObject *__pyx_n_s_stdin;
static PyObject *__pyx_n_s_stdout;
static PyObject *__pyx_n_s_subprocess;
static PyObject *__pyx_n_s_subsequential_label;
static PyObject *__pyx_n_s_symbol;
static PyObject *__pyx_n_s_symbols;
static PyObject *__pyx_n_s_sys;
static PyObject *__pyx_n_s_test;
static PyObject *__pyx_n_s_test_2;
static PyObject *__pyx_n_s_throw;
static PyObject *__pyx_n_s_times;
static PyObject *__pyx_n_s_title;
static PyObject *__pyx_n_s_to_final;
static PyObject *__pyx_n_s_to_string;
static PyObject *__pyx_n_s_type;
static PyObject *__pyx_n_s_typing;
static PyObject *__pyx_kp_u_typing_Literal_alt_sequence_auto;
static PyObject *__pyx_kp_u_typing_Literal_arc_sum_arc_uniqu;
static PyObject *__pyx_kp_u_typing_Literal_auto_fifo_lifo_sh;
static PyObject *__pyx_kp_u_typing_Literal_e_f_g;
static PyObject *__pyx_kp_u_typing_Literal_fst_stlist_sttabl;
static PyObject *__pyx_kp_u_typing_Literal_functional_nonfun;
static PyObject *__pyx_kp_u_typing_Literal_identity_input_ep;
static PyObject *__pyx_kp_u_typing_Literal_ilabel_olabel;
static PyObject *__pyx_kp_u_typing_Literal_input_output;
static PyObject *__pyx_kp_u_typing_Literal_neither_input_out;
static PyObject *__pyx_kp_u_typing_Literal_uniform_log_prob;
static PyObject *__pyx_kp_u_typing_Union_Weight_typing_Union;
static PyObject *__pyx_n_u_uniform;
static PyObject *__pyx_n_s_unique;
static PyObject *__pyx_n_s_unknown_isymbol;
static PyObject *__pyx_n_s_unknown_osymbol;
static PyObject *__pyx_kp_u_unspecified;
static PyObject *__pyx_n_s_value;
static PyObject *__pyx_n_u_vector;
static PyObject *__pyx_n_s_verify;
static PyObject *__pyx_n_s_vertical;
static PyObject *__pyx_n_s_w;
static PyObject *__pyx_n_s_warning;
static PyObject *__pyx_n_s_weight;
static PyObject *__pyx_n_s_weight_2;
static PyObject *__pyx_n_s_weight_type;
static PyObject *__pyx_n_s_weighted;
static PyObject *__pyx_n_s_width;
static PyObject *__pyx_n_s_write;
static PyObject *__pyx_n_s_write_text;
static PyObject *__pyx_n_s_write_to_string;
static PyObject *__pyx_n_u_x;
static PyObject *__pyx_n_s_zero;
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_6Weight___repr__(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_6Weight_2__str__(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_6Weight_4__float__(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__pyx_v_self); /* proto */
static int __pyx_pf_6fstlib_4cext_9pywrapfst_6Weight_6__init__(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__pyx_v_self, PyObject *__pyx_v_weight_type, PyObject *__pyx_v_weight); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_6Weight_8copy(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_6Weight_10zero(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_weight_type); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_6Weight_12one(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_weight_type); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_6Weight_14no_weight(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_weight_type); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_6Weight_16__eq__(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__pyx_v_w1, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__pyx_v_w2); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_6Weight_18__ne__(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__pyx_v_w1, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__pyx_v_w2); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_6Weight_20to_string(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_6Weight_22type(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_6Weight_24member(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_6Weight_26__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_6Weight_28__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_plus(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__pyx_v_lhs, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__pyx_v_rhs); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_2times(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__pyx_v_lhs, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__pyx_v_rhs); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_4divide(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__pyx_v_lhs, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__pyx_v_rhs); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_6power(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__pyx_v_w, size_t __pyx_v_n); /* proto */
static int __pyx_pf_6fstlib_4cext_9pywrapfst_15SymbolTableView___init__(struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_15SymbolTableView_2__iter__(struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_15SymbolTableView_4__reduce__(struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_15SymbolTableView_6available_key(struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_15SymbolTableView_8checksum(struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_15SymbolTableView_10copy(struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_15SymbolTableView_12find(struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_15SymbolTableView_14get_nth_key(struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_self, Py_ssize_t __pyx_v_pos); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_15SymbolTableView_16labeled_checksum(struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_15SymbolTableView_18member(struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_15SymbolTableView_20name(struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_15SymbolTableView_22num_symbols(struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_15SymbolTableView_24write(struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_self, PyObject *__pyx_v_source); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_15SymbolTableView_26write_text(struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_self, PyObject *__pyx_v_source); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_15SymbolTableView_28write_to_string(struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_28_EncodeMapperSymbolTableView___repr__(struct __pyx_obj_6fstlib_4cext_9pywrapfst__EncodeMapperSymbolTableView *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_19_FstSymbolTableView___repr__(struct __pyx_obj_6fstlib_4cext_9pywrapfst__FstSymbolTableView *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_19_MutableSymbolTable_add_symbol(struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableSymbolTable *__pyx_v_self, PyObject *__pyx_v_symbol, int64 __pyx_v_key); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_19_MutableSymbolTable_2add_table(struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableSymbolTable *__pyx_v_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_symbols); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_19_MutableSymbolTable_4set_name(struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableSymbolTable *__pyx_v_self, PyObject *__pyx_v_new_name); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_26_MutableFstSymbolTableView___repr__(struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableFstSymbolTableView *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_11SymbolTable___repr__(struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTable *__pyx_v_self); /* proto */
static int __pyx_pf_6fstlib_4cext_9pywrapfst_11SymbolTable_2__init__(struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTable *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_11SymbolTable_4read(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_source); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_11SymbolTable_6read_text(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_source, bool __pyx_v_allow_negative_labels); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_11SymbolTable_8read_fst(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_source, bool __pyx_v_input_table); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_8_read_SymbolTable_from_string(CYTHON_UNUSED PyObject *__pyx_self, std::string __pyx_v_state); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_10compact_symbol_table(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_symbols); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_12merge_symbol_table(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_lhs, struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_rhs); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_20_SymbolTableIterator___repr__(struct __pyx_obj_6fstlib_4cext_9pywrapfst__SymbolTableIterator *__pyx_v_self); /* proto */
static int __pyx_pf_6fstlib_4cext_9pywrapfst_20_SymbolTableIterator_2__init__(struct __pyx_obj_6fstlib_4cext_9pywrapfst__SymbolTableIterator *__pyx_v_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_symbols); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_20_SymbolTableIterator_4__iter__(struct __pyx_obj_6fstlib_4cext_9pywrapfst__SymbolTableIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_20_SymbolTableIterator_6__next__(struct __pyx_obj_6fstlib_4cext_9pywrapfst__SymbolTableIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_20_SymbolTableIterator_8__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_6fstlib_4cext_9pywrapfst__SymbolTableIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_20_SymbolTableIterator_10__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_6fstlib_4cext_9pywrapfst__SymbolTableIterator *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_12EncodeMapper___repr__(struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *__pyx_v_self); /* proto */
static int __pyx_pf_6fstlib_4cext_9pywrapfst_12EncodeMapper_2__init__(struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *__pyx_v_self, PyObject *__pyx_v_arc_type, bool __pyx_v_encode_labels, bool __pyx_v_encode_weights); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_12EncodeMapper_4__call__(struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *__pyx_v_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Arc *__pyx_v_arc); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_12EncodeMapper_6__reduce__(struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_12EncodeMapper_8arc_type(struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_12EncodeMapper_10weight_type(struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_12EncodeMapper_12flags(struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_12EncodeMapper_14properties(struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *__pyx_v_self, PyObject *__pyx_v_mask); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_12EncodeMapper_16read(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_source); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_12EncodeMapper_18read_from_string(PyObject *__pyx_v_state); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_12EncodeMapper_20write(struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *__pyx_v_self, PyObject *__pyx_v_source); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_12EncodeMapper_22write_to_string(struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_12EncodeMapper_24input_symbols(struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_12EncodeMapper_26output_symbols(struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_12EncodeMapper_28set_input_symbols(struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *__pyx_v_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_symbols); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_12EncodeMapper_30set_output_symbols(struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *__pyx_v_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_symbols); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_14_read_EncodeMapper_from_string(CYTHON_UNUSED PyObject *__pyx_self, std::string __pyx_v_state); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_3Fst__repr_svg_(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_self); /* proto */
static int __pyx_pf_6fstlib_4cext_9pywrapfst_3Fst_2__init__(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_3Fst_4__reduce__(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_3Fst_6__repr__(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_3Fst_8__str__(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_3Fst_10arc_type(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_3Fst_12arcs(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_self, int64 __pyx_v_state); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_3Fst_14copy(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_3Fst_16draw(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_self, PyObject *__pyx_v_source, struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_isymbols, struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_osymbols, struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_ssymbols, bool __pyx_v_acceptor, PyObject *__pyx_v_title, double __pyx_v_width, double __pyx_v_height, bool __pyx_v_portrait, bool __pyx_v_vertical, double __pyx_v_ranksep, double __pyx_v_nodesep, int32 __pyx_v_fontsize, int32 __pyx_v_precision, PyObject *__pyx_v_float_format, bool __pyx_v_show_weight_one); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_3Fst_18final(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_self, int64 __pyx_v_state); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_3Fst_20fst_type(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_3Fst_22input_symbols(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_3Fst_24num_arcs(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_self, int64 __pyx_v_state); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_3Fst_26num_input_epsilons(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_self, int64 __pyx_v_state); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_3Fst_28num_output_epsilons(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_self, int64 __pyx_v_state); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_3Fst_30output_symbols(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_3Fst_32print(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_isymbols, struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_osymbols, struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_ssymbols, bool __pyx_v_acceptor, bool __pyx_v_show_weight_one, PyObject *__pyx_v_missing_sym); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_3Fst_34properties(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_self, PyObject *__pyx_v_mask, bool __pyx_v_test); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_3Fst_36read(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_source); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_3Fst_38read_from_string(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_state); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_3Fst_40start(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_3Fst_42states(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_3Fst_44verify(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_3Fst_46weight_type(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_3Fst_48write(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_self, PyObject *__pyx_v_source); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_3Fst_50write_to_string(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_10MutableFst_add_arc(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, int64 __pyx_v_state, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Arc *__pyx_v_arc); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_10MutableFst_2add_state(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_10MutableFst_4add_states(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, size_t __pyx_v_n); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_10MutableFst_6arcsort(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, PyObject *__pyx_v_sort_type); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_10MutableFst_8closure(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, bool __pyx_v_closure_plus); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_10MutableFst_10concat(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_fst2); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_10MutableFst_12connect(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_10MutableFst_14decode(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *__pyx_v_mapper); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_10MutableFst_16delete_arcs(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, int64 __pyx_v_state, size_t __pyx_v_n); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_10MutableFst_18delete_states(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, PyObject *__pyx_v_states); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_10MutableFst_20encode(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *__pyx_v_mapper); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_10MutableFst_22invert(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_10MutableFst_24minimize(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, float __pyx_v_delta, bool __pyx_v_allow_nondet); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_10MutableFst_26mutable_arcs(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, int64 __pyx_v_state); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_10MutableFst_28mutable_input_symbols(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_10MutableFst_30mutable_output_symbols(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_10MutableFst_32num_states(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_10MutableFst_34project(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, PyObject *__pyx_v_project_type); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_10MutableFst_36prune(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, float __pyx_v_delta, int64 __pyx_v_nstate, PyObject *__pyx_v_weight); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_10MutableFst_38push(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, float __pyx_v_delta, bool __pyx_v_remove_total_weight, bool __pyx_v_to_final); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_10MutableFst_40relabel_pairs(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, PyObject *__pyx_v_ipairs, PyObject *__pyx_v_opairs); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_10MutableFst_42relabel_tables(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_old_isymbols, struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_new_isymbols, PyObject *__pyx_v_unknown_isymbol, bool __pyx_v_attach_new_isymbols, struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_old_osymbols, struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_new_osymbols, PyObject *__pyx_v_unknown_osymbol, bool __pyx_v_attach_new_osymbols); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_10MutableFst_44reserve_arcs(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, int64 __pyx_v_state, size_t __pyx_v_n); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_10MutableFst_46reserve_states(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, int64 __pyx_v_n); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_10MutableFst_48reweight(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, PyObject *__pyx_v_potentials, bool __pyx_v_to_final); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_10MutableFst_50rmepsilon(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, PyObject *__pyx_v_queue_type, bool __pyx_v_connect, PyObject *__pyx_v_weight, int64 __pyx_v_nstate, float __pyx_v_delta); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_10MutableFst_52set_final(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, int64 __pyx_v_state, PyObject *__pyx_v_weight); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_10MutableFst_54set_input_symbols(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_symbols); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_10MutableFst_56set_output_symbols(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_symbols); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_10MutableFst_58set_properties(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, PyObject *__pyx_v_props, PyObject *__pyx_v_mask); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_10MutableFst_60set_start(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, int64 __pyx_v_state); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_10MutableFst_62topsort(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_10MutableFst_64union(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, PyObject *__pyx_v_fsts2); /* proto */
static int __pyx_pf_6fstlib_4cext_9pywrapfst_9VectorFst___init__(struct __pyx_obj_6fstlib_4cext_9pywrapfst_VectorFst *__pyx_v_self, PyObject *__pyx_v_arc_type); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_16_read_Fst(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_source); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_18_read_Fst_from_string(CYTHON_UNUSED PyObject *__pyx_self, std::string __pyx_v_state); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_3Arc___repr__(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Arc *__pyx_v_self); /* proto */
static int __pyx_pf_6fstlib_4cext_9pywrapfst_3Arc_2__init__(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Arc *__pyx_v_self, int64 __pyx_v_ilabel, int64 __pyx_v_olabel, PyObject *__pyx_v_weight, int64 __pyx_v_nextstate); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_3Arc_4copy(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Arc *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_3Arc_6ilabel___get__(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Arc *__pyx_v_self); /* proto */
static int __pyx_pf_6fstlib_4cext_9pywrapfst_3Arc_6ilabel_2__set__(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Arc *__pyx_v_self, int64 __pyx_v_value); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_3Arc_6olabel___get__(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Arc *__pyx_v_self); /* proto */
static int __pyx_pf_6fstlib_4cext_9pywrapfst_3Arc_6olabel_2__set__(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Arc *__pyx_v_self, int64 __pyx_v_value); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_3Arc_6weight___get__(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Arc *__pyx_v_self); /* proto */
static int __pyx_pf_6fstlib_4cext_9pywrapfst_3Arc_6weight_2__set__(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Arc *__pyx_v_self, PyObject *__pyx_v_weight); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_3Arc_9nextstate___get__(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Arc *__pyx_v_self); /* proto */
static int __pyx_pf_6fstlib_4cext_9pywrapfst_3Arc_9nextstate_2__set__(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Arc *__pyx_v_self, int64 __pyx_v_value); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_3Arc_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_6fstlib_4cext_9pywrapfst_Arc *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_3Arc_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_6fstlib_4cext_9pywrapfst_Arc *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_12_ArcIterator___repr__(struct __pyx_obj_6fstlib_4cext_9pywrapfst__ArcIterator *__pyx_v_self); /* proto */
static int __pyx_pf_6fstlib_4cext_9pywrapfst_12_ArcIterator_2__init__(struct __pyx_obj_6fstlib_4cext_9pywrapfst__ArcIterator *__pyx_v_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst, int64 __pyx_v_state); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_12_ArcIterator_4__iter__(struct __pyx_obj_6fstlib_4cext_9pywrapfst__ArcIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_12_ArcIterator_6__next__(struct __pyx_obj_6fstlib_4cext_9pywrapfst__ArcIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_12_ArcIterator_8done(struct __pyx_obj_6fstlib_4cext_9pywrapfst__ArcIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_12_ArcIterator_10flags(struct __pyx_obj_6fstlib_4cext_9pywrapfst__ArcIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_12_ArcIterator_12next(struct __pyx_obj_6fstlib_4cext_9pywrapfst__ArcIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_12_ArcIterator_14position(struct __pyx_obj_6fstlib_4cext_9pywrapfst__ArcIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_12_ArcIterator_16reset(struct __pyx_obj_6fstlib_4cext_9pywrapfst__ArcIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_12_ArcIterator_18seek(struct __pyx_obj_6fstlib_4cext_9pywrapfst__ArcIterator *__pyx_v_self, size_t __pyx_v_a); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_12_ArcIterator_20set_flags(struct __pyx_obj_6fstlib_4cext_9pywrapfst__ArcIterator *__pyx_v_self, uint8 __pyx_v_flags, uint8 __pyx_v_mask); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_12_ArcIterator_22value(struct __pyx_obj_6fstlib_4cext_9pywrapfst__ArcIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_12_ArcIterator_24__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_6fstlib_4cext_9pywrapfst__ArcIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_12_ArcIterator_26__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_6fstlib_4cext_9pywrapfst__ArcIterator *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_19_MutableArcIterator___repr__(struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableArcIterator *__pyx_v_self); /* proto */
static int __pyx_pf_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_2__init__(struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableArcIterator *__pyx_v_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_ifst, int64 __pyx_v_state); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_4__iter__(struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableArcIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_7__next__(struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableArcIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_9done(struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableArcIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_11flags(struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableArcIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_13next(struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableArcIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_15position(struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableArcIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_17reset(struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableArcIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_19seek(struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableArcIterator *__pyx_v_self, size_t __pyx_v_a); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_21set_flags(struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableArcIterator *__pyx_v_self, uint8 __pyx_v_flags, uint8 __pyx_v_mask); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_23set_value(struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableArcIterator *__pyx_v_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Arc *__pyx_v_arc); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_25value(struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableArcIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_27__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableArcIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_29__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableArcIterator *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_14_StateIterator___repr__(struct __pyx_obj_6fstlib_4cext_9pywrapfst__StateIterator *__pyx_v_self); /* proto */
static int __pyx_pf_6fstlib_4cext_9pywrapfst_14_StateIterator_2__init__(struct __pyx_obj_6fstlib_4cext_9pywrapfst__StateIterator *__pyx_v_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_14_StateIterator_4__iter__(struct __pyx_obj_6fstlib_4cext_9pywrapfst__StateIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_14_StateIterator_6__next__(struct __pyx_obj_6fstlib_4cext_9pywrapfst__StateIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_14_StateIterator_8done(struct __pyx_obj_6fstlib_4cext_9pywrapfst__StateIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_14_StateIterator_10next(struct __pyx_obj_6fstlib_4cext_9pywrapfst__StateIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_14_StateIterator_12reset(struct __pyx_obj_6fstlib_4cext_9pywrapfst__StateIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_14_StateIterator_14value(struct __pyx_obj_6fstlib_4cext_9pywrapfst__StateIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_14_StateIterator_16__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_6fstlib_4cext_9pywrapfst__StateIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_14_StateIterator_18__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_6fstlib_4cext_9pywrapfst__StateIterator *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_20arcmap(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst, float __pyx_v_delta, PyObject *__pyx_v_map_type, double __pyx_v_power, PyObject *__pyx_v_weight); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_22compose(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst1, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst2, PyObject *__pyx_v_compose_filter, bool __pyx_v_connect); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_24convert(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst, PyObject *__pyx_v_fst_type); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_26determinize(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst, float __pyx_v_delta, PyObject *__pyx_v_det_type, int64 __pyx_v_nstate, int64 __pyx_v_subsequential_label, PyObject *__pyx_v_weight, bool __pyx_v_increment_subsequential_label); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_28difference(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst1, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst2, PyObject *__pyx_v_compose_filter, bool __pyx_v_connect); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_30disambiguate(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst, float __pyx_v_delta, int64 __pyx_v_nstate, int64 __pyx_v_subsequential_label, PyObject *__pyx_v_weight); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_32epsnormalize(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst, bool __pyx_v_eps_norm_output); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_34equal(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst1, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst2, float __pyx_v_delta); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_36equivalent(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst1, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst2, float __pyx_v_delta); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_38intersect(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst1, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst2, PyObject *__pyx_v_compose_filter, bool __pyx_v_connect); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_40isomorphic(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst1, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst2, float __pyx_v_delta); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_42prune(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst, float __pyx_v_delta, int64 __pyx_v_nstate, PyObject *__pyx_v_weight); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_44push(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst, float __pyx_v_delta, bool __pyx_v_push_weights, bool __pyx_v_push_labels, bool __pyx_v_remove_common_affix, bool __pyx_v_remove_total_weight, bool __pyx_v_to_final); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_46randequivalent(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst1, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst2, int32 __pyx_v_npath, float __pyx_v_delta, PyObject *__pyx_v_select, int32 __pyx_v_max_length, uint64 __pyx_v_seed); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_48randgen(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst, int32 __pyx_v_npath, PyObject *__pyx_v_select, int32 __pyx_v_max_length, bool __pyx_v_weighted, bool __pyx_v_remove_total_weight, uint64 __pyx_v_seed); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_50replace(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_pairs, PyObject *__pyx_v_call_arc_labeling, PyObject *__pyx_v_return_arc_labeling, bool __pyx_v_epsilon_on_replace, int64 __pyx_v_return_label); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_52reverse(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst, bool __pyx_v_require_superinitial); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_54shortestdistance(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst, float __pyx_v_delta, int64 __pyx_v_nstate, PyObject *__pyx_v_queue_type, bool __pyx_v_reverse); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_56shortestpath(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst, float __pyx_v_delta, int32 __pyx_v_nshortest, int64 __pyx_v_nstate, PyObject *__pyx_v_queue_type, bool __pyx_v_unique, PyObject *__pyx_v_weight); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_58statemap(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst, PyObject *__pyx_v_map_type); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_60synchronize(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst); /* proto */
static int __pyx_pf_6fstlib_4cext_9pywrapfst_8Compiler___cinit__(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Compiler *__pyx_v_self, PyObject *__pyx_v_fst_type, PyObject *__pyx_v_arc_type, struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTable *__pyx_v_isymbols, struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTable *__pyx_v_osymbols, struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTable *__pyx_v_ssymbols, bool __pyx_v_acceptor, bool __pyx_v_keep_isymbols, bool __pyx_v_keep_osymbols, bool __pyx_v_keep_state_numbering, bool __pyx_v_allow_negative_labels); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_8Compiler_2compile(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Compiler *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_8Compiler_4write(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Compiler *__pyx_v_self, PyObject *__pyx_v_expression); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_8Compiler_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_6fstlib_4cext_9pywrapfst_Compiler *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_8Compiler_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_6fstlib_4cext_9pywrapfst_Compiler *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_6fstlib_4cext_9pywrapfst_9FarReader___init__(struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_9FarReader_2__repr__(struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_9FarReader_4open(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_sources); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_9FarReader_6arc_type(struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_9FarReader_8done(struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_9FarReader_10error(struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_9FarReader_12far_type(struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_9FarReader_14find(struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarReader *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_9FarReader_16get_fst(struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_9FarReader_18get_key(struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_9FarReader_20next(struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_9FarReader_22reset(struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_9FarReader_24__getitem__(struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarReader *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_9FarReader_26__next__(struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_9FarReader_28__iter__(struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_9FarReader_30__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_9FarReader_32__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarReader *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_6fstlib_4cext_9pywrapfst_9FarWriter___init__(struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarWriter *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_9FarWriter_2__repr__(struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarWriter *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_9FarWriter_4create(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_source, PyObject *__pyx_v_arc_type, PyObject *__pyx_v_far_type); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_9FarWriter_6add(struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarWriter *__pyx_v_self, PyObject *__pyx_v_key, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_9FarWriter_8arc_type(struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarWriter *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_9FarWriter_10error(struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarWriter *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_9FarWriter_12far_type(struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarWriter *__pyx_v_self); /* proto */
static int __pyx_pf_6fstlib_4cext_9pywrapfst_9FarWriter_14__setitem__(struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarWriter *__pyx_v_self, PyObject *__pyx_v_key, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_fst); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_9FarWriter_16__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarWriter *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_9FarWriter_18__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarWriter *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_tp_new_6fstlib_4cext_9pywrapfst_Weight(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6fstlib_4cext_9pywrapfst_SymbolTableView(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6fstlib_4cext_9pywrapfst__EncodeMapperSymbolTableView(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6fstlib_4cext_9pywrapfst__FstSymbolTableView(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6fstlib_4cext_9pywrapfst__MutableSymbolTable(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6fstlib_4cext_9pywrapfst__MutableFstSymbolTableView(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6fstlib_4cext_9pywrapfst_SymbolTable(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6fstlib_4cext_9pywrapfst__SymbolTableIterator(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6fstlib_4cext_9pywrapfst_EncodeMapper(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6fstlib_4cext_9pywrapfst_Fst(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6fstlib_4cext_9pywrapfst_MutableFst(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6fstlib_4cext_9pywrapfst_VectorFst(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6fstlib_4cext_9pywrapfst_Arc(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6fstlib_4cext_9pywrapfst__ArcIterator(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6fstlib_4cext_9pywrapfst__MutableArcIterator(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6fstlib_4cext_9pywrapfst__StateIterator(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6fstlib_4cext_9pywrapfst_Compiler(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6fstlib_4cext_9pywrapfst_FarReader(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6fstlib_4cext_9pywrapfst_FarWriter(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6fstlib_4cext_9pywrapfst___pyx_scope_struct____iter__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static int64 __pyx_k__6;
static float __pyx_k__12;
static float __pyx_k__13;
static float __pyx_k__14;
static int64 __pyx_k__15;
static float __pyx_k__16;
static int64 __pyx_k__17;
static float __pyx_k__18;
static float __pyx_k__19;
static int64 __pyx_k__20;
static float __pyx_k__21;
static int64 __pyx_k__22;
static float __pyx_k__23;
static float __pyx_k__32;
static float __pyx_k__33;
static float __pyx_k__34;
static int64 __pyx_k__35;
static float __pyx_k__36;
static int64 __pyx_k__37;
static float __pyx_k__38;
static float __pyx_k__39;
static float __pyx_k__40;
static float __pyx_k__41;
static int64 __pyx_k__42;
static float __pyx_k__43;
static float __pyx_k__44;
static int32 __pyx_k__45;
static int32 __pyx_k__46;
static float __pyx_k__47;
static int64 __pyx_k__48;
static float __pyx_k__49;
static int64 __pyx_k__50;
static float __pyx_k__51;
static int64 __pyx_k__52;
static PyObject *__pyx_tuple__4;
static PyObject *__pyx_tuple__5;
static PyObject *__pyx_tuple__7;
static PyObject *__pyx_tuple__8;
static PyObject *__pyx_tuple__9;
static PyObject *__pyx_tuple__10;
static PyObject *__pyx_tuple__24;
static PyObject *__pyx_tuple__25;
static PyObject *__pyx_tuple__26;
static PyObject *__pyx_tuple__27;
static PyObject *__pyx_tuple__28;
static PyObject *__pyx_tuple__29;
static PyObject *__pyx_tuple__30;
static PyObject *__pyx_tuple__31;
static PyObject *__pyx_tuple__53;
static PyObject *__pyx_tuple__54;
static PyObject *__pyx_tuple__55;
static PyObject *__pyx_tuple__56;
static PyObject *__pyx_tuple__57;
static PyObject *__pyx_tuple__58;
static PyObject *__pyx_tuple__59;
static PyObject *__pyx_tuple__61;
static PyObject *__pyx_tuple__63;
static PyObject *__pyx_tuple__65;
static PyObject *__pyx_tuple__67;
static PyObject *__pyx_tuple__69;
static PyObject *__pyx_codeobj__60;
static PyObject *__pyx_codeobj__62;
static PyObject *__pyx_codeobj__64;
static PyObject *__pyx_codeobj__66;
static PyObject *__pyx_codeobj__68;
static PyObject *__pyx_codeobj__70;
/* Late includes */

/* "fstlib/cext/pywrapfst.pyx":176
 * 
 * 
 * cdef string tostring(data) except *:             # <<<<<<<<<<<<<<
 *   """Converts strings to bytestrings.
 * 
 */

static std::string __pyx_f_6fstlib_4cext_9pywrapfst_tostring(PyObject *__pyx_v_data) {
  std::string __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  std::string __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  Py_UCS4 __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("tostring", 0);

  /* "fstlib/cext/pywrapfst.pyx":195
 *   """
 *   # A Python string can be implicitly cast to a C++ string.
 *   if isinstance(data, str):             # <<<<<<<<<<<<<<
 *     return data
 *   raise TypeError(f"Expected {str.__name__} but received "
 */
  __pyx_t_1 = PyUnicode_Check(__pyx_v_data); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "fstlib/cext/pywrapfst.pyx":196
 *   # A Python string can be implicitly cast to a C++ string.
 *   if isinstance(data, str):
 *     return data             # <<<<<<<<<<<<<<
 *   raise TypeError(f"Expected {str.__name__} but received "
 *                   f"{type(data).__name__}: {data!r}")
 */
    __pyx_t_3 = __pyx_convert_string_from_py_std__in_string(__pyx_v_data); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 196, __pyx_L1_error)
    __pyx_r = __pyx_t_3;
    goto __pyx_L0;

    /* "fstlib/cext/pywrapfst.pyx":195
 *   """
 *   # A Python string can be implicitly cast to a C++ string.
 *   if isinstance(data, str):             # <<<<<<<<<<<<<<
 *     return data
 *   raise TypeError(f"Expected {str.__name__} but received "
 */
  }

  /* "fstlib/cext/pywrapfst.pyx":197
 *   if isinstance(data, str):
 *     return data
 *   raise TypeError(f"Expected {str.__name__} but received "             # <<<<<<<<<<<<<<
 *                   f"{type(data).__name__}: {data!r}")
 * 
 */
  __pyx_t_4 = PyTuple_New(6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 197, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = 0;
  __pyx_t_6 = 127;
  __Pyx_INCREF(__pyx_kp_u_Expected);
  __pyx_t_5 += 9;
  __Pyx_GIVEREF(__pyx_kp_u_Expected);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_u_Expected);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)(&PyUnicode_Type)), __pyx_n_s_name); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 197, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_t_7, __pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 197, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) : __pyx_t_6;
  __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8);
  __Pyx_GIVEREF(__pyx_t_8);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_8);
  __pyx_t_8 = 0;
  __Pyx_INCREF(__pyx_kp_u_but_received);
  __pyx_t_5 += 14;
  __Pyx_GIVEREF(__pyx_kp_u_but_received);
  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_kp_u_but_received);

  /* "fstlib/cext/pywrapfst.pyx":198
 *     return data
 *   raise TypeError(f"Expected {str.__name__} but received "
 *                   f"{type(data).__name__}: {data!r}")             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_data)), __pyx_n_s_name); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 198, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_t_8, __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 198, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_6;
  __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_7);
  __pyx_t_7 = 0;
  __Pyx_INCREF(__pyx_kp_u_);
  __pyx_t_5 += 2;
  __Pyx_GIVEREF(__pyx_kp_u_);
  PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_kp_u_);
  __pyx_t_7 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_data), __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 198, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_6;
  __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_4, 5, __pyx_t_7);
  __pyx_t_7 = 0;

  /* "fstlib/cext/pywrapfst.pyx":197
 *   if isinstance(data, str):
 *     return data
 *   raise TypeError(f"Expected {str.__name__} but received "             # <<<<<<<<<<<<<<
 *                   f"{type(data).__name__}: {data!r}")
 * 
 */
  __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_4, 6, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 197, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 197, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __PYX_ERR(0, 197, __pyx_L1_error)

  /* "fstlib/cext/pywrapfst.pyx":176
 * 
 * 
 * cdef string tostring(data) except *:             # <<<<<<<<<<<<<<
 *   """Converts strings to bytestrings.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.tostring", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":201
 * 
 * 
 * cdef string weight_tostring(data) except *:             # <<<<<<<<<<<<<<
 *   """Converts strings or numerics to bytestrings.
 * 
 */

static std::string __pyx_f_6fstlib_4cext_9pywrapfst_weight_tostring(PyObject *__pyx_v_data) {
  std::string __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  std::string __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  Py_UCS4 __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("weight_tostring", 0);

  /* "fstlib/cext/pywrapfst.pyx":223
 *   """
 *   # A Python string can be implicitly cast to a C++ string.
 *   if isinstance(data, str):             # <<<<<<<<<<<<<<
 *     return data
 *   elif isinstance(data, numbers.Number):
 */
  __pyx_t_1 = PyUnicode_Check(__pyx_v_data); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "fstlib/cext/pywrapfst.pyx":224
 *   # A Python string can be implicitly cast to a C++ string.
 *   if isinstance(data, str):
 *     return data             # <<<<<<<<<<<<<<
 *   elif isinstance(data, numbers.Number):
 *     return str(data)
 */
    __pyx_t_3 = __pyx_convert_string_from_py_std__in_string(__pyx_v_data); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 224, __pyx_L1_error)
    __pyx_r = __pyx_t_3;
    goto __pyx_L0;

    /* "fstlib/cext/pywrapfst.pyx":223
 *   """
 *   # A Python string can be implicitly cast to a C++ string.
 *   if isinstance(data, str):             # <<<<<<<<<<<<<<
 *     return data
 *   elif isinstance(data, numbers.Number):
 */
  }

  /* "fstlib/cext/pywrapfst.pyx":225
 *   if isinstance(data, str):
 *     return data
 *   elif isinstance(data, numbers.Number):             # <<<<<<<<<<<<<<
 *     return str(data)
 *   raise TypeError(f"Expected {str.__name__} but received "
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_numbers); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 225, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_Number); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 225, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_2 = PyObject_IsInstance(__pyx_v_data, __pyx_t_5); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 225, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "fstlib/cext/pywrapfst.pyx":226
 *     return data
 *   elif isinstance(data, numbers.Number):
 *     return str(data)             # <<<<<<<<<<<<<<
 *   raise TypeError(f"Expected {str.__name__} but received "
 *                   f"{type(data).__name__}: {data!r}")
 */
    __pyx_t_5 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_data); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 226, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = __pyx_convert_string_from_py_std__in_string(__pyx_t_5); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 226, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_r = __pyx_t_3;
    goto __pyx_L0;

    /* "fstlib/cext/pywrapfst.pyx":225
 *   if isinstance(data, str):
 *     return data
 *   elif isinstance(data, numbers.Number):             # <<<<<<<<<<<<<<
 *     return str(data)
 *   raise TypeError(f"Expected {str.__name__} but received "
 */
  }

  /* "fstlib/cext/pywrapfst.pyx":227
 *   elif isinstance(data, numbers.Number):
 *     return str(data)
 *   raise TypeError(f"Expected {str.__name__} but received "             # <<<<<<<<<<<<<<
 *                   f"{type(data).__name__}: {data!r}")
 * 
 */
  __pyx_t_5 = PyTuple_New(6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 227, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = 0;
  __pyx_t_7 = 127;
  __Pyx_INCREF(__pyx_kp_u_Expected);
  __pyx_t_6 += 9;
  __Pyx_GIVEREF(__pyx_kp_u_Expected);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_u_Expected);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)(&PyUnicode_Type)), __pyx_n_s_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 227, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 227, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) : __pyx_t_7;
  __pyx_t_6 += __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_but_received);
  __pyx_t_6 += 14;
  __Pyx_GIVEREF(__pyx_kp_u_but_received);
  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_kp_u_but_received);

  /* "fstlib/cext/pywrapfst.pyx":228
 *     return str(data)
 *   raise TypeError(f"Expected {str.__name__} but received "
 *                   f"{type(data).__name__}: {data!r}")             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_data)), __pyx_n_s_name); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 228, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_t_8, __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 228, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_7;
  __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
  __pyx_t_4 = 0;
  __Pyx_INCREF(__pyx_kp_u_);
  __pyx_t_6 += 2;
  __Pyx_GIVEREF(__pyx_kp_u_);
  PyTuple_SET_ITEM(__pyx_t_5, 4, __pyx_kp_u_);
  __pyx_t_4 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_data), __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 228, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_7;
  __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_5, 5, __pyx_t_4);
  __pyx_t_4 = 0;

  /* "fstlib/cext/pywrapfst.pyx":227
 *   elif isinstance(data, numbers.Number):
 *     return str(data)
 *   raise TypeError(f"Expected {str.__name__} but received "             # <<<<<<<<<<<<<<
 *                   f"{type(data).__name__}: {data!r}")
 * 
 */
  __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_5, 6, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 227, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 227, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_Raise(__pyx_t_5, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __PYX_ERR(0, 227, __pyx_L1_error)

  /* "fstlib/cext/pywrapfst.pyx":201
 * 
 * 
 * cdef string weight_tostring(data) except *:             # <<<<<<<<<<<<<<
 *   """Converts strings or numerics to bytestrings.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.weight_tostring", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":231
 * 
 * 
 * cdef string path_tostring(data) except *:             # <<<<<<<<<<<<<<
 *   return tostring(os.fspath(data))
 * 
 */

static std::string __pyx_f_6fstlib_4cext_9pywrapfst_path_tostring(PyObject *__pyx_v_data) {
  std::string __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  std::string __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("path_tostring", 0);

  /* "fstlib/cext/pywrapfst.pyx":232
 * 
 * cdef string path_tostring(data) except *:
 *   return tostring(os.fspath(data))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 232, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_fspath); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 232, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_v_data) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_data);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 232, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_4 = __pyx_f_6fstlib_4cext_9pywrapfst_tostring(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 232, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_4;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":231
 * 
 * 
 * cdef string path_tostring(data) except *:             # <<<<<<<<<<<<<<
 *   return tostring(os.fspath(data))
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.path_tostring", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":235
 * 
 * 
 * cdef fst.FarType _get_far_type(const string &far_type) except *:             # <<<<<<<<<<<<<<
 *   """Matches string with the appropriate FarType enum value.
 * 
 */

static fst::FarType __pyx_f_6fstlib_4cext_9pywrapfst__get_far_type(std::string const &__pyx_v_far_type) {
  fst::FarType __pyx_v__far_type;
  fst::FarType __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_far_type", 0);

  /* "fstlib/cext/pywrapfst.pyx":251
 *   """
 *   cdef fst.FarType _far_type
 *   if not fst.GetFarType(far_type, addr(_far_type)):             # <<<<<<<<<<<<<<
 *     raise FstArgError(f"Unknown FAR type: {far_type!r}")
 *   return _far_type
 */
  __pyx_t_1 = ((!(fst::script::GetFarType(__pyx_v_far_type, (&__pyx_v__far_type)) != 0)) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "fstlib/cext/pywrapfst.pyx":252
 *   cdef fst.FarType _far_type
 *   if not fst.GetFarType(far_type, addr(_far_type)):
 *     raise FstArgError(f"Unknown FAR type: {far_type!r}")             # <<<<<<<<<<<<<<
 *   return _far_type
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstArgError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 252, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_v_far_type); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 252, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_4), __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 252, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Unknown_FAR_type, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 252, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 252, __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(0, 252, __pyx_L1_error)

    /* "fstlib/cext/pywrapfst.pyx":251
 *   """
 *   cdef fst.FarType _far_type
 *   if not fst.GetFarType(far_type, addr(_far_type)):             # <<<<<<<<<<<<<<
 *     raise FstArgError(f"Unknown FAR type: {far_type!r}")
 *   return _far_type
 */
  }

  /* "fstlib/cext/pywrapfst.pyx":253
 *   if not fst.GetFarType(far_type, addr(_far_type)):
 *     raise FstArgError(f"Unknown FAR type: {far_type!r}")
 *   return _far_type             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v__far_type;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":235
 * 
 * 
 * cdef fst.FarType _get_far_type(const string &far_type) except *:             # <<<<<<<<<<<<<<
 *   """Matches string with the appropriate FarType enum value.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst._get_far_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = (fst::FarType) 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":256
 * 
 * 
 * cdef fst.ComposeFilter _get_compose_filter(             # <<<<<<<<<<<<<<
 *     const string &compose_filter) except *:
 *   """Matches string with the appropriate ComposeFilter enum value.
 */

static enum fst::ComposeFilter __pyx_f_6fstlib_4cext_9pywrapfst__get_compose_filter(std::string const &__pyx_v_compose_filter) {
  enum fst::ComposeFilter __pyx_v__compose_filter;
  enum fst::ComposeFilter __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_compose_filter", 0);

  /* "fstlib/cext/pywrapfst.pyx":278
 *   """
 *   cdef fst.ComposeFilter _compose_filter
 *   if not fst.GetComposeFilter(compose_filter, addr(_compose_filter)):             # <<<<<<<<<<<<<<
 *     raise FstArgError(f"Unknown compose filter type: {compose_filter!r}")
 *   return _compose_filter
 */
  __pyx_t_1 = ((!(fst::script::GetComposeFilter(__pyx_v_compose_filter, (&__pyx_v__compose_filter)) != 0)) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "fstlib/cext/pywrapfst.pyx":279
 *   cdef fst.ComposeFilter _compose_filter
 *   if not fst.GetComposeFilter(compose_filter, addr(_compose_filter)):
 *     raise FstArgError(f"Unknown compose filter type: {compose_filter!r}")             # <<<<<<<<<<<<<<
 *   return _compose_filter
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstArgError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 279, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_v_compose_filter); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 279, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_4), __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 279, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Unknown_compose_filter_type, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 279, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 279, __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(0, 279, __pyx_L1_error)

    /* "fstlib/cext/pywrapfst.pyx":278
 *   """
 *   cdef fst.ComposeFilter _compose_filter
 *   if not fst.GetComposeFilter(compose_filter, addr(_compose_filter)):             # <<<<<<<<<<<<<<
 *     raise FstArgError(f"Unknown compose filter type: {compose_filter!r}")
 *   return _compose_filter
 */
  }

  /* "fstlib/cext/pywrapfst.pyx":280
 *   if not fst.GetComposeFilter(compose_filter, addr(_compose_filter)):
 *     raise FstArgError(f"Unknown compose filter type: {compose_filter!r}")
 *   return _compose_filter             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v__compose_filter;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":256
 * 
 * 
 * cdef fst.ComposeFilter _get_compose_filter(             # <<<<<<<<<<<<<<
 *     const string &compose_filter) except *:
 *   """Matches string with the appropriate ComposeFilter enum value.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst._get_compose_filter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = (enum fst::ComposeFilter) 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":283
 * 
 * 
 * cdef fst.DeterminizeType _get_determinize_type(const string &det_type) except *:             # <<<<<<<<<<<<<<
 *   """Matches string with the appropriate DeterminizeType enum value.
 * 
 */

static enum fst::DeterminizeType __pyx_f_6fstlib_4cext_9pywrapfst__get_determinize_type(std::string const &__pyx_v_det_type) {
  enum fst::DeterminizeType __pyx_v__det_type;
  enum fst::DeterminizeType __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_determinize_type", 0);

  /* "fstlib/cext/pywrapfst.pyx":299
 *   """
 *   cdef fst.DeterminizeType _det_type
 *   if not fst.GetDeterminizeType(det_type, addr(_det_type)):             # <<<<<<<<<<<<<<
 *     raise FstArgError(f"Unknown determinization type: {det_type!r}")
 *   return _det_type
 */
  __pyx_t_1 = ((!(fst::script::GetDeterminizeType(__pyx_v_det_type, (&__pyx_v__det_type)) != 0)) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "fstlib/cext/pywrapfst.pyx":300
 *   cdef fst.DeterminizeType _det_type
 *   if not fst.GetDeterminizeType(det_type, addr(_det_type)):
 *     raise FstArgError(f"Unknown determinization type: {det_type!r}")             # <<<<<<<<<<<<<<
 *   return _det_type
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstArgError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 300, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_v_det_type); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 300, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_4), __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 300, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Unknown_determinization_type, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 300, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 300, __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(0, 300, __pyx_L1_error)

    /* "fstlib/cext/pywrapfst.pyx":299
 *   """
 *   cdef fst.DeterminizeType _det_type
 *   if not fst.GetDeterminizeType(det_type, addr(_det_type)):             # <<<<<<<<<<<<<<
 *     raise FstArgError(f"Unknown determinization type: {det_type!r}")
 *   return _det_type
 */
  }

  /* "fstlib/cext/pywrapfst.pyx":301
 *   if not fst.GetDeterminizeType(det_type, addr(_det_type)):
 *     raise FstArgError(f"Unknown determinization type: {det_type!r}")
 *   return _det_type             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v__det_type;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":283
 * 
 * 
 * cdef fst.DeterminizeType _get_determinize_type(const string &det_type) except *:             # <<<<<<<<<<<<<<
 *   """Matches string with the appropriate DeterminizeType enum value.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst._get_determinize_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = (enum fst::DeterminizeType) 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":304
 * 
 * 
 * cdef fst.ProjectType _get_project_type(const string &project_type) except *:             # <<<<<<<<<<<<<<
 *   """Matches string with the appropriate ProjectType enum value.
 * 
 */

static fst::ProjectType __pyx_f_6fstlib_4cext_9pywrapfst__get_project_type(std::string const &__pyx_v_project_type) {
  fst::ProjectType __pyx_v__project_type;
  fst::ProjectType __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_project_type", 0);

  /* "fstlib/cext/pywrapfst.pyx":320
 *   """
 *   cdef fst.ProjectType _project_type
 *   if not fst.GetProjectType(project_type, addr(_project_type)):             # <<<<<<<<<<<<<<
 *     raise FstArgError(f"Unknown projection type: {project_type!r}")
 *   return _project_type
 */
  __pyx_t_1 = ((!(fst::script::GetProjectType(__pyx_v_project_type, (&__pyx_v__project_type)) != 0)) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "fstlib/cext/pywrapfst.pyx":321
 *   cdef fst.ProjectType _project_type
 *   if not fst.GetProjectType(project_type, addr(_project_type)):
 *     raise FstArgError(f"Unknown projection type: {project_type!r}")             # <<<<<<<<<<<<<<
 *   return _project_type
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstArgError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 321, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_v_project_type); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 321, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_4), __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 321, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Unknown_projection_type, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 321, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 321, __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(0, 321, __pyx_L1_error)

    /* "fstlib/cext/pywrapfst.pyx":320
 *   """
 *   cdef fst.ProjectType _project_type
 *   if not fst.GetProjectType(project_type, addr(_project_type)):             # <<<<<<<<<<<<<<
 *     raise FstArgError(f"Unknown projection type: {project_type!r}")
 *   return _project_type
 */
  }

  /* "fstlib/cext/pywrapfst.pyx":322
 *   if not fst.GetProjectType(project_type, addr(_project_type)):
 *     raise FstArgError(f"Unknown projection type: {project_type!r}")
 *   return _project_type             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v__project_type;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":304
 * 
 * 
 * cdef fst.ProjectType _get_project_type(const string &project_type) except *:             # <<<<<<<<<<<<<<
 *   """Matches string with the appropriate ProjectType enum value.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst._get_project_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = (fst::ProjectType) 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":325
 * 
 * 
 * cdef fst.QueueType _get_queue_type(const string &queue_type) except *:             # <<<<<<<<<<<<<<
 *   """Matches string with the appropriate QueueType enum value.
 * 
 */

static enum fst::QueueType __pyx_f_6fstlib_4cext_9pywrapfst__get_queue_type(std::string const &__pyx_v_queue_type) {
  enum fst::QueueType __pyx_v__queue_type;
  enum fst::QueueType __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_queue_type", 0);

  /* "fstlib/cext/pywrapfst.pyx":344
 *   """
 *   cdef fst.QueueType _queue_type
 *   if not fst.GetQueueType(queue_type, addr(_queue_type)):             # <<<<<<<<<<<<<<
 *     raise FstArgError(f"Unknown queue type: {queue_type!r}")
 *   return _queue_type
 */
  __pyx_t_1 = ((!(fst::script::GetQueueType(__pyx_v_queue_type, (&__pyx_v__queue_type)) != 0)) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "fstlib/cext/pywrapfst.pyx":345
 *   cdef fst.QueueType _queue_type
 *   if not fst.GetQueueType(queue_type, addr(_queue_type)):
 *     raise FstArgError(f"Unknown queue type: {queue_type!r}")             # <<<<<<<<<<<<<<
 *   return _queue_type
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstArgError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 345, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_v_queue_type); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 345, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_4), __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 345, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Unknown_queue_type, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 345, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 345, __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(0, 345, __pyx_L1_error)

    /* "fstlib/cext/pywrapfst.pyx":344
 *   """
 *   cdef fst.QueueType _queue_type
 *   if not fst.GetQueueType(queue_type, addr(_queue_type)):             # <<<<<<<<<<<<<<
 *     raise FstArgError(f"Unknown queue type: {queue_type!r}")
 *   return _queue_type
 */
  }

  /* "fstlib/cext/pywrapfst.pyx":346
 *   if not fst.GetQueueType(queue_type, addr(_queue_type)):
 *     raise FstArgError(f"Unknown queue type: {queue_type!r}")
 *   return _queue_type             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v__queue_type;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":325
 * 
 * 
 * cdef fst.QueueType _get_queue_type(const string &queue_type) except *:             # <<<<<<<<<<<<<<
 *   """Matches string with the appropriate QueueType enum value.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst._get_queue_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = (enum fst::QueueType) 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":349
 * 
 * 
 * cdef fst.RandArcSelection _get_rand_arc_selection(             # <<<<<<<<<<<<<<
 *     const string &select) except *:
 *   """Matches string with the appropriate RandArcSelection enum value.
 */

static fst::script::RandArcSelection __pyx_f_6fstlib_4cext_9pywrapfst__get_rand_arc_selection(std::string const &__pyx_v_select) {
  fst::script::RandArcSelection __pyx_v__select;
  fst::script::RandArcSelection __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_rand_arc_selection", 0);

  /* "fstlib/cext/pywrapfst.pyx":369
 *   """
 *   cdef fst.RandArcSelection _select
 *   if not fst.GetRandArcSelection(select, addr(_select)):             # <<<<<<<<<<<<<<
 *     raise FstArgError(f"Unknown random arc selection type: {select!r}")
 *   return _select
 */
  __pyx_t_1 = ((!(fst::script::GetRandArcSelection(__pyx_v_select, (&__pyx_v__select)) != 0)) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "fstlib/cext/pywrapfst.pyx":370
 *   cdef fst.RandArcSelection _select
 *   if not fst.GetRandArcSelection(select, addr(_select)):
 *     raise FstArgError(f"Unknown random arc selection type: {select!r}")             # <<<<<<<<<<<<<<
 *   return _select
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstArgError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 370, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_v_select); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 370, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_4), __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 370, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Unknown_random_arc_selection_typ, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 370, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 370, __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(0, 370, __pyx_L1_error)

    /* "fstlib/cext/pywrapfst.pyx":369
 *   """
 *   cdef fst.RandArcSelection _select
 *   if not fst.GetRandArcSelection(select, addr(_select)):             # <<<<<<<<<<<<<<
 *     raise FstArgError(f"Unknown random arc selection type: {select!r}")
 *   return _select
 */
  }

  /* "fstlib/cext/pywrapfst.pyx":371
 *   if not fst.GetRandArcSelection(select, addr(_select)):
 *     raise FstArgError(f"Unknown random arc selection type: {select!r}")
 *   return _select             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v__select;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":349
 * 
 * 
 * cdef fst.RandArcSelection _get_rand_arc_selection(             # <<<<<<<<<<<<<<
 *     const string &select) except *:
 *   """Matches string with the appropriate RandArcSelection enum value.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst._get_rand_arc_selection", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = (fst::script::RandArcSelection) 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":374
 * 
 * 
 * cdef fst.ReplaceLabelType _get_replace_label_type(             # <<<<<<<<<<<<<<
 *     const string &replace_label_type, bool epsilon_on_replace) except *:
 *   """Matches string with the appropriate ReplaceLabelType enum value.
 */

static enum fst::ReplaceLabelType __pyx_f_6fstlib_4cext_9pywrapfst__get_replace_label_type(std::string const &__pyx_v_replace_label_type, bool __pyx_v_epsilon_on_replace) {
  enum fst::ReplaceLabelType __pyx_v__replace_label_type;
  enum fst::ReplaceLabelType __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_replace_label_type", 0);

  /* "fstlib/cext/pywrapfst.pyx":395
 *   """
 *   cdef fst.ReplaceLabelType _replace_label_type
 *   if not fst.GetReplaceLabelType(replace_label_type,             # <<<<<<<<<<<<<<
 *                                  epsilon_on_replace,
 *                                  addr(_replace_label_type)):
 */
  __pyx_t_1 = ((!(fst::script::GetReplaceLabelType(__pyx_v_replace_label_type, __pyx_v_epsilon_on_replace, (&__pyx_v__replace_label_type)) != 0)) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "fstlib/cext/pywrapfst.pyx":398
 *                                  epsilon_on_replace,
 *                                  addr(_replace_label_type)):
 *     raise FstArgError(f"Unknown replace label type: {replace_label_type!r}")             # <<<<<<<<<<<<<<
 *   return _replace_label_type
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstArgError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 398, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_v_replace_label_type); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 398, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_4), __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 398, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Unknown_replace_label_type, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 398, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 398, __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(0, 398, __pyx_L1_error)

    /* "fstlib/cext/pywrapfst.pyx":395
 *   """
 *   cdef fst.ReplaceLabelType _replace_label_type
 *   if not fst.GetReplaceLabelType(replace_label_type,             # <<<<<<<<<<<<<<
 *                                  epsilon_on_replace,
 *                                  addr(_replace_label_type)):
 */
  }

  /* "fstlib/cext/pywrapfst.pyx":399
 *                                  addr(_replace_label_type)):
 *     raise FstArgError(f"Unknown replace label type: {replace_label_type!r}")
 *   return _replace_label_type             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v__replace_label_type;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":374
 * 
 * 
 * cdef fst.ReplaceLabelType _get_replace_label_type(             # <<<<<<<<<<<<<<
 *     const string &replace_label_type, bool epsilon_on_replace) except *:
 *   """Matches string with the appropriate ReplaceLabelType enum value.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst._get_replace_label_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = (enum fst::ReplaceLabelType) 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":425
 *   """
 * 
 *   def __repr__(self):             # <<<<<<<<<<<<<<
 *     return f"<{self.type()} Weight {self.to_string()} at 0x{id(self):x}>"
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_6Weight_1__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_6Weight_1__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_6Weight___repr__(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_6Weight___repr__(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  Py_UCS4 __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "fstlib/cext/pywrapfst.pyx":426
 * 
 *   def __repr__(self):
 *     return f"<{self.type()} Weight {self.to_string()} at 0x{id(self):x}>"             # <<<<<<<<<<<<<<
 * 
 *   def __str__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 426, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = 0;
  __pyx_t_3 = 127;
  __Pyx_INCREF(__pyx_kp_u__2);
  __pyx_t_2 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__2);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u__2);
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "type");
    __PYX_ERR(0, 426, __pyx_L1_error)
  }
  __pyx_t_4 = __pyx_convert_PyUnicode_string_to_py_std__in_string(((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_Weight *)__pyx_v_self->__pyx_vtab)->type(__pyx_v_self, 0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 426, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4);
  __pyx_t_4 = 0;
  __Pyx_INCREF(__pyx_kp_u_Weight);
  __pyx_t_2 += 8;
  __Pyx_GIVEREF(__pyx_kp_u_Weight);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_Weight);
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "to_string");
    __PYX_ERR(0, 426, __pyx_L1_error)
  }
  __pyx_t_4 = __pyx_convert_PyUnicode_string_to_py_std__in_string(((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_Weight *)__pyx_v_self->__pyx_vtab)->to_string(__pyx_v_self, 0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 426, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_4);
  __pyx_t_4 = 0;
  __Pyx_INCREF(__pyx_kp_u_at_0x);
  __pyx_t_2 += 6;
  __Pyx_GIVEREF(__pyx_kp_u_at_0x);
  PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u_at_0x);
  __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 426, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_Format(__pyx_t_4, __pyx_n_u_x); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 426, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_t_5);
  __pyx_t_5 = 0;
  __Pyx_INCREF(__pyx_kp_u__3);
  __pyx_t_2 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__3);
  PyTuple_SET_ITEM(__pyx_t_1, 6, __pyx_kp_u__3);
  __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_1, 7, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 426, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":425
 *   """
 * 
 *   def __repr__(self):             # <<<<<<<<<<<<<<
 *     return f"<{self.type()} Weight {self.to_string()} at 0x{id(self):x}>"
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.Weight.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":428
 *     return f"<{self.type()} Weight {self.to_string()} at 0x{id(self):x}>"
 * 
 *   def __str__(self):             # <<<<<<<<<<<<<<
 *     return self.to_string()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_6Weight_3__str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_6Weight_3__str__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_6Weight_2__str__(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_6Weight_2__str__(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__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("__str__", 0);

  /* "fstlib/cext/pywrapfst.pyx":429
 * 
 *   def __str__(self):
 *     return self.to_string()             # <<<<<<<<<<<<<<
 * 
 *   # This attempts to convert the string form into a float, raising
 */
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "to_string");
    __PYX_ERR(0, 429, __pyx_L1_error)
  }
  __pyx_t_1 = __pyx_convert_PyUnicode_string_to_py_std__in_string(((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_Weight *)__pyx_v_self->__pyx_vtab)->to_string(__pyx_v_self, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 429, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":428
 *     return f"<{self.type()} Weight {self.to_string()} at 0x{id(self):x}>"
 * 
 *   def __str__(self):             # <<<<<<<<<<<<<<
 *     return self.to_string()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.Weight.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":434
 *   # ValueError when that is not appropriate.
 * 
 *   def __float__(self):             # <<<<<<<<<<<<<<
 *     return float(self.to_string())
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_6Weight_5__float__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_6Weight_5__float__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__float__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_6Weight_4__float__(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_6Weight_4__float__(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__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("__float__", 0);

  /* "fstlib/cext/pywrapfst.pyx":435
 * 
 *   def __float__(self):
 *     return float(self.to_string())             # <<<<<<<<<<<<<<
 * 
 *   def __init__(self, weight_type, weight):
 */
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "to_string");
    __PYX_ERR(0, 435, __pyx_L1_error)
  }
  __pyx_t_1 = __pyx_convert_PyUnicode_string_to_py_std__in_string(((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_Weight *)__pyx_v_self->__pyx_vtab)->to_string(__pyx_v_self, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 435, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyNumber_Float(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 435, __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;

  /* "fstlib/cext/pywrapfst.pyx":434
 *   # ValueError when that is not appropriate.
 * 
 *   def __float__(self):             # <<<<<<<<<<<<<<
 *     return float(self.to_string())
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.Weight.__float__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":437
 *     return float(self.to_string())
 * 
 *   def __init__(self, weight_type, weight):             # <<<<<<<<<<<<<<
 *     self._weight.reset(new fst.WeightClass(tostring(weight_type),
 *                                            weight_tostring(weight)))
 */

/* Python wrapper */
static int __pyx_pw_6fstlib_4cext_9pywrapfst_6Weight_7__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_6fstlib_4cext_9pywrapfst_6Weight_7__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_weight_type = 0;
  PyObject *__pyx_v_weight = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_weight_type,&__pyx_n_s_weight,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_weight_type)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_weight)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 437, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 437, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_weight_type = values[0];
    __pyx_v_weight = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 437, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.Weight.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_6Weight_6__init__(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *)__pyx_v_self), __pyx_v_weight_type, __pyx_v_weight);

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

static int __pyx_pf_6fstlib_4cext_9pywrapfst_6Weight_6__init__(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__pyx_v_self, PyObject *__pyx_v_weight_type, PyObject *__pyx_v_weight) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  std::string __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "fstlib/cext/pywrapfst.pyx":438
 * 
 *   def __init__(self, weight_type, weight):
 *     self._weight.reset(new fst.WeightClass(tostring(weight_type),             # <<<<<<<<<<<<<<
 *                                            weight_tostring(weight)))
 *     self._check_weight()
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_weight");
    __PYX_ERR(0, 438, __pyx_L1_error)
  }
  __pyx_t_1 = __pyx_f_6fstlib_4cext_9pywrapfst_tostring(__pyx_v_weight_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 438, __pyx_L1_error)

  /* "fstlib/cext/pywrapfst.pyx":439
 *   def __init__(self, weight_type, weight):
 *     self._weight.reset(new fst.WeightClass(tostring(weight_type),
 *                                            weight_tostring(weight)))             # <<<<<<<<<<<<<<
 *     self._check_weight()
 * 
 */
  __pyx_t_2 = __pyx_f_6fstlib_4cext_9pywrapfst_weight_tostring(__pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 439, __pyx_L1_error)

  /* "fstlib/cext/pywrapfst.pyx":438
 * 
 *   def __init__(self, weight_type, weight):
 *     self._weight.reset(new fst.WeightClass(tostring(weight_type),             # <<<<<<<<<<<<<<
 *                                            weight_tostring(weight)))
 *     self._check_weight()
 */
  __pyx_v_self->_weight.reset(new fst::script::WeightClass(__pyx_t_1, __pyx_t_2));

  /* "fstlib/cext/pywrapfst.pyx":440
 *     self._weight.reset(new fst.WeightClass(tostring(weight_type),
 *                                            weight_tostring(weight)))
 *     self._check_weight()             # <<<<<<<<<<<<<<
 * 
 *   cdef void _check_weight(self) except *:
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_check_weight");
    __PYX_ERR(0, 440, __pyx_L1_error)
  }
  ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_Weight *)__pyx_v_self->__pyx_vtab)->_check_weight(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 440, __pyx_L1_error)

  /* "fstlib/cext/pywrapfst.pyx":437
 *     return float(self.to_string())
 * 
 *   def __init__(self, weight_type, weight):             # <<<<<<<<<<<<<<
 *     self._weight.reset(new fst.WeightClass(tostring(weight_type),
 *                                            weight_tostring(weight)))
 */

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

/* "fstlib/cext/pywrapfst.pyx":442
 *     self._check_weight()
 * 
 *   cdef void _check_weight(self) except *:             # <<<<<<<<<<<<<<
 *     if self.type() == b"none":
 *       raise FstArgError("Weight type not found")
 */

static void __pyx_f_6fstlib_4cext_9pywrapfst_6Weight__check_weight(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  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("_check_weight", 0);

  /* "fstlib/cext/pywrapfst.pyx":443
 * 
 *   cdef void _check_weight(self) except *:
 *     if self.type() == b"none":             # <<<<<<<<<<<<<<
 *       raise FstArgError("Weight type not found")
 *     if not self.member():
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "type");
    __PYX_ERR(0, 443, __pyx_L1_error)
  }
  __pyx_t_1 = ((((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_Weight *)__pyx_v_self->__pyx_vtab)->type(__pyx_v_self, 0) == ((char const *)"none")) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "fstlib/cext/pywrapfst.pyx":444
 *   cdef void _check_weight(self) except *:
 *     if self.type() == b"none":
 *       raise FstArgError("Weight type not found")             # <<<<<<<<<<<<<<
 *     if not self.member():
 *       raise FstBadWeightError("Invalid weight")
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstArgError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 444, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_kp_u_Weight_type_not_found) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_u_Weight_type_not_found);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 444, __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(0, 444, __pyx_L1_error)

    /* "fstlib/cext/pywrapfst.pyx":443
 * 
 *   cdef void _check_weight(self) except *:
 *     if self.type() == b"none":             # <<<<<<<<<<<<<<
 *       raise FstArgError("Weight type not found")
 *     if not self.member():
 */
  }

  /* "fstlib/cext/pywrapfst.pyx":445
 *     if self.type() == b"none":
 *       raise FstArgError("Weight type not found")
 *     if not self.member():             # <<<<<<<<<<<<<<
 *       raise FstBadWeightError("Invalid weight")
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "member");
    __PYX_ERR(0, 445, __pyx_L1_error)
  }
  __pyx_t_1 = ((!(((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_Weight *)__pyx_v_self->__pyx_vtab)->member(__pyx_v_self, 0) != 0)) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "fstlib/cext/pywrapfst.pyx":446
 *       raise FstArgError("Weight type not found")
 *     if not self.member():
 *       raise FstBadWeightError("Invalid weight")             # <<<<<<<<<<<<<<
 * 
 *   cpdef Weight copy(self):
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstBadWeightError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 446, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_kp_u_Invalid_weight) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_u_Invalid_weight);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 446, __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(0, 446, __pyx_L1_error)

    /* "fstlib/cext/pywrapfst.pyx":445
 *     if self.type() == b"none":
 *       raise FstArgError("Weight type not found")
 *     if not self.member():             # <<<<<<<<<<<<<<
 *       raise FstBadWeightError("Invalid weight")
 * 
 */
  }

  /* "fstlib/cext/pywrapfst.pyx":442
 *     self._check_weight()
 * 
 *   cdef void _check_weight(self) except *:             # <<<<<<<<<<<<<<
 *     if self.type() == b"none":
 *       raise FstArgError("Weight type not found")
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.Weight._check_weight", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "fstlib/cext/pywrapfst.pyx":448
 *       raise FstBadWeightError("Invalid weight")
 * 
 *   cpdef Weight copy(self):             # <<<<<<<<<<<<<<
 *     """
 *     copy(self)
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_6Weight_9copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__pyx_f_6fstlib_4cext_9pywrapfst_6Weight_copy(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__pyx_v_self, int __pyx_skip_dispatch) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__pyx_v__weight = 0;
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__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("copy", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_copy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 448, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6fstlib_4cext_9pywrapfst_6Weight_9copy)) {
        __Pyx_XDECREF(((PyObject *)__pyx_r));
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 448, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_6fstlib_4cext_9pywrapfst_Weight))))) __PYX_ERR(0, 448, __pyx_L1_error)
        __pyx_r = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "fstlib/cext/pywrapfst.pyx":454
 *     Returns a copy of the Weight.
 *     """
 *     cdef Weight _weight = Weight.__new__(Weight)             # <<<<<<<<<<<<<<
 *     _weight._weight.reset(new fst.WeightClass(deref(self._weight)))
 *     return _weight
 */
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_6fstlib_4cext_9pywrapfst_Weight(((PyTypeObject *)__pyx_ptype_6fstlib_4cext_9pywrapfst_Weight), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 454, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v__weight = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "fstlib/cext/pywrapfst.pyx":455
 *     """
 *     cdef Weight _weight = Weight.__new__(Weight)
 *     _weight._weight.reset(new fst.WeightClass(deref(self._weight)))             # <<<<<<<<<<<<<<
 *     return _weight
 * 
 */
  if (unlikely(((PyObject *)__pyx_v__weight) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_weight");
    __PYX_ERR(0, 455, __pyx_L1_error)
  }
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_weight");
    __PYX_ERR(0, 455, __pyx_L1_error)
  }
  __pyx_v__weight->_weight.reset(new fst::script::WeightClass((*__pyx_v_self->_weight)));

  /* "fstlib/cext/pywrapfst.pyx":456
 *     cdef Weight _weight = Weight.__new__(Weight)
 *     _weight._weight.reset(new fst.WeightClass(deref(self._weight)))
 *     return _weight             # <<<<<<<<<<<<<<
 * 
 *   # To get around the inability to declare cdef class methods, we define the
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v__weight));
  __pyx_r = __pyx_v__weight;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":448
 *       raise FstBadWeightError("Invalid weight")
 * 
 *   cpdef Weight copy(self):             # <<<<<<<<<<<<<<
 *     """
 *     copy(self)
 */

  /* 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("fstlib.cext.pywrapfst.Weight.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v__weight);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_6Weight_9copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_6Weight_8copy[] = "\n    copy(self)\n\n    Returns a copy of the Weight.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_6Weight_9copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("copy (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_6Weight_8copy(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_6Weight_8copy(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__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("copy", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_6fstlib_4cext_9pywrapfst_6Weight_copy(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 448, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.Weight.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":462
 * 
 *   @classmethod
 *   def zero(cls, weight_type):             # <<<<<<<<<<<<<<
 *     """
 *     Weight.zero(weight_type)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_6Weight_11zero(PyObject *__pyx_v_cls, PyObject *__pyx_v_weight_type); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_6Weight_10zero[] = "\n    Weight.zero(weight_type)\n\n    Constructs semiring zero.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_6Weight_11zero(PyObject *__pyx_v_cls, PyObject *__pyx_v_weight_type) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("zero (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_6Weight_10zero(((PyTypeObject*)__pyx_v_cls), ((PyObject *)__pyx_v_weight_type));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_6Weight_10zero(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_weight_type) {
  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("zero", 0);

  /* "fstlib/cext/pywrapfst.pyx":468
 *     Constructs semiring zero.
 *     """
 *     return _zero(weight_type)             # <<<<<<<<<<<<<<
 * 
 *   @classmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_6fstlib_4cext_9pywrapfst__zero(__pyx_v_weight_type)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":462
 * 
 *   @classmethod
 *   def zero(cls, weight_type):             # <<<<<<<<<<<<<<
 *     """
 *     Weight.zero(weight_type)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.Weight.zero", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":471
 * 
 *   @classmethod
 *   def one(cls, weight_type):             # <<<<<<<<<<<<<<
 *     """
 *     Weight.one(weight_type)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_6Weight_13one(PyObject *__pyx_v_cls, PyObject *__pyx_v_weight_type); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_6Weight_12one[] = "\n    Weight.one(weight_type)\n\n    Constructs semiring One.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_6Weight_13one(PyObject *__pyx_v_cls, PyObject *__pyx_v_weight_type) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("one (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_6Weight_12one(((PyTypeObject*)__pyx_v_cls), ((PyObject *)__pyx_v_weight_type));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_6Weight_12one(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_weight_type) {
  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("one", 0);

  /* "fstlib/cext/pywrapfst.pyx":477
 *     Constructs semiring One.
 *     """
 *     return _one(weight_type)             # <<<<<<<<<<<<<<
 * 
 *   @classmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_6fstlib_4cext_9pywrapfst__one(__pyx_v_weight_type)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 477, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":471
 * 
 *   @classmethod
 *   def one(cls, weight_type):             # <<<<<<<<<<<<<<
 *     """
 *     Weight.one(weight_type)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.Weight.one", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":480
 * 
 *   @classmethod
 *   def no_weight(cls, weight_type):             # <<<<<<<<<<<<<<
 *     """
 *     Weight.no_weight(weight_type)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_6Weight_15no_weight(PyObject *__pyx_v_cls, PyObject *__pyx_v_weight_type); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_6Weight_14no_weight[] = "\n    Weight.no_weight(weight_type)\n\n    Constructs a non-member weight in the semiring.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_6Weight_15no_weight(PyObject *__pyx_v_cls, PyObject *__pyx_v_weight_type) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("no_weight (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_6Weight_14no_weight(((PyTypeObject*)__pyx_v_cls), ((PyObject *)__pyx_v_weight_type));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_6Weight_14no_weight(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_weight_type) {
  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("no_weight", 0);

  /* "fstlib/cext/pywrapfst.pyx":486
 *     Constructs a non-member weight in the semiring.
 *     """
 *     return _no_weight(weight_type)             # <<<<<<<<<<<<<<
 * 
 *   def __eq__(Weight w1, Weight w2):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_6fstlib_4cext_9pywrapfst__no_weight(__pyx_v_weight_type)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 486, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":480
 * 
 *   @classmethod
 *   def no_weight(cls, weight_type):             # <<<<<<<<<<<<<<
 *     """
 *     Weight.no_weight(weight_type)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.Weight.no_weight", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":488
 *     return _no_weight(weight_type)
 * 
 *   def __eq__(Weight w1, Weight w2):             # <<<<<<<<<<<<<<
 *     return fst.Eq(deref(w1._weight), deref(w2._weight))
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_6Weight_17__eq__(PyObject *__pyx_v_w1, PyObject *__pyx_v_w2); /*proto*/
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_6Weight_17__eq__(PyObject *__pyx_v_w1, PyObject *__pyx_v_w2) {
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__eq__ (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_w2), __pyx_ptype_6fstlib_4cext_9pywrapfst_Weight, 1, "w2", 0))) __PYX_ERR(0, 488, __pyx_L1_error)
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_6Weight_16__eq__(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *)__pyx_v_w1), ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *)__pyx_v_w2));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_6Weight_16__eq__(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__pyx_v_w1, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__pyx_v_w2) {
  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("__eq__", 0);

  /* "fstlib/cext/pywrapfst.pyx":489
 * 
 *   def __eq__(Weight w1, Weight w2):
 *     return fst.Eq(deref(w1._weight), deref(w2._weight))             # <<<<<<<<<<<<<<
 * 
 *   def __ne__(Weight w1, Weight w2):
 */
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(((PyObject *)__pyx_v_w1) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_weight");
    __PYX_ERR(0, 489, __pyx_L1_error)
  }
  if (unlikely(((PyObject *)__pyx_v_w2) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_weight");
    __PYX_ERR(0, 489, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_PyBool_FromLong(operator==((*__pyx_v_w1->_weight), (*__pyx_v_w2->_weight))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 489, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":488
 *     return _no_weight(weight_type)
 * 
 *   def __eq__(Weight w1, Weight w2):             # <<<<<<<<<<<<<<
 *     return fst.Eq(deref(w1._weight), deref(w2._weight))
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.Weight.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":491
 *     return fst.Eq(deref(w1._weight), deref(w2._weight))
 * 
 *   def __ne__(Weight w1, Weight w2):             # <<<<<<<<<<<<<<
 *     return not w1 == w2
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_6Weight_19__ne__(PyObject *__pyx_v_w1, PyObject *__pyx_v_w2); /*proto*/
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_6Weight_19__ne__(PyObject *__pyx_v_w1, PyObject *__pyx_v_w2) {
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__ne__ (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_w2), __pyx_ptype_6fstlib_4cext_9pywrapfst_Weight, 1, "w2", 0))) __PYX_ERR(0, 491, __pyx_L1_error)
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_6Weight_18__ne__(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *)__pyx_v_w1), ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *)__pyx_v_w2));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_6Weight_18__ne__(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__pyx_v_w1, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__pyx_v_w2) {
  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("__ne__", 0);

  /* "fstlib/cext/pywrapfst.pyx":492
 * 
 *   def __ne__(Weight w1, Weight w2):
 *     return not w1 == w2             # <<<<<<<<<<<<<<
 * 
 *   cpdef string to_string(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_RichCompare(((PyObject *)__pyx_v_w1), ((PyObject *)__pyx_v_w2), Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 492, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 492, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyBool_FromLong((!__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 492, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":491
 *     return fst.Eq(deref(w1._weight), deref(w2._weight))
 * 
 *   def __ne__(Weight w1, Weight w2):             # <<<<<<<<<<<<<<
 *     return not w1 == w2
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.Weight.__ne__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":494
 *     return not w1 == w2
 * 
 *   cpdef string to_string(self):             # <<<<<<<<<<<<<<
 *     return self._weight.get().ToString()
 * 
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_6Weight_21to_string(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static std::string __pyx_f_6fstlib_4cext_9pywrapfst_6Weight_to_string(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__pyx_v_self, int __pyx_skip_dispatch) {
  std::string __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  std::string __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_string", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_to_string); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 494, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6fstlib_4cext_9pywrapfst_6Weight_21to_string)) {
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 494, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 494, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_5;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "fstlib/cext/pywrapfst.pyx":495
 * 
 *   cpdef string to_string(self):
 *     return self._weight.get().ToString()             # <<<<<<<<<<<<<<
 * 
 *   cpdef string type(self):
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_weight");
    __PYX_ERR(0, 495, __pyx_L1_error)
  }
  __pyx_r = __pyx_v_self->_weight.get()->ToString();
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":494
 *     return not w1 == w2
 * 
 *   cpdef string to_string(self):             # <<<<<<<<<<<<<<
 *     return self._weight.get().ToString()
 * 
 */

  /* 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_WriteUnraisable("fstlib.cext.pywrapfst.Weight.to_string", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_6Weight_21to_string(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_6Weight_21to_string(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_string (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_6Weight_20to_string(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_6Weight_20to_string(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__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("to_string", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_f_6fstlib_4cext_9pywrapfst_6Weight_to_string(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 494, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "fstlib/cext/pywrapfst.pyx":497
 *     return self._weight.get().ToString()
 * 
 *   cpdef string type(self):             # <<<<<<<<<<<<<<
 *     """type(self)
 * 
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_6Weight_23type(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static std::string __pyx_f_6fstlib_4cext_9pywrapfst_6Weight_type(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__pyx_v_self, int __pyx_skip_dispatch) {
  std::string __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  std::string __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("type", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 497, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6fstlib_4cext_9pywrapfst_6Weight_23type)) {
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 497, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 497, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_5;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "fstlib/cext/pywrapfst.pyx":502
 *     Returns a string indicating the weight type.
 *     """
 *     return self._weight.get().Type()             # <<<<<<<<<<<<<<
 * 
 *   cpdef bool member(self):
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_weight");
    __PYX_ERR(0, 502, __pyx_L1_error)
  }
  __pyx_r = __pyx_v_self->_weight.get()->Type();
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":497
 *     return self._weight.get().ToString()
 * 
 *   cpdef string type(self):             # <<<<<<<<<<<<<<
 *     """type(self)
 * 
 */

  /* 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_WriteUnraisable("fstlib.cext.pywrapfst.Weight.type", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_6Weight_23type(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_6Weight_22type[] = "type(self)\n\n    Returns a string indicating the weight type.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_6Weight_23type(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("type (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_6Weight_22type(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_6Weight_22type(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__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("type", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_f_6fstlib_4cext_9pywrapfst_6Weight_type(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 497, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.Weight.type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":504
 *     return self._weight.get().Type()
 * 
 *   cpdef bool member(self):             # <<<<<<<<<<<<<<
 *     return self._weight.get().Member()
 * 
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_6Weight_25member(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static bool __pyx_f_6fstlib_4cext_9pywrapfst_6Weight_member(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__pyx_v_self, int __pyx_skip_dispatch) {
  bool __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  bool __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("member", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_member); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 504, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6fstlib_4cext_9pywrapfst_6Weight_25member)) {
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 504, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 504, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_5;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "fstlib/cext/pywrapfst.pyx":505
 * 
 *   cpdef bool member(self):
 *     return self._weight.get().Member()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_weight");
    __PYX_ERR(0, 505, __pyx_L1_error)
  }
  __pyx_r = __pyx_v_self->_weight.get()->Member();
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":504
 *     return self._weight.get().Type()
 * 
 *   cpdef bool member(self):             # <<<<<<<<<<<<<<
 *     return self._weight.get().Member()
 * 
 */

  /* 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_WriteUnraisable("fstlib.cext.pywrapfst.Weight.member", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_6Weight_25member(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_6Weight_25member(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("member (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_6Weight_24member(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_6Weight_24member(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__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("member", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_6fstlib_4cext_9pywrapfst_6Weight_member(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 504, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.Weight.member", __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._weight cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_6Weight_27__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_6Weight_27__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_6Weight_26__reduce_cython__(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_6Weight_26__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__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("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self._weight cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self._weight cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __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(1, 2, __pyx_L1_error)

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.Weight.__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._weight cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self._weight cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_6Weight_29__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_6Weight_29__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_6Weight_28__setstate_cython__(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_6Weight_28__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__pyx_v_self, CYTHON_UNUSED 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__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self._weight cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self._weight cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __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(1, 4, __pyx_L1_error)

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.Weight.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":508
 * 
 * 
 * cdef Weight _plus(Weight lhs, Weight rhs):             # <<<<<<<<<<<<<<
 *   cdef Weight _weight = Weight.__new__(Weight)
 *   _weight._weight.reset(new fst.WeightClass(fst.Plus(deref(lhs._weight),
 */

static struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__pyx_f_6fstlib_4cext_9pywrapfst__plus(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__pyx_v_lhs, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__pyx_v_rhs) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__pyx_v__weight = 0;
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__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("_plus", 0);

  /* "fstlib/cext/pywrapfst.pyx":509
 * 
 * cdef Weight _plus(Weight lhs, Weight rhs):
 *   cdef Weight _weight = Weight.__new__(Weight)             # <<<<<<<<<<<<<<
 *   _weight._weight.reset(new fst.WeightClass(fst.Plus(deref(lhs._weight),
 *                                                      deref(rhs._weight))))
 */
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_6fstlib_4cext_9pywrapfst_Weight(((PyTypeObject *)__pyx_ptype_6fstlib_4cext_9pywrapfst_Weight), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 509, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v__weight = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "fstlib/cext/pywrapfst.pyx":510
 * cdef Weight _plus(Weight lhs, Weight rhs):
 *   cdef Weight _weight = Weight.__new__(Weight)
 *   _weight._weight.reset(new fst.WeightClass(fst.Plus(deref(lhs._weight),             # <<<<<<<<<<<<<<
 *                                                      deref(rhs._weight))))
 *   return _weight
 */
  if (unlikely(((PyObject *)__pyx_v__weight) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_weight");
    __PYX_ERR(0, 510, __pyx_L1_error)
  }
  if (unlikely(((PyObject *)__pyx_v_lhs) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_weight");
    __PYX_ERR(0, 510, __pyx_L1_error)
  }

  /* "fstlib/cext/pywrapfst.pyx":511
 *   cdef Weight _weight = Weight.__new__(Weight)
 *   _weight._weight.reset(new fst.WeightClass(fst.Plus(deref(lhs._weight),
 *                                                      deref(rhs._weight))))             # <<<<<<<<<<<<<<
 *   return _weight
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_rhs) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_weight");
    __PYX_ERR(0, 511, __pyx_L1_error)
  }

  /* "fstlib/cext/pywrapfst.pyx":510
 * cdef Weight _plus(Weight lhs, Weight rhs):
 *   cdef Weight _weight = Weight.__new__(Weight)
 *   _weight._weight.reset(new fst.WeightClass(fst.Plus(deref(lhs._weight),             # <<<<<<<<<<<<<<
 *                                                      deref(rhs._weight))))
 *   return _weight
 */
  __pyx_v__weight->_weight.reset(new fst::script::WeightClass(fst::script::Plus((*__pyx_v_lhs->_weight), (*__pyx_v_rhs->_weight))));

  /* "fstlib/cext/pywrapfst.pyx":512
 *   _weight._weight.reset(new fst.WeightClass(fst.Plus(deref(lhs._weight),
 *                                                      deref(rhs._weight))))
 *   return _weight             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v__weight));
  __pyx_r = __pyx_v__weight;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":508
 * 
 * 
 * cdef Weight _plus(Weight lhs, Weight rhs):             # <<<<<<<<<<<<<<
 *   cdef Weight _weight = Weight.__new__(Weight)
 *   _weight._weight.reset(new fst.WeightClass(fst.Plus(deref(lhs._weight),
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst._plus", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v__weight);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":515
 * 
 * 
 * def plus(Weight lhs, Weight rhs):             # <<<<<<<<<<<<<<
 *   """
 *   plus(lhs, rhs)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_1plus(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_plus[] = "\n  plus(lhs, rhs)\n\n  Computes the sum of two Weights in the same semiring.\n\n  This function computes lhs \\oplus rhs, raising an exception if lhs and rhs\n  are not in the same semiring.\n\n  Args:\n     lhs: Left-hand side Weight.\n     rhs: Right-hand side Weight.\n\n  Returns:\n    A Weight object.\n\n  Raises:\n    FstArgError: Weight type not found (or not in same semiring).\n    FstBadWeightError: invalid weight.\n  ";
static PyMethodDef __pyx_mdef_6fstlib_4cext_9pywrapfst_1plus = {"plus", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6fstlib_4cext_9pywrapfst_1plus, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6fstlib_4cext_9pywrapfst_plus};
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_1plus(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__pyx_v_lhs = 0;
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__pyx_v_rhs = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("plus (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_lhs,&__pyx_n_s_rhs,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_lhs)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rhs)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("plus", 1, 2, 2, 1); __PYX_ERR(0, 515, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "plus") < 0)) __PYX_ERR(0, 515, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_lhs = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *)values[0]);
    __pyx_v_rhs = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("plus", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 515, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.plus", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_lhs), __pyx_ptype_6fstlib_4cext_9pywrapfst_Weight, 1, "lhs", 0))) __PYX_ERR(0, 515, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rhs), __pyx_ptype_6fstlib_4cext_9pywrapfst_Weight, 1, "rhs", 0))) __PYX_ERR(0, 515, __pyx_L1_error)
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_plus(__pyx_self, __pyx_v_lhs, __pyx_v_rhs);

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_plus(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__pyx_v_lhs, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__pyx_v_rhs) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__pyx_v__weight = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("plus", 0);

  /* "fstlib/cext/pywrapfst.pyx":535
 *     FstBadWeightError: invalid weight.
 *   """
 *   cdef Weight _weight = _plus(lhs, rhs)             # <<<<<<<<<<<<<<
 *   _weight._check_weight()
 *   return _weight
 */
  __pyx_t_1 = ((PyObject *)__pyx_f_6fstlib_4cext_9pywrapfst__plus(__pyx_v_lhs, __pyx_v_rhs)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 535, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v__weight = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "fstlib/cext/pywrapfst.pyx":536
 *   """
 *   cdef Weight _weight = _plus(lhs, rhs)
 *   _weight._check_weight()             # <<<<<<<<<<<<<<
 *   return _weight
 * 
 */
  if (unlikely(((PyObject *)__pyx_v__weight) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_check_weight");
    __PYX_ERR(0, 536, __pyx_L1_error)
  }
  ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_Weight *)__pyx_v__weight->__pyx_vtab)->_check_weight(__pyx_v__weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 536, __pyx_L1_error)

  /* "fstlib/cext/pywrapfst.pyx":537
 *   cdef Weight _weight = _plus(lhs, rhs)
 *   _weight._check_weight()
 *   return _weight             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v__weight));
  __pyx_r = ((PyObject *)__pyx_v__weight);
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":515
 * 
 * 
 * def plus(Weight lhs, Weight rhs):             # <<<<<<<<<<<<<<
 *   """
 *   plus(lhs, rhs)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.plus", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v__weight);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":540
 * 
 * 
 * cdef Weight _times(Weight lhs, Weight rhs):             # <<<<<<<<<<<<<<
 *   cdef Weight _weight = Weight.__new__(Weight)
 *   _weight._weight.reset(new fst.WeightClass(fst.Times(deref(lhs._weight),
 */

static struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__pyx_f_6fstlib_4cext_9pywrapfst__times(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__pyx_v_lhs, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__pyx_v_rhs) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__pyx_v__weight = 0;
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__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("_times", 0);

  /* "fstlib/cext/pywrapfst.pyx":541
 * 
 * cdef Weight _times(Weight lhs, Weight rhs):
 *   cdef Weight _weight = Weight.__new__(Weight)             # <<<<<<<<<<<<<<
 *   _weight._weight.reset(new fst.WeightClass(fst.Times(deref(lhs._weight),
 *                                                       deref(rhs._weight))))
 */
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_6fstlib_4cext_9pywrapfst_Weight(((PyTypeObject *)__pyx_ptype_6fstlib_4cext_9pywrapfst_Weight), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 541, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v__weight = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "fstlib/cext/pywrapfst.pyx":542
 * cdef Weight _times(Weight lhs, Weight rhs):
 *   cdef Weight _weight = Weight.__new__(Weight)
 *   _weight._weight.reset(new fst.WeightClass(fst.Times(deref(lhs._weight),             # <<<<<<<<<<<<<<
 *                                                       deref(rhs._weight))))
 *   return _weight
 */
  if (unlikely(((PyObject *)__pyx_v__weight) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_weight");
    __PYX_ERR(0, 542, __pyx_L1_error)
  }
  if (unlikely(((PyObject *)__pyx_v_lhs) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_weight");
    __PYX_ERR(0, 542, __pyx_L1_error)
  }

  /* "fstlib/cext/pywrapfst.pyx":543
 *   cdef Weight _weight = Weight.__new__(Weight)
 *   _weight._weight.reset(new fst.WeightClass(fst.Times(deref(lhs._weight),
 *                                                       deref(rhs._weight))))             # <<<<<<<<<<<<<<
 *   return _weight
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_rhs) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_weight");
    __PYX_ERR(0, 543, __pyx_L1_error)
  }

  /* "fstlib/cext/pywrapfst.pyx":542
 * cdef Weight _times(Weight lhs, Weight rhs):
 *   cdef Weight _weight = Weight.__new__(Weight)
 *   _weight._weight.reset(new fst.WeightClass(fst.Times(deref(lhs._weight),             # <<<<<<<<<<<<<<
 *                                                       deref(rhs._weight))))
 *   return _weight
 */
  __pyx_v__weight->_weight.reset(new fst::script::WeightClass(fst::script::Times((*__pyx_v_lhs->_weight), (*__pyx_v_rhs->_weight))));

  /* "fstlib/cext/pywrapfst.pyx":544
 *   _weight._weight.reset(new fst.WeightClass(fst.Times(deref(lhs._weight),
 *                                                       deref(rhs._weight))))
 *   return _weight             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v__weight));
  __pyx_r = __pyx_v__weight;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":540
 * 
 * 
 * cdef Weight _times(Weight lhs, Weight rhs):             # <<<<<<<<<<<<<<
 *   cdef Weight _weight = Weight.__new__(Weight)
 *   _weight._weight.reset(new fst.WeightClass(fst.Times(deref(lhs._weight),
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst._times", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v__weight);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":547
 * 
 * 
 * def times(Weight lhs, Weight rhs):             # <<<<<<<<<<<<<<
 *   """
 *   times(lhs, rhs)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_3times(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_2times[] = "\n  times(lhs, rhs)\n\n  Computes the product of two Weights in the same semiring.\n\n  This function computes lhs \\otimes rhs, raising an exception if lhs and rhs\n  are not in the same semiring.\n\n  Args:\n     lhs: Left-hand side Weight.\n     rhs: Right-hand side Weight.\n\n  Returns:\n    A Weight object.\n\n  Raises:\n    FstArgError: Weight type not found (or not in same semiring).\n    FstBadWeightError: Invalid weight.\n  ";
static PyMethodDef __pyx_mdef_6fstlib_4cext_9pywrapfst_3times = {"times", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6fstlib_4cext_9pywrapfst_3times, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6fstlib_4cext_9pywrapfst_2times};
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_3times(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__pyx_v_lhs = 0;
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__pyx_v_rhs = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("times (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_lhs,&__pyx_n_s_rhs,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_lhs)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rhs)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("times", 1, 2, 2, 1); __PYX_ERR(0, 547, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "times") < 0)) __PYX_ERR(0, 547, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_lhs = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *)values[0]);
    __pyx_v_rhs = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("times", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 547, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.times", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_lhs), __pyx_ptype_6fstlib_4cext_9pywrapfst_Weight, 1, "lhs", 0))) __PYX_ERR(0, 547, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rhs), __pyx_ptype_6fstlib_4cext_9pywrapfst_Weight, 1, "rhs", 0))) __PYX_ERR(0, 547, __pyx_L1_error)
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_2times(__pyx_self, __pyx_v_lhs, __pyx_v_rhs);

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_2times(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__pyx_v_lhs, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__pyx_v_rhs) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__pyx_v__weight = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("times", 0);

  /* "fstlib/cext/pywrapfst.pyx":567
 *     FstBadWeightError: Invalid weight.
 *   """
 *   cdef Weight _weight = _times(lhs, rhs)             # <<<<<<<<<<<<<<
 *   _weight._check_weight()
 *   return _weight
 */
  __pyx_t_1 = ((PyObject *)__pyx_f_6fstlib_4cext_9pywrapfst__times(__pyx_v_lhs, __pyx_v_rhs)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 567, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v__weight = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "fstlib/cext/pywrapfst.pyx":568
 *   """
 *   cdef Weight _weight = _times(lhs, rhs)
 *   _weight._check_weight()             # <<<<<<<<<<<<<<
 *   return _weight
 * 
 */
  if (unlikely(((PyObject *)__pyx_v__weight) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_check_weight");
    __PYX_ERR(0, 568, __pyx_L1_error)
  }
  ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_Weight *)__pyx_v__weight->__pyx_vtab)->_check_weight(__pyx_v__weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 568, __pyx_L1_error)

  /* "fstlib/cext/pywrapfst.pyx":569
 *   cdef Weight _weight = _times(lhs, rhs)
 *   _weight._check_weight()
 *   return _weight             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v__weight));
  __pyx_r = ((PyObject *)__pyx_v__weight);
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":547
 * 
 * 
 * def times(Weight lhs, Weight rhs):             # <<<<<<<<<<<<<<
 *   """
 *   times(lhs, rhs)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.times", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v__weight);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":572
 * 
 * 
 * cdef Weight _divide(Weight lhs, Weight rhs):             # <<<<<<<<<<<<<<
 *   cdef Weight _weight = Weight.__new__(Weight)
 *   _weight._weight.reset(new fst.WeightClass(fst.Divide(deref(lhs._weight),
 */

static struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__pyx_f_6fstlib_4cext_9pywrapfst__divide(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__pyx_v_lhs, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__pyx_v_rhs) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__pyx_v__weight = 0;
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__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("_divide", 0);

  /* "fstlib/cext/pywrapfst.pyx":573
 * 
 * cdef Weight _divide(Weight lhs, Weight rhs):
 *   cdef Weight _weight = Weight.__new__(Weight)             # <<<<<<<<<<<<<<
 *   _weight._weight.reset(new fst.WeightClass(fst.Divide(deref(lhs._weight),
 *                                                        deref(rhs._weight))))
 */
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_6fstlib_4cext_9pywrapfst_Weight(((PyTypeObject *)__pyx_ptype_6fstlib_4cext_9pywrapfst_Weight), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 573, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v__weight = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "fstlib/cext/pywrapfst.pyx":574
 * cdef Weight _divide(Weight lhs, Weight rhs):
 *   cdef Weight _weight = Weight.__new__(Weight)
 *   _weight._weight.reset(new fst.WeightClass(fst.Divide(deref(lhs._weight),             # <<<<<<<<<<<<<<
 *                                                        deref(rhs._weight))))
 *   return _weight
 */
  if (unlikely(((PyObject *)__pyx_v__weight) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_weight");
    __PYX_ERR(0, 574, __pyx_L1_error)
  }
  if (unlikely(((PyObject *)__pyx_v_lhs) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_weight");
    __PYX_ERR(0, 574, __pyx_L1_error)
  }

  /* "fstlib/cext/pywrapfst.pyx":575
 *   cdef Weight _weight = Weight.__new__(Weight)
 *   _weight._weight.reset(new fst.WeightClass(fst.Divide(deref(lhs._weight),
 *                                                        deref(rhs._weight))))             # <<<<<<<<<<<<<<
 *   return _weight
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_rhs) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_weight");
    __PYX_ERR(0, 575, __pyx_L1_error)
  }

  /* "fstlib/cext/pywrapfst.pyx":574
 * cdef Weight _divide(Weight lhs, Weight rhs):
 *   cdef Weight _weight = Weight.__new__(Weight)
 *   _weight._weight.reset(new fst.WeightClass(fst.Divide(deref(lhs._weight),             # <<<<<<<<<<<<<<
 *                                                        deref(rhs._weight))))
 *   return _weight
 */
  __pyx_v__weight->_weight.reset(new fst::script::WeightClass(fst::script::Divide((*__pyx_v_lhs->_weight), (*__pyx_v_rhs->_weight))));

  /* "fstlib/cext/pywrapfst.pyx":576
 *   _weight._weight.reset(new fst.WeightClass(fst.Divide(deref(lhs._weight),
 *                                                        deref(rhs._weight))))
 *   return _weight             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v__weight));
  __pyx_r = __pyx_v__weight;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":572
 * 
 * 
 * cdef Weight _divide(Weight lhs, Weight rhs):             # <<<<<<<<<<<<<<
 *   cdef Weight _weight = Weight.__new__(Weight)
 *   _weight._weight.reset(new fst.WeightClass(fst.Divide(deref(lhs._weight),
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst._divide", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v__weight);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":579
 * 
 * 
 * def divide(Weight lhs, Weight rhs):             # <<<<<<<<<<<<<<
 *   """
 *   divide(lhs, rhs)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_5divide(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_4divide[] = "\n  divide(lhs, rhs)\n\n  Computes the quotient of two Weights in the same semiring.\n\n  This function computes lhs \\oslash rhs, raising an exception if lhs and rhs\n  are not in the same semiring. As there is no way to specify whether to use\n  left vs. right division, this assumes a commutative semiring in which these\n  are equivalent operations.\n\n  Args:\n     lhs: Left-hand side Weight.\n     rhs: Right-hand side Weight.\n\n  Returns:\n    A Weight object.\n\n  Raises:\n    FstArgError: Weight type not found (or not in same semiring).\n    FstBadWeightError: Invalid weight.\n  ";
static PyMethodDef __pyx_mdef_6fstlib_4cext_9pywrapfst_5divide = {"divide", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6fstlib_4cext_9pywrapfst_5divide, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6fstlib_4cext_9pywrapfst_4divide};
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_5divide(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__pyx_v_lhs = 0;
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__pyx_v_rhs = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("divide (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_lhs,&__pyx_n_s_rhs,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_lhs)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rhs)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("divide", 1, 2, 2, 1); __PYX_ERR(0, 579, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "divide") < 0)) __PYX_ERR(0, 579, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_lhs = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *)values[0]);
    __pyx_v_rhs = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("divide", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 579, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.divide", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_lhs), __pyx_ptype_6fstlib_4cext_9pywrapfst_Weight, 1, "lhs", 0))) __PYX_ERR(0, 579, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rhs), __pyx_ptype_6fstlib_4cext_9pywrapfst_Weight, 1, "rhs", 0))) __PYX_ERR(0, 579, __pyx_L1_error)
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_4divide(__pyx_self, __pyx_v_lhs, __pyx_v_rhs);

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_4divide(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__pyx_v_lhs, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__pyx_v_rhs) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__pyx_v__weight = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("divide", 0);

  /* "fstlib/cext/pywrapfst.pyx":601
 *     FstBadWeightError: Invalid weight.
 *   """
 *   cdef Weight _weight = _divide(lhs, rhs)             # <<<<<<<<<<<<<<
 *   _weight._check_weight()
 *   return _weight
 */
  __pyx_t_1 = ((PyObject *)__pyx_f_6fstlib_4cext_9pywrapfst__divide(__pyx_v_lhs, __pyx_v_rhs)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 601, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v__weight = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "fstlib/cext/pywrapfst.pyx":602
 *   """
 *   cdef Weight _weight = _divide(lhs, rhs)
 *   _weight._check_weight()             # <<<<<<<<<<<<<<
 *   return _weight
 * 
 */
  if (unlikely(((PyObject *)__pyx_v__weight) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_check_weight");
    __PYX_ERR(0, 602, __pyx_L1_error)
  }
  ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_Weight *)__pyx_v__weight->__pyx_vtab)->_check_weight(__pyx_v__weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 602, __pyx_L1_error)

  /* "fstlib/cext/pywrapfst.pyx":603
 *   cdef Weight _weight = _divide(lhs, rhs)
 *   _weight._check_weight()
 *   return _weight             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v__weight));
  __pyx_r = ((PyObject *)__pyx_v__weight);
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":579
 * 
 * 
 * def divide(Weight lhs, Weight rhs):             # <<<<<<<<<<<<<<
 *   """
 *   divide(lhs, rhs)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.divide", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v__weight);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":606
 * 
 * 
 * cdef Weight _power(Weight w, size_t n):             # <<<<<<<<<<<<<<
 *   cdef Weight _weight = Weight.__new__(Weight)
 *   _weight._weight.reset(new fst.WeightClass(fst.Power(deref(w._weight), n)))
 */

static struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__pyx_f_6fstlib_4cext_9pywrapfst__power(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__pyx_v_w, size_t __pyx_v_n) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__pyx_v__weight = 0;
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__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("_power", 0);

  /* "fstlib/cext/pywrapfst.pyx":607
 * 
 * cdef Weight _power(Weight w, size_t n):
 *   cdef Weight _weight = Weight.__new__(Weight)             # <<<<<<<<<<<<<<
 *   _weight._weight.reset(new fst.WeightClass(fst.Power(deref(w._weight), n)))
 *   return _weight
 */
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_6fstlib_4cext_9pywrapfst_Weight(((PyTypeObject *)__pyx_ptype_6fstlib_4cext_9pywrapfst_Weight), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 607, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v__weight = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "fstlib/cext/pywrapfst.pyx":608
 * cdef Weight _power(Weight w, size_t n):
 *   cdef Weight _weight = Weight.__new__(Weight)
 *   _weight._weight.reset(new fst.WeightClass(fst.Power(deref(w._weight), n)))             # <<<<<<<<<<<<<<
 *   return _weight
 * 
 */
  if (unlikely(((PyObject *)__pyx_v__weight) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_weight");
    __PYX_ERR(0, 608, __pyx_L1_error)
  }
  if (unlikely(((PyObject *)__pyx_v_w) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_weight");
    __PYX_ERR(0, 608, __pyx_L1_error)
  }
  __pyx_v__weight->_weight.reset(new fst::script::WeightClass(fst::script::Power((*__pyx_v_w->_weight), __pyx_v_n)));

  /* "fstlib/cext/pywrapfst.pyx":609
 *   cdef Weight _weight = Weight.__new__(Weight)
 *   _weight._weight.reset(new fst.WeightClass(fst.Power(deref(w._weight), n)))
 *   return _weight             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v__weight));
  __pyx_r = __pyx_v__weight;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":606
 * 
 * 
 * cdef Weight _power(Weight w, size_t n):             # <<<<<<<<<<<<<<
 *   cdef Weight _weight = Weight.__new__(Weight)
 *   _weight._weight.reset(new fst.WeightClass(fst.Power(deref(w._weight), n)))
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst._power", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v__weight);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":612
 * 
 * 
 * def power(Weight w, size_t n):             # <<<<<<<<<<<<<<
 *   """
 *   power(lhs, rhs)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_7power(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_6power[] = "\n  power(lhs, rhs)\n\n  Computes the iterated product of a weight.\n\n  Args:\n     w: The weight.\n     n: The power.\n\n  Returns:\n    A Weight object.\n\n  Raises:\n    FstArgError: Weight type not found (or not in same semiring).\n    FstBadWeightError: Invalid weight.\n  ";
static PyMethodDef __pyx_mdef_6fstlib_4cext_9pywrapfst_7power = {"power", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6fstlib_4cext_9pywrapfst_7power, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6fstlib_4cext_9pywrapfst_6power};
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_7power(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__pyx_v_w = 0;
  size_t __pyx_v_n;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("power (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_w,&__pyx_n_s_n,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_w)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("power", 1, 2, 2, 1); __PYX_ERR(0, 612, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "power") < 0)) __PYX_ERR(0, 612, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_w = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *)values[0]);
    __pyx_v_n = __Pyx_PyInt_As_size_t(values[1]); if (unlikely((__pyx_v_n == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 612, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("power", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 612, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.power", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_w), __pyx_ptype_6fstlib_4cext_9pywrapfst_Weight, 1, "w", 0))) __PYX_ERR(0, 612, __pyx_L1_error)
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_6power(__pyx_self, __pyx_v_w, __pyx_v_n);

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_6power(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__pyx_v_w, size_t __pyx_v_n) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__pyx_v__weight = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("power", 0);

  /* "fstlib/cext/pywrapfst.pyx":629
 *     FstBadWeightError: Invalid weight.
 *   """
 *   cdef Weight _weight = _power(w, n)             # <<<<<<<<<<<<<<
 *   _weight._check_weight()
 *   return _weight
 */
  __pyx_t_1 = ((PyObject *)__pyx_f_6fstlib_4cext_9pywrapfst__power(__pyx_v_w, __pyx_v_n)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 629, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v__weight = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "fstlib/cext/pywrapfst.pyx":630
 *   """
 *   cdef Weight _weight = _power(w, n)
 *   _weight._check_weight()             # <<<<<<<<<<<<<<
 *   return _weight
 * 
 */
  if (unlikely(((PyObject *)__pyx_v__weight) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_check_weight");
    __PYX_ERR(0, 630, __pyx_L1_error)
  }
  ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_Weight *)__pyx_v__weight->__pyx_vtab)->_check_weight(__pyx_v__weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 630, __pyx_L1_error)

  /* "fstlib/cext/pywrapfst.pyx":631
 *   cdef Weight _weight = _power(w, n)
 *   _weight._check_weight()
 *   return _weight             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v__weight));
  __pyx_r = ((PyObject *)__pyx_v__weight);
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":612
 * 
 * 
 * def power(Weight w, size_t n):             # <<<<<<<<<<<<<<
 *   """
 *   power(lhs, rhs)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.power", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v__weight);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":634
 * 
 * 
 * cdef fst.WeightClass _get_WeightClass_or_zero(const string &weight_type,             # <<<<<<<<<<<<<<
 *                                               weight) except *:
 *   """Converts weight string to a WeightClass.
 */

static fst::script::WeightClass __pyx_f_6fstlib_4cext_9pywrapfst__get_WeightClass_or_zero(std::string const &__pyx_v_weight_type, PyObject *__pyx_v_weight) {
  fst::script::WeightClass __pyx_v__weight;
  fst::script::WeightClass __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  std::string __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_WeightClass_or_zero", 0);

  /* "fstlib/cext/pywrapfst.pyx":652
 *   """
 *   cdef fst.WeightClass _weight
 *   if weight is None:             # <<<<<<<<<<<<<<
 *     _weight = fst.WeightClass.Zero(weight_type)
 *   elif isinstance(weight, Weight):
 */
  __pyx_t_1 = (__pyx_v_weight == Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "fstlib/cext/pywrapfst.pyx":653
 *   cdef fst.WeightClass _weight
 *   if weight is None:
 *     _weight = fst.WeightClass.Zero(weight_type)             # <<<<<<<<<<<<<<
 *   elif isinstance(weight, Weight):
 *     _weight = deref(<fst.WeightClass *> (<Weight> weight)._weight.get())
 */
    __pyx_v__weight = fst::script::WeightClass::Zero(__pyx_v_weight_type);

    /* "fstlib/cext/pywrapfst.pyx":652
 *   """
 *   cdef fst.WeightClass _weight
 *   if weight is None:             # <<<<<<<<<<<<<<
 *     _weight = fst.WeightClass.Zero(weight_type)
 *   elif isinstance(weight, Weight):
 */
    goto __pyx_L3;
  }

  /* "fstlib/cext/pywrapfst.pyx":654
 *   if weight is None:
 *     _weight = fst.WeightClass.Zero(weight_type)
 *   elif isinstance(weight, Weight):             # <<<<<<<<<<<<<<
 *     _weight = deref(<fst.WeightClass *> (<Weight> weight)._weight.get())
 *   else:
 */
  __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_weight, __pyx_ptype_6fstlib_4cext_9pywrapfst_Weight); 
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "fstlib/cext/pywrapfst.pyx":655
 *     _weight = fst.WeightClass.Zero(weight_type)
 *   elif isinstance(weight, Weight):
 *     _weight = deref(<fst.WeightClass *> (<Weight> weight)._weight.get())             # <<<<<<<<<<<<<<
 *   else:
 *     _weight = fst.WeightClass(weight_type, weight_tostring(weight))
 */
    if (unlikely(__pyx_v_weight == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_weight");
      __PYX_ERR(0, 655, __pyx_L1_error)
    }
    __pyx_v__weight = (*((fst::script::WeightClass *)((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *)__pyx_v_weight)->_weight.get()));

    /* "fstlib/cext/pywrapfst.pyx":654
 *   if weight is None:
 *     _weight = fst.WeightClass.Zero(weight_type)
 *   elif isinstance(weight, Weight):             # <<<<<<<<<<<<<<
 *     _weight = deref(<fst.WeightClass *> (<Weight> weight)._weight.get())
 *   else:
 */
    goto __pyx_L3;
  }

  /* "fstlib/cext/pywrapfst.pyx":657
 *     _weight = deref(<fst.WeightClass *> (<Weight> weight)._weight.get())
 *   else:
 *     _weight = fst.WeightClass(weight_type, weight_tostring(weight))             # <<<<<<<<<<<<<<
 *     if not _weight.Member():
 *       raise FstBadWeightError(weight_tostring(weight))
 */
  /*else*/ {
    __pyx_t_3 = __pyx_f_6fstlib_4cext_9pywrapfst_weight_tostring(__pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 657, __pyx_L1_error)
    __pyx_v__weight = fst::script::WeightClass(__pyx_v_weight_type, __pyx_t_3);

    /* "fstlib/cext/pywrapfst.pyx":658
 *   else:
 *     _weight = fst.WeightClass(weight_type, weight_tostring(weight))
 *     if not _weight.Member():             # <<<<<<<<<<<<<<
 *       raise FstBadWeightError(weight_tostring(weight))
 *   return _weight
 */
    __pyx_t_1 = ((!(__pyx_v__weight.Member() != 0)) != 0);
    if (unlikely(__pyx_t_1)) {

      /* "fstlib/cext/pywrapfst.pyx":659
 *     _weight = fst.WeightClass(weight_type, weight_tostring(weight))
 *     if not _weight.Member():
 *       raise FstBadWeightError(weight_tostring(weight))             # <<<<<<<<<<<<<<
 *   return _weight
 * 
 */
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_FstBadWeightError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 659, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = __pyx_f_6fstlib_4cext_9pywrapfst_weight_tostring(__pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 659, __pyx_L1_error)
      __pyx_t_6 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 659, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = NULL;
      if (CYTHON_UNPACK_METHODS && 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_4 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 659, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __PYX_ERR(0, 659, __pyx_L1_error)

      /* "fstlib/cext/pywrapfst.pyx":658
 *   else:
 *     _weight = fst.WeightClass(weight_type, weight_tostring(weight))
 *     if not _weight.Member():             # <<<<<<<<<<<<<<
 *       raise FstBadWeightError(weight_tostring(weight))
 *   return _weight
 */
    }
  }
  __pyx_L3:;

  /* "fstlib/cext/pywrapfst.pyx":660
 *     if not _weight.Member():
 *       raise FstBadWeightError(weight_tostring(weight))
 *   return _weight             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v__weight;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":634
 * 
 * 
 * cdef fst.WeightClass _get_WeightClass_or_zero(const string &weight_type,             # <<<<<<<<<<<<<<
 *                                               weight) except *:
 *   """Converts weight string to a WeightClass.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst._get_WeightClass_or_zero", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":663
 * 
 * 
 * cdef fst.WeightClass _get_WeightClass_or_one(const string &weight_type,             # <<<<<<<<<<<<<<
 *                                              weight) except *:
 *   """Converts weight string to a WeightClass.
 */

static fst::script::WeightClass __pyx_f_6fstlib_4cext_9pywrapfst__get_WeightClass_or_one(std::string const &__pyx_v_weight_type, PyObject *__pyx_v_weight) {
  fst::script::WeightClass __pyx_v__weight;
  fst::script::WeightClass __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  std::string __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_WeightClass_or_one", 0);

  /* "fstlib/cext/pywrapfst.pyx":681
 *   """
 *   cdef fst.WeightClass _weight
 *   if weight is None:             # <<<<<<<<<<<<<<
 *     _weight = fst.WeightClass.One(weight_type)
 *   elif isinstance(weight, Weight):
 */
  __pyx_t_1 = (__pyx_v_weight == Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "fstlib/cext/pywrapfst.pyx":682
 *   cdef fst.WeightClass _weight
 *   if weight is None:
 *     _weight = fst.WeightClass.One(weight_type)             # <<<<<<<<<<<<<<
 *   elif isinstance(weight, Weight):
 *     _weight = deref(<fst.WeightClass *> (<Weight> weight)._weight.get())
 */
    __pyx_v__weight = fst::script::WeightClass::One(__pyx_v_weight_type);

    /* "fstlib/cext/pywrapfst.pyx":681
 *   """
 *   cdef fst.WeightClass _weight
 *   if weight is None:             # <<<<<<<<<<<<<<
 *     _weight = fst.WeightClass.One(weight_type)
 *   elif isinstance(weight, Weight):
 */
    goto __pyx_L3;
  }

  /* "fstlib/cext/pywrapfst.pyx":683
 *   if weight is None:
 *     _weight = fst.WeightClass.One(weight_type)
 *   elif isinstance(weight, Weight):             # <<<<<<<<<<<<<<
 *     _weight = deref(<fst.WeightClass *> (<Weight> weight)._weight.get())
 *   else:
 */
  __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_weight, __pyx_ptype_6fstlib_4cext_9pywrapfst_Weight); 
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "fstlib/cext/pywrapfst.pyx":684
 *     _weight = fst.WeightClass.One(weight_type)
 *   elif isinstance(weight, Weight):
 *     _weight = deref(<fst.WeightClass *> (<Weight> weight)._weight.get())             # <<<<<<<<<<<<<<
 *   else:
 *     _weight = fst.WeightClass(weight_type, weight_tostring(weight))
 */
    if (unlikely(__pyx_v_weight == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_weight");
      __PYX_ERR(0, 684, __pyx_L1_error)
    }
    __pyx_v__weight = (*((fst::script::WeightClass *)((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *)__pyx_v_weight)->_weight.get()));

    /* "fstlib/cext/pywrapfst.pyx":683
 *   if weight is None:
 *     _weight = fst.WeightClass.One(weight_type)
 *   elif isinstance(weight, Weight):             # <<<<<<<<<<<<<<
 *     _weight = deref(<fst.WeightClass *> (<Weight> weight)._weight.get())
 *   else:
 */
    goto __pyx_L3;
  }

  /* "fstlib/cext/pywrapfst.pyx":686
 *     _weight = deref(<fst.WeightClass *> (<Weight> weight)._weight.get())
 *   else:
 *     _weight = fst.WeightClass(weight_type, weight_tostring(weight))             # <<<<<<<<<<<<<<
 *     if not _weight.Member():
 *       raise FstBadWeightError(weight_tostring(weight))
 */
  /*else*/ {
    __pyx_t_3 = __pyx_f_6fstlib_4cext_9pywrapfst_weight_tostring(__pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 686, __pyx_L1_error)
    __pyx_v__weight = fst::script::WeightClass(__pyx_v_weight_type, __pyx_t_3);

    /* "fstlib/cext/pywrapfst.pyx":687
 *   else:
 *     _weight = fst.WeightClass(weight_type, weight_tostring(weight))
 *     if not _weight.Member():             # <<<<<<<<<<<<<<
 *       raise FstBadWeightError(weight_tostring(weight))
 *   return _weight
 */
    __pyx_t_1 = ((!(__pyx_v__weight.Member() != 0)) != 0);
    if (unlikely(__pyx_t_1)) {

      /* "fstlib/cext/pywrapfst.pyx":688
 *     _weight = fst.WeightClass(weight_type, weight_tostring(weight))
 *     if not _weight.Member():
 *       raise FstBadWeightError(weight_tostring(weight))             # <<<<<<<<<<<<<<
 *   return _weight
 * 
 */
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_FstBadWeightError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 688, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = __pyx_f_6fstlib_4cext_9pywrapfst_weight_tostring(__pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 688, __pyx_L1_error)
      __pyx_t_6 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 688, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = NULL;
      if (CYTHON_UNPACK_METHODS && 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_4 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 688, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __PYX_ERR(0, 688, __pyx_L1_error)

      /* "fstlib/cext/pywrapfst.pyx":687
 *   else:
 *     _weight = fst.WeightClass(weight_type, weight_tostring(weight))
 *     if not _weight.Member():             # <<<<<<<<<<<<<<
 *       raise FstBadWeightError(weight_tostring(weight))
 *   return _weight
 */
    }
  }
  __pyx_L3:;

  /* "fstlib/cext/pywrapfst.pyx":689
 *     if not _weight.Member():
 *       raise FstBadWeightError(weight_tostring(weight))
 *   return _weight             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v__weight;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":663
 * 
 * 
 * cdef fst.WeightClass _get_WeightClass_or_one(const string &weight_type,             # <<<<<<<<<<<<<<
 *                                              weight) except *:
 *   """Converts weight string to a WeightClass.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst._get_WeightClass_or_one", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":692
 * 
 * 
 * cdef Weight _zero(weight_type):             # <<<<<<<<<<<<<<
 *   cdef Weight _weight = Weight.__new__(Weight)
 *   _weight._weight.reset(
 */

static struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__pyx_f_6fstlib_4cext_9pywrapfst__zero(PyObject *__pyx_v_weight_type) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__pyx_v__weight = 0;
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  std::string __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_zero", 0);

  /* "fstlib/cext/pywrapfst.pyx":693
 * 
 * cdef Weight _zero(weight_type):
 *   cdef Weight _weight = Weight.__new__(Weight)             # <<<<<<<<<<<<<<
 *   _weight._weight.reset(
 *     new fst.WeightClass(fst.WeightClass.Zero(tostring(weight_type))))
 */
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_6fstlib_4cext_9pywrapfst_Weight(((PyTypeObject *)__pyx_ptype_6fstlib_4cext_9pywrapfst_Weight), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 693, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v__weight = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "fstlib/cext/pywrapfst.pyx":694
 * cdef Weight _zero(weight_type):
 *   cdef Weight _weight = Weight.__new__(Weight)
 *   _weight._weight.reset(             # <<<<<<<<<<<<<<
 *     new fst.WeightClass(fst.WeightClass.Zero(tostring(weight_type))))
 *   if _weight._weight.get().Type() == b"none":
 */
  if (unlikely(((PyObject *)__pyx_v__weight) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_weight");
    __PYX_ERR(0, 694, __pyx_L1_error)
  }

  /* "fstlib/cext/pywrapfst.pyx":695
 *   cdef Weight _weight = Weight.__new__(Weight)
 *   _weight._weight.reset(
 *     new fst.WeightClass(fst.WeightClass.Zero(tostring(weight_type))))             # <<<<<<<<<<<<<<
 *   if _weight._weight.get().Type() == b"none":
 *     raise FstArgError("Weight type not found")
 */
  __pyx_t_2 = __pyx_f_6fstlib_4cext_9pywrapfst_tostring(__pyx_v_weight_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 695, __pyx_L1_error)

  /* "fstlib/cext/pywrapfst.pyx":694
 * cdef Weight _zero(weight_type):
 *   cdef Weight _weight = Weight.__new__(Weight)
 *   _weight._weight.reset(             # <<<<<<<<<<<<<<
 *     new fst.WeightClass(fst.WeightClass.Zero(tostring(weight_type))))
 *   if _weight._weight.get().Type() == b"none":
 */
  __pyx_v__weight->_weight.reset(new fst::script::WeightClass(fst::script::WeightClass::Zero(__pyx_t_2)));

  /* "fstlib/cext/pywrapfst.pyx":696
 *   _weight._weight.reset(
 *     new fst.WeightClass(fst.WeightClass.Zero(tostring(weight_type))))
 *   if _weight._weight.get().Type() == b"none":             # <<<<<<<<<<<<<<
 *     raise FstArgError("Weight type not found")
 *   return _weight
 */
  if (unlikely(((PyObject *)__pyx_v__weight) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_weight");
    __PYX_ERR(0, 696, __pyx_L1_error)
  }
  __pyx_t_3 = ((__pyx_v__weight->_weight.get()->Type() == ((char const *)"none")) != 0);
  if (unlikely(__pyx_t_3)) {

    /* "fstlib/cext/pywrapfst.pyx":697
 *     new fst.WeightClass(fst.WeightClass.Zero(tostring(weight_type))))
 *   if _weight._weight.get().Type() == b"none":
 *     raise FstArgError("Weight type not found")             # <<<<<<<<<<<<<<
 *   return _weight
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FstArgError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 697, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_kp_u_Weight_type_not_found) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_kp_u_Weight_type_not_found);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 697, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 697, __pyx_L1_error)

    /* "fstlib/cext/pywrapfst.pyx":696
 *   _weight._weight.reset(
 *     new fst.WeightClass(fst.WeightClass.Zero(tostring(weight_type))))
 *   if _weight._weight.get().Type() == b"none":             # <<<<<<<<<<<<<<
 *     raise FstArgError("Weight type not found")
 *   return _weight
 */
  }

  /* "fstlib/cext/pywrapfst.pyx":698
 *   if _weight._weight.get().Type() == b"none":
 *     raise FstArgError("Weight type not found")
 *   return _weight             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v__weight));
  __pyx_r = __pyx_v__weight;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":692
 * 
 * 
 * cdef Weight _zero(weight_type):             # <<<<<<<<<<<<<<
 *   cdef Weight _weight = Weight.__new__(Weight)
 *   _weight._weight.reset(
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst._zero", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v__weight);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":701
 * 
 * 
 * cdef Weight _one(weight_type):             # <<<<<<<<<<<<<<
 *   cdef Weight _weight = Weight.__new__(Weight)
 *   _weight._weight.reset(
 */

static struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__pyx_f_6fstlib_4cext_9pywrapfst__one(PyObject *__pyx_v_weight_type) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__pyx_v__weight = 0;
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  std::string __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_one", 0);

  /* "fstlib/cext/pywrapfst.pyx":702
 * 
 * cdef Weight _one(weight_type):
 *   cdef Weight _weight = Weight.__new__(Weight)             # <<<<<<<<<<<<<<
 *   _weight._weight.reset(
 *     new fst.WeightClass(fst.WeightClass.One(tostring(weight_type))))
 */
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_6fstlib_4cext_9pywrapfst_Weight(((PyTypeObject *)__pyx_ptype_6fstlib_4cext_9pywrapfst_Weight), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 702, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v__weight = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "fstlib/cext/pywrapfst.pyx":703
 * cdef Weight _one(weight_type):
 *   cdef Weight _weight = Weight.__new__(Weight)
 *   _weight._weight.reset(             # <<<<<<<<<<<<<<
 *     new fst.WeightClass(fst.WeightClass.One(tostring(weight_type))))
 *   if _weight._weight.get().Type() == b"none":
 */
  if (unlikely(((PyObject *)__pyx_v__weight) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_weight");
    __PYX_ERR(0, 703, __pyx_L1_error)
  }

  /* "fstlib/cext/pywrapfst.pyx":704
 *   cdef Weight _weight = Weight.__new__(Weight)
 *   _weight._weight.reset(
 *     new fst.WeightClass(fst.WeightClass.One(tostring(weight_type))))             # <<<<<<<<<<<<<<
 *   if _weight._weight.get().Type() == b"none":
 *     raise FstArgError("Weight type not found")
 */
  __pyx_t_2 = __pyx_f_6fstlib_4cext_9pywrapfst_tostring(__pyx_v_weight_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 704, __pyx_L1_error)

  /* "fstlib/cext/pywrapfst.pyx":703
 * cdef Weight _one(weight_type):
 *   cdef Weight _weight = Weight.__new__(Weight)
 *   _weight._weight.reset(             # <<<<<<<<<<<<<<
 *     new fst.WeightClass(fst.WeightClass.One(tostring(weight_type))))
 *   if _weight._weight.get().Type() == b"none":
 */
  __pyx_v__weight->_weight.reset(new fst::script::WeightClass(fst::script::WeightClass::One(__pyx_t_2)));

  /* "fstlib/cext/pywrapfst.pyx":705
 *   _weight._weight.reset(
 *     new fst.WeightClass(fst.WeightClass.One(tostring(weight_type))))
 *   if _weight._weight.get().Type() == b"none":             # <<<<<<<<<<<<<<
 *     raise FstArgError("Weight type not found")
 *   return _weight
 */
  if (unlikely(((PyObject *)__pyx_v__weight) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_weight");
    __PYX_ERR(0, 705, __pyx_L1_error)
  }
  __pyx_t_3 = ((__pyx_v__weight->_weight.get()->Type() == ((char const *)"none")) != 0);
  if (unlikely(__pyx_t_3)) {

    /* "fstlib/cext/pywrapfst.pyx":706
 *     new fst.WeightClass(fst.WeightClass.One(tostring(weight_type))))
 *   if _weight._weight.get().Type() == b"none":
 *     raise FstArgError("Weight type not found")             # <<<<<<<<<<<<<<
 *   return _weight
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FstArgError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 706, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_kp_u_Weight_type_not_found) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_kp_u_Weight_type_not_found);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 706, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 706, __pyx_L1_error)

    /* "fstlib/cext/pywrapfst.pyx":705
 *   _weight._weight.reset(
 *     new fst.WeightClass(fst.WeightClass.One(tostring(weight_type))))
 *   if _weight._weight.get().Type() == b"none":             # <<<<<<<<<<<<<<
 *     raise FstArgError("Weight type not found")
 *   return _weight
 */
  }

  /* "fstlib/cext/pywrapfst.pyx":707
 *   if _weight._weight.get().Type() == b"none":
 *     raise FstArgError("Weight type not found")
 *   return _weight             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v__weight));
  __pyx_r = __pyx_v__weight;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":701
 * 
 * 
 * cdef Weight _one(weight_type):             # <<<<<<<<<<<<<<
 *   cdef Weight _weight = Weight.__new__(Weight)
 *   _weight._weight.reset(
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst._one", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v__weight);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":710
 * 
 * 
 * cdef Weight _no_weight(weight_type):             # <<<<<<<<<<<<<<
 *   cdef Weight _weight = Weight.__new__(Weight)
 *   _weight._weight.reset(
 */

static struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__pyx_f_6fstlib_4cext_9pywrapfst__no_weight(PyObject *__pyx_v_weight_type) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__pyx_v__weight = 0;
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  std::string __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_no_weight", 0);

  /* "fstlib/cext/pywrapfst.pyx":711
 * 
 * cdef Weight _no_weight(weight_type):
 *   cdef Weight _weight = Weight.__new__(Weight)             # <<<<<<<<<<<<<<
 *   _weight._weight.reset(
 *     new fst.WeightClass(fst.WeightClass.NoWeight(tostring(weight_type))))
 */
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_6fstlib_4cext_9pywrapfst_Weight(((PyTypeObject *)__pyx_ptype_6fstlib_4cext_9pywrapfst_Weight), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 711, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v__weight = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "fstlib/cext/pywrapfst.pyx":712
 * cdef Weight _no_weight(weight_type):
 *   cdef Weight _weight = Weight.__new__(Weight)
 *   _weight._weight.reset(             # <<<<<<<<<<<<<<
 *     new fst.WeightClass(fst.WeightClass.NoWeight(tostring(weight_type))))
 *   return _weight
 */
  if (unlikely(((PyObject *)__pyx_v__weight) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_weight");
    __PYX_ERR(0, 712, __pyx_L1_error)
  }

  /* "fstlib/cext/pywrapfst.pyx":713
 *   cdef Weight _weight = Weight.__new__(Weight)
 *   _weight._weight.reset(
 *     new fst.WeightClass(fst.WeightClass.NoWeight(tostring(weight_type))))             # <<<<<<<<<<<<<<
 *   return _weight
 * 
 */
  __pyx_t_2 = __pyx_f_6fstlib_4cext_9pywrapfst_tostring(__pyx_v_weight_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 713, __pyx_L1_error)

  /* "fstlib/cext/pywrapfst.pyx":712
 * cdef Weight _no_weight(weight_type):
 *   cdef Weight _weight = Weight.__new__(Weight)
 *   _weight._weight.reset(             # <<<<<<<<<<<<<<
 *     new fst.WeightClass(fst.WeightClass.NoWeight(tostring(weight_type))))
 *   return _weight
 */
  __pyx_v__weight->_weight.reset(new fst::script::WeightClass(fst::script::WeightClass::NoWeight(__pyx_t_2)));

  /* "fstlib/cext/pywrapfst.pyx":714
 *   _weight._weight.reset(
 *     new fst.WeightClass(fst.WeightClass.NoWeight(tostring(weight_type))))
 *   return _weight             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v__weight));
  __pyx_r = __pyx_v__weight;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":710
 * 
 * 
 * cdef Weight _no_weight(weight_type):             # <<<<<<<<<<<<<<
 *   cdef Weight _weight = Weight.__new__(Weight)
 *   _weight._weight.reset(
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst._no_weight", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v__weight);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":746
 *   # Doing so will allow undefined behavior.
 * 
 *   def __init__(self):             # <<<<<<<<<<<<<<
 *     raise NotImplementedError(f"Cannot construct {self.__class__.__name__}")
 * 
 */

/* Python wrapper */
static int __pyx_pw_6fstlib_4cext_9pywrapfst_15SymbolTableView_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_6fstlib_4cext_9pywrapfst_15SymbolTableView_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_15SymbolTableView___init__(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *)__pyx_v_self));

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

static int __pyx_pf_6fstlib_4cext_9pywrapfst_15SymbolTableView___init__(struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_self) {
  int __pyx_r;
  __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("__init__", 0);

  /* "fstlib/cext/pywrapfst.pyx":747
 * 
 *   def __init__(self):
 *     raise NotImplementedError(f"Cannot construct {self.__class__.__name__}")             # <<<<<<<<<<<<<<
 * 
 *   def __iter__(self):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 747, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 747, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_t_2, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 747, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Cannot_construct, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 747, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_NotImplementedError, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 747, __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(0, 747, __pyx_L1_error)

  /* "fstlib/cext/pywrapfst.pyx":746
 *   # Doing so will allow undefined behavior.
 * 
 *   def __init__(self):             # <<<<<<<<<<<<<<
 *     raise NotImplementedError(f"Cannot construct {self.__class__.__name__}")
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.SymbolTableView.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":749
 *     raise NotImplementedError(f"Cannot construct {self.__class__.__name__}")
 * 
 *   def __iter__(self):             # <<<<<<<<<<<<<<
 *     return _SymbolTableIterator(self)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_15SymbolTableView_3__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_15SymbolTableView_3__iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_15SymbolTableView_2__iter__(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_15SymbolTableView_2__iter__(struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__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__", 0);

  /* "fstlib/cext/pywrapfst.pyx":750
 * 
 *   def __iter__(self):
 *     return _SymbolTableIterator(self)             # <<<<<<<<<<<<<<
 * 
 *   # Registers the class for pickling.
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_6fstlib_4cext_9pywrapfst__SymbolTableIterator), ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 750, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":749
 *     raise NotImplementedError(f"Cannot construct {self.__class__.__name__}")
 * 
 *   def __iter__(self):             # <<<<<<<<<<<<<<
 *     return _SymbolTableIterator(self)
 * 
 */

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

/* "fstlib/cext/pywrapfst.pyx":754
 *   # Registers the class for pickling.
 * 
 *   def __reduce__(self):             # <<<<<<<<<<<<<<
 *     return (_read_SymbolTable_from_string, (self.write_to_string(),))
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_15SymbolTableView_5__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_15SymbolTableView_5__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_15SymbolTableView_4__reduce__(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_15SymbolTableView_4__reduce__(struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__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("__reduce__", 0);

  /* "fstlib/cext/pywrapfst.pyx":755
 * 
 *   def __reduce__(self):
 *     return (_read_SymbolTable_from_string, (self.write_to_string(),))             # <<<<<<<<<<<<<<
 * 
 *   # Returns a raw const pointer to SymbolTable.
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_read_SymbolTable_from_string); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 755, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "write_to_string");
    __PYX_ERR(0, 755, __pyx_L1_error)
  }
  __pyx_t_2 = ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_SymbolTableView *)__pyx_v_self->__pyx_vtab)->write_to_string(__pyx_v_self, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 755, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 755, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 755, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
  __pyx_t_1 = 0;
  __pyx_t_3 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":754
 *   # Registers the class for pickling.
 * 
 *   def __reduce__(self):             # <<<<<<<<<<<<<<
 *     return (_read_SymbolTable_from_string, (self.write_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("fstlib.cext.pywrapfst.SymbolTableView.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":761
 *   # Should not be directly accessed except by `_raw_ptr_or_raise()`.
 *   # All other methods should use the safer _raw_ptr_or_raise() instead.
 *   cdef const_SymbolTable_ptr _raw(self):             # <<<<<<<<<<<<<<
 *     return NULL
 * 
 */

static __pyx_t_6fstlib_4cext_9pywrapfst_const_SymbolTable_ptr __pyx_f_6fstlib_4cext_9pywrapfst_15SymbolTableView__raw(CYTHON_UNUSED struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_self) {
  __pyx_t_6fstlib_4cext_9pywrapfst_const_SymbolTable_ptr __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_raw", 0);

  /* "fstlib/cext/pywrapfst.pyx":762
 *   # All other methods should use the safer _raw_ptr_or_raise() instead.
 *   cdef const_SymbolTable_ptr _raw(self):
 *     return NULL             # <<<<<<<<<<<<<<
 * 
 *   # Raises an FstOpError for a nonexistent SymbolTable.
 */
  __pyx_r = NULL;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":761
 *   # Should not be directly accessed except by `_raw_ptr_or_raise()`.
 *   # All other methods should use the safer _raw_ptr_or_raise() instead.
 *   cdef const_SymbolTable_ptr _raw(self):             # <<<<<<<<<<<<<<
 *     return NULL
 * 
 */

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

/* "fstlib/cext/pywrapfst.pyx":765
 * 
 *   # Raises an FstOpError for a nonexistent SymbolTable.
 *   cdef void _raise_nonexistent(self) except *:             # <<<<<<<<<<<<<<
 *     raise FstOpError("SymbolTable no longer exists")
 * 
 */

static void __pyx_f_6fstlib_4cext_9pywrapfst_15SymbolTableView__raise_nonexistent(CYTHON_UNUSED struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_self) {
  __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("_raise_nonexistent", 0);

  /* "fstlib/cext/pywrapfst.pyx":766
 *   # Raises an FstOpError for a nonexistent SymbolTable.
 *   cdef void _raise_nonexistent(self) except *:
 *     raise FstOpError("SymbolTable no longer exists")             # <<<<<<<<<<<<<<
 * 
 *   # Internal API method that should be used when a const pointer to an
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FstOpError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 766, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_kp_u_SymbolTable_no_longer_exists) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_u_SymbolTable_no_longer_exists);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 766, __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(0, 766, __pyx_L1_error)

  /* "fstlib/cext/pywrapfst.pyx":765
 * 
 *   # Raises an FstOpError for a nonexistent SymbolTable.
 *   cdef void _raise_nonexistent(self) except *:             # <<<<<<<<<<<<<<
 *     raise FstOpError("SymbolTable no longer exists")
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.SymbolTableView._raise_nonexistent", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
}

/* "fstlib/cext/pywrapfst.pyx":770
 *   # Internal API method that should be used when a const pointer to an
 *   # fst.SymbolTable is required.
 *   cdef const_SymbolTable_ptr _raw_ptr_or_raise(self) except *:             # <<<<<<<<<<<<<<
 *     cdef const_SymbolTable_ptr _raw = self._raw()
 *     if _raw == NULL:
 */

static __pyx_t_6fstlib_4cext_9pywrapfst_const_SymbolTable_ptr __pyx_f_6fstlib_4cext_9pywrapfst_15SymbolTableView__raw_ptr_or_raise(struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_self) {
  __pyx_t_6fstlib_4cext_9pywrapfst_const_SymbolTable_ptr __pyx_v__raw;
  __pyx_t_6fstlib_4cext_9pywrapfst_const_SymbolTable_ptr __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_raw_ptr_or_raise", 0);

  /* "fstlib/cext/pywrapfst.pyx":771
 *   # fst.SymbolTable is required.
 *   cdef const_SymbolTable_ptr _raw_ptr_or_raise(self) except *:
 *     cdef const_SymbolTable_ptr _raw = self._raw()             # <<<<<<<<<<<<<<
 *     if _raw == NULL:
 *       self._raise_nonexistent()
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raw");
    __PYX_ERR(0, 771, __pyx_L1_error)
  }
  __pyx_v__raw = ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_SymbolTableView *)__pyx_v_self->__pyx_vtab)->_raw(__pyx_v_self);

  /* "fstlib/cext/pywrapfst.pyx":772
 *   cdef const_SymbolTable_ptr _raw_ptr_or_raise(self) except *:
 *     cdef const_SymbolTable_ptr _raw = self._raw()
 *     if _raw == NULL:             # <<<<<<<<<<<<<<
 *       self._raise_nonexistent()
 *     return _raw
 */
  __pyx_t_1 = ((__pyx_v__raw == NULL) != 0);
  if (__pyx_t_1) {

    /* "fstlib/cext/pywrapfst.pyx":773
 *     cdef const_SymbolTable_ptr _raw = self._raw()
 *     if _raw == NULL:
 *       self._raise_nonexistent()             # <<<<<<<<<<<<<<
 *     return _raw
 * 
 */
    if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raise_nonexistent");
      __PYX_ERR(0, 773, __pyx_L1_error)
    }
    ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_SymbolTableView *)__pyx_v_self->__pyx_vtab)->_raise_nonexistent(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 773, __pyx_L1_error)

    /* "fstlib/cext/pywrapfst.pyx":772
 *   cdef const_SymbolTable_ptr _raw_ptr_or_raise(self) except *:
 *     cdef const_SymbolTable_ptr _raw = self._raw()
 *     if _raw == NULL:             # <<<<<<<<<<<<<<
 *       self._raise_nonexistent()
 *     return _raw
 */
  }

  /* "fstlib/cext/pywrapfst.pyx":774
 *     if _raw == NULL:
 *       self._raise_nonexistent()
 *     return _raw             # <<<<<<<<<<<<<<
 * 
 *   cpdef int64 available_key(self) except *:
 */
  __pyx_r = __pyx_v__raw;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":770
 *   # Internal API method that should be used when a const pointer to an
 *   # fst.SymbolTable is required.
 *   cdef const_SymbolTable_ptr _raw_ptr_or_raise(self) except *:             # <<<<<<<<<<<<<<
 *     cdef const_SymbolTable_ptr _raw = self._raw()
 *     if _raw == NULL:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.SymbolTableView._raw_ptr_or_raise", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":776
 *     return _raw
 * 
 *   cpdef int64 available_key(self) except *:             # <<<<<<<<<<<<<<
 *     """
 *     available_key(self)
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_15SymbolTableView_7available_key(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static int64 __pyx_f_6fstlib_4cext_9pywrapfst_15SymbolTableView_available_key(struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_self, int __pyx_skip_dispatch) {
  int64 __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int64 __pyx_t_5;
  fst::SymbolTable const *__pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("available_key", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_available_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 776, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6fstlib_4cext_9pywrapfst_15SymbolTableView_7available_key)) {
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 776, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_5 = __Pyx_PyInt_As_int64_t(__pyx_t_2); if (unlikely((__pyx_t_5 == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 776, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_5;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "fstlib/cext/pywrapfst.pyx":782
 *     Returns an integer indicating the next available key index in the table.
 *     """
 *     return self._raw_ptr_or_raise().AvailableKey()             # <<<<<<<<<<<<<<
 * 
 *   cpdef bytes checksum(self):
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raw_ptr_or_raise");
    __PYX_ERR(0, 782, __pyx_L1_error)
  }
  __pyx_t_6 = ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_SymbolTableView *)__pyx_v_self->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 782, __pyx_L1_error)
  __pyx_r = __pyx_t_6->AvailableKey();
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":776
 *     return _raw
 * 
 *   cpdef int64 available_key(self) except *:             # <<<<<<<<<<<<<<
 *     """
 *     available_key(self)
 */

  /* 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("fstlib.cext.pywrapfst.SymbolTableView.available_key", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_15SymbolTableView_7available_key(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_15SymbolTableView_6available_key[] = "\n    available_key(self)\n\n    Returns an integer indicating the next available key index in the table.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_15SymbolTableView_7available_key(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("available_key (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_15SymbolTableView_6available_key(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_15SymbolTableView_6available_key(struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int64 __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("available_key", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6fstlib_4cext_9pywrapfst_15SymbolTableView_available_key(__pyx_v_self, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 776, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 776, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.SymbolTableView.available_key", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":784
 *     return self._raw_ptr_or_raise().AvailableKey()
 * 
 *   cpdef bytes checksum(self):             # <<<<<<<<<<<<<<
 *     """
 *     checksum(self)
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_15SymbolTableView_9checksum(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_6fstlib_4cext_9pywrapfst_15SymbolTableView_checksum(struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_self, int __pyx_skip_dispatch) {
  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;
  fst::SymbolTable const *__pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("checksum", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 784, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6fstlib_4cext_9pywrapfst_15SymbolTableView_9checksum)) {
        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 784, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (!(likely(PyBytes_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 784, __pyx_L1_error)
        __pyx_r = ((PyObject*)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "fstlib/cext/pywrapfst.pyx":790
 *     Returns a bytestring indicating the label-independent MD5 checksum.
 *     """
 *     return self._raw_ptr_or_raise().CheckSum()             # <<<<<<<<<<<<<<
 * 
 *   cpdef SymbolTable copy(self):
 */
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raw_ptr_or_raise");
    __PYX_ERR(0, 790, __pyx_L1_error)
  }
  __pyx_t_5 = ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_SymbolTableView *)__pyx_v_self->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 790, __pyx_L1_error)
  __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_t_5->CheckSum()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 790, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":784
 *     return self._raw_ptr_or_raise().AvailableKey()
 * 
 *   cpdef bytes checksum(self):             # <<<<<<<<<<<<<<
 *     """
 *     checksum(self)
 */

  /* 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("fstlib.cext.pywrapfst.SymbolTableView.checksum", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_15SymbolTableView_9checksum(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_15SymbolTableView_8checksum[] = "\n    checksum(self)\n\n    Returns a bytestring indicating the label-independent MD5 checksum.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_15SymbolTableView_9checksum(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("checksum (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_15SymbolTableView_8checksum(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_15SymbolTableView_8checksum(struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__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("checksum", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6fstlib_4cext_9pywrapfst_15SymbolTableView_checksum(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 784, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.SymbolTableView.checksum", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":792
 *     return self._raw_ptr_or_raise().CheckSum()
 * 
 *   cpdef SymbolTable copy(self):             # <<<<<<<<<<<<<<
 *     """
 *     copy(self)
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_15SymbolTableView_11copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTable *__pyx_f_6fstlib_4cext_9pywrapfst_15SymbolTableView_copy(struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_self, int __pyx_skip_dispatch) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTable *__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;
  fst::SymbolTable const *__pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("copy", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_copy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 792, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6fstlib_4cext_9pywrapfst_15SymbolTableView_11copy)) {
        __Pyx_XDECREF(((PyObject *)__pyx_r));
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 792, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_6fstlib_4cext_9pywrapfst_SymbolTable))))) __PYX_ERR(0, 792, __pyx_L1_error)
        __pyx_r = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTable *)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "fstlib/cext/pywrapfst.pyx":798
 *     Returns a mutable copy of the SymbolTable.
 *     """
 *     return _init_SymbolTable(WrapUnique(self._raw_ptr_or_raise().Copy()))             # <<<<<<<<<<<<<<
 * 
 *   def find(self, key):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raw_ptr_or_raise");
    __PYX_ERR(0, 798, __pyx_L1_error)
  }
  __pyx_t_5 = ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_SymbolTableView *)__pyx_v_self->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 798, __pyx_L1_error)
  __pyx_t_1 = ((PyObject *)__pyx_f_6fstlib_4cext_9pywrapfst__init_SymbolTable(fst::WrapUnique<fst::SymbolTable>(__pyx_t_5->Copy()))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 798, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTable *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":792
 *     return self._raw_ptr_or_raise().CheckSum()
 * 
 *   cpdef SymbolTable copy(self):             # <<<<<<<<<<<<<<
 *     """
 *     copy(self)
 */

  /* 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("fstlib.cext.pywrapfst.SymbolTableView.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_15SymbolTableView_11copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_15SymbolTableView_10copy[] = "\n    copy(self)\n\n    Returns a mutable copy of the SymbolTable.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_15SymbolTableView_11copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("copy (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_15SymbolTableView_10copy(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_15SymbolTableView_10copy(struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__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("copy", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_6fstlib_4cext_9pywrapfst_15SymbolTableView_copy(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 792, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.SymbolTableView.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":800
 *     return _init_SymbolTable(WrapUnique(self._raw_ptr_or_raise().Copy()))
 * 
 *   def find(self, key):             # <<<<<<<<<<<<<<
 *     """
 *     find(self, key)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_15SymbolTableView_13find(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_15SymbolTableView_12find[] = "\n    find(self, key)\n\n    Given a symbol or index, finds the other one.\n\n    This method returns the index associated with a symbol key, or the symbol\n    associated with a index key.\n\n    Args:\n      key: Either a string or an index.\n\n    Returns:\n      If the key is a string, the associated index or NO_LABEL if not found; if\n          the key is an integer, the associated symbol or an empty string if\n          not found.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_15SymbolTableView_13find(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("find (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_15SymbolTableView_12find(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *)__pyx_v_self), ((PyObject *)__pyx_v_key));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_15SymbolTableView_12find(struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_self, PyObject *__pyx_v_key) {
  __pyx_t_6fstlib_4cext_9pywrapfst_const_SymbolTable_ptr __pyx_v__raw;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  fst::SymbolTable const *__pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  std::string __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int64 __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("find", 0);

  /* "fstlib/cext/pywrapfst.pyx":817
 *           not found.
 *     """
 *     cdef const_SymbolTable_ptr _raw = self._raw_ptr_or_raise()             # <<<<<<<<<<<<<<
 *     try:
 *       return _raw.FindIndex(tostring(key))
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raw_ptr_or_raise");
    __PYX_ERR(0, 817, __pyx_L1_error)
  }
  __pyx_t_1 = ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_SymbolTableView *)__pyx_v_self->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 817, __pyx_L1_error)
  __pyx_v__raw = __pyx_t_1;

  /* "fstlib/cext/pywrapfst.pyx":818
 *     """
 *     cdef const_SymbolTable_ptr _raw = self._raw_ptr_or_raise()
 *     try:             # <<<<<<<<<<<<<<
 *       return _raw.FindIndex(tostring(key))
 *     except TypeError:
 */
  {
    __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:*/ {

      /* "fstlib/cext/pywrapfst.pyx":819
 *     cdef const_SymbolTable_ptr _raw = self._raw_ptr_or_raise()
 *     try:
 *       return _raw.FindIndex(tostring(key))             # <<<<<<<<<<<<<<
 *     except TypeError:
 *       return _raw.FindSymbol(key)
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_5 = __pyx_f_6fstlib_4cext_9pywrapfst_tostring(__pyx_v_key); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 819, __pyx_L3_error)
      __pyx_t_6 = __Pyx_PyInt_From_int64_t(__pyx_v__raw->Find(__pyx_t_5)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 819, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_r = __pyx_t_6;
      __pyx_t_6 = 0;
      goto __pyx_L7_try_return;

      /* "fstlib/cext/pywrapfst.pyx":818
 *     """
 *     cdef const_SymbolTable_ptr _raw = self._raw_ptr_or_raise()
 *     try:             # <<<<<<<<<<<<<<
 *       return _raw.FindIndex(tostring(key))
 *     except TypeError:
 */
    }
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "fstlib/cext/pywrapfst.pyx":820
 *     try:
 *       return _raw.FindIndex(tostring(key))
 *     except TypeError:             # <<<<<<<<<<<<<<
 *       return _raw.FindSymbol(key)
 * 
 */
    __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
    if (__pyx_t_7) {
      __Pyx_AddTraceback("fstlib.cext.pywrapfst.SymbolTableView.find", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_8, &__pyx_t_9) < 0) __PYX_ERR(0, 820, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_9);

      /* "fstlib/cext/pywrapfst.pyx":821
 *       return _raw.FindIndex(tostring(key))
 *     except TypeError:
 *       return _raw.FindSymbol(key)             # <<<<<<<<<<<<<<
 * 
 *   cpdef int64 get_nth_key(self, ssize_t pos) except *:
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_10 = __Pyx_PyInt_As_int64_t(__pyx_v_key); if (unlikely((__pyx_t_10 == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 821, __pyx_L5_except_error)
      __pyx_t_11 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_v__raw->Find(__pyx_t_10)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 821, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_r = __pyx_t_11;
      __pyx_t_11 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      goto __pyx_L6_except_return;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "fstlib/cext/pywrapfst.pyx":818
 *     """
 *     cdef const_SymbolTable_ptr _raw = self._raw_ptr_or_raise()
 *     try:             # <<<<<<<<<<<<<<
 *       return _raw.FindIndex(tostring(key))
 *     except TypeError:
 */
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
    goto __pyx_L1_error;
    __pyx_L7_try_return:;
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
    goto __pyx_L0;
    __pyx_L6_except_return:;
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
    goto __pyx_L0;
  }

  /* "fstlib/cext/pywrapfst.pyx":800
 *     return _init_SymbolTable(WrapUnique(self._raw_ptr_or_raise().Copy()))
 * 
 *   def find(self, key):             # <<<<<<<<<<<<<<
 *     """
 *     find(self, key)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.SymbolTableView.find", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":823
 *       return _raw.FindSymbol(key)
 * 
 *   cpdef int64 get_nth_key(self, ssize_t pos) except *:             # <<<<<<<<<<<<<<
 *     """
 *     get_nth_key(self, pos)
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_15SymbolTableView_15get_nth_key(PyObject *__pyx_v_self, PyObject *__pyx_arg_pos); /*proto*/
static int64 __pyx_f_6fstlib_4cext_9pywrapfst_15SymbolTableView_get_nth_key(struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_self, Py_ssize_t __pyx_v_pos, int __pyx_skip_dispatch) {
  int64 __pyx_r;
  __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;
  int64 __pyx_t_6;
  fst::SymbolTable const *__pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_nth_key", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_nth_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 823, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6fstlib_4cext_9pywrapfst_15SymbolTableView_15get_nth_key)) {
        __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_pos); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 823, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
          if (likely(__pyx_t_5)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
            __Pyx_INCREF(__pyx_t_5);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_4, function);
          }
        }
        __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 823, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_6 = __Pyx_PyInt_As_int64_t(__pyx_t_2); if (unlikely((__pyx_t_6 == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 823, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_6;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "fstlib/cext/pywrapfst.pyx":835
 *       The integer index of the n-th key, or NO_LABEL if not found.
 *     """
 *     return self._raw_ptr_or_raise().GetNthKey(pos)             # <<<<<<<<<<<<<<
 * 
 *   cpdef bytes labeled_checksum(self):
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raw_ptr_or_raise");
    __PYX_ERR(0, 835, __pyx_L1_error)
  }
  __pyx_t_7 = ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_SymbolTableView *)__pyx_v_self->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 835, __pyx_L1_error)
  __pyx_r = __pyx_t_7->GetNthKey(__pyx_v_pos);
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":823
 *       return _raw.FindSymbol(key)
 * 
 *   cpdef int64 get_nth_key(self, ssize_t pos) except *:             # <<<<<<<<<<<<<<
 *     """
 *     get_nth_key(self, pos)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.SymbolTableView.get_nth_key", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_15SymbolTableView_15get_nth_key(PyObject *__pyx_v_self, PyObject *__pyx_arg_pos); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_15SymbolTableView_14get_nth_key[] = "\n    get_nth_key(self, pos)\n\n    Retrieves the integer index of the n-th key in the table.\n\n    Args:\n      pos: The n-th key to retrieve.\n\n    Returns:\n      The integer index of the n-th key, or NO_LABEL if not found.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_15SymbolTableView_15get_nth_key(PyObject *__pyx_v_self, PyObject *__pyx_arg_pos) {
  Py_ssize_t __pyx_v_pos;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_nth_key (wrapper)", 0);
  assert(__pyx_arg_pos); {
    __pyx_v_pos = PyInt_AsSsize_t(__pyx_arg_pos); if (unlikely((__pyx_v_pos == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 823, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.SymbolTableView.get_nth_key", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_15SymbolTableView_14get_nth_key(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *)__pyx_v_self), ((Py_ssize_t)__pyx_v_pos));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_15SymbolTableView_14get_nth_key(struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_self, Py_ssize_t __pyx_v_pos) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int64 __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_nth_key", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6fstlib_4cext_9pywrapfst_15SymbolTableView_get_nth_key(__pyx_v_self, __pyx_v_pos, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 823, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 823, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.SymbolTableView.get_nth_key", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":837
 *     return self._raw_ptr_or_raise().GetNthKey(pos)
 * 
 *   cpdef bytes labeled_checksum(self):             # <<<<<<<<<<<<<<
 *     """
 *     labeled_checksum(self)
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_15SymbolTableView_17labeled_checksum(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_6fstlib_4cext_9pywrapfst_15SymbolTableView_labeled_checksum(struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_self, int __pyx_skip_dispatch) {
  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;
  fst::SymbolTable const *__pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("labeled_checksum", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_labeled_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 837, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6fstlib_4cext_9pywrapfst_15SymbolTableView_17labeled_checksum)) {
        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 837, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (!(likely(PyBytes_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 837, __pyx_L1_error)
        __pyx_r = ((PyObject*)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "fstlib/cext/pywrapfst.pyx":843
 *     Returns a bytestring indicating the label-dependent MD5 checksum.
 *     """
 *     return self._raw_ptr_or_raise().LabeledCheckSum()             # <<<<<<<<<<<<<<
 * 
 *   cpdef bool member(self, key) except *:
 */
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raw_ptr_or_raise");
    __PYX_ERR(0, 843, __pyx_L1_error)
  }
  __pyx_t_5 = ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_SymbolTableView *)__pyx_v_self->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 843, __pyx_L1_error)
  __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_t_5->LabeledCheckSum()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 843, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":837
 *     return self._raw_ptr_or_raise().GetNthKey(pos)
 * 
 *   cpdef bytes labeled_checksum(self):             # <<<<<<<<<<<<<<
 *     """
 *     labeled_checksum(self)
 */

  /* 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("fstlib.cext.pywrapfst.SymbolTableView.labeled_checksum", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_15SymbolTableView_17labeled_checksum(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_15SymbolTableView_16labeled_checksum[] = "\n    labeled_checksum(self)\n\n    Returns a bytestring indicating the label-dependent MD5 checksum.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_15SymbolTableView_17labeled_checksum(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("labeled_checksum (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_15SymbolTableView_16labeled_checksum(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_15SymbolTableView_16labeled_checksum(struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__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("labeled_checksum", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6fstlib_4cext_9pywrapfst_15SymbolTableView_labeled_checksum(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 837, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.SymbolTableView.labeled_checksum", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":845
 *     return self._raw_ptr_or_raise().LabeledCheckSum()
 * 
 *   cpdef bool member(self, key) except *:             # <<<<<<<<<<<<<<
 *     """
 *     member(self, key)
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_15SymbolTableView_19member(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static bool __pyx_f_6fstlib_4cext_9pywrapfst_15SymbolTableView_member(struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch) {
  __pyx_t_6fstlib_4cext_9pywrapfst_const_SymbolTable_ptr __pyx_v__raw;
  bool __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  bool __pyx_t_5;
  fst::SymbolTable const *__pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  std::string __pyx_t_10;
  int __pyx_t_11;
  int64 __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("member", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_member); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 845, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6fstlib_4cext_9pywrapfst_15SymbolTableView_19member)) {
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_key) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_key);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 845, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 845, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_5;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "fstlib/cext/pywrapfst.pyx":861
 *       Whether or not the key is present (as a string or a index) in the table.
 *     """
 *     cdef const_SymbolTable_ptr _raw = self._raw_ptr_or_raise()             # <<<<<<<<<<<<<<
 *     try:
 *       return _raw.MemberSymbol(tostring(key))
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raw_ptr_or_raise");
    __PYX_ERR(0, 861, __pyx_L1_error)
  }
  __pyx_t_6 = ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_SymbolTableView *)__pyx_v_self->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 861, __pyx_L1_error)
  __pyx_v__raw = __pyx_t_6;

  /* "fstlib/cext/pywrapfst.pyx":862
 *     """
 *     cdef const_SymbolTable_ptr _raw = self._raw_ptr_or_raise()
 *     try:             # <<<<<<<<<<<<<<
 *       return _raw.MemberSymbol(tostring(key))
 *     except TypeError:
 */
  {
    __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:*/ {

      /* "fstlib/cext/pywrapfst.pyx":863
 *     cdef const_SymbolTable_ptr _raw = self._raw_ptr_or_raise()
 *     try:
 *       return _raw.MemberSymbol(tostring(key))             # <<<<<<<<<<<<<<
 *     except TypeError:
 *       return _raw.MemberIndex(key)
 */
      __pyx_t_10 = __pyx_f_6fstlib_4cext_9pywrapfst_tostring(__pyx_v_key); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 863, __pyx_L3_error)
      __pyx_r = __pyx_v__raw->Member(__pyx_t_10);
      goto __pyx_L7_try_return;

      /* "fstlib/cext/pywrapfst.pyx":862
 *     """
 *     cdef const_SymbolTable_ptr _raw = self._raw_ptr_or_raise()
 *     try:             # <<<<<<<<<<<<<<
 *       return _raw.MemberSymbol(tostring(key))
 *     except TypeError:
 */
    }
    __pyx_L3_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;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "fstlib/cext/pywrapfst.pyx":864
 *     try:
 *       return _raw.MemberSymbol(tostring(key))
 *     except TypeError:             # <<<<<<<<<<<<<<
 *       return _raw.MemberIndex(key)
 * 
 */
    __pyx_t_11 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
    if (__pyx_t_11) {
      __Pyx_AddTraceback("fstlib.cext.pywrapfst.SymbolTableView.member", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3) < 0) __PYX_ERR(0, 864, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_t_3);

      /* "fstlib/cext/pywrapfst.pyx":865
 *       return _raw.MemberSymbol(tostring(key))
 *     except TypeError:
 *       return _raw.MemberIndex(key)             # <<<<<<<<<<<<<<
 * 
 *   cpdef string name(self) except *:
 */
      __pyx_t_12 = __Pyx_PyInt_As_int64_t(__pyx_v_key); if (unlikely((__pyx_t_12 == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 865, __pyx_L5_except_error)
      __pyx_r = __pyx_v__raw->Member(__pyx_t_12);
      __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_L6_except_return;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "fstlib/cext/pywrapfst.pyx":862
 *     """
 *     cdef const_SymbolTable_ptr _raw = self._raw_ptr_or_raise()
 *     try:             # <<<<<<<<<<<<<<
 *       return _raw.MemberSymbol(tostring(key))
 *     except TypeError:
 */
    __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_L7_try_return:;
    __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_L0;
    __pyx_L6_except_return:;
    __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_L0;
  }

  /* "fstlib/cext/pywrapfst.pyx":845
 *     return self._raw_ptr_or_raise().LabeledCheckSum()
 * 
 *   cpdef bool member(self, key) except *:             # <<<<<<<<<<<<<<
 *     """
 *     member(self, key)
 */

  /* 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("fstlib.cext.pywrapfst.SymbolTableView.member", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_15SymbolTableView_19member(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_15SymbolTableView_18member[] = "\n    member(self, key)\n\n    Given a symbol or index, returns whether it is found in the table.\n\n    This method returns a boolean indicating whether the given symbol or index\n    is present in the table. If one intends to perform subsequent lookup, it is\n    better to simply call the find method, catching the KeyError.\n\n    Args:\n      key: Either a string or an index.\n\n    Returns:\n      Whether or not the key is present (as a string or a index) in the table.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_15SymbolTableView_19member(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("member (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_15SymbolTableView_18member(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *)__pyx_v_self), ((PyObject *)__pyx_v_key));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_15SymbolTableView_18member(struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  bool __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("member", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6fstlib_4cext_9pywrapfst_15SymbolTableView_member(__pyx_v_self, __pyx_v_key, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 845, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 845, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.SymbolTableView.member", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":867
 *       return _raw.MemberIndex(key)
 * 
 *   cpdef string name(self) except *:             # <<<<<<<<<<<<<<
 *     """
 *     name(self)
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_15SymbolTableView_21name(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static std::string __pyx_f_6fstlib_4cext_9pywrapfst_15SymbolTableView_name(struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_self, int __pyx_skip_dispatch) {
  std::string __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  std::string __pyx_t_5;
  fst::SymbolTable const *__pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("name", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 867, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6fstlib_4cext_9pywrapfst_15SymbolTableView_21name)) {
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 867, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 867, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_5;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "fstlib/cext/pywrapfst.pyx":873
 *     Returns the symbol table's name.
 *     """
 *     return self._raw_ptr_or_raise().Name()             # <<<<<<<<<<<<<<
 * 
 *   cpdef size_t num_symbols(self) except *:
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raw_ptr_or_raise");
    __PYX_ERR(0, 873, __pyx_L1_error)
  }
  __pyx_t_6 = ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_SymbolTableView *)__pyx_v_self->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 873, __pyx_L1_error)
  __pyx_r = __pyx_t_6->Name();
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":867
 *       return _raw.MemberIndex(key)
 * 
 *   cpdef string name(self) except *:             # <<<<<<<<<<<<<<
 *     """
 *     name(self)
 */

  /* 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("fstlib.cext.pywrapfst.SymbolTableView.name", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_15SymbolTableView_21name(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_15SymbolTableView_20name[] = "\n    name(self)\n\n    Returns the symbol table's name.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_15SymbolTableView_21name(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("name (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_15SymbolTableView_20name(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_15SymbolTableView_20name(struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("name", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6fstlib_4cext_9pywrapfst_15SymbolTableView_name(__pyx_v_self, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 867, __pyx_L1_error)
  __pyx_t_2 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 867, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.SymbolTableView.name", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":875
 *     return self._raw_ptr_or_raise().Name()
 * 
 *   cpdef size_t num_symbols(self) except *:             # <<<<<<<<<<<<<<
 *     """
 *     num_symbols(self)
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_15SymbolTableView_23num_symbols(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static size_t __pyx_f_6fstlib_4cext_9pywrapfst_15SymbolTableView_num_symbols(struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_self, int __pyx_skip_dispatch) {
  size_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  fst::SymbolTable const *__pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("num_symbols", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_symbols); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 875, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6fstlib_4cext_9pywrapfst_15SymbolTableView_23num_symbols)) {
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 875, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_5 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 875, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_5;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "fstlib/cext/pywrapfst.pyx":881
 *     Returns the number of symbols in the symbol table.
 *     """
 *     return self._raw_ptr_or_raise().NumSymbols()             # <<<<<<<<<<<<<<
 * 
 *   cpdef void write(self, source) except *:
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raw_ptr_or_raise");
    __PYX_ERR(0, 881, __pyx_L1_error)
  }
  __pyx_t_6 = ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_SymbolTableView *)__pyx_v_self->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 881, __pyx_L1_error)
  __pyx_r = __pyx_t_6->NumSymbols();
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":875
 *     return self._raw_ptr_or_raise().Name()
 * 
 *   cpdef size_t num_symbols(self) except *:             # <<<<<<<<<<<<<<
 *     """
 *     num_symbols(self)
 */

  /* 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("fstlib.cext.pywrapfst.SymbolTableView.num_symbols", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_15SymbolTableView_23num_symbols(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_15SymbolTableView_22num_symbols[] = "\n    num_symbols(self)\n\n    Returns the number of symbols in the symbol table.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_15SymbolTableView_23num_symbols(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("num_symbols (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_15SymbolTableView_22num_symbols(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_15SymbolTableView_22num_symbols(struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_self) {
  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("num_symbols", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6fstlib_4cext_9pywrapfst_15SymbolTableView_num_symbols(__pyx_v_self, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 875, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 875, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.SymbolTableView.num_symbols", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":883
 *     return self._raw_ptr_or_raise().NumSymbols()
 * 
 *   cpdef void write(self, source) except *:             # <<<<<<<<<<<<<<
 *     """
 *     write(self, source)
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_15SymbolTableView_25write(PyObject *__pyx_v_self, PyObject *__pyx_v_source); /*proto*/
static void __pyx_f_6fstlib_4cext_9pywrapfst_15SymbolTableView_write(struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_self, PyObject *__pyx_v_source, int __pyx_skip_dispatch) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  fst::SymbolTable const *__pyx_t_5;
  std::string __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("write", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_write); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 883, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6fstlib_4cext_9pywrapfst_15SymbolTableView_25write)) {
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_source) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_source);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 883, __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;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "fstlib/cext/pywrapfst.pyx":897
 *       FstIOError: Write failed.
 *     """
 *     if not self._raw_ptr_or_raise().Write(path_tostring(source)):             # <<<<<<<<<<<<<<
 *       raise FstIOError(f"Write failed: {source!r}")
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raw_ptr_or_raise");
    __PYX_ERR(0, 897, __pyx_L1_error)
  }
  __pyx_t_5 = ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_SymbolTableView *)__pyx_v_self->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 897, __pyx_L1_error)
  __pyx_t_6 = __pyx_f_6fstlib_4cext_9pywrapfst_path_tostring(__pyx_v_source); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 897, __pyx_L1_error)
  __pyx_t_7 = ((!(__pyx_t_5->Write(__pyx_t_6) != 0)) != 0);
  if (unlikely(__pyx_t_7)) {

    /* "fstlib/cext/pywrapfst.pyx":898
 *     """
 *     if not self._raw_ptr_or_raise().Write(path_tostring(source)):
 *       raise FstIOError(f"Write failed: {source!r}")             # <<<<<<<<<<<<<<
 * 
 *   cpdef void write_text(self, source) except *:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FstIOError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 898, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_source), __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 898, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Write_failed, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 898, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_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_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 898, __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(0, 898, __pyx_L1_error)

    /* "fstlib/cext/pywrapfst.pyx":897
 *       FstIOError: Write failed.
 *     """
 *     if not self._raw_ptr_or_raise().Write(path_tostring(source)):             # <<<<<<<<<<<<<<
 *       raise FstIOError(f"Write failed: {source!r}")
 * 
 */
  }

  /* "fstlib/cext/pywrapfst.pyx":883
 *     return self._raw_ptr_or_raise().NumSymbols()
 * 
 *   cpdef void write(self, source) except *:             # <<<<<<<<<<<<<<
 *     """
 *     write(self, source)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.SymbolTableView.write", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_15SymbolTableView_25write(PyObject *__pyx_v_self, PyObject *__pyx_v_source); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_15SymbolTableView_24write[] = "\n    write(self, source)\n\n    Serializes symbol table to a file.\n\n    This methods writes the SymbolTable to a file in binary format.\n\n    Args:\n      source: The string location of the output file.\n\n    Raises:\n      FstIOError: Write failed.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_15SymbolTableView_25write(PyObject *__pyx_v_self, PyObject *__pyx_v_source) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("write (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_15SymbolTableView_24write(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *)__pyx_v_self), ((PyObject *)__pyx_v_source));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_15SymbolTableView_24write(struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_self, PyObject *__pyx_v_source) {
  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("write", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_6fstlib_4cext_9pywrapfst_15SymbolTableView_write(__pyx_v_self, __pyx_v_source, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 883, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 883, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.SymbolTableView.write", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":900
 *       raise FstIOError(f"Write failed: {source!r}")
 * 
 *   cpdef void write_text(self, source) except *:             # <<<<<<<<<<<<<<
 *     """
 *     write_text(self, source)
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_15SymbolTableView_27write_text(PyObject *__pyx_v_self, PyObject *__pyx_v_source); /*proto*/
static void __pyx_f_6fstlib_4cext_9pywrapfst_15SymbolTableView_write_text(struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_self, PyObject *__pyx_v_source, int __pyx_skip_dispatch) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  fst::SymbolTable const *__pyx_t_5;
  std::string __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("write_text", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_write_text); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 900, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6fstlib_4cext_9pywrapfst_15SymbolTableView_27write_text)) {
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_source) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_source);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 900, __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;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "fstlib/cext/pywrapfst.pyx":914
 *       FstIOError: Write failed.
 *     """
 *     if not self._raw_ptr_or_raise().WriteText(path_tostring(source)):             # <<<<<<<<<<<<<<
 *       raise FstIOError(f"Write failed: {source!r}")
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raw_ptr_or_raise");
    __PYX_ERR(0, 914, __pyx_L1_error)
  }
  __pyx_t_5 = ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_SymbolTableView *)__pyx_v_self->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 914, __pyx_L1_error)
  __pyx_t_6 = __pyx_f_6fstlib_4cext_9pywrapfst_path_tostring(__pyx_v_source); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 914, __pyx_L1_error)
  __pyx_t_7 = ((!(__pyx_t_5->WriteText(__pyx_t_6) != 0)) != 0);
  if (unlikely(__pyx_t_7)) {

    /* "fstlib/cext/pywrapfst.pyx":915
 *     """
 *     if not self._raw_ptr_or_raise().WriteText(path_tostring(source)):
 *       raise FstIOError(f"Write failed: {source!r}")             # <<<<<<<<<<<<<<
 * 
 *   cpdef bytes write_to_string(self):
 */
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FstIOError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 915, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_source), __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 915, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Write_failed, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 915, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_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_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 915, __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(0, 915, __pyx_L1_error)

    /* "fstlib/cext/pywrapfst.pyx":914
 *       FstIOError: Write failed.
 *     """
 *     if not self._raw_ptr_or_raise().WriteText(path_tostring(source)):             # <<<<<<<<<<<<<<
 *       raise FstIOError(f"Write failed: {source!r}")
 * 
 */
  }

  /* "fstlib/cext/pywrapfst.pyx":900
 *       raise FstIOError(f"Write failed: {source!r}")
 * 
 *   cpdef void write_text(self, source) except *:             # <<<<<<<<<<<<<<
 *     """
 *     write_text(self, source)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.SymbolTableView.write_text", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_15SymbolTableView_27write_text(PyObject *__pyx_v_self, PyObject *__pyx_v_source); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_15SymbolTableView_26write_text[] = "\n    write_text(self, source)\n\n    Writes symbol table to text file.\n\n    This method writes the SymbolTable to a file in human-readable format.\n\n    Args:\n      source: The string location of the output file.\n\n    Raises:\n      FstIOError: Write failed.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_15SymbolTableView_27write_text(PyObject *__pyx_v_self, PyObject *__pyx_v_source) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("write_text (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_15SymbolTableView_26write_text(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *)__pyx_v_self), ((PyObject *)__pyx_v_source));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_15SymbolTableView_26write_text(struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_self, PyObject *__pyx_v_source) {
  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("write_text", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_6fstlib_4cext_9pywrapfst_15SymbolTableView_write_text(__pyx_v_self, __pyx_v_source, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 900, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 900, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.SymbolTableView.write_text", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":917
 *       raise FstIOError(f"Write failed: {source!r}")
 * 
 *   cpdef bytes write_to_string(self):             # <<<<<<<<<<<<<<
 *     """
 *     write_to_string(self)
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_15SymbolTableView_29write_to_string(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_6fstlib_4cext_9pywrapfst_15SymbolTableView_write_to_string(struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_self, int __pyx_skip_dispatch) {
  std::stringstream __pyx_v__sstrm;
  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;
  fst::SymbolTable const *__pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("write_to_string", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_write_to_string); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 917, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6fstlib_4cext_9pywrapfst_15SymbolTableView_29write_to_string)) {
        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 917, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (!(likely(PyBytes_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 917, __pyx_L1_error)
        __pyx_r = ((PyObject*)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "fstlib/cext/pywrapfst.pyx":930
 *     """
 *     cdef stringstream _sstrm
 *     if not self._raw_ptr_or_raise().Write(_sstrm):             # <<<<<<<<<<<<<<
 *       raise FstIOError("Write to string failed")
 *     return _sstrm.str()
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raw_ptr_or_raise");
    __PYX_ERR(0, 930, __pyx_L1_error)
  }
  __pyx_t_5 = ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_SymbolTableView *)__pyx_v_self->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 930, __pyx_L1_error)
  __pyx_t_6 = ((!(__pyx_t_5->Write(__pyx_v__sstrm) != 0)) != 0);
  if (unlikely(__pyx_t_6)) {

    /* "fstlib/cext/pywrapfst.pyx":931
 *     cdef stringstream _sstrm
 *     if not self._raw_ptr_or_raise().Write(_sstrm):
 *       raise FstIOError("Write to string failed")             # <<<<<<<<<<<<<<
 *     return _sstrm.str()
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FstIOError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 931, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_kp_u_Write_to_string_failed) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_u_Write_to_string_failed);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 931, __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(0, 931, __pyx_L1_error)

    /* "fstlib/cext/pywrapfst.pyx":930
 *     """
 *     cdef stringstream _sstrm
 *     if not self._raw_ptr_or_raise().Write(_sstrm):             # <<<<<<<<<<<<<<
 *       raise FstIOError("Write to string failed")
 *     return _sstrm.str()
 */
  }

  /* "fstlib/cext/pywrapfst.pyx":932
 *     if not self._raw_ptr_or_raise().Write(_sstrm):
 *       raise FstIOError("Write to string failed")
 *     return _sstrm.str()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v__sstrm.str()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 932, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":917
 *       raise FstIOError(f"Write failed: {source!r}")
 * 
 *   cpdef bytes write_to_string(self):             # <<<<<<<<<<<<<<
 *     """
 *     write_to_string(self)
 */

  /* 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("fstlib.cext.pywrapfst.SymbolTableView.write_to_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_15SymbolTableView_29write_to_string(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_15SymbolTableView_28write_to_string[] = "\n    write_to_string(self)\n\n    Serializes SymbolTable to a string.\n\n    Returns:\n      A bytestring.\n\n    Raises:\n      FstIOError: Write to string failed.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_15SymbolTableView_29write_to_string(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("write_to_string (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_15SymbolTableView_28write_to_string(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_15SymbolTableView_28write_to_string(struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__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("write_to_string", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6fstlib_4cext_9pywrapfst_15SymbolTableView_write_to_string(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 917, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.SymbolTableView.write_to_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":950
 *   # Doing so will allow undefined behavior.
 * 
 *   def __repr__(self):             # <<<<<<<<<<<<<<
 *     return (f"<const EncodeMapper SymbolTableView {self.name()!r} "
 *             f"at 0x{id(self):x}>")
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_28_EncodeMapperSymbolTableView_1__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_28_EncodeMapperSymbolTableView_1__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_28_EncodeMapperSymbolTableView___repr__(((struct __pyx_obj_6fstlib_4cext_9pywrapfst__EncodeMapperSymbolTableView *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_28_EncodeMapperSymbolTableView___repr__(struct __pyx_obj_6fstlib_4cext_9pywrapfst__EncodeMapperSymbolTableView *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  Py_UCS4 __pyx_t_3;
  std::string __pyx_t_4;
  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("__repr__", 0);

  /* "fstlib/cext/pywrapfst.pyx":951
 * 
 *   def __repr__(self):
 *     return (f"<const EncodeMapper SymbolTableView {self.name()!r} "             # <<<<<<<<<<<<<<
 *             f"at 0x{id(self):x}>")
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 951, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = 0;
  __pyx_t_3 = 127;
  __Pyx_INCREF(__pyx_kp_u_const_EncodeMapper_SymbolTableV);
  __pyx_t_2 += 36;
  __Pyx_GIVEREF(__pyx_kp_u_const_EncodeMapper_SymbolTableV);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_const_EncodeMapper_SymbolTableV);
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "name");
    __PYX_ERR(0, 951, __pyx_L1_error)
  }
  __pyx_t_4 = ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst__EncodeMapperSymbolTableView *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.name(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *)__pyx_v_self), 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 951, __pyx_L1_error)
  __pyx_t_5 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 951, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_5), __pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 951, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_6);
  __pyx_t_6 = 0;
  __Pyx_INCREF(__pyx_kp_u_at_0x);
  __pyx_t_2 += 6;
  __Pyx_GIVEREF(__pyx_kp_u_at_0x);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_at_0x);

  /* "fstlib/cext/pywrapfst.pyx":952
 *   def __repr__(self):
 *     return (f"<const EncodeMapper SymbolTableView {self.name()!r} "
 *             f"at 0x{id(self):x}>")             # <<<<<<<<<<<<<<
 * 
 *   cdef const_SymbolTable_ptr _raw(self):
 */
  __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 952, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = __Pyx_PyObject_Format(__pyx_t_6, __pyx_n_u_x); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 952, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_5);
  __pyx_t_5 = 0;
  __Pyx_INCREF(__pyx_kp_u__3);
  __pyx_t_2 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__3);
  PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u__3);

  /* "fstlib/cext/pywrapfst.pyx":951
 * 
 *   def __repr__(self):
 *     return (f"<const EncodeMapper SymbolTableView {self.name()!r} "             # <<<<<<<<<<<<<<
 *             f"at 0x{id(self):x}>")
 * 
 */
  __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_1, 5, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 951, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":950
 *   # Doing so will allow undefined behavior.
 * 
 *   def __repr__(self):             # <<<<<<<<<<<<<<
 *     return (f"<const EncodeMapper SymbolTableView {self.name()!r} "
 *             f"at 0x{id(self):x}>")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst._EncodeMapperSymbolTableView.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":954
 *             f"at 0x{id(self):x}>")
 * 
 *   cdef const_SymbolTable_ptr _raw(self):             # <<<<<<<<<<<<<<
 *     return (self._mapper.get().InputSymbols() if self._input_side
 *             else self._mapper.get().OutputSymbols())
 */

static __pyx_t_6fstlib_4cext_9pywrapfst_const_SymbolTable_ptr __pyx_f_6fstlib_4cext_9pywrapfst_28_EncodeMapperSymbolTableView__raw(struct __pyx_obj_6fstlib_4cext_9pywrapfst__EncodeMapperSymbolTableView *__pyx_v_self) {
  __pyx_t_6fstlib_4cext_9pywrapfst_const_SymbolTable_ptr __pyx_r;
  __Pyx_RefNannyDeclarations
  fst::SymbolTable const *__pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_raw", 0);

  /* "fstlib/cext/pywrapfst.pyx":955
 * 
 *   cdef const_SymbolTable_ptr _raw(self):
 *     return (self._mapper.get().InputSymbols() if self._input_side             # <<<<<<<<<<<<<<
 *             else self._mapper.get().OutputSymbols())
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_input_side");
    __PYX_ERR(0, 955, __pyx_L1_error)
  }
  if ((__pyx_v_self->_input_side != 0)) {
    if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mapper");
      __PYX_ERR(0, 955, __pyx_L1_error)
    }
    __pyx_t_1 = __pyx_v_self->_mapper.get()->InputSymbols();
  } else {

    /* "fstlib/cext/pywrapfst.pyx":956
 *   cdef const_SymbolTable_ptr _raw(self):
 *     return (self._mapper.get().InputSymbols() if self._input_side
 *             else self._mapper.get().OutputSymbols())             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mapper");
      __PYX_ERR(0, 956, __pyx_L1_error)
    }
    __pyx_t_1 = __pyx_v_self->_mapper.get()->OutputSymbols();
  }
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":954
 *             f"at 0x{id(self):x}>")
 * 
 *   cdef const_SymbolTable_ptr _raw(self):             # <<<<<<<<<<<<<<
 *     return (self._mapper.get().InputSymbols() if self._input_side
 *             else self._mapper.get().OutputSymbols())
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("fstlib.cext.pywrapfst._EncodeMapperSymbolTableView._raw", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":973
 *   # Doing so will allow undefined behavior.
 * 
 *   def __repr__(self):             # <<<<<<<<<<<<<<
 *     return (f"<const Fst SymbolTableView {self.name()!r} "
 *             f"at 0x{id(self):x}>")
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_19_FstSymbolTableView_1__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_19_FstSymbolTableView_1__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_19_FstSymbolTableView___repr__(((struct __pyx_obj_6fstlib_4cext_9pywrapfst__FstSymbolTableView *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_19_FstSymbolTableView___repr__(struct __pyx_obj_6fstlib_4cext_9pywrapfst__FstSymbolTableView *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  Py_UCS4 __pyx_t_3;
  std::string __pyx_t_4;
  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("__repr__", 0);

  /* "fstlib/cext/pywrapfst.pyx":974
 * 
 *   def __repr__(self):
 *     return (f"<const Fst SymbolTableView {self.name()!r} "             # <<<<<<<<<<<<<<
 *             f"at 0x{id(self):x}>")
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 974, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = 0;
  __pyx_t_3 = 127;
  __Pyx_INCREF(__pyx_kp_u_const_Fst_SymbolTableView);
  __pyx_t_2 += 27;
  __Pyx_GIVEREF(__pyx_kp_u_const_Fst_SymbolTableView);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_const_Fst_SymbolTableView);
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "name");
    __PYX_ERR(0, 974, __pyx_L1_error)
  }
  __pyx_t_4 = ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst__FstSymbolTableView *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.name(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *)__pyx_v_self), 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 974, __pyx_L1_error)
  __pyx_t_5 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 974, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_5), __pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 974, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_6);
  __pyx_t_6 = 0;
  __Pyx_INCREF(__pyx_kp_u_at_0x);
  __pyx_t_2 += 6;
  __Pyx_GIVEREF(__pyx_kp_u_at_0x);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_at_0x);

  /* "fstlib/cext/pywrapfst.pyx":975
 *   def __repr__(self):
 *     return (f"<const Fst SymbolTableView {self.name()!r} "
 *             f"at 0x{id(self):x}>")             # <<<<<<<<<<<<<<
 * 
 *   cdef const_SymbolTable_ptr _raw(self):
 */
  __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 975, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = __Pyx_PyObject_Format(__pyx_t_6, __pyx_n_u_x); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 975, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_5);
  __pyx_t_5 = 0;
  __Pyx_INCREF(__pyx_kp_u__3);
  __pyx_t_2 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__3);
  PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u__3);

  /* "fstlib/cext/pywrapfst.pyx":974
 * 
 *   def __repr__(self):
 *     return (f"<const Fst SymbolTableView {self.name()!r} "             # <<<<<<<<<<<<<<
 *             f"at 0x{id(self):x}>")
 * 
 */
  __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_1, 5, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 974, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":973
 *   # Doing so will allow undefined behavior.
 * 
 *   def __repr__(self):             # <<<<<<<<<<<<<<
 *     return (f"<const Fst SymbolTableView {self.name()!r} "
 *             f"at 0x{id(self):x}>")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst._FstSymbolTableView.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":977
 *             f"at 0x{id(self):x}>")
 * 
 *   cdef const_SymbolTable_ptr _raw(self):             # <<<<<<<<<<<<<<
 *     return (self._fst.get().InputSymbols() if self._input_side
 *             else self._fst.get().OutputSymbols())
 */

static __pyx_t_6fstlib_4cext_9pywrapfst_const_SymbolTable_ptr __pyx_f_6fstlib_4cext_9pywrapfst_19_FstSymbolTableView__raw(struct __pyx_obj_6fstlib_4cext_9pywrapfst__FstSymbolTableView *__pyx_v_self) {
  __pyx_t_6fstlib_4cext_9pywrapfst_const_SymbolTable_ptr __pyx_r;
  __Pyx_RefNannyDeclarations
  fst::SymbolTable const *__pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_raw", 0);

  /* "fstlib/cext/pywrapfst.pyx":978
 * 
 *   cdef const_SymbolTable_ptr _raw(self):
 *     return (self._fst.get().InputSymbols() if self._input_side             # <<<<<<<<<<<<<<
 *             else self._fst.get().OutputSymbols())
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_input_side");
    __PYX_ERR(0, 978, __pyx_L1_error)
  }
  if ((__pyx_v_self->_input_side != 0)) {
    if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
      __PYX_ERR(0, 978, __pyx_L1_error)
    }
    __pyx_t_1 = __pyx_v_self->_fst.get()->InputSymbols();
  } else {

    /* "fstlib/cext/pywrapfst.pyx":979
 *   cdef const_SymbolTable_ptr _raw(self):
 *     return (self._fst.get().InputSymbols() if self._input_side
 *             else self._fst.get().OutputSymbols())             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
      __PYX_ERR(0, 979, __pyx_L1_error)
    }
    __pyx_t_1 = __pyx_v_self->_fst.get()->OutputSymbols();
  }
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":977
 *             f"at 0x{id(self):x}>")
 * 
 *   cdef const_SymbolTable_ptr _raw(self):             # <<<<<<<<<<<<<<
 *     return (self._fst.get().InputSymbols() if self._input_side
 *             else self._fst.get().OutputSymbols())
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("fstlib.cext.pywrapfst._FstSymbolTableView._raw", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":993
 *   """
 * 
 *   cdef const_SymbolTable_ptr _raw(self):             # <<<<<<<<<<<<<<
 *     return self._mutable_raw()
 * 
 */

static __pyx_t_6fstlib_4cext_9pywrapfst_const_SymbolTable_ptr __pyx_f_6fstlib_4cext_9pywrapfst_19_MutableSymbolTable__raw(struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableSymbolTable *__pyx_v_self) {
  __pyx_t_6fstlib_4cext_9pywrapfst_const_SymbolTable_ptr __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_raw", 0);

  /* "fstlib/cext/pywrapfst.pyx":994
 * 
 *   cdef const_SymbolTable_ptr _raw(self):
 *     return self._mutable_raw()             # <<<<<<<<<<<<<<
 * 
 *   # Returns a mutable raw pointer to SymbolTable.
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mutable_raw");
    __PYX_ERR(0, 994, __pyx_L1_error)
  }
  __pyx_r = ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst__MutableSymbolTable *)__pyx_v_self->__pyx_base.__pyx_vtab)->_mutable_raw(__pyx_v_self);
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":993
 *   """
 * 
 *   cdef const_SymbolTable_ptr _raw(self):             # <<<<<<<<<<<<<<
 *     return self._mutable_raw()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("fstlib.cext.pywrapfst._MutableSymbolTable._raw", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":1000
 *   # Should not be directly accessed except by `_mutable__raw_ptr_or_raise()`.
 *   # All other methods should use the safer _mutable__raw_ptr_or_raise() instead.
 *   cdef SymbolTable_ptr _mutable_raw(self):             # <<<<<<<<<<<<<<
 *     return NULL
 * 
 */

static __pyx_t_6fstlib_4cext_9pywrapfst_SymbolTable_ptr __pyx_f_6fstlib_4cext_9pywrapfst_19_MutableSymbolTable__mutable_raw(CYTHON_UNUSED struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableSymbolTable *__pyx_v_self) {
  __pyx_t_6fstlib_4cext_9pywrapfst_SymbolTable_ptr __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_mutable_raw", 0);

  /* "fstlib/cext/pywrapfst.pyx":1001
 *   # All other methods should use the safer _mutable__raw_ptr_or_raise() instead.
 *   cdef SymbolTable_ptr _mutable_raw(self):
 *     return NULL             # <<<<<<<<<<<<<<
 * 
 *   # Internal API method that should be used when a mutable pointer to an
 */
  __pyx_r = NULL;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":1000
 *   # Should not be directly accessed except by `_mutable__raw_ptr_or_raise()`.
 *   # All other methods should use the safer _mutable__raw_ptr_or_raise() instead.
 *   cdef SymbolTable_ptr _mutable_raw(self):             # <<<<<<<<<<<<<<
 *     return NULL
 * 
 */

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

/* "fstlib/cext/pywrapfst.pyx":1005
 *   # Internal API method that should be used when a mutable pointer to an
 *   # fst.SymbolTable is required.
 *   cdef SymbolTable_ptr _mutable_raw_ptr_or_raise(self) except *:             # <<<<<<<<<<<<<<
 *     cdef SymbolTable_ptr mutable_raw = self._mutable_raw()
 *     if mutable_raw == NULL:
 */

static __pyx_t_6fstlib_4cext_9pywrapfst_SymbolTable_ptr __pyx_f_6fstlib_4cext_9pywrapfst_19_MutableSymbolTable__mutable_raw_ptr_or_raise(struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableSymbolTable *__pyx_v_self) {
  __pyx_t_6fstlib_4cext_9pywrapfst_SymbolTable_ptr __pyx_v_mutable_raw;
  __pyx_t_6fstlib_4cext_9pywrapfst_SymbolTable_ptr __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_mutable_raw_ptr_or_raise", 0);

  /* "fstlib/cext/pywrapfst.pyx":1006
 *   # fst.SymbolTable is required.
 *   cdef SymbolTable_ptr _mutable_raw_ptr_or_raise(self) except *:
 *     cdef SymbolTable_ptr mutable_raw = self._mutable_raw()             # <<<<<<<<<<<<<<
 *     if mutable_raw == NULL:
 *       self._raise_nonexistent()
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mutable_raw");
    __PYX_ERR(0, 1006, __pyx_L1_error)
  }
  __pyx_v_mutable_raw = ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst__MutableSymbolTable *)__pyx_v_self->__pyx_base.__pyx_vtab)->_mutable_raw(__pyx_v_self);

  /* "fstlib/cext/pywrapfst.pyx":1007
 *   cdef SymbolTable_ptr _mutable_raw_ptr_or_raise(self) except *:
 *     cdef SymbolTable_ptr mutable_raw = self._mutable_raw()
 *     if mutable_raw == NULL:             # <<<<<<<<<<<<<<
 *       self._raise_nonexistent()
 *     return mutable_raw
 */
  __pyx_t_1 = ((__pyx_v_mutable_raw == NULL) != 0);
  if (__pyx_t_1) {

    /* "fstlib/cext/pywrapfst.pyx":1008
 *     cdef SymbolTable_ptr mutable_raw = self._mutable_raw()
 *     if mutable_raw == NULL:
 *       self._raise_nonexistent()             # <<<<<<<<<<<<<<
 *     return mutable_raw
 * 
 */
    if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raise_nonexistent");
      __PYX_ERR(0, 1008, __pyx_L1_error)
    }
    ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst__MutableSymbolTable *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._raise_nonexistent(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *)__pyx_v_self)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1008, __pyx_L1_error)

    /* "fstlib/cext/pywrapfst.pyx":1007
 *   cdef SymbolTable_ptr _mutable_raw_ptr_or_raise(self) except *:
 *     cdef SymbolTable_ptr mutable_raw = self._mutable_raw()
 *     if mutable_raw == NULL:             # <<<<<<<<<<<<<<
 *       self._raise_nonexistent()
 *     return mutable_raw
 */
  }

  /* "fstlib/cext/pywrapfst.pyx":1009
 *     if mutable_raw == NULL:
 *       self._raise_nonexistent()
 *     return mutable_raw             # <<<<<<<<<<<<<<
 * 
 *   cpdef int64 add_symbol(self, symbol, int64 key=fst.kNoSymbol) except *:
 */
  __pyx_r = __pyx_v_mutable_raw;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":1005
 *   # Internal API method that should be used when a mutable pointer to an
 *   # fst.SymbolTable is required.
 *   cdef SymbolTable_ptr _mutable_raw_ptr_or_raise(self) except *:             # <<<<<<<<<<<<<<
 *     cdef SymbolTable_ptr mutable_raw = self._mutable_raw()
 *     if mutable_raw == NULL:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst._MutableSymbolTable._mutable_raw_ptr_or_raise", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":1011
 *     return mutable_raw
 * 
 *   cpdef int64 add_symbol(self, symbol, int64 key=fst.kNoSymbol) except *:             # <<<<<<<<<<<<<<
 *     """
 *     add_symbol(self, symbol, key=NO_SYMBOL)
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_19_MutableSymbolTable_1add_symbol(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int64 __pyx_f_6fstlib_4cext_9pywrapfst_19_MutableSymbolTable_add_symbol(struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableSymbolTable *__pyx_v_self, PyObject *__pyx_v_symbol, int __pyx_skip_dispatch, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_19_MutableSymbolTable_add_symbol *__pyx_optional_args) {
  int64 __pyx_v_key = __pyx_k__6;
  __pyx_t_6fstlib_4cext_9pywrapfst_SymbolTable_ptr __pyx_v__mutable_raw;
  std::string __pyx_v__symbol;
  int64 __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int64 __pyx_t_8;
  fst::SymbolTable *__pyx_t_9;
  std::string __pyx_t_10;
  int __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("add_symbol", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_key = __pyx_optional_args->key;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_symbol); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1011, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6fstlib_4cext_9pywrapfst_19_MutableSymbolTable_1add_symbol)) {
        __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_v_key); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1011, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
        __pyx_t_6 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
          if (likely(__pyx_t_5)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
            __Pyx_INCREF(__pyx_t_5);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_4, function);
            __pyx_t_6 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_4)) {
          PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_symbol, __pyx_t_3};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1011, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
          PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_symbol, __pyx_t_3};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1011, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        } else
        #endif
        {
          __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1011, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          if (__pyx_t_5) {
            __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
          }
          __Pyx_INCREF(__pyx_v_symbol);
          __Pyx_GIVEREF(__pyx_v_symbol);
          PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_symbol);
          __Pyx_GIVEREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_3);
          __pyx_t_3 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1011, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        }
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_8 = __Pyx_PyInt_As_int64_t(__pyx_t_2); if (unlikely((__pyx_t_8 == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1011, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_8;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "fstlib/cext/pywrapfst.pyx":1028
 *       The integer key of the new symbol.
 *     """
 *     cdef SymbolTable_ptr _mutable_raw = self._mutable_raw_ptr_or_raise()             # <<<<<<<<<<<<<<
 *     cdef string _symbol = tostring(symbol)
 *     if key != fst.kNoSymbol:
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mutable_raw_ptr_or_raise");
    __PYX_ERR(0, 1028, __pyx_L1_error)
  }
  __pyx_t_9 = ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst__MutableSymbolTable *)__pyx_v_self->__pyx_base.__pyx_vtab)->_mutable_raw_ptr_or_raise(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1028, __pyx_L1_error)
  __pyx_v__mutable_raw = __pyx_t_9;

  /* "fstlib/cext/pywrapfst.pyx":1029
 *     """
 *     cdef SymbolTable_ptr _mutable_raw = self._mutable_raw_ptr_or_raise()
 *     cdef string _symbol = tostring(symbol)             # <<<<<<<<<<<<<<
 *     if key != fst.kNoSymbol:
 *       return _mutable_raw.AddSymbol(_symbol, key)
 */
  __pyx_t_10 = __pyx_f_6fstlib_4cext_9pywrapfst_tostring(__pyx_v_symbol); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1029, __pyx_L1_error)
  __pyx_v__symbol = __pyx_t_10;

  /* "fstlib/cext/pywrapfst.pyx":1030
 *     cdef SymbolTable_ptr _mutable_raw = self._mutable_raw_ptr_or_raise()
 *     cdef string _symbol = tostring(symbol)
 *     if key != fst.kNoSymbol:             # <<<<<<<<<<<<<<
 *       return _mutable_raw.AddSymbol(_symbol, key)
 *     else:
 */
  __pyx_t_11 = ((__pyx_v_key != fst::kNoSymbol) != 0);
  if (__pyx_t_11) {

    /* "fstlib/cext/pywrapfst.pyx":1031
 *     cdef string _symbol = tostring(symbol)
 *     if key != fst.kNoSymbol:
 *       return _mutable_raw.AddSymbol(_symbol, key)             # <<<<<<<<<<<<<<
 *     else:
 *       return _mutable_raw.AddSymbol(_symbol)
 */
    __pyx_r = __pyx_v__mutable_raw->AddSymbol(__pyx_v__symbol, __pyx_v_key);
    goto __pyx_L0;

    /* "fstlib/cext/pywrapfst.pyx":1030
 *     cdef SymbolTable_ptr _mutable_raw = self._mutable_raw_ptr_or_raise()
 *     cdef string _symbol = tostring(symbol)
 *     if key != fst.kNoSymbol:             # <<<<<<<<<<<<<<
 *       return _mutable_raw.AddSymbol(_symbol, key)
 *     else:
 */
  }

  /* "fstlib/cext/pywrapfst.pyx":1033
 *       return _mutable_raw.AddSymbol(_symbol, key)
 *     else:
 *       return _mutable_raw.AddSymbol(_symbol)             # <<<<<<<<<<<<<<
 * 
 *   cpdef void add_table(self, SymbolTableView symbols) except *:
 */
  /*else*/ {
    __pyx_r = __pyx_v__mutable_raw->AddSymbol(__pyx_v__symbol);
    goto __pyx_L0;
  }

  /* "fstlib/cext/pywrapfst.pyx":1011
 *     return mutable_raw
 * 
 *   cpdef int64 add_symbol(self, symbol, int64 key=fst.kNoSymbol) except *:             # <<<<<<<<<<<<<<
 *     """
 *     add_symbol(self, symbol, key=NO_SYMBOL)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst._MutableSymbolTable.add_symbol", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_19_MutableSymbolTable_1add_symbol(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_19_MutableSymbolTable_add_symbol[] = "\n    add_symbol(self, symbol, key=NO_SYMBOL)\n\n    Adds a symbol to the table and returns the index.\n\n    This method adds a symbol to the table. The caller can optionally\n    specify a non-negative integer index for the key.\n\n    Args:\n      symbol: A symbol string.\n      key: An index for the symbol; if not specified, the next index will be\n          used.\n\n    Returns:\n      The integer key of the new symbol.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_19_MutableSymbolTable_1add_symbol(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_symbol = 0;
  int64 __pyx_v_key;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("add_symbol (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_symbol,&__pyx_n_s_key,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_symbol)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add_symbol") < 0)) __PYX_ERR(0, 1011, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_symbol = values[0];
    if (values[1]) {
      __pyx_v_key = __Pyx_PyInt_As_int64_t(values[1]); if (unlikely((__pyx_v_key == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1011, __pyx_L3_error)
    } else {
      __pyx_v_key = __pyx_k__6;
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("add_symbol", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1011, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst._MutableSymbolTable.add_symbol", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_19_MutableSymbolTable_add_symbol(((struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableSymbolTable *)__pyx_v_self), __pyx_v_symbol, __pyx_v_key);

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_19_MutableSymbolTable_add_symbol(struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableSymbolTable *__pyx_v_self, PyObject *__pyx_v_symbol, int64 __pyx_v_key) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int64 __pyx_t_1;
  struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_19_MutableSymbolTable_add_symbol __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("add_symbol", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.key = __pyx_v_key;
  __pyx_t_1 = __pyx_vtabptr_6fstlib_4cext_9pywrapfst__MutableSymbolTable->add_symbol(__pyx_v_self, __pyx_v_symbol, 1, &__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1011, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1011, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst._MutableSymbolTable.add_symbol", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":1035
 *       return _mutable_raw.AddSymbol(_symbol)
 * 
 *   cpdef void add_table(self, SymbolTableView symbols) except *:             # <<<<<<<<<<<<<<
 *     """
 *     add_table(self, symbols)
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_19_MutableSymbolTable_3add_table(PyObject *__pyx_v_self, PyObject *__pyx_v_symbols); /*proto*/
static void __pyx_f_6fstlib_4cext_9pywrapfst_19_MutableSymbolTable_add_table(struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableSymbolTable *__pyx_v_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_symbols, int __pyx_skip_dispatch) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  fst::SymbolTable *__pyx_t_5;
  fst::SymbolTable const *__pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("add_table", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_table); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1035, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6fstlib_4cext_9pywrapfst_19_MutableSymbolTable_3add_table)) {
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, ((PyObject *)__pyx_v_symbols)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_symbols));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1035, __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;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "fstlib/cext/pywrapfst.pyx":1047
 *       symbols: A SymbolTable to be merged with the current table.
 *     """
 *     self._mutable_raw_ptr_or_raise().AddTable(             # <<<<<<<<<<<<<<
 *         deref(symbols._raw_ptr_or_raise()))
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mutable_raw_ptr_or_raise");
    __PYX_ERR(0, 1047, __pyx_L1_error)
  }
  __pyx_t_5 = ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst__MutableSymbolTable *)__pyx_v_self->__pyx_base.__pyx_vtab)->_mutable_raw_ptr_or_raise(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1047, __pyx_L1_error)

  /* "fstlib/cext/pywrapfst.pyx":1048
 *     """
 *     self._mutable_raw_ptr_or_raise().AddTable(
 *         deref(symbols._raw_ptr_or_raise()))             # <<<<<<<<<<<<<<
 * 
 *   cpdef void set_name(self, new_name) except *:
 */
  if (unlikely(((PyObject *)__pyx_v_symbols) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raw_ptr_or_raise");
    __PYX_ERR(0, 1048, __pyx_L1_error)
  }
  __pyx_t_6 = ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_SymbolTableView *)__pyx_v_symbols->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_symbols); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1048, __pyx_L1_error)

  /* "fstlib/cext/pywrapfst.pyx":1047
 *       symbols: A SymbolTable to be merged with the current table.
 *     """
 *     self._mutable_raw_ptr_or_raise().AddTable(             # <<<<<<<<<<<<<<
 *         deref(symbols._raw_ptr_or_raise()))
 * 
 */
  __pyx_t_5->AddTable((*__pyx_t_6));

  /* "fstlib/cext/pywrapfst.pyx":1035
 *       return _mutable_raw.AddSymbol(_symbol)
 * 
 *   cpdef void add_table(self, SymbolTableView symbols) except *:             # <<<<<<<<<<<<<<
 *     """
 *     add_table(self, symbols)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst._MutableSymbolTable.add_table", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_19_MutableSymbolTable_3add_table(PyObject *__pyx_v_self, PyObject *__pyx_v_symbols); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_19_MutableSymbolTable_2add_table[] = "\n    add_table(self, symbols)\n\n    Adds another SymbolTable to this table.\n\n    This method merges another symbol table into the current table. All key\n    values will be offset by the current available key.\n\n    Args:\n      symbols: A SymbolTable to be merged with the current table.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_19_MutableSymbolTable_3add_table(PyObject *__pyx_v_self, PyObject *__pyx_v_symbols) {
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("add_table (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_symbols), __pyx_ptype_6fstlib_4cext_9pywrapfst_SymbolTableView, 1, "symbols", 0))) __PYX_ERR(0, 1035, __pyx_L1_error)
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_19_MutableSymbolTable_2add_table(((struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableSymbolTable *)__pyx_v_self), ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *)__pyx_v_symbols));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_19_MutableSymbolTable_2add_table(struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableSymbolTable *__pyx_v_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_symbols) {
  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("add_table", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_6fstlib_4cext_9pywrapfst_19_MutableSymbolTable_add_table(__pyx_v_self, __pyx_v_symbols, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1035, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1035, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst._MutableSymbolTable.add_table", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":1050
 *         deref(symbols._raw_ptr_or_raise()))
 * 
 *   cpdef void set_name(self, new_name) except *:             # <<<<<<<<<<<<<<
 *     self._mutable_raw_ptr_or_raise().SetName(tostring(new_name))
 * 
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_19_MutableSymbolTable_5set_name(PyObject *__pyx_v_self, PyObject *__pyx_v_new_name); /*proto*/
static void __pyx_f_6fstlib_4cext_9pywrapfst_19_MutableSymbolTable_set_name(struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableSymbolTable *__pyx_v_self, PyObject *__pyx_v_new_name, int __pyx_skip_dispatch) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  fst::SymbolTable *__pyx_t_5;
  std::string __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_name", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1050, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6fstlib_4cext_9pywrapfst_19_MutableSymbolTable_5set_name)) {
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_new_name) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_new_name);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1050, __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;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "fstlib/cext/pywrapfst.pyx":1051
 * 
 *   cpdef void set_name(self, new_name) except *:
 *     self._mutable_raw_ptr_or_raise().SetName(tostring(new_name))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mutable_raw_ptr_or_raise");
    __PYX_ERR(0, 1051, __pyx_L1_error)
  }
  __pyx_t_5 = ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst__MutableSymbolTable *)__pyx_v_self->__pyx_base.__pyx_vtab)->_mutable_raw_ptr_or_raise(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1051, __pyx_L1_error)
  __pyx_t_6 = __pyx_f_6fstlib_4cext_9pywrapfst_tostring(__pyx_v_new_name); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1051, __pyx_L1_error)
  __pyx_t_5->SetName(__pyx_t_6);

  /* "fstlib/cext/pywrapfst.pyx":1050
 *         deref(symbols._raw_ptr_or_raise()))
 * 
 *   cpdef void set_name(self, new_name) except *:             # <<<<<<<<<<<<<<
 *     self._mutable_raw_ptr_or_raise().SetName(tostring(new_name))
 * 
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst._MutableSymbolTable.set_name", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_19_MutableSymbolTable_5set_name(PyObject *__pyx_v_self, PyObject *__pyx_v_new_name); /*proto*/
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_19_MutableSymbolTable_5set_name(PyObject *__pyx_v_self, PyObject *__pyx_v_new_name) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_name (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_19_MutableSymbolTable_4set_name(((struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableSymbolTable *)__pyx_v_self), ((PyObject *)__pyx_v_new_name));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_19_MutableSymbolTable_4set_name(struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableSymbolTable *__pyx_v_self, PyObject *__pyx_v_new_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("set_name", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_6fstlib_4cext_9pywrapfst_19_MutableSymbolTable_set_name(__pyx_v_self, __pyx_v_new_name, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1050, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1050, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst._MutableSymbolTable.set_name", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":1061
 *   """
 * 
 *   def __repr__(self):             # <<<<<<<<<<<<<<
 *     return f"<Fst SymbolTableView {self.name()!r} at 0x{id(self):x}>"
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_26_MutableFstSymbolTableView_1__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_26_MutableFstSymbolTableView_1__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_26_MutableFstSymbolTableView___repr__(((struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableFstSymbolTableView *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_26_MutableFstSymbolTableView___repr__(struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableFstSymbolTableView *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  Py_UCS4 __pyx_t_3;
  std::string __pyx_t_4;
  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("__repr__", 0);

  /* "fstlib/cext/pywrapfst.pyx":1062
 * 
 *   def __repr__(self):
 *     return f"<Fst SymbolTableView {self.name()!r} at 0x{id(self):x}>"             # <<<<<<<<<<<<<<
 * 
 *   cdef SymbolTable_ptr _mutable_raw(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1062, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = 0;
  __pyx_t_3 = 127;
  __Pyx_INCREF(__pyx_kp_u_Fst_SymbolTableView);
  __pyx_t_2 += 21;
  __Pyx_GIVEREF(__pyx_kp_u_Fst_SymbolTableView);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_Fst_SymbolTableView);
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "name");
    __PYX_ERR(0, 1062, __pyx_L1_error)
  }
  __pyx_t_4 = ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst__MutableFstSymbolTableView *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.name(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *)__pyx_v_self), 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1062, __pyx_L1_error)
  __pyx_t_5 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1062, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_5), __pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1062, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_6);
  __pyx_t_6 = 0;
  __Pyx_INCREF(__pyx_kp_u_at_0x);
  __pyx_t_2 += 6;
  __Pyx_GIVEREF(__pyx_kp_u_at_0x);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_at_0x);
  __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1062, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = __Pyx_PyObject_Format(__pyx_t_6, __pyx_n_u_x); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1062, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_5);
  __pyx_t_5 = 0;
  __Pyx_INCREF(__pyx_kp_u__3);
  __pyx_t_2 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__3);
  PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u__3);
  __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_1, 5, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1062, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":1061
 *   """
 * 
 *   def __repr__(self):             # <<<<<<<<<<<<<<
 *     return f"<Fst SymbolTableView {self.name()!r} at 0x{id(self):x}>"
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst._MutableFstSymbolTableView.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":1064
 *     return f"<Fst SymbolTableView {self.name()!r} at 0x{id(self):x}>"
 * 
 *   cdef SymbolTable_ptr _mutable_raw(self):             # <<<<<<<<<<<<<<
 *     return (self._mfst.get().MutableInputSymbols() if self._input_side else
 *             self._mfst.get().MutableOutputSymbols())
 */

static __pyx_t_6fstlib_4cext_9pywrapfst_SymbolTable_ptr __pyx_f_6fstlib_4cext_9pywrapfst_26_MutableFstSymbolTableView__mutable_raw(struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableFstSymbolTableView *__pyx_v_self) {
  __pyx_t_6fstlib_4cext_9pywrapfst_SymbolTable_ptr __pyx_r;
  __Pyx_RefNannyDeclarations
  fst::SymbolTable *__pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_mutable_raw", 0);

  /* "fstlib/cext/pywrapfst.pyx":1065
 * 
 *   cdef SymbolTable_ptr _mutable_raw(self):
 *     return (self._mfst.get().MutableInputSymbols() if self._input_side else             # <<<<<<<<<<<<<<
 *             self._mfst.get().MutableOutputSymbols())
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_input_side");
    __PYX_ERR(0, 1065, __pyx_L1_error)
  }
  if ((__pyx_v_self->_input_side != 0)) {
    if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
      __PYX_ERR(0, 1065, __pyx_L1_error)
    }
    __pyx_t_1 = __pyx_v_self->_mfst.get()->MutableInputSymbols();
  } else {

    /* "fstlib/cext/pywrapfst.pyx":1066
 *   cdef SymbolTable_ptr _mutable_raw(self):
 *     return (self._mfst.get().MutableInputSymbols() if self._input_side else
 *             self._mfst.get().MutableOutputSymbols())             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
      __PYX_ERR(0, 1066, __pyx_L1_error)
    }
    __pyx_t_1 = __pyx_v_self->_mfst.get()->MutableOutputSymbols();
  }
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":1064
 *     return f"<Fst SymbolTableView {self.name()!r} at 0x{id(self):x}>"
 * 
 *   cdef SymbolTable_ptr _mutable_raw(self):             # <<<<<<<<<<<<<<
 *     return (self._mfst.get().MutableInputSymbols() if self._input_side else
 *             self._mfst.get().MutableOutputSymbols())
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("fstlib.cext.pywrapfst._MutableFstSymbolTableView._mutable_raw", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":1086
 *   """
 * 
 *   def __repr__(self):             # <<<<<<<<<<<<<<
 *     return f"<SymbolTable {self.name()!r} at 0x{id(self):x}>"
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_11SymbolTable_1__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_11SymbolTable_1__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_11SymbolTable___repr__(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTable *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_11SymbolTable___repr__(struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTable *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  Py_UCS4 __pyx_t_3;
  std::string __pyx_t_4;
  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("__repr__", 0);

  /* "fstlib/cext/pywrapfst.pyx":1087
 * 
 *   def __repr__(self):
 *     return f"<SymbolTable {self.name()!r} at 0x{id(self):x}>"             # <<<<<<<<<<<<<<
 * 
 *   def __init__(self, name="<unspecified>"):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1087, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = 0;
  __pyx_t_3 = 127;
  __Pyx_INCREF(__pyx_kp_u_SymbolTable);
  __pyx_t_2 += 13;
  __Pyx_GIVEREF(__pyx_kp_u_SymbolTable);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_SymbolTable);
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "name");
    __PYX_ERR(0, 1087, __pyx_L1_error)
  }
  __pyx_t_4 = ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_SymbolTable *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.name(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *)__pyx_v_self), 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1087, __pyx_L1_error)
  __pyx_t_5 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1087, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_5), __pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1087, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_6);
  __pyx_t_6 = 0;
  __Pyx_INCREF(__pyx_kp_u_at_0x);
  __pyx_t_2 += 6;
  __Pyx_GIVEREF(__pyx_kp_u_at_0x);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_at_0x);
  __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1087, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = __Pyx_PyObject_Format(__pyx_t_6, __pyx_n_u_x); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1087, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_5);
  __pyx_t_5 = 0;
  __Pyx_INCREF(__pyx_kp_u__3);
  __pyx_t_2 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__3);
  PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u__3);
  __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_1, 5, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1087, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":1086
 *   """
 * 
 *   def __repr__(self):             # <<<<<<<<<<<<<<
 *     return f"<SymbolTable {self.name()!r} at 0x{id(self):x}>"
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.SymbolTable.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":1089
 *     return f"<SymbolTable {self.name()!r} at 0x{id(self):x}>"
 * 
 *   def __init__(self, name="<unspecified>"):             # <<<<<<<<<<<<<<
 *     self._smart_table.reset(new fst.SymbolTable(tostring(name)))
 * 
 */

/* Python wrapper */
static int __pyx_pw_6fstlib_4cext_9pywrapfst_11SymbolTable_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_6fstlib_4cext_9pywrapfst_11SymbolTable_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_name = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name_2,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)__pyx_kp_u_unspecified);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name_2);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1089, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_name = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1089, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.SymbolTable.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_11SymbolTable_2__init__(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTable *)__pyx_v_self), __pyx_v_name);

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

static int __pyx_pf_6fstlib_4cext_9pywrapfst_11SymbolTable_2__init__(struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTable *__pyx_v_self, PyObject *__pyx_v_name) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "fstlib/cext/pywrapfst.pyx":1090
 * 
 *   def __init__(self, name="<unspecified>"):
 *     self._smart_table.reset(new fst.SymbolTable(tostring(name)))             # <<<<<<<<<<<<<<
 * 
 *   cdef SymbolTable_ptr _mutable_raw(self):
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_smart_table");
    __PYX_ERR(0, 1090, __pyx_L1_error)
  }
  __pyx_t_1 = __pyx_f_6fstlib_4cext_9pywrapfst_tostring(__pyx_v_name); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1090, __pyx_L1_error)
  __pyx_v_self->_smart_table.reset(new fst::SymbolTable(__pyx_t_1));

  /* "fstlib/cext/pywrapfst.pyx":1089
 *     return f"<SymbolTable {self.name()!r} at 0x{id(self):x}>"
 * 
 *   def __init__(self, name="<unspecified>"):             # <<<<<<<<<<<<<<
 *     self._smart_table.reset(new fst.SymbolTable(tostring(name)))
 * 
 */

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

/* "fstlib/cext/pywrapfst.pyx":1092
 *     self._smart_table.reset(new fst.SymbolTable(tostring(name)))
 * 
 *   cdef SymbolTable_ptr _mutable_raw(self):             # <<<<<<<<<<<<<<
 *     return self._smart_table.get()
 * 
 */

static __pyx_t_6fstlib_4cext_9pywrapfst_SymbolTable_ptr __pyx_f_6fstlib_4cext_9pywrapfst_11SymbolTable__mutable_raw(struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTable *__pyx_v_self) {
  __pyx_t_6fstlib_4cext_9pywrapfst_SymbolTable_ptr __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_mutable_raw", 0);

  /* "fstlib/cext/pywrapfst.pyx":1093
 * 
 *   cdef SymbolTable_ptr _mutable_raw(self):
 *     return self._smart_table.get()             # <<<<<<<<<<<<<<
 * 
 *   @classmethod
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_smart_table");
    __PYX_ERR(0, 1093, __pyx_L1_error)
  }
  __pyx_r = __pyx_v_self->_smart_table.get();
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":1092
 *     self._smart_table.reset(new fst.SymbolTable(tostring(name)))
 * 
 *   cdef SymbolTable_ptr _mutable_raw(self):             # <<<<<<<<<<<<<<
 *     return self._smart_table.get()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("fstlib.cext.pywrapfst.SymbolTable._mutable_raw", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":1096
 * 
 *   @classmethod
 *   def read(cls, source):             # <<<<<<<<<<<<<<
 *     """
 *     SymbolTable.read(source)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_11SymbolTable_5read(PyObject *__pyx_v_cls, PyObject *__pyx_v_source); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_11SymbolTable_4read[] = "\n    SymbolTable.read(source)\n\n    Reads symbol table from binary file.\n\n    This class method creates a new SymbolTable from a symbol table binary file.\n\n    Args:\n      source: The string location of the input binary file.\n\n    Returns:\n      A new SymbolTable instance.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_11SymbolTable_5read(PyObject *__pyx_v_cls, PyObject *__pyx_v_source) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("read (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_11SymbolTable_4read(((PyTypeObject*)__pyx_v_cls), ((PyObject *)__pyx_v_source));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_11SymbolTable_4read(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_source) {
  std::unique_ptr<fst::SymbolTable>  __pyx_v__symbols;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("read", 0);

  /* "fstlib/cext/pywrapfst.pyx":1111
 *     """
 *     cdef unique_ptr[fst.SymbolTable] _symbols
 *     _symbols.reset(fst.SymbolTable.Read(path_tostring(source)))             # <<<<<<<<<<<<<<
 *     if _symbols.get() == NULL:
 *       raise FstIOError(f"Read failed: {source!r}")
 */
  __pyx_t_1 = __pyx_f_6fstlib_4cext_9pywrapfst_path_tostring(__pyx_v_source); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1111, __pyx_L1_error)
  __pyx_v__symbols.reset(fst::SymbolTable::Read(__pyx_t_1));

  /* "fstlib/cext/pywrapfst.pyx":1112
 *     cdef unique_ptr[fst.SymbolTable] _symbols
 *     _symbols.reset(fst.SymbolTable.Read(path_tostring(source)))
 *     if _symbols.get() == NULL:             # <<<<<<<<<<<<<<
 *       raise FstIOError(f"Read failed: {source!r}")
 *     return _init_SymbolTable(move(_symbols))
 */
  __pyx_t_2 = ((__pyx_v__symbols.get() == NULL) != 0);
  if (unlikely(__pyx_t_2)) {

    /* "fstlib/cext/pywrapfst.pyx":1113
 *     _symbols.reset(fst.SymbolTable.Read(path_tostring(source)))
 *     if _symbols.get() == NULL:
 *       raise FstIOError(f"Read failed: {source!r}")             # <<<<<<<<<<<<<<
 *     return _init_SymbolTable(move(_symbols))
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FstIOError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1113, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_source), __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1113, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Read_failed, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1113, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_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_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1113, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 1113, __pyx_L1_error)

    /* "fstlib/cext/pywrapfst.pyx":1112
 *     cdef unique_ptr[fst.SymbolTable] _symbols
 *     _symbols.reset(fst.SymbolTable.Read(path_tostring(source)))
 *     if _symbols.get() == NULL:             # <<<<<<<<<<<<<<
 *       raise FstIOError(f"Read failed: {source!r}")
 *     return _init_SymbolTable(move(_symbols))
 */
  }

  /* "fstlib/cext/pywrapfst.pyx":1114
 *     if _symbols.get() == NULL:
 *       raise FstIOError(f"Read failed: {source!r}")
 *     return _init_SymbolTable(move(_symbols))             # <<<<<<<<<<<<<<
 * 
 *   @classmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = ((PyObject *)__pyx_f_6fstlib_4cext_9pywrapfst__init_SymbolTable(fst::move<std::unique_ptr<fst::SymbolTable> >(__pyx_v__symbols))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1114, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":1096
 * 
 *   @classmethod
 *   def read(cls, source):             # <<<<<<<<<<<<<<
 *     """
 *     SymbolTable.read(source)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.SymbolTable.read", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":1117
 * 
 *   @classmethod
 *   def read_text(cls, source, bool allow_negative_labels=False):             # <<<<<<<<<<<<<<
 *     """
 *     SymbolTable.read_text(source)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_11SymbolTable_7read_text(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_11SymbolTable_6read_text[] = "\n    SymbolTable.read_text(source)\n\n    Reads symbol table from text file.\n\n    This class method creates a new SymbolTable from a symbol table text file.\n\n    Args:\n      source: The string location of the input text file.\n      allow_negative_labels: Should negative labels be allowed? (Not\n          recommended; may cause conflicts).\n\n    Returns:\n      A new SymbolTable instance.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_11SymbolTable_7read_text(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_source = 0;
  bool __pyx_v_allow_negative_labels;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("read_text (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_source,&__pyx_n_s_allow_negative_labels,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_source)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_allow_negative_labels);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "read_text") < 0)) __PYX_ERR(0, 1117, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_source = values[0];
    if (values[1]) {
      __pyx_v_allow_negative_labels = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_allow_negative_labels == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1117, __pyx_L3_error)
    } else {
      __pyx_v_allow_negative_labels = ((bool)0);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("read_text", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1117, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.SymbolTable.read_text", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_11SymbolTable_6read_text(((PyTypeObject*)__pyx_v_cls), __pyx_v_source, __pyx_v_allow_negative_labels);

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_11SymbolTable_6read_text(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_source, bool __pyx_v_allow_negative_labels) {
  std::unique_ptr<fst::SymbolTableTextOptions>  __pyx_v__opts;
  std::unique_ptr<fst::SymbolTable>  __pyx_v__symbols;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("read_text", 0);

  /* "fstlib/cext/pywrapfst.pyx":1134
 *     """
 *     cdef unique_ptr[fst.SymbolTableTextOptions] _opts
 *     _opts.reset(new fst.SymbolTableTextOptions(allow_negative_labels))             # <<<<<<<<<<<<<<
 *     cdef unique_ptr[fst.SymbolTable] _symbols
 *     _symbols.reset(fst.SymbolTable.ReadText(path_tostring(source),
 */
  __pyx_v__opts.reset(new fst::SymbolTableTextOptions(__pyx_v_allow_negative_labels));

  /* "fstlib/cext/pywrapfst.pyx":1136
 *     _opts.reset(new fst.SymbolTableTextOptions(allow_negative_labels))
 *     cdef unique_ptr[fst.SymbolTable] _symbols
 *     _symbols.reset(fst.SymbolTable.ReadText(path_tostring(source),             # <<<<<<<<<<<<<<
 *                                             deref(_opts)))
 *     if _symbols.get() == NULL:
 */
  __pyx_t_1 = __pyx_f_6fstlib_4cext_9pywrapfst_path_tostring(__pyx_v_source); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1136, __pyx_L1_error)

  /* "fstlib/cext/pywrapfst.pyx":1137
 *     cdef unique_ptr[fst.SymbolTable] _symbols
 *     _symbols.reset(fst.SymbolTable.ReadText(path_tostring(source),
 *                                             deref(_opts)))             # <<<<<<<<<<<<<<
 *     if _symbols.get() == NULL:
 *       raise FstIOError(f"Read failed: {source!r}")
 */
  __pyx_v__symbols.reset(fst::SymbolTable::ReadText(__pyx_t_1, (*__pyx_v__opts)));

  /* "fstlib/cext/pywrapfst.pyx":1138
 *     _symbols.reset(fst.SymbolTable.ReadText(path_tostring(source),
 *                                             deref(_opts)))
 *     if _symbols.get() == NULL:             # <<<<<<<<<<<<<<
 *       raise FstIOError(f"Read failed: {source!r}")
 *     return _init_SymbolTable(move(_symbols))
 */
  __pyx_t_2 = ((__pyx_v__symbols.get() == NULL) != 0);
  if (unlikely(__pyx_t_2)) {

    /* "fstlib/cext/pywrapfst.pyx":1139
 *                                             deref(_opts)))
 *     if _symbols.get() == NULL:
 *       raise FstIOError(f"Read failed: {source!r}")             # <<<<<<<<<<<<<<
 *     return _init_SymbolTable(move(_symbols))
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FstIOError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1139, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_source), __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1139, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Read_failed, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1139, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_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_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1139, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 1139, __pyx_L1_error)

    /* "fstlib/cext/pywrapfst.pyx":1138
 *     _symbols.reset(fst.SymbolTable.ReadText(path_tostring(source),
 *                                             deref(_opts)))
 *     if _symbols.get() == NULL:             # <<<<<<<<<<<<<<
 *       raise FstIOError(f"Read failed: {source!r}")
 *     return _init_SymbolTable(move(_symbols))
 */
  }

  /* "fstlib/cext/pywrapfst.pyx":1140
 *     if _symbols.get() == NULL:
 *       raise FstIOError(f"Read failed: {source!r}")
 *     return _init_SymbolTable(move(_symbols))             # <<<<<<<<<<<<<<
 * 
 *   @classmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = ((PyObject *)__pyx_f_6fstlib_4cext_9pywrapfst__init_SymbolTable(fst::move<std::unique_ptr<fst::SymbolTable> >(__pyx_v__symbols))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1140, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":1117
 * 
 *   @classmethod
 *   def read_text(cls, source, bool allow_negative_labels=False):             # <<<<<<<<<<<<<<
 *     """
 *     SymbolTable.read_text(source)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.SymbolTable.read_text", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":1143
 * 
 *   @classmethod
 *   def read_fst(cls, source, bool input_table):             # <<<<<<<<<<<<<<
 *     """
 *     SymbolTable.read_fst(source, input_table)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_11SymbolTable_9read_fst(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_11SymbolTable_8read_fst[] = "\n    SymbolTable.read_fst(source, input_table)\n\n    Reads symbol table from an FST file without loading the corresponding FST.\n\n    This class method creates a new SymbolTable by reading either the input or\n    output symbol table from an FST file, without loading the corresponding FST.\n\n    Args:\n      source: The string location of the input FST file.\n      input_table: Should the input table be read (True) or the output table\n          (False)?\n\n    Returns:\n      A new SymbolTable instance, or None if none can be read.\n\n    Raises:\n      FstIOError: Read failed.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_11SymbolTable_9read_fst(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_source = 0;
  bool __pyx_v_input_table;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("read_fst (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_source,&__pyx_n_s_input_table,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_source)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_input_table)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("read_fst", 1, 2, 2, 1); __PYX_ERR(0, 1143, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "read_fst") < 0)) __PYX_ERR(0, 1143, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_source = values[0];
    __pyx_v_input_table = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_input_table == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1143, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("read_fst", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1143, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.SymbolTable.read_fst", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_11SymbolTable_8read_fst(((PyTypeObject*)__pyx_v_cls), __pyx_v_source, __pyx_v_input_table);

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_11SymbolTable_8read_fst(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_source, bool __pyx_v_input_table) {
  std::unique_ptr<fst::SymbolTable>  __pyx_v__symbols;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("read_fst", 0);

  /* "fstlib/cext/pywrapfst.pyx":1164
 *     """
 *     cdef unique_ptr[fst.SymbolTable] _symbols
 *     _symbols.reset(fst.FstReadSymbols(path_tostring(source), input_table))             # <<<<<<<<<<<<<<
 *     if _symbols.get() == NULL:
 *       raise FstIOError(f"Read from FST failed: {source!r}")
 */
  __pyx_t_1 = __pyx_f_6fstlib_4cext_9pywrapfst_path_tostring(__pyx_v_source); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1164, __pyx_L1_error)
  __pyx_v__symbols.reset(fst::FstReadSymbols(__pyx_t_1, __pyx_v_input_table));

  /* "fstlib/cext/pywrapfst.pyx":1165
 *     cdef unique_ptr[fst.SymbolTable] _symbols
 *     _symbols.reset(fst.FstReadSymbols(path_tostring(source), input_table))
 *     if _symbols.get() == NULL:             # <<<<<<<<<<<<<<
 *       raise FstIOError(f"Read from FST failed: {source!r}")
 *     return _init_SymbolTable(move(_symbols))
 */
  __pyx_t_2 = ((__pyx_v__symbols.get() == NULL) != 0);
  if (unlikely(__pyx_t_2)) {

    /* "fstlib/cext/pywrapfst.pyx":1166
 *     _symbols.reset(fst.FstReadSymbols(path_tostring(source), input_table))
 *     if _symbols.get() == NULL:
 *       raise FstIOError(f"Read from FST failed: {source!r}")             # <<<<<<<<<<<<<<
 *     return _init_SymbolTable(move(_symbols))
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FstIOError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1166, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_source), __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1166, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Read_from_FST_failed, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1166, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_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_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1166, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 1166, __pyx_L1_error)

    /* "fstlib/cext/pywrapfst.pyx":1165
 *     cdef unique_ptr[fst.SymbolTable] _symbols
 *     _symbols.reset(fst.FstReadSymbols(path_tostring(source), input_table))
 *     if _symbols.get() == NULL:             # <<<<<<<<<<<<<<
 *       raise FstIOError(f"Read from FST failed: {source!r}")
 *     return _init_SymbolTable(move(_symbols))
 */
  }

  /* "fstlib/cext/pywrapfst.pyx":1167
 *     if _symbols.get() == NULL:
 *       raise FstIOError(f"Read from FST failed: {source!r}")
 *     return _init_SymbolTable(move(_symbols))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = ((PyObject *)__pyx_f_6fstlib_4cext_9pywrapfst__init_SymbolTable(fst::move<std::unique_ptr<fst::SymbolTable> >(__pyx_v__symbols))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1167, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":1143
 * 
 *   @classmethod
 *   def read_fst(cls, source, bool input_table):             # <<<<<<<<<<<<<<
 *     """
 *     SymbolTable.read_fst(source, input_table)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.SymbolTable.read_fst", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":1170
 * 
 * 
 * cdef _EncodeMapperSymbolTableView _init_EncodeMapperSymbolTableView(             # <<<<<<<<<<<<<<
 *     shared_ptr[fst.EncodeMapperClass] mapper, bool input_side):
 *   cdef _EncodeMapperSymbolTableView _symbols = (
 */

static struct __pyx_obj_6fstlib_4cext_9pywrapfst__EncodeMapperSymbolTableView *__pyx_f_6fstlib_4cext_9pywrapfst__init_EncodeMapperSymbolTableView(std::shared_ptr<fst::script::EncodeMapperClass>  __pyx_v_mapper, bool __pyx_v_input_side) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst__EncodeMapperSymbolTableView *__pyx_v__symbols = 0;
  struct __pyx_obj_6fstlib_4cext_9pywrapfst__EncodeMapperSymbolTableView *__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_EncodeMapperSymbolTableView", 0);

  /* "fstlib/cext/pywrapfst.pyx":1173
 *     shared_ptr[fst.EncodeMapperClass] mapper, bool input_side):
 *   cdef _EncodeMapperSymbolTableView _symbols = (
 *       _EncodeMapperSymbolTableView.__new__(_EncodeMapperSymbolTableView))             # <<<<<<<<<<<<<<
 *   _symbols._mapper = move(mapper)
 *   _symbols._input_side = input_side
 */
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_6fstlib_4cext_9pywrapfst__EncodeMapperSymbolTableView(((PyTypeObject *)__pyx_ptype_6fstlib_4cext_9pywrapfst__EncodeMapperSymbolTableView), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1173, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v__symbols = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst__EncodeMapperSymbolTableView *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "fstlib/cext/pywrapfst.pyx":1174
 *   cdef _EncodeMapperSymbolTableView _symbols = (
 *       _EncodeMapperSymbolTableView.__new__(_EncodeMapperSymbolTableView))
 *   _symbols._mapper = move(mapper)             # <<<<<<<<<<<<<<
 *   _symbols._input_side = input_side
 *   return _symbols
 */
  if (unlikely(((PyObject *)__pyx_v__symbols) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mapper");
    __PYX_ERR(0, 1174, __pyx_L1_error)
  }
  __pyx_v__symbols->_mapper = fst::move<std::shared_ptr<fst::script::EncodeMapperClass> >(__pyx_v_mapper);

  /* "fstlib/cext/pywrapfst.pyx":1175
 *       _EncodeMapperSymbolTableView.__new__(_EncodeMapperSymbolTableView))
 *   _symbols._mapper = move(mapper)
 *   _symbols._input_side = input_side             # <<<<<<<<<<<<<<
 *   return _symbols
 * 
 */
  if (unlikely(((PyObject *)__pyx_v__symbols) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_input_side");
    __PYX_ERR(0, 1175, __pyx_L1_error)
  }
  __pyx_v__symbols->_input_side = __pyx_v_input_side;

  /* "fstlib/cext/pywrapfst.pyx":1176
 *   _symbols._mapper = move(mapper)
 *   _symbols._input_side = input_side
 *   return _symbols             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v__symbols));
  __pyx_r = __pyx_v__symbols;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":1170
 * 
 * 
 * cdef _EncodeMapperSymbolTableView _init_EncodeMapperSymbolTableView(             # <<<<<<<<<<<<<<
 *     shared_ptr[fst.EncodeMapperClass] mapper, bool input_side):
 *   cdef _EncodeMapperSymbolTableView _symbols = (
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst._init_EncodeMapperSymbolTableView", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v__symbols);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":1179
 * 
 * 
 * cdef _FstSymbolTableView _init_FstSymbolTableView(shared_ptr[fst.FstClass] ifst,             # <<<<<<<<<<<<<<
 *                                                   bool input_side):
 *   cdef _FstSymbolTableView _symbols = (
 */

static struct __pyx_obj_6fstlib_4cext_9pywrapfst__FstSymbolTableView *__pyx_f_6fstlib_4cext_9pywrapfst__init_FstSymbolTableView(std::shared_ptr<fst::script::FstClass>  __pyx_v_ifst, bool __pyx_v_input_side) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst__FstSymbolTableView *__pyx_v__symbols = 0;
  struct __pyx_obj_6fstlib_4cext_9pywrapfst__FstSymbolTableView *__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_FstSymbolTableView", 0);

  /* "fstlib/cext/pywrapfst.pyx":1182
 *                                                   bool input_side):
 *   cdef _FstSymbolTableView _symbols = (
 *       _FstSymbolTableView.__new__(_FstSymbolTableView))             # <<<<<<<<<<<<<<
 *   _symbols._fst = move(ifst)
 *   _symbols._input_side = input_side
 */
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_6fstlib_4cext_9pywrapfst__FstSymbolTableView(((PyTypeObject *)__pyx_ptype_6fstlib_4cext_9pywrapfst__FstSymbolTableView), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1182, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v__symbols = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst__FstSymbolTableView *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "fstlib/cext/pywrapfst.pyx":1183
 *   cdef _FstSymbolTableView _symbols = (
 *       _FstSymbolTableView.__new__(_FstSymbolTableView))
 *   _symbols._fst = move(ifst)             # <<<<<<<<<<<<<<
 *   _symbols._input_side = input_side
 *   return _symbols
 */
  if (unlikely(((PyObject *)__pyx_v__symbols) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 1183, __pyx_L1_error)
  }
  __pyx_v__symbols->_fst = fst::move<std::shared_ptr<fst::script::FstClass> >(__pyx_v_ifst);

  /* "fstlib/cext/pywrapfst.pyx":1184
 *       _FstSymbolTableView.__new__(_FstSymbolTableView))
 *   _symbols._fst = move(ifst)
 *   _symbols._input_side = input_side             # <<<<<<<<<<<<<<
 *   return _symbols
 * 
 */
  if (unlikely(((PyObject *)__pyx_v__symbols) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_input_side");
    __PYX_ERR(0, 1184, __pyx_L1_error)
  }
  __pyx_v__symbols->_input_side = __pyx_v_input_side;

  /* "fstlib/cext/pywrapfst.pyx":1185
 *   _symbols._fst = move(ifst)
 *   _symbols._input_side = input_side
 *   return _symbols             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v__symbols));
  __pyx_r = __pyx_v__symbols;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":1179
 * 
 * 
 * cdef _FstSymbolTableView _init_FstSymbolTableView(shared_ptr[fst.FstClass] ifst,             # <<<<<<<<<<<<<<
 *                                                   bool input_side):
 *   cdef _FstSymbolTableView _symbols = (
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst._init_FstSymbolTableView", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v__symbols);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":1188
 * 
 * 
 * cdef _MutableFstSymbolTableView _init_MutableFstSymbolTableView(             # <<<<<<<<<<<<<<
 *                                     shared_ptr[fst.MutableFstClass] ifst,
 *                                     bool input_side):
 */

static struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableFstSymbolTableView *__pyx_f_6fstlib_4cext_9pywrapfst__init_MutableFstSymbolTableView(std::shared_ptr<fst::script::MutableFstClass>  __pyx_v_ifst, bool __pyx_v_input_side) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableFstSymbolTableView *__pyx_v__symbols = 0;
  struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableFstSymbolTableView *__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_MutableFstSymbolTableView", 0);

  /* "fstlib/cext/pywrapfst.pyx":1192
 *                                     bool input_side):
 *   cdef _MutableFstSymbolTableView _symbols = (
 *       _MutableFstSymbolTableView.__new__(_MutableFstSymbolTableView))             # <<<<<<<<<<<<<<
 *   _symbols._mfst = move(ifst)
 *   _symbols._input_side = input_side
 */
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_6fstlib_4cext_9pywrapfst__MutableFstSymbolTableView(((PyTypeObject *)__pyx_ptype_6fstlib_4cext_9pywrapfst__MutableFstSymbolTableView), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1192, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v__symbols = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableFstSymbolTableView *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "fstlib/cext/pywrapfst.pyx":1193
 *   cdef _MutableFstSymbolTableView _symbols = (
 *       _MutableFstSymbolTableView.__new__(_MutableFstSymbolTableView))
 *   _symbols._mfst = move(ifst)             # <<<<<<<<<<<<<<
 *   _symbols._input_side = input_side
 *   return _symbols
 */
  if (unlikely(((PyObject *)__pyx_v__symbols) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
    __PYX_ERR(0, 1193, __pyx_L1_error)
  }
  __pyx_v__symbols->_mfst = fst::move<std::shared_ptr<fst::script::MutableFstClass> >(__pyx_v_ifst);

  /* "fstlib/cext/pywrapfst.pyx":1194
 *       _MutableFstSymbolTableView.__new__(_MutableFstSymbolTableView))
 *   _symbols._mfst = move(ifst)
 *   _symbols._input_side = input_side             # <<<<<<<<<<<<<<
 *   return _symbols
 * 
 */
  if (unlikely(((PyObject *)__pyx_v__symbols) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_input_side");
    __PYX_ERR(0, 1194, __pyx_L1_error)
  }
  __pyx_v__symbols->_input_side = __pyx_v_input_side;

  /* "fstlib/cext/pywrapfst.pyx":1195
 *   _symbols._mfst = move(ifst)
 *   _symbols._input_side = input_side
 *   return _symbols             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v__symbols));
  __pyx_r = __pyx_v__symbols;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":1188
 * 
 * 
 * cdef _MutableFstSymbolTableView _init_MutableFstSymbolTableView(             # <<<<<<<<<<<<<<
 *                                     shared_ptr[fst.MutableFstClass] ifst,
 *                                     bool input_side):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst._init_MutableFstSymbolTableView", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v__symbols);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":1198
 * 
 * 
 * cdef SymbolTable _init_SymbolTable(unique_ptr[fst.SymbolTable] symbols):             # <<<<<<<<<<<<<<
 *   cdef SymbolTable _symbols = SymbolTable.__new__(SymbolTable)
 *   _symbols._smart_table = move(symbols)
 */

static struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTable *__pyx_f_6fstlib_4cext_9pywrapfst__init_SymbolTable(std::unique_ptr<fst::SymbolTable>  __pyx_v_symbols) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTable *__pyx_v__symbols = 0;
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTable *__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_SymbolTable", 0);

  /* "fstlib/cext/pywrapfst.pyx":1199
 * 
 * cdef SymbolTable _init_SymbolTable(unique_ptr[fst.SymbolTable] symbols):
 *   cdef SymbolTable _symbols = SymbolTable.__new__(SymbolTable)             # <<<<<<<<<<<<<<
 *   _symbols._smart_table = move(symbols)
 *   return _symbols
 */
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_6fstlib_4cext_9pywrapfst_SymbolTable(((PyTypeObject *)__pyx_ptype_6fstlib_4cext_9pywrapfst_SymbolTable), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1199, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v__symbols = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTable *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "fstlib/cext/pywrapfst.pyx":1200
 * cdef SymbolTable _init_SymbolTable(unique_ptr[fst.SymbolTable] symbols):
 *   cdef SymbolTable _symbols = SymbolTable.__new__(SymbolTable)
 *   _symbols._smart_table = move(symbols)             # <<<<<<<<<<<<<<
 *   return _symbols
 * 
 */
  if (unlikely(((PyObject *)__pyx_v__symbols) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_smart_table");
    __PYX_ERR(0, 1200, __pyx_L1_error)
  }
  __pyx_v__symbols->_smart_table = fst::move<std::unique_ptr<fst::SymbolTable> >(__pyx_v_symbols);

  /* "fstlib/cext/pywrapfst.pyx":1201
 *   cdef SymbolTable _symbols = SymbolTable.__new__(SymbolTable)
 *   _symbols._smart_table = move(symbols)
 *   return _symbols             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v__symbols));
  __pyx_r = __pyx_v__symbols;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":1198
 * 
 * 
 * cdef SymbolTable _init_SymbolTable(unique_ptr[fst.SymbolTable] symbols):             # <<<<<<<<<<<<<<
 *   cdef SymbolTable _symbols = SymbolTable.__new__(SymbolTable)
 *   _symbols._smart_table = move(symbols)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst._init_SymbolTable", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v__symbols);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":1204
 * 
 * 
 * cpdef SymbolTable _read_SymbolTable_from_string(string state):             # <<<<<<<<<<<<<<
 *   cdef stringstream _sstrm
 *   _sstrm << state
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_9_read_SymbolTable_from_string(PyObject *__pyx_self, PyObject *__pyx_arg_state); /*proto*/
static struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTable *__pyx_f_6fstlib_4cext_9pywrapfst__read_SymbolTable_from_string(std::string __pyx_v_state, CYTHON_UNUSED int __pyx_skip_dispatch) {
  std::stringstream __pyx_v__sstrm;
  std::unique_ptr<fst::SymbolTable>  __pyx_v__symbols;
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTable *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_read_SymbolTable_from_string", 0);

  /* "fstlib/cext/pywrapfst.pyx":1206
 * cpdef SymbolTable _read_SymbolTable_from_string(string state):
 *   cdef stringstream _sstrm
 *   _sstrm << state             # <<<<<<<<<<<<<<
 *   cdef unique_ptr[fst.SymbolTable] _symbols
 *   _symbols.reset(fst.SymbolTable.ReadStream(_sstrm, b"<pywrapfst>"))
 */
  (void)((__pyx_v__sstrm << __pyx_v_state));

  /* "fstlib/cext/pywrapfst.pyx":1208
 *   _sstrm << state
 *   cdef unique_ptr[fst.SymbolTable] _symbols
 *   _symbols.reset(fst.SymbolTable.ReadStream(_sstrm, b"<pywrapfst>"))             # <<<<<<<<<<<<<<
 *   if _symbols.get() == NULL:
 *     raise FstIOError("Read from string failed")
 */
  __pyx_v__symbols.reset(fst::SymbolTable::Read(__pyx_v__sstrm, __pyx_k_pywrapfst));

  /* "fstlib/cext/pywrapfst.pyx":1209
 *   cdef unique_ptr[fst.SymbolTable] _symbols
 *   _symbols.reset(fst.SymbolTable.ReadStream(_sstrm, b"<pywrapfst>"))
 *   if _symbols.get() == NULL:             # <<<<<<<<<<<<<<
 *     raise FstIOError("Read from string failed")
 *   return _init_SymbolTable(move(_symbols))
 */
  __pyx_t_1 = ((__pyx_v__symbols.get() == NULL) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "fstlib/cext/pywrapfst.pyx":1210
 *   _symbols.reset(fst.SymbolTable.ReadStream(_sstrm, b"<pywrapfst>"))
 *   if _symbols.get() == NULL:
 *     raise FstIOError("Read from string failed")             # <<<<<<<<<<<<<<
 *   return _init_SymbolTable(move(_symbols))
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstIOError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1210, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_kp_u_Read_from_string_failed) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_u_Read_from_string_failed);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1210, __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(0, 1210, __pyx_L1_error)

    /* "fstlib/cext/pywrapfst.pyx":1209
 *   cdef unique_ptr[fst.SymbolTable] _symbols
 *   _symbols.reset(fst.SymbolTable.ReadStream(_sstrm, b"<pywrapfst>"))
 *   if _symbols.get() == NULL:             # <<<<<<<<<<<<<<
 *     raise FstIOError("Read from string failed")
 *   return _init_SymbolTable(move(_symbols))
 */
  }

  /* "fstlib/cext/pywrapfst.pyx":1211
 *   if _symbols.get() == NULL:
 *     raise FstIOError("Read from string failed")
 *   return _init_SymbolTable(move(_symbols))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_2 = ((PyObject *)__pyx_f_6fstlib_4cext_9pywrapfst__init_SymbolTable(fst::move<std::unique_ptr<fst::SymbolTable> >(__pyx_v__symbols))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1211, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTable *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":1204
 * 
 * 
 * cpdef SymbolTable _read_SymbolTable_from_string(string state):             # <<<<<<<<<<<<<<
 *   cdef stringstream _sstrm
 *   _sstrm << state
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst._read_SymbolTable_from_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_9_read_SymbolTable_from_string(PyObject *__pyx_self, PyObject *__pyx_arg_state); /*proto*/
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_9_read_SymbolTable_from_string(PyObject *__pyx_self, PyObject *__pyx_arg_state) {
  std::string __pyx_v_state;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_read_SymbolTable_from_string (wrapper)", 0);
  assert(__pyx_arg_state); {
    __pyx_v_state = __pyx_convert_string_from_py_std__in_string(__pyx_arg_state); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1204, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst._read_SymbolTable_from_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_8_read_SymbolTable_from_string(__pyx_self, ((std::string)__pyx_v_state));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_8_read_SymbolTable_from_string(CYTHON_UNUSED PyObject *__pyx_self, std::string __pyx_v_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("_read_SymbolTable_from_string", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_6fstlib_4cext_9pywrapfst__read_SymbolTable_from_string(__pyx_v_state, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1204, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst._read_SymbolTable_from_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":1217
 * 
 * 
 * cpdef SymbolTable compact_symbol_table(SymbolTableView symbols):             # <<<<<<<<<<<<<<
 *   """
 *   compact_symbol_table(symbols)
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_11compact_symbol_table(PyObject *__pyx_self, PyObject *__pyx_v_symbols); /*proto*/
static struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTable *__pyx_f_6fstlib_4cext_9pywrapfst_compact_symbol_table(struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_symbols, CYTHON_UNUSED int __pyx_skip_dispatch) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTable *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  fst::SymbolTable const *__pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("compact_symbol_table", 0);

  /* "fstlib/cext/pywrapfst.pyx":1229
 *     A new compacted SymbolTable.
 *   """
 *   return _init_SymbolTable(WrapUnique(fst.CompactSymbolTable(             # <<<<<<<<<<<<<<
 *                                           deref(symbols._raw_ptr_or_raise()))))
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));

  /* "fstlib/cext/pywrapfst.pyx":1230
 *   """
 *   return _init_SymbolTable(WrapUnique(fst.CompactSymbolTable(
 *                                           deref(symbols._raw_ptr_or_raise()))))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_symbols) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raw_ptr_or_raise");
    __PYX_ERR(0, 1230, __pyx_L1_error)
  }
  __pyx_t_1 = ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_SymbolTableView *)__pyx_v_symbols->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_symbols); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1230, __pyx_L1_error)

  /* "fstlib/cext/pywrapfst.pyx":1229
 *     A new compacted SymbolTable.
 *   """
 *   return _init_SymbolTable(WrapUnique(fst.CompactSymbolTable(             # <<<<<<<<<<<<<<
 *                                           deref(symbols._raw_ptr_or_raise()))))
 * 
 */
  __pyx_t_2 = ((PyObject *)__pyx_f_6fstlib_4cext_9pywrapfst__init_SymbolTable(fst::WrapUnique<fst::SymbolTable>(fst::CompactSymbolTable((*__pyx_t_1))))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1229, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTable *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":1217
 * 
 * 
 * cpdef SymbolTable compact_symbol_table(SymbolTableView symbols):             # <<<<<<<<<<<<<<
 *   """
 *   compact_symbol_table(symbols)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.compact_symbol_table", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_11compact_symbol_table(PyObject *__pyx_self, PyObject *__pyx_v_symbols); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_10compact_symbol_table[] = "\n  compact_symbol_table(symbols)\n\n  Constructively relabels a SymbolTable to make it a contiguous mapping.\n\n  Args:\n    symbols: Input SymbolTable.\n\n  Returns:\n    A new compacted SymbolTable.\n  ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_11compact_symbol_table(PyObject *__pyx_self, PyObject *__pyx_v_symbols) {
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("compact_symbol_table (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_symbols), __pyx_ptype_6fstlib_4cext_9pywrapfst_SymbolTableView, 1, "symbols", 0))) __PYX_ERR(0, 1217, __pyx_L1_error)
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_10compact_symbol_table(__pyx_self, ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *)__pyx_v_symbols));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_10compact_symbol_table(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_symbols) {
  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("compact_symbol_table", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_6fstlib_4cext_9pywrapfst_compact_symbol_table(__pyx_v_symbols, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1217, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.compact_symbol_table", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":1233
 * 
 * 
 * cpdef SymbolTable merge_symbol_table(SymbolTableView lhs,             # <<<<<<<<<<<<<<
 *                                      SymbolTableView rhs):
 *   """
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_13merge_symbol_table(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTable *__pyx_f_6fstlib_4cext_9pywrapfst_merge_symbol_table(struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_lhs, struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_rhs, CYTHON_UNUSED int __pyx_skip_dispatch) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTable *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  fst::SymbolTable const *__pyx_t_1;
  fst::SymbolTable const *__pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("merge_symbol_table", 0);

  /* "fstlib/cext/pywrapfst.pyx":1256
 *     A new merged SymbolTable.
 *   """
 *   return _init_SymbolTable(WrapUnique(fst.MergeSymbolTable(             # <<<<<<<<<<<<<<
 *                                           deref(lhs._raw_ptr_or_raise()),
 *                                           deref(rhs._raw_ptr_or_raise()),
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));

  /* "fstlib/cext/pywrapfst.pyx":1257
 *   """
 *   return _init_SymbolTable(WrapUnique(fst.MergeSymbolTable(
 *                                           deref(lhs._raw_ptr_or_raise()),             # <<<<<<<<<<<<<<
 *                                           deref(rhs._raw_ptr_or_raise()),
 *                                           NULL)))
 */
  if (unlikely(((PyObject *)__pyx_v_lhs) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raw_ptr_or_raise");
    __PYX_ERR(0, 1257, __pyx_L1_error)
  }
  __pyx_t_1 = ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_SymbolTableView *)__pyx_v_lhs->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_lhs); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1257, __pyx_L1_error)

  /* "fstlib/cext/pywrapfst.pyx":1258
 *   return _init_SymbolTable(WrapUnique(fst.MergeSymbolTable(
 *                                           deref(lhs._raw_ptr_or_raise()),
 *                                           deref(rhs._raw_ptr_or_raise()),             # <<<<<<<<<<<<<<
 *                                           NULL)))
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_rhs) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raw_ptr_or_raise");
    __PYX_ERR(0, 1258, __pyx_L1_error)
  }
  __pyx_t_2 = ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_SymbolTableView *)__pyx_v_rhs->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_rhs); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1258, __pyx_L1_error)

  /* "fstlib/cext/pywrapfst.pyx":1256
 *     A new merged SymbolTable.
 *   """
 *   return _init_SymbolTable(WrapUnique(fst.MergeSymbolTable(             # <<<<<<<<<<<<<<
 *                                           deref(lhs._raw_ptr_or_raise()),
 *                                           deref(rhs._raw_ptr_or_raise()),
 */
  __pyx_t_3 = ((PyObject *)__pyx_f_6fstlib_4cext_9pywrapfst__init_SymbolTable(fst::WrapUnique<fst::SymbolTable>(fst::MergeSymbolTable((*__pyx_t_1), (*__pyx_t_2), NULL)))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1256, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTable *)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":1233
 * 
 * 
 * cpdef SymbolTable merge_symbol_table(SymbolTableView lhs,             # <<<<<<<<<<<<<<
 *                                      SymbolTableView rhs):
 *   """
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.merge_symbol_table", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_13merge_symbol_table(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_12merge_symbol_table[] = "\n  merge_symbol_table(lhs, rhs)\n\n  Merges all symbols from the left table into the right.\n\n  This function creates a new SymbolTable which is the merger of the two input\n  symbol Tables. Symbols in the right-hand table that conflict with those in the\n  left-hand table will be assigned values from the left-hand table. Thus the\n  returned table will never modify symbol assignments from the left-hand side,\n  but may do so on the right.\n\n  If the left-hand table is associated with an FST, it may be necessary to\n  relabel it using the output table.\n\n  Args:\n    lhs: Left-hand side SymbolTable.\n    rhs: Left-hand side SymbolTable.\n\n  Returns:\n    A new merged SymbolTable.\n  ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_13merge_symbol_table(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_lhs = 0;
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_rhs = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("merge_symbol_table (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_lhs,&__pyx_n_s_rhs,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_lhs)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rhs)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("merge_symbol_table", 1, 2, 2, 1); __PYX_ERR(0, 1233, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "merge_symbol_table") < 0)) __PYX_ERR(0, 1233, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_lhs = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *)values[0]);
    __pyx_v_rhs = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("merge_symbol_table", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1233, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.merge_symbol_table", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_lhs), __pyx_ptype_6fstlib_4cext_9pywrapfst_SymbolTableView, 1, "lhs", 0))) __PYX_ERR(0, 1233, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rhs), __pyx_ptype_6fstlib_4cext_9pywrapfst_SymbolTableView, 1, "rhs", 0))) __PYX_ERR(0, 1234, __pyx_L1_error)
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_12merge_symbol_table(__pyx_self, __pyx_v_lhs, __pyx_v_rhs);

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_12merge_symbol_table(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_lhs, struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_rhs) {
  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("merge_symbol_table", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_6fstlib_4cext_9pywrapfst_merge_symbol_table(__pyx_v_lhs, __pyx_v_rhs, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1233, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.merge_symbol_table", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":1272
 *   """
 * 
 *   def __repr__(self):             # <<<<<<<<<<<<<<
 *     return f"<_SymbolTableIterator at 0x{id(self):x}>"
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_20_SymbolTableIterator_1__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_20_SymbolTableIterator_1__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_20_SymbolTableIterator___repr__(((struct __pyx_obj_6fstlib_4cext_9pywrapfst__SymbolTableIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_20_SymbolTableIterator___repr__(struct __pyx_obj_6fstlib_4cext_9pywrapfst__SymbolTableIterator *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  Py_UCS4 __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "fstlib/cext/pywrapfst.pyx":1273
 * 
 *   def __repr__(self):
 *     return f"<_SymbolTableIterator at 0x{id(self):x}>"             # <<<<<<<<<<<<<<
 * 
 *   def __init__(self, SymbolTableView symbols):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1273, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = 0;
  __pyx_t_3 = 127;
  __Pyx_INCREF(__pyx_kp_u_SymbolTableIterator_at_0x);
  __pyx_t_2 += 27;
  __Pyx_GIVEREF(__pyx_kp_u_SymbolTableIterator_at_0x);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_SymbolTableIterator_at_0x);
  __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1273, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_Format(__pyx_t_4, __pyx_n_u_x); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1273, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5);
  __pyx_t_5 = 0;
  __Pyx_INCREF(__pyx_kp_u__3);
  __pyx_t_2 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__3);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u__3);
  __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_1, 3, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1273, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":1272
 *   """
 * 
 *   def __repr__(self):             # <<<<<<<<<<<<<<
 *     return f"<_SymbolTableIterator at 0x{id(self):x}>"
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst._SymbolTableIterator.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":1275
 *     return f"<_SymbolTableIterator at 0x{id(self):x}>"
 * 
 *   def __init__(self, SymbolTableView symbols):             # <<<<<<<<<<<<<<
 *     self._table = symbols
 *     self._siter.reset(
 */

/* Python wrapper */
static int __pyx_pw_6fstlib_4cext_9pywrapfst_20_SymbolTableIterator_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_6fstlib_4cext_9pywrapfst_20_SymbolTableIterator_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_symbols = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_symbols,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_symbols)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1275, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_symbols = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1275, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst._SymbolTableIterator.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_symbols), __pyx_ptype_6fstlib_4cext_9pywrapfst_SymbolTableView, 1, "symbols", 0))) __PYX_ERR(0, 1275, __pyx_L1_error)
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_20_SymbolTableIterator_2__init__(((struct __pyx_obj_6fstlib_4cext_9pywrapfst__SymbolTableIterator *)__pyx_v_self), __pyx_v_symbols);

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

static int __pyx_pf_6fstlib_4cext_9pywrapfst_20_SymbolTableIterator_2__init__(struct __pyx_obj_6fstlib_4cext_9pywrapfst__SymbolTableIterator *__pyx_v_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_symbols) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  fst::SymbolTable const *__pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "fstlib/cext/pywrapfst.pyx":1276
 * 
 *   def __init__(self, SymbolTableView symbols):
 *     self._table = symbols             # <<<<<<<<<<<<<<
 *     self._siter.reset(
 *         new fst.SymbolTableIterator(self._table._raw_ptr_or_raise().begin()))
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_table");
    __PYX_ERR(0, 1276, __pyx_L1_error)
  }
  __Pyx_INCREF(((PyObject *)__pyx_v_symbols));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_symbols));
  __Pyx_GOTREF(__pyx_v_self->_table);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->_table));
  __pyx_v_self->_table = __pyx_v_symbols;

  /* "fstlib/cext/pywrapfst.pyx":1277
 *   def __init__(self, SymbolTableView symbols):
 *     self._table = symbols
 *     self._siter.reset(             # <<<<<<<<<<<<<<
 *         new fst.SymbolTableIterator(self._table._raw_ptr_or_raise().begin()))
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_siter");
    __PYX_ERR(0, 1277, __pyx_L1_error)
  }

  /* "fstlib/cext/pywrapfst.pyx":1278
 *     self._table = symbols
 *     self._siter.reset(
 *         new fst.SymbolTableIterator(self._table._raw_ptr_or_raise().begin()))             # <<<<<<<<<<<<<<
 * 
 *   # This just registers this class as a possible iterator.
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_table");
    __PYX_ERR(0, 1278, __pyx_L1_error)
  }
  if (unlikely(((PyObject *)__pyx_v_self->_table) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raw_ptr_or_raise");
    __PYX_ERR(0, 1278, __pyx_L1_error)
  }
  __pyx_t_1 = ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_SymbolTableView *)__pyx_v_self->_table->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_self->_table); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1278, __pyx_L1_error)

  /* "fstlib/cext/pywrapfst.pyx":1277
 *   def __init__(self, SymbolTableView symbols):
 *     self._table = symbols
 *     self._siter.reset(             # <<<<<<<<<<<<<<
 *         new fst.SymbolTableIterator(self._table._raw_ptr_or_raise().begin()))
 * 
 */
  __pyx_v_self->_siter.reset(new fst::SymbolTable::iterator(__pyx_t_1->begin()));

  /* "fstlib/cext/pywrapfst.pyx":1275
 *     return f"<_SymbolTableIterator at 0x{id(self):x}>"
 * 
 *   def __init__(self, SymbolTableView symbols):             # <<<<<<<<<<<<<<
 *     self._table = symbols
 *     self._siter.reset(
 */

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

/* "fstlib/cext/pywrapfst.pyx":1281
 * 
 *   # This just registers this class as a possible iterator.
 *   def __iter__(self):             # <<<<<<<<<<<<<<
 *     return self
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_20_SymbolTableIterator_5__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_20_SymbolTableIterator_5__iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_20_SymbolTableIterator_4__iter__(((struct __pyx_obj_6fstlib_4cext_9pywrapfst__SymbolTableIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_20_SymbolTableIterator_4__iter__(struct __pyx_obj_6fstlib_4cext_9pywrapfst__SymbolTableIterator *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);

  /* "fstlib/cext/pywrapfst.pyx":1282
 *   # This just registers this class as a possible iterator.
 *   def __iter__(self):
 *     return self             # <<<<<<<<<<<<<<
 * 
 *   # Magic method used to get a Pythonic API out of the C++ API.
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":1281
 * 
 *   # This just registers this class as a possible iterator.
 *   def __iter__(self):             # <<<<<<<<<<<<<<
 *     return self
 * 
 */

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

/* "fstlib/cext/pywrapfst.pyx":1285
 * 
 *   # Magic method used to get a Pythonic API out of the C++ API.
 *   def __next__(self):             # <<<<<<<<<<<<<<
 *     if self._table._raw_ptr_or_raise().end() == deref(self._siter):
 *       raise StopIteration
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_20_SymbolTableIterator_7__next__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_20_SymbolTableIterator_7__next__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__next__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_20_SymbolTableIterator_6__next__(((struct __pyx_obj_6fstlib_4cext_9pywrapfst__SymbolTableIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_20_SymbolTableIterator_6__next__(struct __pyx_obj_6fstlib_4cext_9pywrapfst__SymbolTableIterator *__pyx_v_self) {
  int64 __pyx_v__label;
  std::string __pyx_v__symbol;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  fst::SymbolTable const *__pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__next__", 0);

  /* "fstlib/cext/pywrapfst.pyx":1286
 *   # Magic method used to get a Pythonic API out of the C++ API.
 *   def __next__(self):
 *     if self._table._raw_ptr_or_raise().end() == deref(self._siter):             # <<<<<<<<<<<<<<
 *       raise StopIteration
 *     cdef int64 _label = self._siter.get().Pair().Label()
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_table");
    __PYX_ERR(0, 1286, __pyx_L1_error)
  }
  if (unlikely(((PyObject *)__pyx_v_self->_table) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raw_ptr_or_raise");
    __PYX_ERR(0, 1286, __pyx_L1_error)
  }
  __pyx_t_1 = ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_SymbolTableView *)__pyx_v_self->_table->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_self->_table); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1286, __pyx_L1_error)
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_siter");
    __PYX_ERR(0, 1286, __pyx_L1_error)
  }
  __pyx_t_2 = ((__pyx_t_1->end() == (*__pyx_v_self->_siter)) != 0);
  if (unlikely(__pyx_t_2)) {

    /* "fstlib/cext/pywrapfst.pyx":1287
 *   def __next__(self):
 *     if self._table._raw_ptr_or_raise().end() == deref(self._siter):
 *       raise StopIteration             # <<<<<<<<<<<<<<
 *     cdef int64 _label = self._siter.get().Pair().Label()
 *     cdef string _symbol = self._siter.get().Pair().Symbol()
 */
    __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
    __PYX_ERR(0, 1287, __pyx_L1_error)

    /* "fstlib/cext/pywrapfst.pyx":1286
 *   # Magic method used to get a Pythonic API out of the C++ API.
 *   def __next__(self):
 *     if self._table._raw_ptr_or_raise().end() == deref(self._siter):             # <<<<<<<<<<<<<<
 *       raise StopIteration
 *     cdef int64 _label = self._siter.get().Pair().Label()
 */
  }

  /* "fstlib/cext/pywrapfst.pyx":1288
 *     if self._table._raw_ptr_or_raise().end() == deref(self._siter):
 *       raise StopIteration
 *     cdef int64 _label = self._siter.get().Pair().Label()             # <<<<<<<<<<<<<<
 *     cdef string _symbol = self._siter.get().Pair().Symbol()
 *     inc(deref(self._siter))
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_siter");
    __PYX_ERR(0, 1288, __pyx_L1_error)
  }
  __pyx_v__label = __pyx_v_self->_siter.get()->operator*().Label();

  /* "fstlib/cext/pywrapfst.pyx":1289
 *       raise StopIteration
 *     cdef int64 _label = self._siter.get().Pair().Label()
 *     cdef string _symbol = self._siter.get().Pair().Symbol()             # <<<<<<<<<<<<<<
 *     inc(deref(self._siter))
 *     return (_label, _symbol)
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_siter");
    __PYX_ERR(0, 1289, __pyx_L1_error)
  }
  __pyx_v__symbol = __pyx_v_self->_siter.get()->operator*().Symbol();

  /* "fstlib/cext/pywrapfst.pyx":1290
 *     cdef int64 _label = self._siter.get().Pair().Label()
 *     cdef string _symbol = self._siter.get().Pair().Symbol()
 *     inc(deref(self._siter))             # <<<<<<<<<<<<<<
 *     return (_label, _symbol)
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_siter");
    __PYX_ERR(0, 1290, __pyx_L1_error)
  }
  (void)((++(*__pyx_v_self->_siter)));

  /* "fstlib/cext/pywrapfst.pyx":1291
 *     cdef string _symbol = self._siter.get().Pair().Symbol()
 *     inc(deref(self._siter))
 *     return (_label, _symbol)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_v__label); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1291, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_v__symbol); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1291, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1291, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4);
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":1285
 * 
 *   # Magic method used to get a Pythonic API out of the C++ API.
 *   def __next__(self):             # <<<<<<<<<<<<<<
 *     if self._table._raw_ptr_or_raise().end() == deref(self._siter):
 *       raise StopIteration
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst._SymbolTableIterator.__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._siter cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_20_SymbolTableIterator_9__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_20_SymbolTableIterator_9__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_20_SymbolTableIterator_8__reduce_cython__(((struct __pyx_obj_6fstlib_4cext_9pywrapfst__SymbolTableIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_20_SymbolTableIterator_8__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_6fstlib_4cext_9pywrapfst__SymbolTableIterator *__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("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self._siter cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self._siter cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __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(1, 2, __pyx_L1_error)

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst._SymbolTableIterator.__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._siter cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self._siter cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_20_SymbolTableIterator_11__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_20_SymbolTableIterator_11__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_20_SymbolTableIterator_10__setstate_cython__(((struct __pyx_obj_6fstlib_4cext_9pywrapfst__SymbolTableIterator *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_20_SymbolTableIterator_10__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_6fstlib_4cext_9pywrapfst__SymbolTableIterator *__pyx_v_self, CYTHON_UNUSED 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__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self._siter cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self._siter cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __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(1, 4, __pyx_L1_error)

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst._SymbolTableIterator.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":1320
 *   """
 * 
 *   def __repr__(self):             # <<<<<<<<<<<<<<
 *     return f"<EncodeMapper at 0x{id(self):x}>"
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_12EncodeMapper_1__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_12EncodeMapper_1__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_12EncodeMapper___repr__(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_12EncodeMapper___repr__(struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  Py_UCS4 __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "fstlib/cext/pywrapfst.pyx":1321
 * 
 *   def __repr__(self):
 *     return f"<EncodeMapper at 0x{id(self):x}>"             # <<<<<<<<<<<<<<
 * 
 *   def __init__(self,
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1321, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = 0;
  __pyx_t_3 = 127;
  __Pyx_INCREF(__pyx_kp_u_EncodeMapper_at_0x);
  __pyx_t_2 += 19;
  __Pyx_GIVEREF(__pyx_kp_u_EncodeMapper_at_0x);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_EncodeMapper_at_0x);
  __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1321, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_Format(__pyx_t_4, __pyx_n_u_x); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1321, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5);
  __pyx_t_5 = 0;
  __Pyx_INCREF(__pyx_kp_u__3);
  __pyx_t_2 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__3);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u__3);
  __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_1, 3, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1321, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":1320
 *   """
 * 
 *   def __repr__(self):             # <<<<<<<<<<<<<<
 *     return f"<EncodeMapper at 0x{id(self):x}>"
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.EncodeMapper.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":1323
 *     return f"<EncodeMapper at 0x{id(self):x}>"
 * 
 *   def __init__(self,             # <<<<<<<<<<<<<<
 *                arc_type="standard",
 *                bool encode_labels=False,
 */

/* Python wrapper */
static int __pyx_pw_6fstlib_4cext_9pywrapfst_12EncodeMapper_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_6fstlib_4cext_9pywrapfst_12EncodeMapper_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_arc_type = 0;
  bool __pyx_v_encode_labels;
  bool __pyx_v_encode_weights;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_arc_type,&__pyx_n_s_encode_labels,&__pyx_n_s_encode_weights,0};
    PyObject* values[3] = {0,0,0};
    values[0] = ((PyObject *)__pyx_n_u_standard);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_arc_type);
          if (value) { values[0] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_encode_labels);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_encode_weights);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1323, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_arc_type = values[0];
    if (values[1]) {
      __pyx_v_encode_labels = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_encode_labels == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1325, __pyx_L3_error)
    } else {

      /* "fstlib/cext/pywrapfst.pyx":1325
 *   def __init__(self,
 *                arc_type="standard",
 *                bool encode_labels=False,             # <<<<<<<<<<<<<<
 *                bool encode_weights=False):
 *     cdef uint8 _flags = fst.GetEncodeFlags(encode_labels, encode_weights)
 */
      __pyx_v_encode_labels = ((bool)0);
    }
    if (values[2]) {
      __pyx_v_encode_weights = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_encode_weights == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1326, __pyx_L3_error)
    } else {

      /* "fstlib/cext/pywrapfst.pyx":1326
 *                arc_type="standard",
 *                bool encode_labels=False,
 *                bool encode_weights=False):             # <<<<<<<<<<<<<<
 *     cdef uint8 _flags = fst.GetEncodeFlags(encode_labels, encode_weights)
 *     self._mapper.reset(
 */
      __pyx_v_encode_weights = ((bool)0);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1323, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.EncodeMapper.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_12EncodeMapper_2__init__(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *)__pyx_v_self), __pyx_v_arc_type, __pyx_v_encode_labels, __pyx_v_encode_weights);

  /* "fstlib/cext/pywrapfst.pyx":1323
 *     return f"<EncodeMapper at 0x{id(self):x}>"
 * 
 *   def __init__(self,             # <<<<<<<<<<<<<<
 *                arc_type="standard",
 *                bool encode_labels=False,
 */

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

static int __pyx_pf_6fstlib_4cext_9pywrapfst_12EncodeMapper_2__init__(struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *__pyx_v_self, PyObject *__pyx_v_arc_type, bool __pyx_v_encode_labels, bool __pyx_v_encode_weights) {
  uint8 __pyx_v__flags;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "fstlib/cext/pywrapfst.pyx":1327
 *                bool encode_labels=False,
 *                bool encode_weights=False):
 *     cdef uint8 _flags = fst.GetEncodeFlags(encode_labels, encode_weights)             # <<<<<<<<<<<<<<
 *     self._mapper.reset(
 *         new fst.EncodeMapperClass(tostring(arc_type), _flags, fst.ENCODE))
 */
  __pyx_v__flags = fst::script::GetEncodeFlags(__pyx_v_encode_labels, __pyx_v_encode_weights);

  /* "fstlib/cext/pywrapfst.pyx":1328
 *                bool encode_weights=False):
 *     cdef uint8 _flags = fst.GetEncodeFlags(encode_labels, encode_weights)
 *     self._mapper.reset(             # <<<<<<<<<<<<<<
 *         new fst.EncodeMapperClass(tostring(arc_type), _flags, fst.ENCODE))
 *     if self._mapper.get() == NULL:
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mapper");
    __PYX_ERR(0, 1328, __pyx_L1_error)
  }

  /* "fstlib/cext/pywrapfst.pyx":1329
 *     cdef uint8 _flags = fst.GetEncodeFlags(encode_labels, encode_weights)
 *     self._mapper.reset(
 *         new fst.EncodeMapperClass(tostring(arc_type), _flags, fst.ENCODE))             # <<<<<<<<<<<<<<
 *     if self._mapper.get() == NULL:
 *       raise FstOpError(f"Unknown arc type: {arc_type!r}")
 */
  __pyx_t_1 = __pyx_f_6fstlib_4cext_9pywrapfst_tostring(__pyx_v_arc_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1329, __pyx_L1_error)

  /* "fstlib/cext/pywrapfst.pyx":1328
 *                bool encode_weights=False):
 *     cdef uint8 _flags = fst.GetEncodeFlags(encode_labels, encode_weights)
 *     self._mapper.reset(             # <<<<<<<<<<<<<<
 *         new fst.EncodeMapperClass(tostring(arc_type), _flags, fst.ENCODE))
 *     if self._mapper.get() == NULL:
 */
  __pyx_v_self->_mapper.reset(new fst::script::EncodeMapperClass(__pyx_t_1, __pyx_v__flags, fst::ENCODE));

  /* "fstlib/cext/pywrapfst.pyx":1330
 *     self._mapper.reset(
 *         new fst.EncodeMapperClass(tostring(arc_type), _flags, fst.ENCODE))
 *     if self._mapper.get() == NULL:             # <<<<<<<<<<<<<<
 *       raise FstOpError(f"Unknown arc type: {arc_type!r}")
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mapper");
    __PYX_ERR(0, 1330, __pyx_L1_error)
  }
  __pyx_t_2 = ((__pyx_v_self->_mapper.get() == NULL) != 0);
  if (unlikely(__pyx_t_2)) {

    /* "fstlib/cext/pywrapfst.pyx":1331
 *         new fst.EncodeMapperClass(tostring(arc_type), _flags, fst.ENCODE))
 *     if self._mapper.get() == NULL:
 *       raise FstOpError(f"Unknown arc type: {arc_type!r}")             # <<<<<<<<<<<<<<
 * 
 *   # Python's equivalent to operator().
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FstOpError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1331, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_arc_type), __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1331, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Unknown_arc_type, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1331, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_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_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1331, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 1331, __pyx_L1_error)

    /* "fstlib/cext/pywrapfst.pyx":1330
 *     self._mapper.reset(
 *         new fst.EncodeMapperClass(tostring(arc_type), _flags, fst.ENCODE))
 *     if self._mapper.get() == NULL:             # <<<<<<<<<<<<<<
 *       raise FstOpError(f"Unknown arc type: {arc_type!r}")
 * 
 */
  }

  /* "fstlib/cext/pywrapfst.pyx":1323
 *     return f"<EncodeMapper at 0x{id(self):x}>"
 * 
 *   def __init__(self,             # <<<<<<<<<<<<<<
 *                arc_type="standard",
 *                bool encode_labels=False,
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.EncodeMapper.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":1335
 *   # Python's equivalent to operator().
 * 
 *   def __call__(self, Arc arc):             # <<<<<<<<<<<<<<
 *     """
 *     self(state, ilabel, olabel, weight, nextstate)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_12EncodeMapper_5__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_12EncodeMapper_4__call__[] = "\n    self(state, ilabel, olabel, weight, nextstate)\n\n    Uses the mapper to encode an arc.\n\n    Args:\n      ilabel: The integer index of the input label.\n      olabel: The integer index of the output label.\n      weight: A Weight or weight string indicating the desired final weight; if\n        null, it is set to semiring One.\n      nextstate: The integer index of the destination state.\n\n    Raises:\n      FstOpError: Incompatible or invalid weight.\n    ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_6fstlib_4cext_9pywrapfst_12EncodeMapper_4__call__;
#endif
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_12EncodeMapper_5__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_Arc *__pyx_v_arc = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__call__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_arc,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_arc)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__call__") < 0)) __PYX_ERR(0, 1335, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_arc = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Arc *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__call__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1335, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.EncodeMapper.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arc), __pyx_ptype_6fstlib_4cext_9pywrapfst_Arc, 1, "arc", 0))) __PYX_ERR(0, 1335, __pyx_L1_error)
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_12EncodeMapper_4__call__(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *)__pyx_v_self), __pyx_v_arc);

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_12EncodeMapper_4__call__(struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *__pyx_v_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Arc *__pyx_v_arc) {
  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("__call__", 0);

  /* "fstlib/cext/pywrapfst.pyx":1351
 *       FstOpError: Incompatible or invalid weight.
 *     """
 *     return _init_Arc(self._mapper.get().__call__(deref(arc._arc)))             # <<<<<<<<<<<<<<
 * 
 *   # Registers the class for pickling.
 */
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mapper");
    __PYX_ERR(0, 1351, __pyx_L1_error)
  }
  if (unlikely(((PyObject *)__pyx_v_arc) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_arc");
    __PYX_ERR(0, 1351, __pyx_L1_error)
  }
  __pyx_t_1 = ((PyObject *)__pyx_f_6fstlib_4cext_9pywrapfst__init_Arc(__pyx_v_self->_mapper.get()->operator()((*__pyx_v_arc->_arc)))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1351, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":1335
 *   # Python's equivalent to operator().
 * 
 *   def __call__(self, Arc arc):             # <<<<<<<<<<<<<<
 *     """
 *     self(state, ilabel, olabel, weight, nextstate)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.EncodeMapper.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":1355
 *   # Registers the class for pickling.
 * 
 *   def __reduce__(self):             # <<<<<<<<<<<<<<
 *       return (_read_EncodeMapper_from_string, (self.write_to_string(),))
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_12EncodeMapper_7__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_12EncodeMapper_7__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_12EncodeMapper_6__reduce__(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_12EncodeMapper_6__reduce__(struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *__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("__reduce__", 0);

  /* "fstlib/cext/pywrapfst.pyx":1356
 * 
 *   def __reduce__(self):
 *       return (_read_EncodeMapper_from_string, (self.write_to_string(),))             # <<<<<<<<<<<<<<
 * 
 *   cpdef string arc_type(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_read_EncodeMapper_from_string); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1356, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "write_to_string");
    __PYX_ERR(0, 1356, __pyx_L1_error)
  }
  __pyx_t_2 = ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_EncodeMapper *)__pyx_v_self->__pyx_vtab)->write_to_string(__pyx_v_self, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1356, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1356, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1356, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
  __pyx_t_1 = 0;
  __pyx_t_3 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":1355
 *   # Registers the class for pickling.
 * 
 *   def __reduce__(self):             # <<<<<<<<<<<<<<
 *       return (_read_EncodeMapper_from_string, (self.write_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("fstlib.cext.pywrapfst.EncodeMapper.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":1358
 *       return (_read_EncodeMapper_from_string, (self.write_to_string(),))
 * 
 *   cpdef string arc_type(self):             # <<<<<<<<<<<<<<
 *     """
 *     arc_type(self)
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_12EncodeMapper_9arc_type(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static std::string __pyx_f_6fstlib_4cext_9pywrapfst_12EncodeMapper_arc_type(struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *__pyx_v_self, int __pyx_skip_dispatch) {
  std::string __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  std::string __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("arc_type", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_arc_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1358, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6fstlib_4cext_9pywrapfst_12EncodeMapper_9arc_type)) {
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1358, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1358, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_5;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "fstlib/cext/pywrapfst.pyx":1364
 *     Returns a string indicating the arc type.
 *     """
 *     return self._mapper.get().ArcType()             # <<<<<<<<<<<<<<
 * 
 *   cpdef string weight_type(self):
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mapper");
    __PYX_ERR(0, 1364, __pyx_L1_error)
  }
  __pyx_r = __pyx_v_self->_mapper.get()->ArcType();
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":1358
 *       return (_read_EncodeMapper_from_string, (self.write_to_string(),))
 * 
 *   cpdef string arc_type(self):             # <<<<<<<<<<<<<<
 *     """
 *     arc_type(self)
 */

  /* 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_WriteUnraisable("fstlib.cext.pywrapfst.EncodeMapper.arc_type", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_12EncodeMapper_9arc_type(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_12EncodeMapper_8arc_type[] = "\n    arc_type(self)\n\n    Returns a string indicating the arc type.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_12EncodeMapper_9arc_type(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("arc_type (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_12EncodeMapper_8arc_type(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_12EncodeMapper_8arc_type(struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *__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("arc_type", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_f_6fstlib_4cext_9pywrapfst_12EncodeMapper_arc_type(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1358, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.EncodeMapper.arc_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":1366
 *     return self._mapper.get().ArcType()
 * 
 *   cpdef string weight_type(self):             # <<<<<<<<<<<<<<
 *     """
 *     weight_type(self)
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_12EncodeMapper_11weight_type(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static std::string __pyx_f_6fstlib_4cext_9pywrapfst_12EncodeMapper_weight_type(struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *__pyx_v_self, int __pyx_skip_dispatch) {
  std::string __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  std::string __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("weight_type", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_weight_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1366, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6fstlib_4cext_9pywrapfst_12EncodeMapper_11weight_type)) {
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1366, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1366, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_5;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "fstlib/cext/pywrapfst.pyx":1372
 *     Returns a string indicating the weight type.
 *     """
 *     return self._mapper.get().WeightType()             # <<<<<<<<<<<<<<
 * 
 *   cpdef uint8 flags(self):
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mapper");
    __PYX_ERR(0, 1372, __pyx_L1_error)
  }
  __pyx_r = __pyx_v_self->_mapper.get()->WeightType();
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":1366
 *     return self._mapper.get().ArcType()
 * 
 *   cpdef string weight_type(self):             # <<<<<<<<<<<<<<
 *     """
 *     weight_type(self)
 */

  /* 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_WriteUnraisable("fstlib.cext.pywrapfst.EncodeMapper.weight_type", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_12EncodeMapper_11weight_type(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_12EncodeMapper_10weight_type[] = "\n    weight_type(self)\n\n    Returns a string indicating the weight type.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_12EncodeMapper_11weight_type(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("weight_type (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_12EncodeMapper_10weight_type(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_12EncodeMapper_10weight_type(struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *__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("weight_type", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_f_6fstlib_4cext_9pywrapfst_12EncodeMapper_weight_type(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1366, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.EncodeMapper.weight_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":1374
 *     return self._mapper.get().WeightType()
 * 
 *   cpdef uint8 flags(self):             # <<<<<<<<<<<<<<
 *     """
 *     flags(self)
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_12EncodeMapper_13flags(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static uint8 __pyx_f_6fstlib_4cext_9pywrapfst_12EncodeMapper_flags(struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *__pyx_v_self, int __pyx_skip_dispatch) {
  uint8 __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  uint8 __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("flags", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1374, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6fstlib_4cext_9pywrapfst_12EncodeMapper_13flags)) {
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1374, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_5 = __Pyx_PyInt_As_uint8_t(__pyx_t_2); if (unlikely((__pyx_t_5 == ((uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1374, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_5;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "fstlib/cext/pywrapfst.pyx":1380
 *     Returns the mapper's flags.
 *     """
 *     return self._mapper.get().Flags()             # <<<<<<<<<<<<<<
 * 
 *   def properties(self, mask):
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mapper");
    __PYX_ERR(0, 1380, __pyx_L1_error)
  }
  __pyx_r = __pyx_v_self->_mapper.get()->Flags();
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":1374
 *     return self._mapper.get().WeightType()
 * 
 *   cpdef uint8 flags(self):             # <<<<<<<<<<<<<<
 *     """
 *     flags(self)
 */

  /* 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_WriteUnraisable("fstlib.cext.pywrapfst.EncodeMapper.flags", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_12EncodeMapper_13flags(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_12EncodeMapper_12flags[] = "\n    flags(self)\n\n    Returns the mapper's flags.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_12EncodeMapper_13flags(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("flags (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_12EncodeMapper_12flags(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_12EncodeMapper_12flags(struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *__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("flags", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_uint8_t(__pyx_f_6fstlib_4cext_9pywrapfst_12EncodeMapper_flags(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1374, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.EncodeMapper.flags", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":1382
 *     return self._mapper.get().Flags()
 * 
 *   def properties(self, mask):             # <<<<<<<<<<<<<<
 *     """
 *     properties(self, mask)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_12EncodeMapper_15properties(PyObject *__pyx_v_self, PyObject *__pyx_v_mask); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_12EncodeMapper_14properties[] = "\n    properties(self, mask)\n\n    Provides property bits.\n\n    This method provides user access to the properties of the mapper.\n\n    Args:\n      mask: The property mask to be compared to the mapper's properties.\n\n    Returns:\n      A 64-bit bitmask representing the requested properties.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_12EncodeMapper_15properties(PyObject *__pyx_v_self, PyObject *__pyx_v_mask) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("properties (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_12EncodeMapper_14properties(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *)__pyx_v_self), ((PyObject *)__pyx_v_mask));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_12EncodeMapper_14properties(struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *__pyx_v_self, PyObject *__pyx_v_mask) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  uint64 __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("properties", 0);

  /* "fstlib/cext/pywrapfst.pyx":1397
 *     """
 * 
 *     return FstProperties(self._mapper.get().Properties(mask.value))             # <<<<<<<<<<<<<<
 * 
 *   @classmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FstProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1397, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mapper");
    __PYX_ERR(0, 1397, __pyx_L1_error)
  }
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_mask, __pyx_n_s_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1397, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyInt_As_uint64_t(__pyx_t_3); if (unlikely((__pyx_t_4 == ((uint64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1397, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyInt_From_uint64_t(__pyx_v_self->_mapper.get()->Properties(__pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1397, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1397, __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;

  /* "fstlib/cext/pywrapfst.pyx":1382
 *     return self._mapper.get().Flags()
 * 
 *   def properties(self, mask):             # <<<<<<<<<<<<<<
 *     """
 *     properties(self, mask)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.EncodeMapper.properties", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":1400
 * 
 *   @classmethod
 *   def read(cls, source):             # <<<<<<<<<<<<<<
 *     """
 *     EncodeMapper.read(source)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_12EncodeMapper_17read(PyObject *__pyx_v_cls, PyObject *__pyx_v_source); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_12EncodeMapper_16read[] = "\n    EncodeMapper.read(source)\n\n    Reads encode mapper from binary file.\n\n    This class method creates a new EncodeMapper from an encode mapper binary\n    file.\n\n    Args:\n      source: The string location of the input binary file.\n\n    Returns:\n      A new EncodeMapper instance.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_12EncodeMapper_17read(PyObject *__pyx_v_cls, PyObject *__pyx_v_source) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("read (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_12EncodeMapper_16read(((PyTypeObject*)__pyx_v_cls), ((PyObject *)__pyx_v_source));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_12EncodeMapper_16read(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_source) {
  std::unique_ptr<fst::script::EncodeMapperClass>  __pyx_v__mapper;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("read", 0);

  /* "fstlib/cext/pywrapfst.pyx":1416
 *     """
 *     cdef unique_ptr[fst.EncodeMapperClass] _mapper
 *     _mapper.reset(fst.EncodeMapperClass.Read(path_tostring(source)))             # <<<<<<<<<<<<<<
 *     if _mapper.get() == NULL:
 *       raise FstIOError(f"Read failed: {source!r}")
 */
  __pyx_t_1 = __pyx_f_6fstlib_4cext_9pywrapfst_path_tostring(__pyx_v_source); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1416, __pyx_L1_error)
  __pyx_v__mapper.reset(fst::script::EncodeMapperClass::Read(__pyx_t_1));

  /* "fstlib/cext/pywrapfst.pyx":1417
 *     cdef unique_ptr[fst.EncodeMapperClass] _mapper
 *     _mapper.reset(fst.EncodeMapperClass.Read(path_tostring(source)))
 *     if _mapper.get() == NULL:             # <<<<<<<<<<<<<<
 *       raise FstIOError(f"Read failed: {source!r}")
 *     return _init_EncodeMapper(_mapper.release())
 */
  __pyx_t_2 = ((__pyx_v__mapper.get() == NULL) != 0);
  if (unlikely(__pyx_t_2)) {

    /* "fstlib/cext/pywrapfst.pyx":1418
 *     _mapper.reset(fst.EncodeMapperClass.Read(path_tostring(source)))
 *     if _mapper.get() == NULL:
 *       raise FstIOError(f"Read failed: {source!r}")             # <<<<<<<<<<<<<<
 *     return _init_EncodeMapper(_mapper.release())
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FstIOError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1418, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_source), __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1418, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Read_failed, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1418, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_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_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1418, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 1418, __pyx_L1_error)

    /* "fstlib/cext/pywrapfst.pyx":1417
 *     cdef unique_ptr[fst.EncodeMapperClass] _mapper
 *     _mapper.reset(fst.EncodeMapperClass.Read(path_tostring(source)))
 *     if _mapper.get() == NULL:             # <<<<<<<<<<<<<<
 *       raise FstIOError(f"Read failed: {source!r}")
 *     return _init_EncodeMapper(_mapper.release())
 */
  }

  /* "fstlib/cext/pywrapfst.pyx":1419
 *     if _mapper.get() == NULL:
 *       raise FstIOError(f"Read failed: {source!r}")
 *     return _init_EncodeMapper(_mapper.release())             # <<<<<<<<<<<<<<
 * 
 *   @staticmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = ((PyObject *)__pyx_f_6fstlib_4cext_9pywrapfst__init_EncodeMapper(__pyx_v__mapper.release())); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1419, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":1400
 * 
 *   @classmethod
 *   def read(cls, source):             # <<<<<<<<<<<<<<
 *     """
 *     EncodeMapper.read(source)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.EncodeMapper.read", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":1422
 * 
 *   @staticmethod
 *   def read_from_string(state):             # <<<<<<<<<<<<<<
 *     """
 *     read_from_string(state)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_12EncodeMapper_19read_from_string(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_12EncodeMapper_18read_from_string[] = "\n    read_from_string(state)\n\n    Reads an EncodeMapper from a serialized string.\n\n    Args:\n      state: A string containing the serialized EncodeMapper.\n\n    Returns:\n      An EncodeMapper object.\n\n    Raises:\n      FstIOError: Read failed.\n    ";
static PyMethodDef __pyx_mdef_6fstlib_4cext_9pywrapfst_12EncodeMapper_19read_from_string = {"read_from_string", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6fstlib_4cext_9pywrapfst_12EncodeMapper_19read_from_string, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6fstlib_4cext_9pywrapfst_12EncodeMapper_18read_from_string};
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_12EncodeMapper_19read_from_string(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_state = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("read_from_string (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_state,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_state)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "read_from_string") < 0)) __PYX_ERR(0, 1422, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_state = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("read_from_string", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1422, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.EncodeMapper.read_from_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_12EncodeMapper_18read_from_string(__pyx_v_state);

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_12EncodeMapper_18read_from_string(PyObject *__pyx_v_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("read_from_string", 0);

  /* "fstlib/cext/pywrapfst.pyx":1437
 *       FstIOError: Read failed.
 *     """
 *     return _read_EncodeMapper_from_string(state)             # <<<<<<<<<<<<<<
 * 
 *   cpdef void write(self, source) except *:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_v_state); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1437, __pyx_L1_error)
  __pyx_t_2 = ((PyObject *)__pyx_f_6fstlib_4cext_9pywrapfst__read_EncodeMapper_from_string(__pyx_t_1, 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1437, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":1422
 * 
 *   @staticmethod
 *   def read_from_string(state):             # <<<<<<<<<<<<<<
 *     """
 *     read_from_string(state)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.EncodeMapper.read_from_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":1439
 *     return _read_EncodeMapper_from_string(state)
 * 
 *   cpdef void write(self, source) except *:             # <<<<<<<<<<<<<<
 *       """
 *       write(self, source)
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_12EncodeMapper_21write(PyObject *__pyx_v_self, PyObject *__pyx_v_source); /*proto*/
static void __pyx_f_6fstlib_4cext_9pywrapfst_12EncodeMapper_write(struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *__pyx_v_self, PyObject *__pyx_v_source, int __pyx_skip_dispatch) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  std::string __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("write", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_write); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1439, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6fstlib_4cext_9pywrapfst_12EncodeMapper_21write)) {
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_source) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_source);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1439, __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;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "fstlib/cext/pywrapfst.pyx":1452
 *         FstIOError: Write failed.
 *       """
 *       if not self._mapper.get().Write(path_tostring(source)):             # <<<<<<<<<<<<<<
 *         raise FstIOError(f"Write failed: {source!r}")
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mapper");
    __PYX_ERR(0, 1452, __pyx_L1_error)
  }
  __pyx_t_5 = __pyx_f_6fstlib_4cext_9pywrapfst_path_tostring(__pyx_v_source); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1452, __pyx_L1_error)
  __pyx_t_6 = ((!(__pyx_v_self->_mapper.get()->Write(__pyx_t_5) != 0)) != 0);
  if (unlikely(__pyx_t_6)) {

    /* "fstlib/cext/pywrapfst.pyx":1453
 *       """
 *       if not self._mapper.get().Write(path_tostring(source)):
 *         raise FstIOError(f"Write failed: {source!r}")             # <<<<<<<<<<<<<<
 * 
 *   cpdef bytes write_to_string(self):
 */
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FstIOError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1453, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_source), __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1453, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Write_failed, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1453, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_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_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1453, __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(0, 1453, __pyx_L1_error)

    /* "fstlib/cext/pywrapfst.pyx":1452
 *         FstIOError: Write failed.
 *       """
 *       if not self._mapper.get().Write(path_tostring(source)):             # <<<<<<<<<<<<<<
 *         raise FstIOError(f"Write failed: {source!r}")
 * 
 */
  }

  /* "fstlib/cext/pywrapfst.pyx":1439
 *     return _read_EncodeMapper_from_string(state)
 * 
 *   cpdef void write(self, source) except *:             # <<<<<<<<<<<<<<
 *       """
 *       write(self, source)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.EncodeMapper.write", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_12EncodeMapper_21write(PyObject *__pyx_v_self, PyObject *__pyx_v_source); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_12EncodeMapper_20write[] = "\n      write(self, source)\n\n      Serializes mapper to a file.\n\n      This method writes the mapper to a file in a binary format.\n\n      Args:\n        source: The string location of the output file.\n      Raises:\n        FstIOError: Write failed.\n      ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_12EncodeMapper_21write(PyObject *__pyx_v_self, PyObject *__pyx_v_source) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("write (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_12EncodeMapper_20write(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *)__pyx_v_self), ((PyObject *)__pyx_v_source));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_12EncodeMapper_20write(struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *__pyx_v_self, PyObject *__pyx_v_source) {
  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("write", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_6fstlib_4cext_9pywrapfst_12EncodeMapper_write(__pyx_v_self, __pyx_v_source, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1439, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1439, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.EncodeMapper.write", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":1455
 *         raise FstIOError(f"Write failed: {source!r}")
 * 
 *   cpdef bytes write_to_string(self):             # <<<<<<<<<<<<<<
 *       """
 *       write_to_string(self)
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_12EncodeMapper_23write_to_string(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_6fstlib_4cext_9pywrapfst_12EncodeMapper_write_to_string(struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *__pyx_v_self, int __pyx_skip_dispatch) {
  std::stringstream __pyx_v__sstrm;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("write_to_string", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_write_to_string); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1455, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6fstlib_4cext_9pywrapfst_12EncodeMapper_23write_to_string)) {
        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1455, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (!(likely(PyBytes_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 1455, __pyx_L1_error)
        __pyx_r = ((PyObject*)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "fstlib/cext/pywrapfst.pyx":1468
 *       """
 *       cdef stringstream _sstrm
 *       if not self._mapper.get().WriteStream(_sstrm, b"<pywrapfst>"):             # <<<<<<<<<<<<<<
 *         raise FstIOError("Write to string failed")
 *       return _sstrm.str()
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mapper");
    __PYX_ERR(0, 1468, __pyx_L1_error)
  }
  __pyx_t_5 = ((!(__pyx_v_self->_mapper.get()->Write(__pyx_v__sstrm, __pyx_k_pywrapfst) != 0)) != 0);
  if (unlikely(__pyx_t_5)) {

    /* "fstlib/cext/pywrapfst.pyx":1469
 *       cdef stringstream _sstrm
 *       if not self._mapper.get().WriteStream(_sstrm, b"<pywrapfst>"):
 *         raise FstIOError("Write to string failed")             # <<<<<<<<<<<<<<
 *       return _sstrm.str()
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FstIOError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1469, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_kp_u_Write_to_string_failed) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_u_Write_to_string_failed);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1469, __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(0, 1469, __pyx_L1_error)

    /* "fstlib/cext/pywrapfst.pyx":1468
 *       """
 *       cdef stringstream _sstrm
 *       if not self._mapper.get().WriteStream(_sstrm, b"<pywrapfst>"):             # <<<<<<<<<<<<<<
 *         raise FstIOError("Write to string failed")
 *       return _sstrm.str()
 */
  }

  /* "fstlib/cext/pywrapfst.pyx":1470
 *       if not self._mapper.get().WriteStream(_sstrm, b"<pywrapfst>"):
 *         raise FstIOError("Write to string failed")
 *       return _sstrm.str()             # <<<<<<<<<<<<<<
 * 
 *   cpdef _EncodeMapperSymbolTableView input_symbols(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v__sstrm.str()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1470, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":1455
 *         raise FstIOError(f"Write failed: {source!r}")
 * 
 *   cpdef bytes write_to_string(self):             # <<<<<<<<<<<<<<
 *       """
 *       write_to_string(self)
 */

  /* 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("fstlib.cext.pywrapfst.EncodeMapper.write_to_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_12EncodeMapper_23write_to_string(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_12EncodeMapper_22write_to_string[] = "\n      write_to_string(self)\n\n      Serializes mapper to a string.\n\n      Returns:\n        A bytestring.\n\n      Raises:\n        FstIOError: Write to string failed.\n      ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_12EncodeMapper_23write_to_string(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("write_to_string (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_12EncodeMapper_22write_to_string(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_12EncodeMapper_22write_to_string(struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *__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("write_to_string", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6fstlib_4cext_9pywrapfst_12EncodeMapper_write_to_string(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1455, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.EncodeMapper.write_to_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":1472
 *       return _sstrm.str()
 * 
 *   cpdef _EncodeMapperSymbolTableView input_symbols(self):             # <<<<<<<<<<<<<<
 *     """
 *     input_symbols(self)
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_12EncodeMapper_25input_symbols(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static struct __pyx_obj_6fstlib_4cext_9pywrapfst__EncodeMapperSymbolTableView *__pyx_f_6fstlib_4cext_9pywrapfst_12EncodeMapper_input_symbols(struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *__pyx_v_self, int __pyx_skip_dispatch) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst__EncodeMapperSymbolTableView *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("input_symbols", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_input_symbols); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1472, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6fstlib_4cext_9pywrapfst_12EncodeMapper_25input_symbols)) {
        __Pyx_XDECREF(((PyObject *)__pyx_r));
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1472, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_6fstlib_4cext_9pywrapfst__EncodeMapperSymbolTableView))))) __PYX_ERR(0, 1472, __pyx_L1_error)
        __pyx_r = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst__EncodeMapperSymbolTableView *)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "fstlib/cext/pywrapfst.pyx":1478
 *     Returns the mapper's input symbol table, or None if none is present.
 *     """
 *     if self._mapper.get().InputSymbols() == NULL:             # <<<<<<<<<<<<<<
 *       return
 *     return _init_EncodeMapperSymbolTableView(self._mapper, input_side=True)
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mapper");
    __PYX_ERR(0, 1478, __pyx_L1_error)
  }
  __pyx_t_5 = ((__pyx_v_self->_mapper.get()->InputSymbols() == NULL) != 0);
  if (__pyx_t_5) {

    /* "fstlib/cext/pywrapfst.pyx":1479
 *     """
 *     if self._mapper.get().InputSymbols() == NULL:
 *       return             # <<<<<<<<<<<<<<
 *     return _init_EncodeMapperSymbolTableView(self._mapper, input_side=True)
 * 
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_r = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst__EncodeMapperSymbolTableView *)Py_None); __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "fstlib/cext/pywrapfst.pyx":1478
 *     Returns the mapper's input symbol table, or None if none is present.
 *     """
 *     if self._mapper.get().InputSymbols() == NULL:             # <<<<<<<<<<<<<<
 *       return
 *     return _init_EncodeMapperSymbolTableView(self._mapper, input_side=True)
 */
  }

  /* "fstlib/cext/pywrapfst.pyx":1480
 *     if self._mapper.get().InputSymbols() == NULL:
 *       return
 *     return _init_EncodeMapperSymbolTableView(self._mapper, input_side=True)             # <<<<<<<<<<<<<<
 * 
 *   cpdef _EncodeMapperSymbolTableView output_symbols(self):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mapper");
    __PYX_ERR(0, 1480, __pyx_L1_error)
  }
  __pyx_t_1 = ((PyObject *)__pyx_f_6fstlib_4cext_9pywrapfst__init_EncodeMapperSymbolTableView(__pyx_v_self->_mapper, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1480, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst__EncodeMapperSymbolTableView *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":1472
 *       return _sstrm.str()
 * 
 *   cpdef _EncodeMapperSymbolTableView input_symbols(self):             # <<<<<<<<<<<<<<
 *     """
 *     input_symbols(self)
 */

  /* 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("fstlib.cext.pywrapfst.EncodeMapper.input_symbols", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_12EncodeMapper_25input_symbols(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_12EncodeMapper_24input_symbols[] = "\n    input_symbols(self)\n\n    Returns the mapper's input symbol table, or None if none is present.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_12EncodeMapper_25input_symbols(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("input_symbols (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_12EncodeMapper_24input_symbols(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_12EncodeMapper_24input_symbols(struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *__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("input_symbols", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_6fstlib_4cext_9pywrapfst_12EncodeMapper_input_symbols(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1472, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.EncodeMapper.input_symbols", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":1482
 *     return _init_EncodeMapperSymbolTableView(self._mapper, input_side=True)
 * 
 *   cpdef _EncodeMapperSymbolTableView output_symbols(self):             # <<<<<<<<<<<<<<
 *     """
 *     output_symbols(self)
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_12EncodeMapper_27output_symbols(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static struct __pyx_obj_6fstlib_4cext_9pywrapfst__EncodeMapperSymbolTableView *__pyx_f_6fstlib_4cext_9pywrapfst_12EncodeMapper_output_symbols(struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *__pyx_v_self, int __pyx_skip_dispatch) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst__EncodeMapperSymbolTableView *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("output_symbols", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_output_symbols); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1482, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6fstlib_4cext_9pywrapfst_12EncodeMapper_27output_symbols)) {
        __Pyx_XDECREF(((PyObject *)__pyx_r));
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1482, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_6fstlib_4cext_9pywrapfst__EncodeMapperSymbolTableView))))) __PYX_ERR(0, 1482, __pyx_L1_error)
        __pyx_r = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst__EncodeMapperSymbolTableView *)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "fstlib/cext/pywrapfst.pyx":1488
 *     Returns the mapper's output symbol table, or None if none is present.
 *     """
 *     if self._mapper.get().OutputSymbols() == NULL:             # <<<<<<<<<<<<<<
 *       return
 *     return _init_EncodeMapperSymbolTableView(self._mapper, input_side=False)
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mapper");
    __PYX_ERR(0, 1488, __pyx_L1_error)
  }
  __pyx_t_5 = ((__pyx_v_self->_mapper.get()->OutputSymbols() == NULL) != 0);
  if (__pyx_t_5) {

    /* "fstlib/cext/pywrapfst.pyx":1489
 *     """
 *     if self._mapper.get().OutputSymbols() == NULL:
 *       return             # <<<<<<<<<<<<<<
 *     return _init_EncodeMapperSymbolTableView(self._mapper, input_side=False)
 * 
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_r = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst__EncodeMapperSymbolTableView *)Py_None); __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "fstlib/cext/pywrapfst.pyx":1488
 *     Returns the mapper's output symbol table, or None if none is present.
 *     """
 *     if self._mapper.get().OutputSymbols() == NULL:             # <<<<<<<<<<<<<<
 *       return
 *     return _init_EncodeMapperSymbolTableView(self._mapper, input_side=False)
 */
  }

  /* "fstlib/cext/pywrapfst.pyx":1490
 *     if self._mapper.get().OutputSymbols() == NULL:
 *       return
 *     return _init_EncodeMapperSymbolTableView(self._mapper, input_side=False)             # <<<<<<<<<<<<<<
 * 
 *   cdef void _set_input_symbols(self, SymbolTableView symbols) except *:
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mapper");
    __PYX_ERR(0, 1490, __pyx_L1_error)
  }
  __pyx_t_1 = ((PyObject *)__pyx_f_6fstlib_4cext_9pywrapfst__init_EncodeMapperSymbolTableView(__pyx_v_self->_mapper, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1490, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst__EncodeMapperSymbolTableView *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":1482
 *     return _init_EncodeMapperSymbolTableView(self._mapper, input_side=True)
 * 
 *   cpdef _EncodeMapperSymbolTableView output_symbols(self):             # <<<<<<<<<<<<<<
 *     """
 *     output_symbols(self)
 */

  /* 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("fstlib.cext.pywrapfst.EncodeMapper.output_symbols", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_12EncodeMapper_27output_symbols(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_12EncodeMapper_26output_symbols[] = "\n    output_symbols(self)\n\n    Returns the mapper's output symbol table, or None if none is present.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_12EncodeMapper_27output_symbols(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("output_symbols (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_12EncodeMapper_26output_symbols(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_12EncodeMapper_26output_symbols(struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *__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("output_symbols", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_6fstlib_4cext_9pywrapfst_12EncodeMapper_output_symbols(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1482, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.EncodeMapper.output_symbols", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":1492
 *     return _init_EncodeMapperSymbolTableView(self._mapper, input_side=False)
 * 
 *   cdef void _set_input_symbols(self, SymbolTableView symbols) except *:             # <<<<<<<<<<<<<<
 *     if symbols is None:
 *       self._mapper.get().SetInputSymbols(NULL)
 */

static void __pyx_f_6fstlib_4cext_9pywrapfst_12EncodeMapper__set_input_symbols(struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *__pyx_v_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_symbols) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  fst::SymbolTable const *__pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_set_input_symbols", 0);

  /* "fstlib/cext/pywrapfst.pyx":1493
 * 
 *   cdef void _set_input_symbols(self, SymbolTableView symbols) except *:
 *     if symbols is None:             # <<<<<<<<<<<<<<
 *       self._mapper.get().SetInputSymbols(NULL)
 *       return
 */
  __pyx_t_1 = (((PyObject *)__pyx_v_symbols) == Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "fstlib/cext/pywrapfst.pyx":1494
 *   cdef void _set_input_symbols(self, SymbolTableView symbols) except *:
 *     if symbols is None:
 *       self._mapper.get().SetInputSymbols(NULL)             # <<<<<<<<<<<<<<
 *       return
 *     self._mapper.get().SetInputSymbols(symbols._raw_ptr_or_raise())
 */
    if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mapper");
      __PYX_ERR(0, 1494, __pyx_L1_error)
    }
    __pyx_v_self->_mapper.get()->SetInputSymbols(NULL);

    /* "fstlib/cext/pywrapfst.pyx":1495
 *     if symbols is None:
 *       self._mapper.get().SetInputSymbols(NULL)
 *       return             # <<<<<<<<<<<<<<
 *     self._mapper.get().SetInputSymbols(symbols._raw_ptr_or_raise())
 * 
 */
    goto __pyx_L0;

    /* "fstlib/cext/pywrapfst.pyx":1493
 * 
 *   cdef void _set_input_symbols(self, SymbolTableView symbols) except *:
 *     if symbols is None:             # <<<<<<<<<<<<<<
 *       self._mapper.get().SetInputSymbols(NULL)
 *       return
 */
  }

  /* "fstlib/cext/pywrapfst.pyx":1496
 *       self._mapper.get().SetInputSymbols(NULL)
 *       return
 *     self._mapper.get().SetInputSymbols(symbols._raw_ptr_or_raise())             # <<<<<<<<<<<<<<
 * 
 *   def set_input_symbols(self, SymbolTableView symbols):
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mapper");
    __PYX_ERR(0, 1496, __pyx_L1_error)
  }
  if (unlikely(((PyObject *)__pyx_v_symbols) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raw_ptr_or_raise");
    __PYX_ERR(0, 1496, __pyx_L1_error)
  }
  __pyx_t_3 = ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_SymbolTableView *)__pyx_v_symbols->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_symbols); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1496, __pyx_L1_error)
  __pyx_v_self->_mapper.get()->SetInputSymbols(__pyx_t_3);

  /* "fstlib/cext/pywrapfst.pyx":1492
 *     return _init_EncodeMapperSymbolTableView(self._mapper, input_side=False)
 * 
 *   cdef void _set_input_symbols(self, SymbolTableView symbols) except *:             # <<<<<<<<<<<<<<
 *     if symbols is None:
 *       self._mapper.get().SetInputSymbols(NULL)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.EncodeMapper._set_input_symbols", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "fstlib/cext/pywrapfst.pyx":1498
 *     self._mapper.get().SetInputSymbols(symbols._raw_ptr_or_raise())
 * 
 *   def set_input_symbols(self, SymbolTableView symbols):             # <<<<<<<<<<<<<<
 *     """
 *     set_input_symbols(self, symbols)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_12EncodeMapper_29set_input_symbols(PyObject *__pyx_v_self, PyObject *__pyx_v_symbols); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_12EncodeMapper_28set_input_symbols[] = "\n    set_input_symbols(self, symbols)\n\n    Sets the mapper's input symbol table.\n\n    Passing None as a value will delete the input symbol table.\n\n    Args:\n      symbols: A SymbolTable.\n\n    Returns:\n      self.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_12EncodeMapper_29set_input_symbols(PyObject *__pyx_v_self, PyObject *__pyx_v_symbols) {
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_input_symbols (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_symbols), __pyx_ptype_6fstlib_4cext_9pywrapfst_SymbolTableView, 1, "symbols", 0))) __PYX_ERR(0, 1498, __pyx_L1_error)
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_12EncodeMapper_28set_input_symbols(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *)__pyx_v_self), ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *)__pyx_v_symbols));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_12EncodeMapper_28set_input_symbols(struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *__pyx_v_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_symbols) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_input_symbols", 0);

  /* "fstlib/cext/pywrapfst.pyx":1512
 *       self.
 *     """
 *     self._set_input_symbols(symbols)             # <<<<<<<<<<<<<<
 *     return self
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_set_input_symbols");
    __PYX_ERR(0, 1512, __pyx_L1_error)
  }
  ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_EncodeMapper *)__pyx_v_self->__pyx_vtab)->_set_input_symbols(__pyx_v_self, __pyx_v_symbols); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1512, __pyx_L1_error)

  /* "fstlib/cext/pywrapfst.pyx":1513
 *     """
 *     self._set_input_symbols(symbols)
 *     return self             # <<<<<<<<<<<<<<
 * 
 *   cdef void _set_output_symbols(self, SymbolTableView symbols) except *:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":1498
 *     self._mapper.get().SetInputSymbols(symbols._raw_ptr_or_raise())
 * 
 *   def set_input_symbols(self, SymbolTableView symbols):             # <<<<<<<<<<<<<<
 *     """
 *     set_input_symbols(self, symbols)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.EncodeMapper.set_input_symbols", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":1515
 *     return self
 * 
 *   cdef void _set_output_symbols(self, SymbolTableView symbols) except *:             # <<<<<<<<<<<<<<
 *     if symbols is None:
 *       self._mapper.get().SetOutputSymbols(NULL)
 */

static void __pyx_f_6fstlib_4cext_9pywrapfst_12EncodeMapper__set_output_symbols(struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *__pyx_v_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_symbols) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  fst::SymbolTable const *__pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_set_output_symbols", 0);

  /* "fstlib/cext/pywrapfst.pyx":1516
 * 
 *   cdef void _set_output_symbols(self, SymbolTableView symbols) except *:
 *     if symbols is None:             # <<<<<<<<<<<<<<
 *       self._mapper.get().SetOutputSymbols(NULL)
 *       return
 */
  __pyx_t_1 = (((PyObject *)__pyx_v_symbols) == Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "fstlib/cext/pywrapfst.pyx":1517
 *   cdef void _set_output_symbols(self, SymbolTableView symbols) except *:
 *     if symbols is None:
 *       self._mapper.get().SetOutputSymbols(NULL)             # <<<<<<<<<<<<<<
 *       return
 *     self._mapper.get().SetOutputSymbols(symbols._raw_ptr_or_raise())
 */
    if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mapper");
      __PYX_ERR(0, 1517, __pyx_L1_error)
    }
    __pyx_v_self->_mapper.get()->SetOutputSymbols(NULL);

    /* "fstlib/cext/pywrapfst.pyx":1518
 *     if symbols is None:
 *       self._mapper.get().SetOutputSymbols(NULL)
 *       return             # <<<<<<<<<<<<<<
 *     self._mapper.get().SetOutputSymbols(symbols._raw_ptr_or_raise())
 * 
 */
    goto __pyx_L0;

    /* "fstlib/cext/pywrapfst.pyx":1516
 * 
 *   cdef void _set_output_symbols(self, SymbolTableView symbols) except *:
 *     if symbols is None:             # <<<<<<<<<<<<<<
 *       self._mapper.get().SetOutputSymbols(NULL)
 *       return
 */
  }

  /* "fstlib/cext/pywrapfst.pyx":1519
 *       self._mapper.get().SetOutputSymbols(NULL)
 *       return
 *     self._mapper.get().SetOutputSymbols(symbols._raw_ptr_or_raise())             # <<<<<<<<<<<<<<
 * 
 *   def set_output_symbols(self, SymbolTableView symbols):
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mapper");
    __PYX_ERR(0, 1519, __pyx_L1_error)
  }
  if (unlikely(((PyObject *)__pyx_v_symbols) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raw_ptr_or_raise");
    __PYX_ERR(0, 1519, __pyx_L1_error)
  }
  __pyx_t_3 = ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_SymbolTableView *)__pyx_v_symbols->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_symbols); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1519, __pyx_L1_error)
  __pyx_v_self->_mapper.get()->SetOutputSymbols(__pyx_t_3);

  /* "fstlib/cext/pywrapfst.pyx":1515
 *     return self
 * 
 *   cdef void _set_output_symbols(self, SymbolTableView symbols) except *:             # <<<<<<<<<<<<<<
 *     if symbols is None:
 *       self._mapper.get().SetOutputSymbols(NULL)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.EncodeMapper._set_output_symbols", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "fstlib/cext/pywrapfst.pyx":1521
 *     self._mapper.get().SetOutputSymbols(symbols._raw_ptr_or_raise())
 * 
 *   def set_output_symbols(self, SymbolTableView symbols):             # <<<<<<<<<<<<<<
 *     """
 *     set_output_symbols(self, symbols)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_12EncodeMapper_31set_output_symbols(PyObject *__pyx_v_self, PyObject *__pyx_v_symbols); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_12EncodeMapper_30set_output_symbols[] = "\n    set_output_symbols(self, symbols)\n\n    Sets the mapper's output symbol table.\n\n    Passing None as a value will delete the output symbol table.\n\n    Args:\n      symbols: A SymbolTable.\n\n    Returns:\n      self.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_12EncodeMapper_31set_output_symbols(PyObject *__pyx_v_self, PyObject *__pyx_v_symbols) {
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_output_symbols (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_symbols), __pyx_ptype_6fstlib_4cext_9pywrapfst_SymbolTableView, 1, "symbols", 0))) __PYX_ERR(0, 1521, __pyx_L1_error)
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_12EncodeMapper_30set_output_symbols(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *)__pyx_v_self), ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *)__pyx_v_symbols));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_12EncodeMapper_30set_output_symbols(struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *__pyx_v_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_symbols) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_output_symbols", 0);

  /* "fstlib/cext/pywrapfst.pyx":1535
 *       self.
 *     """
 *     self._set_output_symbols(symbols)             # <<<<<<<<<<<<<<
 *     return self
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_set_output_symbols");
    __PYX_ERR(0, 1535, __pyx_L1_error)
  }
  ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_EncodeMapper *)__pyx_v_self->__pyx_vtab)->_set_output_symbols(__pyx_v_self, __pyx_v_symbols); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1535, __pyx_L1_error)

  /* "fstlib/cext/pywrapfst.pyx":1536
 *     """
 *     self._set_output_symbols(symbols)
 *     return self             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":1521
 *     self._mapper.get().SetOutputSymbols(symbols._raw_ptr_or_raise())
 * 
 *   def set_output_symbols(self, SymbolTableView symbols):             # <<<<<<<<<<<<<<
 *     """
 *     set_output_symbols(self, symbols)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.EncodeMapper.set_output_symbols", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":1539
 * 
 * 
 * cdef EncodeMapper _init_EncodeMapper(EncodeMapperClass_ptr mapper):             # <<<<<<<<<<<<<<
 *   cdef EncodeMapper result = EncodeMapper.__new__(EncodeMapper)
 *   result._mapper.reset(mapper)
 */

static struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *__pyx_f_6fstlib_4cext_9pywrapfst__init_EncodeMapper(__pyx_t_6fstlib_4cext_9pywrapfst_EncodeMapperClass_ptr __pyx_v_mapper) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *__pyx_v_result = 0;
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *__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_EncodeMapper", 0);

  /* "fstlib/cext/pywrapfst.pyx":1540
 * 
 * cdef EncodeMapper _init_EncodeMapper(EncodeMapperClass_ptr mapper):
 *   cdef EncodeMapper result = EncodeMapper.__new__(EncodeMapper)             # <<<<<<<<<<<<<<
 *   result._mapper.reset(mapper)
 *   return result
 */
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_6fstlib_4cext_9pywrapfst_EncodeMapper(((PyTypeObject *)__pyx_ptype_6fstlib_4cext_9pywrapfst_EncodeMapper), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1540, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v_result = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "fstlib/cext/pywrapfst.pyx":1541
 * cdef EncodeMapper _init_EncodeMapper(EncodeMapperClass_ptr mapper):
 *   cdef EncodeMapper result = EncodeMapper.__new__(EncodeMapper)
 *   result._mapper.reset(mapper)             # <<<<<<<<<<<<<<
 *   return result
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_result) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mapper");
    __PYX_ERR(0, 1541, __pyx_L1_error)
  }
  __pyx_v_result->_mapper.reset(__pyx_v_mapper);

  /* "fstlib/cext/pywrapfst.pyx":1542
 *   cdef EncodeMapper result = EncodeMapper.__new__(EncodeMapper)
 *   result._mapper.reset(mapper)
 *   return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":1539
 * 
 * 
 * cdef EncodeMapper _init_EncodeMapper(EncodeMapperClass_ptr mapper):             # <<<<<<<<<<<<<<
 *   cdef EncodeMapper result = EncodeMapper.__new__(EncodeMapper)
 *   result._mapper.reset(mapper)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst._init_EncodeMapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":1545
 * 
 * 
 * cpdef EncodeMapper _read_EncodeMapper_from_string(string state):             # <<<<<<<<<<<<<<
 *   cdef stringstream _sstrm
 *   _sstrm << state
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_15_read_EncodeMapper_from_string(PyObject *__pyx_self, PyObject *__pyx_arg_state); /*proto*/
static struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *__pyx_f_6fstlib_4cext_9pywrapfst__read_EncodeMapper_from_string(std::string __pyx_v_state, CYTHON_UNUSED int __pyx_skip_dispatch) {
  std::stringstream __pyx_v__sstrm;
  std::unique_ptr<fst::script::EncodeMapperClass>  __pyx_v__mapper;
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_read_EncodeMapper_from_string", 0);

  /* "fstlib/cext/pywrapfst.pyx":1547
 * cpdef EncodeMapper _read_EncodeMapper_from_string(string state):
 *   cdef stringstream _sstrm
 *   _sstrm << state             # <<<<<<<<<<<<<<
 *   cdef unique_ptr[fst.EncodeMapperClass] _mapper
 *   _mapper.reset(fst.EncodeMapperClass.ReadStream(_sstrm, b"<pywrapfst>"))
 */
  (void)((__pyx_v__sstrm << __pyx_v_state));

  /* "fstlib/cext/pywrapfst.pyx":1549
 *   _sstrm << state
 *   cdef unique_ptr[fst.EncodeMapperClass] _mapper
 *   _mapper.reset(fst.EncodeMapperClass.ReadStream(_sstrm, b"<pywrapfst>"))             # <<<<<<<<<<<<<<
 *   if _mapper.get() == NULL:
 *     raise FstIOError("Read from string failed")
 */
  __pyx_v__mapper.reset(fst::script::EncodeMapperClass::Read(__pyx_v__sstrm, __pyx_k_pywrapfst));

  /* "fstlib/cext/pywrapfst.pyx":1550
 *   cdef unique_ptr[fst.EncodeMapperClass] _mapper
 *   _mapper.reset(fst.EncodeMapperClass.ReadStream(_sstrm, b"<pywrapfst>"))
 *   if _mapper.get() == NULL:             # <<<<<<<<<<<<<<
 *     raise FstIOError("Read from string failed")
 *   return _init_EncodeMapper(_mapper.release())
 */
  __pyx_t_1 = ((__pyx_v__mapper.get() == NULL) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "fstlib/cext/pywrapfst.pyx":1551
 *   _mapper.reset(fst.EncodeMapperClass.ReadStream(_sstrm, b"<pywrapfst>"))
 *   if _mapper.get() == NULL:
 *     raise FstIOError("Read from string failed")             # <<<<<<<<<<<<<<
 *   return _init_EncodeMapper(_mapper.release())
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstIOError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1551, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_kp_u_Read_from_string_failed) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_u_Read_from_string_failed);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1551, __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(0, 1551, __pyx_L1_error)

    /* "fstlib/cext/pywrapfst.pyx":1550
 *   cdef unique_ptr[fst.EncodeMapperClass] _mapper
 *   _mapper.reset(fst.EncodeMapperClass.ReadStream(_sstrm, b"<pywrapfst>"))
 *   if _mapper.get() == NULL:             # <<<<<<<<<<<<<<
 *     raise FstIOError("Read from string failed")
 *   return _init_EncodeMapper(_mapper.release())
 */
  }

  /* "fstlib/cext/pywrapfst.pyx":1552
 *   if _mapper.get() == NULL:
 *     raise FstIOError("Read from string failed")
 *   return _init_EncodeMapper(_mapper.release())             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_2 = ((PyObject *)__pyx_f_6fstlib_4cext_9pywrapfst__init_EncodeMapper(__pyx_v__mapper.release())); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1552, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":1545
 * 
 * 
 * cpdef EncodeMapper _read_EncodeMapper_from_string(string state):             # <<<<<<<<<<<<<<
 *   cdef stringstream _sstrm
 *   _sstrm << state
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst._read_EncodeMapper_from_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_15_read_EncodeMapper_from_string(PyObject *__pyx_self, PyObject *__pyx_arg_state); /*proto*/
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_15_read_EncodeMapper_from_string(PyObject *__pyx_self, PyObject *__pyx_arg_state) {
  std::string __pyx_v_state;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_read_EncodeMapper_from_string (wrapper)", 0);
  assert(__pyx_arg_state); {
    __pyx_v_state = __pyx_convert_string_from_py_std__in_string(__pyx_arg_state); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1545, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst._read_EncodeMapper_from_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_14_read_EncodeMapper_from_string(__pyx_self, ((std::string)__pyx_v_state));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_14_read_EncodeMapper_from_string(CYTHON_UNUSED PyObject *__pyx_self, std::string __pyx_v_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("_read_EncodeMapper_from_string", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_6fstlib_4cext_9pywrapfst__read_EncodeMapper_from_string(__pyx_v_state, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1545, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst._read_EncodeMapper_from_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":1578
 * 
 *   @staticmethod
 *   cdef string _local_render_svg(const string &dot):             # <<<<<<<<<<<<<<
 *     proc = subprocess.Popen(("dot", "-Tsvg"),
 *                             stdin=subprocess.PIPE,
 */

static std::string __pyx_f_6fstlib_4cext_9pywrapfst_3Fst__local_render_svg(std::string const &__pyx_v_dot) {
  PyObject *__pyx_v_proc = NULL;
  std::string __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  std::string __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_local_render_svg", 0);

  /* "fstlib/cext/pywrapfst.pyx":1579
 *   @staticmethod
 *   cdef string _local_render_svg(const string &dot):
 *     proc = subprocess.Popen(("dot", "-Tsvg"),             # <<<<<<<<<<<<<<
 *                             stdin=subprocess.PIPE,
 *                             stdout=subprocess.PIPE)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_subprocess); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1579, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_Popen); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1579, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "fstlib/cext/pywrapfst.pyx":1580
 *   cdef string _local_render_svg(const string &dot):
 *     proc = subprocess.Popen(("dot", "-Tsvg"),
 *                             stdin=subprocess.PIPE,             # <<<<<<<<<<<<<<
 *                             stdout=subprocess.PIPE)
 *     return proc.communicate(dot.encode("utf8"))[0]
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1580, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_subprocess); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1580, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_PIPE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1580, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_stdin, __pyx_t_4) < 0) __PYX_ERR(0, 1580, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "fstlib/cext/pywrapfst.pyx":1581
 *     proc = subprocess.Popen(("dot", "-Tsvg"),
 *                             stdin=subprocess.PIPE,
 *                             stdout=subprocess.PIPE)             # <<<<<<<<<<<<<<
 *     return proc.communicate(dot.encode("utf8"))[0]
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_subprocess); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1581, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_PIPE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1581, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_stdout, __pyx_t_3) < 0) __PYX_ERR(0, 1580, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "fstlib/cext/pywrapfst.pyx":1579
 *   @staticmethod
 *   cdef string _local_render_svg(const string &dot):
 *     proc = subprocess.Popen(("dot", "-Tsvg"),             # <<<<<<<<<<<<<<
 *                             stdin=subprocess.PIPE,
 *                             stdout=subprocess.PIPE)
 */
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__10, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1579, __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_proc = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "fstlib/cext/pywrapfst.pyx":1582
 *                             stdin=subprocess.PIPE,
 *                             stdout=subprocess.PIPE)
 *     return proc.communicate(dot.encode("utf8"))[0]             # <<<<<<<<<<<<<<
 * 
 *   def _repr_svg_(self):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_proc, __pyx_n_s_communicate); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1582, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_v_dot); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1582, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyUnicode_AsUTF8String(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1582, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_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_3 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1582, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(__pyx_t_3 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(0, 1582, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1582, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1582, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_5;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":1578
 * 
 *   @staticmethod
 *   cdef string _local_render_svg(const string &dot):             # <<<<<<<<<<<<<<
 *     proc = subprocess.Popen(("dot", "-Tsvg"),
 *                             stdin=subprocess.PIPE,
 */

  /* 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_WriteUnraisable("fstlib.cext.pywrapfst.Fst._local_render_svg", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_proc);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":1584
 *     return proc.communicate(dot.encode("utf8"))[0]
 * 
 *   def _repr_svg_(self):             # <<<<<<<<<<<<<<
 *     """IPython notebook magic to produce an SVG of the FST using GraphViz.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_1_repr_svg_(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_3Fst__repr_svg_[] = "IPython notebook magic to produce an SVG of the FST using GraphViz.\n\n    This method produces an SVG of the internal graph. Users wishing to create\n    publication-quality graphs should instead use the method `draw`, which\n    exposes additional parameters.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_1_repr_svg_(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_repr_svg_ (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_3Fst__repr_svg_(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_3Fst__repr_svg_(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_self) {
  std::stringstream __pyx_v__sstrm;
  bool __pyx_v_acceptor;
  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;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  char const *__pyx_t_13;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_repr_svg_", 0);

  /* "fstlib/cext/pywrapfst.pyx":1592
 *     """
 *     cdef stringstream _sstrm
 *     cdef bool acceptor = (self._fst.get().Properties(fst.kAcceptor, True) ==             # <<<<<<<<<<<<<<
 *                           fst.kAcceptor)
 *     fst.Draw(deref(self._fst),
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 1592, __pyx_L1_error)
  }

  /* "fstlib/cext/pywrapfst.pyx":1593
 *     cdef stringstream _sstrm
 *     cdef bool acceptor = (self._fst.get().Properties(fst.kAcceptor, True) ==
 *                           fst.kAcceptor)             # <<<<<<<<<<<<<<
 *     fst.Draw(deref(self._fst),
 *              self._fst.get().InputSymbols(),
 */
  __pyx_v_acceptor = (__pyx_v_self->_fst.get()->Properties(fst::kAcceptor, 1) == fst::kAcceptor);

  /* "fstlib/cext/pywrapfst.pyx":1594
 *     cdef bool acceptor = (self._fst.get().Properties(fst.kAcceptor, True) ==
 *                           fst.kAcceptor)
 *     fst.Draw(deref(self._fst),             # <<<<<<<<<<<<<<
 *              self._fst.get().InputSymbols(),
 *              self._fst.get().OutputSymbols(),
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 1594, __pyx_L1_error)
  }

  /* "fstlib/cext/pywrapfst.pyx":1595
 *                           fst.kAcceptor)
 *     fst.Draw(deref(self._fst),
 *              self._fst.get().InputSymbols(),             # <<<<<<<<<<<<<<
 *              self._fst.get().OutputSymbols(),
 *              NULL,
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 1595, __pyx_L1_error)
  }

  /* "fstlib/cext/pywrapfst.pyx":1596
 *     fst.Draw(deref(self._fst),
 *              self._fst.get().InputSymbols(),
 *              self._fst.get().OutputSymbols(),             # <<<<<<<<<<<<<<
 *              NULL,
 *              acceptor,
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 1596, __pyx_L1_error)
  }

  /* "fstlib/cext/pywrapfst.pyx":1594
 *     cdef bool acceptor = (self._fst.get().Properties(fst.kAcceptor, True) ==
 *                           fst.kAcceptor)
 *     fst.Draw(deref(self._fst),             # <<<<<<<<<<<<<<
 *              self._fst.get().InputSymbols(),
 *              self._fst.get().OutputSymbols(),
 */
  fst::script::Draw((*__pyx_v_self->_fst), __pyx_v_self->_fst.get()->InputSymbols(), __pyx_v_self->_fst.get()->OutputSymbols(), NULL, __pyx_v_acceptor, __pyx_k__11, 8.5, 11.0, 1, 0, 0.4, 0.25, 14, 5, __pyx_k_g, 0, __pyx_v__sstrm, __pyx_k_pywrapfst);

  /* "fstlib/cext/pywrapfst.pyx":1612
 *              _sstrm,
 *              b"<pywrapfst>")
 *     try:             # <<<<<<<<<<<<<<
 *       return Fst._local_render_svg(_sstrm.str())
 *     except Exception as e:
 */
  {
    __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:*/ {

      /* "fstlib/cext/pywrapfst.pyx":1613
 *              b"<pywrapfst>")
 *     try:
 *       return Fst._local_render_svg(_sstrm.str())             # <<<<<<<<<<<<<<
 *     except Exception as e:
 *       logging.error("Dot rendering failed: %s", e)
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_4 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_f_6fstlib_4cext_9pywrapfst_3Fst__local_render_svg(__pyx_v__sstrm.str())); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1613, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_r = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L7_try_return;

      /* "fstlib/cext/pywrapfst.pyx":1612
 *              _sstrm,
 *              b"<pywrapfst>")
 *     try:             # <<<<<<<<<<<<<<
 *       return Fst._local_render_svg(_sstrm.str())
 *     except Exception as e:
 */
    }
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "fstlib/cext/pywrapfst.pyx":1614
 *     try:
 *       return Fst._local_render_svg(_sstrm.str())
 *     except Exception as e:             # <<<<<<<<<<<<<<
 *       logging.error("Dot rendering failed: %s", e)
 * 
 */
    __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_5) {
      __Pyx_AddTraceback("fstlib.cext.pywrapfst.Fst._repr_svg_", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 1614, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_e = __pyx_t_6;
      /*try:*/ {

        /* "fstlib/cext/pywrapfst.pyx":1615
 *       return Fst._local_render_svg(_sstrm.str())
 *     except Exception as e:
 *       logging.error("Dot rendering failed: %s", e)             # <<<<<<<<<<<<<<
 * 
 *   def __init__(self):
 */
        __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_logging); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1615, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_error); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1615, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = NULL;
        __pyx_t_5 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
          __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_10);
          if (likely(__pyx_t_9)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
            __Pyx_INCREF(__pyx_t_9);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_10, function);
            __pyx_t_5 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_10)) {
          PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_kp_u_Dot_rendering_failed_s, __pyx_v_e};
          __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1615, __pyx_L14_error)
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_GOTREF(__pyx_t_8);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) {
          PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_kp_u_Dot_rendering_failed_s, __pyx_v_e};
          __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1615, __pyx_L14_error)
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_GOTREF(__pyx_t_8);
        } else
        #endif
        {
          __pyx_t_11 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1615, __pyx_L14_error)
          __Pyx_GOTREF(__pyx_t_11);
          if (__pyx_t_9) {
            __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); __pyx_t_9 = NULL;
          }
          __Pyx_INCREF(__pyx_kp_u_Dot_rendering_failed_s);
          __Pyx_GIVEREF(__pyx_kp_u_Dot_rendering_failed_s);
          PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_5, __pyx_kp_u_Dot_rendering_failed_s);
          __Pyx_INCREF(__pyx_v_e);
          __Pyx_GIVEREF(__pyx_v_e);
          PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_5, __pyx_v_e);
          __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_11, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1615, __pyx_L14_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        }
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }

      /* "fstlib/cext/pywrapfst.pyx":1614
 *     try:
 *       return Fst._local_render_svg(_sstrm.str())
 *     except Exception as e:             # <<<<<<<<<<<<<<
 *       logging.error("Dot rendering failed: %s", e)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_e);
          __pyx_v_e = NULL;
          goto __pyx_L15;
        }
        __pyx_L14_error:;
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16) < 0)) __Pyx_ErrFetch(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_14);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __pyx_t_5 = __pyx_lineno; __pyx_t_12 = __pyx_clineno; __pyx_t_13 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_e);
            __pyx_v_e = NULL;
          }
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_17);
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_ExceptionReset(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          }
          __Pyx_XGIVEREF(__pyx_t_14);
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_ErrRestore(__pyx_t_14, __pyx_t_15, __pyx_t_16);
          __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0;
          __pyx_lineno = __pyx_t_5; __pyx_clineno = __pyx_t_12; __pyx_filename = __pyx_t_13;
          goto __pyx_L5_except_error;
        }
        __pyx_L15:;
      }
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "fstlib/cext/pywrapfst.pyx":1612
 *              _sstrm,
 *              b"<pywrapfst>")
 *     try:             # <<<<<<<<<<<<<<
 *       return Fst._local_render_svg(_sstrm.str())
 *     except Exception as e:
 */
    __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_L4_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  }

  /* "fstlib/cext/pywrapfst.pyx":1584
 *     return proc.communicate(dot.encode("utf8"))[0]
 * 
 *   def _repr_svg_(self):             # <<<<<<<<<<<<<<
 *     """IPython notebook magic to produce an SVG of the FST using GraphViz.
 * 
 */

  /* 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_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.Fst._repr_svg_", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_e);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":1617
 *       logging.error("Dot rendering failed: %s", e)
 * 
 *   def __init__(self):             # <<<<<<<<<<<<<<
 *     raise NotImplementedError(f"Cannot construct {self._class__.__name__}")
 * 
 */

/* Python wrapper */
static int __pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_3Fst_2__init__(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *)__pyx_v_self));

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

static int __pyx_pf_6fstlib_4cext_9pywrapfst_3Fst_2__init__(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_self) {
  int __pyx_r;
  __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("__init__", 0);

  /* "fstlib/cext/pywrapfst.pyx":1618
 * 
 *   def __init__(self):
 *     raise NotImplementedError(f"Cannot construct {self._class__.__name__}")             # <<<<<<<<<<<<<<
 * 
 *   # Registers the class for pickling; must be repeated in any subclass which
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1618, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1618, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_t_2, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1618, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Cannot_construct, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1618, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_NotImplementedError, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1618, __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(0, 1618, __pyx_L1_error)

  /* "fstlib/cext/pywrapfst.pyx":1617
 *       logging.error("Dot rendering failed: %s", e)
 * 
 *   def __init__(self):             # <<<<<<<<<<<<<<
 *     raise NotImplementedError(f"Cannot construct {self._class__.__name__}")
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.Fst.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":1623
 *   # can't be derived by _init_XFst.
 * 
 *   def __reduce__(self):             # <<<<<<<<<<<<<<
 *     return (_read_Fst_from_string, (self.write_to_string(),))
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_5__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_5__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_3Fst_4__reduce__(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_3Fst_4__reduce__(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__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("__reduce__", 0);

  /* "fstlib/cext/pywrapfst.pyx":1624
 * 
 *   def __reduce__(self):
 *     return (_read_Fst_from_string, (self.write_to_string(),))             # <<<<<<<<<<<<<<
 * 
 *   def __repr__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_read_Fst_from_string); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1624, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "write_to_string");
    __PYX_ERR(0, 1624, __pyx_L1_error)
  }
  __pyx_t_2 = ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_Fst *)__pyx_v_self->__pyx_vtab)->write_to_string(__pyx_v_self, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1624, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1624, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1624, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
  __pyx_t_1 = 0;
  __pyx_t_3 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":1623
 *   # can't be derived by _init_XFst.
 * 
 *   def __reduce__(self):             # <<<<<<<<<<<<<<
 *     return (_read_Fst_from_string, (self.write_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("fstlib.cext.pywrapfst.Fst.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":1626
 *     return (_read_Fst_from_string, (self.write_to_string(),))
 * 
 *   def __repr__(self):             # <<<<<<<<<<<<<<
 *     return f"<{self.fst_type()} Fst at 0x{id(self):x}>"
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_7__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_7__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_3Fst_6__repr__(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_3Fst_6__repr__(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  Py_UCS4 __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "fstlib/cext/pywrapfst.pyx":1627
 * 
 *   def __repr__(self):
 *     return f"<{self.fst_type()} Fst at 0x{id(self):x}>"             # <<<<<<<<<<<<<<
 * 
 *   def __str__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1627, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = 0;
  __pyx_t_3 = 127;
  __Pyx_INCREF(__pyx_kp_u__2);
  __pyx_t_2 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__2);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u__2);
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "fst_type");
    __PYX_ERR(0, 1627, __pyx_L1_error)
  }
  __pyx_t_4 = __pyx_convert_PyUnicode_string_to_py_std__in_string(((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_Fst *)__pyx_v_self->__pyx_vtab)->fst_type(__pyx_v_self, 0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1627, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4);
  __pyx_t_4 = 0;
  __Pyx_INCREF(__pyx_kp_u_Fst_at_0x);
  __pyx_t_2 += 10;
  __Pyx_GIVEREF(__pyx_kp_u_Fst_at_0x);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_Fst_at_0x);
  __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1627, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_Format(__pyx_t_4, __pyx_n_u_x); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1627, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_5);
  __pyx_t_5 = 0;
  __Pyx_INCREF(__pyx_kp_u__3);
  __pyx_t_2 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__3);
  PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u__3);
  __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_1, 5, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1627, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":1626
 *     return (_read_Fst_from_string, (self.write_to_string(),))
 * 
 *   def __repr__(self):             # <<<<<<<<<<<<<<
 *     return f"<{self.fst_type()} Fst at 0x{id(self):x}>"
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.Fst.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":1629
 *     return f"<{self.fst_type()} Fst at 0x{id(self):x}>"
 * 
 *   def __str__(self):             # <<<<<<<<<<<<<<
 *     return self.print()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_9__str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_9__str__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_3Fst_8__str__(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_3Fst_8__str__(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__str__", 0);

  /* "fstlib/cext/pywrapfst.pyx":1630
 * 
 *   def __str__(self):
 *     return self.print()             # <<<<<<<<<<<<<<
 * 
 *   cpdef string arc_type(self):
 */
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "print");
    __PYX_ERR(0, 1630, __pyx_L1_error)
  }
  __pyx_t_1 = ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_Fst *)__pyx_v_self->__pyx_vtab)->print(__pyx_v_self, 0, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1630, __pyx_L1_error)
  __pyx_t_2 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1630, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":1629
 *     return f"<{self.fst_type()} Fst at 0x{id(self):x}>"
 * 
 *   def __str__(self):             # <<<<<<<<<<<<<<
 *     return self.print()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.Fst.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":1632
 *     return self.print()
 * 
 *   cpdef string arc_type(self):             # <<<<<<<<<<<<<<
 *     """
 *     arc_type(self)
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_11arc_type(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static std::string __pyx_f_6fstlib_4cext_9pywrapfst_3Fst_arc_type(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_self, int __pyx_skip_dispatch) {
  std::string __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  std::string __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("arc_type", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_arc_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1632, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_11arc_type)) {
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1632, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1632, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_5;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "fstlib/cext/pywrapfst.pyx":1638
 *     Returns a string indicating the arc type.
 *     """
 *     return self._fst.get().ArcType()             # <<<<<<<<<<<<<<
 * 
 *   cpdef _ArcIterator arcs(self, int64 state):
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 1638, __pyx_L1_error)
  }
  __pyx_r = __pyx_v_self->_fst.get()->ArcType();
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":1632
 *     return self.print()
 * 
 *   cpdef string arc_type(self):             # <<<<<<<<<<<<<<
 *     """
 *     arc_type(self)
 */

  /* 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_WriteUnraisable("fstlib.cext.pywrapfst.Fst.arc_type", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_11arc_type(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_3Fst_10arc_type[] = "\n    arc_type(self)\n\n    Returns a string indicating the arc type.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_11arc_type(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("arc_type (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_3Fst_10arc_type(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_3Fst_10arc_type(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__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("arc_type", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_f_6fstlib_4cext_9pywrapfst_3Fst_arc_type(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1632, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.Fst.arc_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":1640
 *     return self._fst.get().ArcType()
 * 
 *   cpdef _ArcIterator arcs(self, int64 state):             # <<<<<<<<<<<<<<
 *     """
 *     arcs(self, state)
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_13arcs(PyObject *__pyx_v_self, PyObject *__pyx_arg_state); /*proto*/
static struct __pyx_obj_6fstlib_4cext_9pywrapfst__ArcIterator *__pyx_f_6fstlib_4cext_9pywrapfst_3Fst_arcs(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_self, int64 __pyx_v_state, int __pyx_skip_dispatch) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst__ArcIterator *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("arcs", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_arcs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1640, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_13arcs)) {
        __Pyx_XDECREF(((PyObject *)__pyx_r));
        __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_v_state); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1640, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
          if (likely(__pyx_t_5)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
            __Pyx_INCREF(__pyx_t_5);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_4, function);
          }
        }
        __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1640, __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_6fstlib_4cext_9pywrapfst__ArcIterator))))) __PYX_ERR(0, 1640, __pyx_L1_error)
        __pyx_r = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst__ArcIterator *)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "fstlib/cext/pywrapfst.pyx":1652
 *       An _ArcIterator.
 *     """
 *     return _ArcIterator(self, state)             # <<<<<<<<<<<<<<
 * 
 *   cpdef Fst copy(self):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_state); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1652, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1652, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6fstlib_4cext_9pywrapfst__ArcIterator), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1652, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst__ArcIterator *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":1640
 *     return self._fst.get().ArcType()
 * 
 *   cpdef _ArcIterator arcs(self, int64 state):             # <<<<<<<<<<<<<<
 *     """
 *     arcs(self, state)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.Fst.arcs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_13arcs(PyObject *__pyx_v_self, PyObject *__pyx_arg_state); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_3Fst_12arcs[] = "\n    arcs(self, state)\n\n    Returns an iterator over arcs leaving the specified state.\n\n    Args:\n      state: The source state ID.\n\n    Returns:\n      An _ArcIterator.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_13arcs(PyObject *__pyx_v_self, PyObject *__pyx_arg_state) {
  int64 __pyx_v_state;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("arcs (wrapper)", 0);
  assert(__pyx_arg_state); {
    __pyx_v_state = __Pyx_PyInt_As_int64_t(__pyx_arg_state); if (unlikely((__pyx_v_state == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1640, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.Fst.arcs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_3Fst_12arcs(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *)__pyx_v_self), ((int64)__pyx_v_state));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_3Fst_12arcs(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_self, int64 __pyx_v_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("arcs", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_6fstlib_4cext_9pywrapfst_3Fst_arcs(__pyx_v_self, __pyx_v_state, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1640, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.Fst.arcs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":1654
 *     return _ArcIterator(self, state)
 * 
 *   cpdef Fst copy(self):             # <<<<<<<<<<<<<<
 *     """
 *     copy(self)
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_15copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_f_6fstlib_4cext_9pywrapfst_3Fst_copy(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_self, int __pyx_skip_dispatch) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__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("copy", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_copy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1654, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_15copy)) {
        __Pyx_XDECREF(((PyObject *)__pyx_r));
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1654, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_6fstlib_4cext_9pywrapfst_Fst))))) __PYX_ERR(0, 1654, __pyx_L1_error)
        __pyx_r = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "fstlib/cext/pywrapfst.pyx":1660
 *     Makes a copy of the FST.
 *     """
 *     return _init_XFst(new fst.FstClass(deref(self._fst)))             # <<<<<<<<<<<<<<
 * 
 *   cpdef void draw(self,
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 1660, __pyx_L1_error)
  }
  __pyx_t_1 = ((PyObject *)__pyx_f_6fstlib_4cext_9pywrapfst__init_XFst(new fst::script::FstClass((*__pyx_v_self->_fst)))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1660, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":1654
 *     return _ArcIterator(self, state)
 * 
 *   cpdef Fst copy(self):             # <<<<<<<<<<<<<<
 *     """
 *     copy(self)
 */

  /* 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("fstlib.cext.pywrapfst.Fst.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_15copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_3Fst_14copy[] = "\n    copy(self)\n\n    Makes a copy of the FST.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_15copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("copy (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_3Fst_14copy(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_3Fst_14copy(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__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("copy", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_6fstlib_4cext_9pywrapfst_3Fst_copy(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1654, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.Fst.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":1662
 *     return _init_XFst(new fst.FstClass(deref(self._fst)))
 * 
 *   cpdef void draw(self,             # <<<<<<<<<<<<<<
 *                   source,
 *                   SymbolTableView isymbols=None,
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_17draw(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static void __pyx_f_6fstlib_4cext_9pywrapfst_3Fst_draw(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_self, PyObject *__pyx_v_source, int __pyx_skip_dispatch, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_3Fst_draw *__pyx_optional_args) {

  /* "fstlib/cext/pywrapfst.pyx":1664
 *   cpdef void draw(self,
 *                   source,
 *                   SymbolTableView isymbols=None,             # <<<<<<<<<<<<<<
 *                   SymbolTableView osymbols=None,
 *                   SymbolTableView ssymbols=None,
 */
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_isymbols = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *)Py_None);

  /* "fstlib/cext/pywrapfst.pyx":1665
 *                   source,
 *                   SymbolTableView isymbols=None,
 *                   SymbolTableView osymbols=None,             # <<<<<<<<<<<<<<
 *                   SymbolTableView ssymbols=None,
 *                   bool acceptor=False,
 */
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_osymbols = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *)Py_None);

  /* "fstlib/cext/pywrapfst.pyx":1666
 *                   SymbolTableView isymbols=None,
 *                   SymbolTableView osymbols=None,
 *                   SymbolTableView ssymbols=None,             # <<<<<<<<<<<<<<
 *                   bool acceptor=False,
 *                   title="",
 */
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_ssymbols = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *)Py_None);

  /* "fstlib/cext/pywrapfst.pyx":1667
 *                   SymbolTableView osymbols=None,
 *                   SymbolTableView ssymbols=None,
 *                   bool acceptor=False,             # <<<<<<<<<<<<<<
 *                   title="",
 *                   double width=8.5,
 */
  bool __pyx_v_acceptor = ((bool)0);
  PyObject *__pyx_v_title = ((PyObject *)__pyx_kp_u__11);
  double __pyx_v_width = ((double)8.5);
  double __pyx_v_height = ((double)11.0);

  /* "fstlib/cext/pywrapfst.pyx":1671
 *                   double width=8.5,
 *                   double height=11,
 *                   bool portrait=False,             # <<<<<<<<<<<<<<
 *                   bool vertical=False,
 *                   double ranksep=0.4,
 */
  bool __pyx_v_portrait = ((bool)0);

  /* "fstlib/cext/pywrapfst.pyx":1672
 *                   double height=11,
 *                   bool portrait=False,
 *                   bool vertical=False,             # <<<<<<<<<<<<<<
 *                   double ranksep=0.4,
 *                   double nodesep=0.25,
 */
  bool __pyx_v_vertical = ((bool)0);
  double __pyx_v_ranksep = ((double)0.4);
  double __pyx_v_nodesep = ((double)0.25);
  int32 __pyx_v_fontsize = ((int32)14);
  int32 __pyx_v_precision = ((int32)5);
  PyObject *__pyx_v_float_format = ((PyObject *)__pyx_n_u_g);

  /* "fstlib/cext/pywrapfst.pyx":1678
 *                   int32 precision=5,
 *                   float_format="g",
 *                   bool show_weight_one=False) except *:             # <<<<<<<<<<<<<<
 *     """
 *     draw(self, source, isymbols=None, osymbols=None, ssymbols=None,
 */
  bool __pyx_v_show_weight_one = ((bool)0);
  std::string __pyx_v__source;
  std::unique_ptr<std::ostream>  __pyx_v__fstrm;
  fst::SymbolTable const *__pyx_v__isymbols;
  fst::SymbolTable const *__pyx_v__osymbols;
  fst::SymbolTable const *__pyx_v__ssymbols;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  int __pyx_t_15;
  PyObject *__pyx_t_16 = NULL;
  std::string __pyx_t_17;
  int __pyx_t_18;
  int __pyx_t_19;
  fst::SymbolTable const *__pyx_t_20;
  std::string __pyx_t_21;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("draw", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_isymbols = __pyx_optional_args->isymbols;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_osymbols = __pyx_optional_args->osymbols;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_ssymbols = __pyx_optional_args->ssymbols;
          if (__pyx_optional_args->__pyx_n > 3) {
            __pyx_v_acceptor = __pyx_optional_args->acceptor;
            if (__pyx_optional_args->__pyx_n > 4) {
              __pyx_v_title = __pyx_optional_args->title;
              if (__pyx_optional_args->__pyx_n > 5) {
                __pyx_v_width = __pyx_optional_args->width;
                if (__pyx_optional_args->__pyx_n > 6) {
                  __pyx_v_height = __pyx_optional_args->height;
                  if (__pyx_optional_args->__pyx_n > 7) {
                    __pyx_v_portrait = __pyx_optional_args->portrait;
                    if (__pyx_optional_args->__pyx_n > 8) {
                      __pyx_v_vertical = __pyx_optional_args->vertical;
                      if (__pyx_optional_args->__pyx_n > 9) {
                        __pyx_v_ranksep = __pyx_optional_args->ranksep;
                        if (__pyx_optional_args->__pyx_n > 10) {
                          __pyx_v_nodesep = __pyx_optional_args->nodesep;
                          if (__pyx_optional_args->__pyx_n > 11) {
                            __pyx_v_fontsize = __pyx_optional_args->fontsize;
                            if (__pyx_optional_args->__pyx_n > 12) {
                              __pyx_v_precision = __pyx_optional_args->precision;
                              if (__pyx_optional_args->__pyx_n > 13) {
                                __pyx_v_float_format = __pyx_optional_args->float_format;
                                if (__pyx_optional_args->__pyx_n > 14) {
                                  __pyx_v_show_weight_one = __pyx_optional_args->show_weight_one;
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }

  /* "fstlib/cext/pywrapfst.pyx":1662
 *     return _init_XFst(new fst.FstClass(deref(self._fst)))
 * 
 *   cpdef void draw(self,             # <<<<<<<<<<<<<<
 *                   source,
 *                   SymbolTableView isymbols=None,
 */
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_draw); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1662, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_17draw)) {
        __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_acceptor); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1662, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = PyFloat_FromDouble(__pyx_v_width); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1662, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = PyFloat_FromDouble(__pyx_v_height); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1662, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_v_portrait); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1662, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_vertical); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1662, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_8 = PyFloat_FromDouble(__pyx_v_ranksep); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1662, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_9 = PyFloat_FromDouble(__pyx_v_nodesep); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1662, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_10 = __Pyx_PyInt_From_int32_t(__pyx_v_fontsize); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1662, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_11 = __Pyx_PyInt_From_int32_t(__pyx_v_precision); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1662, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_v_show_weight_one); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1662, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_13 = __pyx_t_1; __pyx_t_14 = NULL;
        __pyx_t_15 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_13))) {
          __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_13);
          if (likely(__pyx_t_14)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
            __Pyx_INCREF(__pyx_t_14);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_13, function);
            __pyx_t_15 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_13)) {
          PyObject *__pyx_temp[17] = {__pyx_t_14, __pyx_v_source, ((PyObject *)__pyx_v_isymbols), ((PyObject *)__pyx_v_osymbols), ((PyObject *)__pyx_v_ssymbols), __pyx_t_3, __pyx_v_title, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_10, __pyx_t_11, __pyx_v_float_format, __pyx_t_12};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_15, 16+__pyx_t_15); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1662, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_13)) {
          PyObject *__pyx_temp[17] = {__pyx_t_14, __pyx_v_source, ((PyObject *)__pyx_v_isymbols), ((PyObject *)__pyx_v_osymbols), ((PyObject *)__pyx_v_ssymbols), __pyx_t_3, __pyx_v_title, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_10, __pyx_t_11, __pyx_v_float_format, __pyx_t_12};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_15, 16+__pyx_t_15); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1662, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        {
          __pyx_t_16 = PyTuple_New(16+__pyx_t_15); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1662, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_16);
          if (__pyx_t_14) {
            __Pyx_GIVEREF(__pyx_t_14); PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_14); __pyx_t_14 = NULL;
          }
          __Pyx_INCREF(__pyx_v_source);
          __Pyx_GIVEREF(__pyx_v_source);
          PyTuple_SET_ITEM(__pyx_t_16, 0+__pyx_t_15, __pyx_v_source);
          __Pyx_INCREF(((PyObject *)__pyx_v_isymbols));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_isymbols));
          PyTuple_SET_ITEM(__pyx_t_16, 1+__pyx_t_15, ((PyObject *)__pyx_v_isymbols));
          __Pyx_INCREF(((PyObject *)__pyx_v_osymbols));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_osymbols));
          PyTuple_SET_ITEM(__pyx_t_16, 2+__pyx_t_15, ((PyObject *)__pyx_v_osymbols));
          __Pyx_INCREF(((PyObject *)__pyx_v_ssymbols));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_ssymbols));
          PyTuple_SET_ITEM(__pyx_t_16, 3+__pyx_t_15, ((PyObject *)__pyx_v_ssymbols));
          __Pyx_GIVEREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_16, 4+__pyx_t_15, __pyx_t_3);
          __Pyx_INCREF(__pyx_v_title);
          __Pyx_GIVEREF(__pyx_v_title);
          PyTuple_SET_ITEM(__pyx_t_16, 5+__pyx_t_15, __pyx_v_title);
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_16, 6+__pyx_t_15, __pyx_t_4);
          __Pyx_GIVEREF(__pyx_t_5);
          PyTuple_SET_ITEM(__pyx_t_16, 7+__pyx_t_15, __pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_6);
          PyTuple_SET_ITEM(__pyx_t_16, 8+__pyx_t_15, __pyx_t_6);
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_16, 9+__pyx_t_15, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_16, 10+__pyx_t_15, __pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_9);
          PyTuple_SET_ITEM(__pyx_t_16, 11+__pyx_t_15, __pyx_t_9);
          __Pyx_GIVEREF(__pyx_t_10);
          PyTuple_SET_ITEM(__pyx_t_16, 12+__pyx_t_15, __pyx_t_10);
          __Pyx_GIVEREF(__pyx_t_11);
          PyTuple_SET_ITEM(__pyx_t_16, 13+__pyx_t_15, __pyx_t_11);
          __Pyx_INCREF(__pyx_v_float_format);
          __Pyx_GIVEREF(__pyx_v_float_format);
          PyTuple_SET_ITEM(__pyx_t_16, 14+__pyx_t_15, __pyx_v_float_format);
          __Pyx_GIVEREF(__pyx_t_12);
          PyTuple_SET_ITEM(__pyx_t_16, 15+__pyx_t_15, __pyx_t_12);
          __pyx_t_3 = 0;
          __pyx_t_4 = 0;
          __pyx_t_5 = 0;
          __pyx_t_6 = 0;
          __pyx_t_7 = 0;
          __pyx_t_8 = 0;
          __pyx_t_9 = 0;
          __pyx_t_10 = 0;
          __pyx_t_11 = 0;
          __pyx_t_12 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_16, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1662, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
        }
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "fstlib/cext/pywrapfst.pyx":1710
 *       show_weight_one: Should weights equivalent to semiring One be printed?
 *     """
 *     cdef string _source = path_tostring(source)             # <<<<<<<<<<<<<<
 *     cdef unique_ptr[ostream] _fstrm
 *     _fstrm.reset(new ofstream(_source))
 */
  __pyx_t_17 = __pyx_f_6fstlib_4cext_9pywrapfst_path_tostring(__pyx_v_source); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1710, __pyx_L1_error)
  __pyx_v__source = __pyx_t_17;

  /* "fstlib/cext/pywrapfst.pyx":1712
 *     cdef string _source = path_tostring(source)
 *     cdef unique_ptr[ostream] _fstrm
 *     _fstrm.reset(new ofstream(_source))             # <<<<<<<<<<<<<<
 *     cdef const fst.SymbolTable *_isymbols = self._fst.get().InputSymbols()
 *     if isymbols is not None:
 */
  __pyx_v__fstrm.reset(new std::ofstream(__pyx_v__source));

  /* "fstlib/cext/pywrapfst.pyx":1713
 *     cdef unique_ptr[ostream] _fstrm
 *     _fstrm.reset(new ofstream(_source))
 *     cdef const fst.SymbolTable *_isymbols = self._fst.get().InputSymbols()             # <<<<<<<<<<<<<<
 *     if isymbols is not None:
 *        _isymbols = isymbols._raw_ptr_or_raise()
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 1713, __pyx_L1_error)
  }
  __pyx_v__isymbols = __pyx_v_self->_fst.get()->InputSymbols();

  /* "fstlib/cext/pywrapfst.pyx":1714
 *     _fstrm.reset(new ofstream(_source))
 *     cdef const fst.SymbolTable *_isymbols = self._fst.get().InputSymbols()
 *     if isymbols is not None:             # <<<<<<<<<<<<<<
 *        _isymbols = isymbols._raw_ptr_or_raise()
 *     cdef const fst.SymbolTable *_osymbols = self._fst.get().OutputSymbols()
 */
  __pyx_t_18 = (((PyObject *)__pyx_v_isymbols) != Py_None);
  __pyx_t_19 = (__pyx_t_18 != 0);
  if (__pyx_t_19) {

    /* "fstlib/cext/pywrapfst.pyx":1715
 *     cdef const fst.SymbolTable *_isymbols = self._fst.get().InputSymbols()
 *     if isymbols is not None:
 *        _isymbols = isymbols._raw_ptr_or_raise()             # <<<<<<<<<<<<<<
 *     cdef const fst.SymbolTable *_osymbols = self._fst.get().OutputSymbols()
 *     if osymbols is not None:
 */
    if (unlikely(((PyObject *)__pyx_v_isymbols) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raw_ptr_or_raise");
      __PYX_ERR(0, 1715, __pyx_L1_error)
    }
    __pyx_t_20 = ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_SymbolTableView *)__pyx_v_isymbols->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_isymbols); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1715, __pyx_L1_error)
    __pyx_v__isymbols = __pyx_t_20;

    /* "fstlib/cext/pywrapfst.pyx":1714
 *     _fstrm.reset(new ofstream(_source))
 *     cdef const fst.SymbolTable *_isymbols = self._fst.get().InputSymbols()
 *     if isymbols is not None:             # <<<<<<<<<<<<<<
 *        _isymbols = isymbols._raw_ptr_or_raise()
 *     cdef const fst.SymbolTable *_osymbols = self._fst.get().OutputSymbols()
 */
  }

  /* "fstlib/cext/pywrapfst.pyx":1716
 *     if isymbols is not None:
 *        _isymbols = isymbols._raw_ptr_or_raise()
 *     cdef const fst.SymbolTable *_osymbols = self._fst.get().OutputSymbols()             # <<<<<<<<<<<<<<
 *     if osymbols is not None:
 *        _osymbols = osymbols._raw_ptr_or_raise()
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 1716, __pyx_L1_error)
  }
  __pyx_v__osymbols = __pyx_v_self->_fst.get()->OutputSymbols();

  /* "fstlib/cext/pywrapfst.pyx":1717
 *        _isymbols = isymbols._raw_ptr_or_raise()
 *     cdef const fst.SymbolTable *_osymbols = self._fst.get().OutputSymbols()
 *     if osymbols is not None:             # <<<<<<<<<<<<<<
 *        _osymbols = osymbols._raw_ptr_or_raise()
 *     cdef const fst.SymbolTable *_ssymbols = NULL
 */
  __pyx_t_19 = (((PyObject *)__pyx_v_osymbols) != Py_None);
  __pyx_t_18 = (__pyx_t_19 != 0);
  if (__pyx_t_18) {

    /* "fstlib/cext/pywrapfst.pyx":1718
 *     cdef const fst.SymbolTable *_osymbols = self._fst.get().OutputSymbols()
 *     if osymbols is not None:
 *        _osymbols = osymbols._raw_ptr_or_raise()             # <<<<<<<<<<<<<<
 *     cdef const fst.SymbolTable *_ssymbols = NULL
 *     if ssymbols is not None:
 */
    if (unlikely(((PyObject *)__pyx_v_osymbols) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raw_ptr_or_raise");
      __PYX_ERR(0, 1718, __pyx_L1_error)
    }
    __pyx_t_20 = ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_SymbolTableView *)__pyx_v_osymbols->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_osymbols); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1718, __pyx_L1_error)
    __pyx_v__osymbols = __pyx_t_20;

    /* "fstlib/cext/pywrapfst.pyx":1717
 *        _isymbols = isymbols._raw_ptr_or_raise()
 *     cdef const fst.SymbolTable *_osymbols = self._fst.get().OutputSymbols()
 *     if osymbols is not None:             # <<<<<<<<<<<<<<
 *        _osymbols = osymbols._raw_ptr_or_raise()
 *     cdef const fst.SymbolTable *_ssymbols = NULL
 */
  }

  /* "fstlib/cext/pywrapfst.pyx":1719
 *     if osymbols is not None:
 *        _osymbols = osymbols._raw_ptr_or_raise()
 *     cdef const fst.SymbolTable *_ssymbols = NULL             # <<<<<<<<<<<<<<
 *     if ssymbols is not None:
 *       _ssymbols = ssymbols._raw_ptr_or_raise()
 */
  __pyx_v__ssymbols = NULL;

  /* "fstlib/cext/pywrapfst.pyx":1720
 *        _osymbols = osymbols._raw_ptr_or_raise()
 *     cdef const fst.SymbolTable *_ssymbols = NULL
 *     if ssymbols is not None:             # <<<<<<<<<<<<<<
 *       _ssymbols = ssymbols._raw_ptr_or_raise()
 *     fst.Draw(deref(self._fst),
 */
  __pyx_t_18 = (((PyObject *)__pyx_v_ssymbols) != Py_None);
  __pyx_t_19 = (__pyx_t_18 != 0);
  if (__pyx_t_19) {

    /* "fstlib/cext/pywrapfst.pyx":1721
 *     cdef const fst.SymbolTable *_ssymbols = NULL
 *     if ssymbols is not None:
 *       _ssymbols = ssymbols._raw_ptr_or_raise()             # <<<<<<<<<<<<<<
 *     fst.Draw(deref(self._fst),
 *              _isymbols,
 */
    if (unlikely(((PyObject *)__pyx_v_ssymbols) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raw_ptr_or_raise");
      __PYX_ERR(0, 1721, __pyx_L1_error)
    }
    __pyx_t_20 = ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_SymbolTableView *)__pyx_v_ssymbols->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_ssymbols); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1721, __pyx_L1_error)
    __pyx_v__ssymbols = __pyx_t_20;

    /* "fstlib/cext/pywrapfst.pyx":1720
 *        _osymbols = osymbols._raw_ptr_or_raise()
 *     cdef const fst.SymbolTable *_ssymbols = NULL
 *     if ssymbols is not None:             # <<<<<<<<<<<<<<
 *       _ssymbols = ssymbols._raw_ptr_or_raise()
 *     fst.Draw(deref(self._fst),
 */
  }

  /* "fstlib/cext/pywrapfst.pyx":1722
 *     if ssymbols is not None:
 *       _ssymbols = ssymbols._raw_ptr_or_raise()
 *     fst.Draw(deref(self._fst),             # <<<<<<<<<<<<<<
 *              _isymbols,
 *              _osymbols,
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 1722, __pyx_L1_error)
  }

  /* "fstlib/cext/pywrapfst.pyx":1727
 *              _ssymbols,
 *              acceptor,
 *              tostring(title),             # <<<<<<<<<<<<<<
 *              width,
 *              height,
 */
  __pyx_t_17 = __pyx_f_6fstlib_4cext_9pywrapfst_tostring(__pyx_v_title); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1727, __pyx_L1_error)

  /* "fstlib/cext/pywrapfst.pyx":1736
 *              fontsize,
 *              precision,
 *              tostring(float_format),             # <<<<<<<<<<<<<<
 *              show_weight_one,
 *              deref(_fstrm),
 */
  __pyx_t_21 = __pyx_f_6fstlib_4cext_9pywrapfst_tostring(__pyx_v_float_format); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1736, __pyx_L1_error)

  /* "fstlib/cext/pywrapfst.pyx":1722
 *     if ssymbols is not None:
 *       _ssymbols = ssymbols._raw_ptr_or_raise()
 *     fst.Draw(deref(self._fst),             # <<<<<<<<<<<<<<
 *              _isymbols,
 *              _osymbols,
 */
  fst::script::Draw((*__pyx_v_self->_fst), __pyx_v__isymbols, __pyx_v__osymbols, __pyx_v__ssymbols, __pyx_v_acceptor, __pyx_t_17, __pyx_v_width, __pyx_v_height, __pyx_v_portrait, __pyx_v_vertical, __pyx_v_ranksep, __pyx_v_nodesep, __pyx_v_fontsize, __pyx_v_precision, __pyx_t_21, __pyx_v_show_weight_one, (*__pyx_v__fstrm), __pyx_v__source);

  /* "fstlib/cext/pywrapfst.pyx":1662
 *     return _init_XFst(new fst.FstClass(deref(self._fst)))
 * 
 *   cpdef void draw(self,             # <<<<<<<<<<<<<<
 *                   source,
 *                   SymbolTableView isymbols=None,
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.Fst.draw", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_17draw(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_3Fst_16draw[] = "\n    draw(self, source, isymbols=None, osymbols=None, ssymbols=None,\n         acceptor=False, title=\"\", width=8.5, height=11, portrait=False,\n         vertical=False, ranksep=0.4, nodesep=0.25, fontsize=14,\n         precision=5, float_format=\"g\", show_weight_one=False):\n\n    Writes out the FST in Graphviz text format.\n\n    This method writes out the FST in the dot graph description language. The\n    graph can be rendered using the `dot` executable provided by Graphviz.\n\n    Args:\n      source: The string location of the output dot/Graphviz file.\n      isymbols: An optional symbol table used to label input symbols.\n      osymbols: An optional symbol table used to label output symbols.\n      ssymbols: An optional symbol table used to label states.\n      acceptor: Should the figure be rendered in acceptor format if possible?\n      title: An optional string indicating the figure title.\n      width: The figure width, in inches.\n      height: The figure height, in inches.\n      portrait: Should the figure be rendered in portrait rather than\n          landscape?\n      vertical: Should the figure be rendered bottom-to-top rather than\n          left-to-right?\n      ranksep: The minimum separation separation between ranks, in inches.\n      nodesep: The minimum separation between nodes, in inches.\n      fontsize: Font size, in points.\n      precision: Numeric precision for floats, in number of chars.\n      float_format: One of: 'e', 'f' or 'g'.\n      show_weight_one: Should weights equivalent to semiring One be printed?\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_17draw(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_source = 0;
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_isymbols = 0;
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_osymbols = 0;
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_ssymbols = 0;
  bool __pyx_v_acceptor;
  PyObject *__pyx_v_title = 0;
  double __pyx_v_width;
  double __pyx_v_height;
  bool __pyx_v_portrait;
  bool __pyx_v_vertical;
  double __pyx_v_ranksep;
  double __pyx_v_nodesep;
  int32 __pyx_v_fontsize;
  int32 __pyx_v_precision;
  PyObject *__pyx_v_float_format = 0;
  bool __pyx_v_show_weight_one;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("draw (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_source,&__pyx_n_s_isymbols,&__pyx_n_s_osymbols,&__pyx_n_s_ssymbols,&__pyx_n_s_acceptor,&__pyx_n_s_title,&__pyx_n_s_width,&__pyx_n_s_height,&__pyx_n_s_portrait,&__pyx_n_s_vertical,&__pyx_n_s_ranksep,&__pyx_n_s_nodesep,&__pyx_n_s_fontsize,&__pyx_n_s_precision,&__pyx_n_s_float_format,&__pyx_n_s_show_weight_one,0};
    PyObject* values[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};

    /* "fstlib/cext/pywrapfst.pyx":1664
 *   cpdef void draw(self,
 *                   source,
 *                   SymbolTableView isymbols=None,             # <<<<<<<<<<<<<<
 *                   SymbolTableView osymbols=None,
 *                   SymbolTableView ssymbols=None,
 */
    values[1] = (PyObject *)((struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *)Py_None);

    /* "fstlib/cext/pywrapfst.pyx":1665
 *                   source,
 *                   SymbolTableView isymbols=None,
 *                   SymbolTableView osymbols=None,             # <<<<<<<<<<<<<<
 *                   SymbolTableView ssymbols=None,
 *                   bool acceptor=False,
 */
    values[2] = (PyObject *)((struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *)Py_None);

    /* "fstlib/cext/pywrapfst.pyx":1666
 *                   SymbolTableView isymbols=None,
 *                   SymbolTableView osymbols=None,
 *                   SymbolTableView ssymbols=None,             # <<<<<<<<<<<<<<
 *                   bool acceptor=False,
 *                   title="",
 */
    values[3] = (PyObject *)((struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *)Py_None);
    values[5] = ((PyObject *)__pyx_kp_u__11);
    values[14] = ((PyObject *)__pyx_n_u_g);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
        CYTHON_FALLTHROUGH;
        case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
        CYTHON_FALLTHROUGH;
        case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
        CYTHON_FALLTHROUGH;
        case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
        CYTHON_FALLTHROUGH;
        case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
        CYTHON_FALLTHROUGH;
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_source)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_isymbols);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_osymbols);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ssymbols);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_acceptor);
          if (value) { values[4] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_title);
          if (value) { values[5] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_width);
          if (value) { values[6] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_height);
          if (value) { values[7] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_portrait);
          if (value) { values[8] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vertical);
          if (value) { values[9] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case 10:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ranksep);
          if (value) { values[10] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case 11:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodesep);
          if (value) { values[11] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case 12:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fontsize);
          if (value) { values[12] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case 13:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_precision);
          if (value) { values[13] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case 14:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_float_format);
          if (value) { values[14] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case 15:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_show_weight_one);
          if (value) { values[15] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "draw") < 0)) __PYX_ERR(0, 1662, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
        CYTHON_FALLTHROUGH;
        case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
        CYTHON_FALLTHROUGH;
        case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
        CYTHON_FALLTHROUGH;
        case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
        CYTHON_FALLTHROUGH;
        case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
        CYTHON_FALLTHROUGH;
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_source = values[0];
    __pyx_v_isymbols = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *)values[1]);
    __pyx_v_osymbols = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *)values[2]);
    __pyx_v_ssymbols = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *)values[3]);
    if (values[4]) {
      __pyx_v_acceptor = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_acceptor == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1667, __pyx_L3_error)
    } else {

      /* "fstlib/cext/pywrapfst.pyx":1667
 *                   SymbolTableView osymbols=None,
 *                   SymbolTableView ssymbols=None,
 *                   bool acceptor=False,             # <<<<<<<<<<<<<<
 *                   title="",
 *                   double width=8.5,
 */
      __pyx_v_acceptor = ((bool)0);
    }
    __pyx_v_title = values[5];
    if (values[6]) {
      __pyx_v_width = __pyx_PyFloat_AsDouble(values[6]); if (unlikely((__pyx_v_width == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1669, __pyx_L3_error)
    } else {
      __pyx_v_width = ((double)8.5);
    }
    if (values[7]) {
      __pyx_v_height = __pyx_PyFloat_AsDouble(values[7]); if (unlikely((__pyx_v_height == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1670, __pyx_L3_error)
    } else {
      __pyx_v_height = ((double)11.0);
    }
    if (values[8]) {
      __pyx_v_portrait = __Pyx_PyObject_IsTrue(values[8]); if (unlikely((__pyx_v_portrait == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1671, __pyx_L3_error)
    } else {

      /* "fstlib/cext/pywrapfst.pyx":1671
 *                   double width=8.5,
 *                   double height=11,
 *                   bool portrait=False,             # <<<<<<<<<<<<<<
 *                   bool vertical=False,
 *                   double ranksep=0.4,
 */
      __pyx_v_portrait = ((bool)0);
    }
    if (values[9]) {
      __pyx_v_vertical = __Pyx_PyObject_IsTrue(values[9]); if (unlikely((__pyx_v_vertical == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1672, __pyx_L3_error)
    } else {

      /* "fstlib/cext/pywrapfst.pyx":1672
 *                   double height=11,
 *                   bool portrait=False,
 *                   bool vertical=False,             # <<<<<<<<<<<<<<
 *                   double ranksep=0.4,
 *                   double nodesep=0.25,
 */
      __pyx_v_vertical = ((bool)0);
    }
    if (values[10]) {
      __pyx_v_ranksep = __pyx_PyFloat_AsDouble(values[10]); if (unlikely((__pyx_v_ranksep == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1673, __pyx_L3_error)
    } else {
      __pyx_v_ranksep = ((double)0.4);
    }
    if (values[11]) {
      __pyx_v_nodesep = __pyx_PyFloat_AsDouble(values[11]); if (unlikely((__pyx_v_nodesep == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1674, __pyx_L3_error)
    } else {
      __pyx_v_nodesep = ((double)0.25);
    }
    if (values[12]) {
      __pyx_v_fontsize = __Pyx_PyInt_As_int32_t(values[12]); if (unlikely((__pyx_v_fontsize == ((int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1675, __pyx_L3_error)
    } else {
      __pyx_v_fontsize = ((int32)14);
    }
    if (values[13]) {
      __pyx_v_precision = __Pyx_PyInt_As_int32_t(values[13]); if (unlikely((__pyx_v_precision == ((int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1676, __pyx_L3_error)
    } else {
      __pyx_v_precision = ((int32)5);
    }
    __pyx_v_float_format = values[14];
    if (values[15]) {
      __pyx_v_show_weight_one = __Pyx_PyObject_IsTrue(values[15]); if (unlikely((__pyx_v_show_weight_one == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1678, __pyx_L3_error)
    } else {

      /* "fstlib/cext/pywrapfst.pyx":1678
 *                   int32 precision=5,
 *                   float_format="g",
 *                   bool show_weight_one=False) except *:             # <<<<<<<<<<<<<<
 *     """
 *     draw(self, source, isymbols=None, osymbols=None, ssymbols=None,
 */
      __pyx_v_show_weight_one = ((bool)0);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("draw", 0, 1, 16, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1662, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.Fst.draw", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_isymbols), __pyx_ptype_6fstlib_4cext_9pywrapfst_SymbolTableView, 1, "isymbols", 0))) __PYX_ERR(0, 1664, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_osymbols), __pyx_ptype_6fstlib_4cext_9pywrapfst_SymbolTableView, 1, "osymbols", 0))) __PYX_ERR(0, 1665, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ssymbols), __pyx_ptype_6fstlib_4cext_9pywrapfst_SymbolTableView, 1, "ssymbols", 0))) __PYX_ERR(0, 1666, __pyx_L1_error)
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_3Fst_16draw(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *)__pyx_v_self), __pyx_v_source, __pyx_v_isymbols, __pyx_v_osymbols, __pyx_v_ssymbols, __pyx_v_acceptor, __pyx_v_title, __pyx_v_width, __pyx_v_height, __pyx_v_portrait, __pyx_v_vertical, __pyx_v_ranksep, __pyx_v_nodesep, __pyx_v_fontsize, __pyx_v_precision, __pyx_v_float_format, __pyx_v_show_weight_one);

  /* "fstlib/cext/pywrapfst.pyx":1662
 *     return _init_XFst(new fst.FstClass(deref(self._fst)))
 * 
 *   cpdef void draw(self,             # <<<<<<<<<<<<<<
 *                   source,
 *                   SymbolTableView isymbols=None,
 */

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_3Fst_16draw(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_self, PyObject *__pyx_v_source, struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_isymbols, struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_osymbols, struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_ssymbols, bool __pyx_v_acceptor, PyObject *__pyx_v_title, double __pyx_v_width, double __pyx_v_height, bool __pyx_v_portrait, bool __pyx_v_vertical, double __pyx_v_ranksep, double __pyx_v_nodesep, int32 __pyx_v_fontsize, int32 __pyx_v_precision, PyObject *__pyx_v_float_format, bool __pyx_v_show_weight_one) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_3Fst_draw __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("draw", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1.__pyx_n = 15;
  __pyx_t_1.isymbols = __pyx_v_isymbols;
  __pyx_t_1.osymbols = __pyx_v_osymbols;
  __pyx_t_1.ssymbols = __pyx_v_ssymbols;
  __pyx_t_1.acceptor = __pyx_v_acceptor;
  __pyx_t_1.title = __pyx_v_title;
  __pyx_t_1.width = __pyx_v_width;
  __pyx_t_1.height = __pyx_v_height;
  __pyx_t_1.portrait = __pyx_v_portrait;
  __pyx_t_1.vertical = __pyx_v_vertical;
  __pyx_t_1.ranksep = __pyx_v_ranksep;
  __pyx_t_1.nodesep = __pyx_v_nodesep;
  __pyx_t_1.fontsize = __pyx_v_fontsize;
  __pyx_t_1.precision = __pyx_v_precision;
  __pyx_t_1.float_format = __pyx_v_float_format;
  __pyx_t_1.show_weight_one = __pyx_v_show_weight_one;
  __pyx_vtabptr_6fstlib_4cext_9pywrapfst_Fst->draw(__pyx_v_self, __pyx_v_source, 1, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1662, __pyx_L1_error)
  __pyx_t_2 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1662, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.Fst.draw", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":1741
 *              _source)
 * 
 *   cpdef Weight final(self, int64 state):             # <<<<<<<<<<<<<<
 *     """
 *     final(self, state)
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_19final(PyObject *__pyx_v_self, PyObject *__pyx_arg_state); /*proto*/
static struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__pyx_f_6fstlib_4cext_9pywrapfst_3Fst_final(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_self, int64 __pyx_v_state, int __pyx_skip_dispatch) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__pyx_v__weight = 0;
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("final", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_final); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1741, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_19final)) {
        __Pyx_XDECREF(((PyObject *)__pyx_r));
        __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_v_state); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1741, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
          if (likely(__pyx_t_5)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
            __Pyx_INCREF(__pyx_t_5);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_4, function);
          }
        }
        __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1741, __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_6fstlib_4cext_9pywrapfst_Weight))))) __PYX_ERR(0, 1741, __pyx_L1_error)
        __pyx_r = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "fstlib/cext/pywrapfst.pyx":1756
 *       FstIndexError: State index out of range.
 *     """
 *     cdef Weight _weight = Weight.__new__(Weight)             # <<<<<<<<<<<<<<
 *     _weight._weight.reset(new fst.WeightClass(self._fst.get().Final(state)))
 *     if not _weight.member():
 */
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_6fstlib_4cext_9pywrapfst_Weight(((PyTypeObject *)__pyx_ptype_6fstlib_4cext_9pywrapfst_Weight), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1756, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v__weight = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "fstlib/cext/pywrapfst.pyx":1757
 *     """
 *     cdef Weight _weight = Weight.__new__(Weight)
 *     _weight._weight.reset(new fst.WeightClass(self._fst.get().Final(state)))             # <<<<<<<<<<<<<<
 *     if not _weight.member():
 *       raise FstIndexError("State index out of range")
 */
  if (unlikely(((PyObject *)__pyx_v__weight) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_weight");
    __PYX_ERR(0, 1757, __pyx_L1_error)
  }
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 1757, __pyx_L1_error)
  }
  __pyx_v__weight->_weight.reset(new fst::script::WeightClass(__pyx_v_self->_fst.get()->Final(__pyx_v_state)));

  /* "fstlib/cext/pywrapfst.pyx":1758
 *     cdef Weight _weight = Weight.__new__(Weight)
 *     _weight._weight.reset(new fst.WeightClass(self._fst.get().Final(state)))
 *     if not _weight.member():             # <<<<<<<<<<<<<<
 *       raise FstIndexError("State index out of range")
 *     return _weight
 */
  if (unlikely(((PyObject *)__pyx_v__weight) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "member");
    __PYX_ERR(0, 1758, __pyx_L1_error)
  }
  __pyx_t_6 = ((!(((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_Weight *)__pyx_v__weight->__pyx_vtab)->member(__pyx_v__weight, 0) != 0)) != 0);
  if (unlikely(__pyx_t_6)) {

    /* "fstlib/cext/pywrapfst.pyx":1759
 *     _weight._weight.reset(new fst.WeightClass(self._fst.get().Final(state)))
 *     if not _weight.member():
 *       raise FstIndexError("State index out of range")             # <<<<<<<<<<<<<<
 *     return _weight
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1759, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_kp_u_State_index_out_of_range) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_u_State_index_out_of_range);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1759, __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(0, 1759, __pyx_L1_error)

    /* "fstlib/cext/pywrapfst.pyx":1758
 *     cdef Weight _weight = Weight.__new__(Weight)
 *     _weight._weight.reset(new fst.WeightClass(self._fst.get().Final(state)))
 *     if not _weight.member():             # <<<<<<<<<<<<<<
 *       raise FstIndexError("State index out of range")
 *     return _weight
 */
  }

  /* "fstlib/cext/pywrapfst.pyx":1760
 *     if not _weight.member():
 *       raise FstIndexError("State index out of range")
 *     return _weight             # <<<<<<<<<<<<<<
 * 
 *   cpdef string fst_type(self):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v__weight));
  __pyx_r = __pyx_v__weight;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":1741
 *              _source)
 * 
 *   cpdef Weight final(self, int64 state):             # <<<<<<<<<<<<<<
 *     """
 *     final(self, state)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.Fst.final", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v__weight);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_19final(PyObject *__pyx_v_self, PyObject *__pyx_arg_state); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_3Fst_18final[] = "\n    final(self, state)\n\n    Returns the final weight of a state.\n\n    Args:\n      state: The integer index of a state.\n\n    Returns:\n      The final Weight of that state.\n\n    Raises:\n      FstIndexError: State index out of range.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_19final(PyObject *__pyx_v_self, PyObject *__pyx_arg_state) {
  int64 __pyx_v_state;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("final (wrapper)", 0);
  assert(__pyx_arg_state); {
    __pyx_v_state = __Pyx_PyInt_As_int64_t(__pyx_arg_state); if (unlikely((__pyx_v_state == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1741, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.Fst.final", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_3Fst_18final(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *)__pyx_v_self), ((int64)__pyx_v_state));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_3Fst_18final(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_self, int64 __pyx_v_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("final", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_6fstlib_4cext_9pywrapfst_3Fst_final(__pyx_v_self, __pyx_v_state, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1741, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.Fst.final", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":1762
 *     return _weight
 * 
 *   cpdef string fst_type(self):             # <<<<<<<<<<<<<<
 *     """
 *     fst_type(self)
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_21fst_type(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static std::string __pyx_f_6fstlib_4cext_9pywrapfst_3Fst_fst_type(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_self, int __pyx_skip_dispatch) {
  std::string __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  std::string __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("fst_type", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_fst_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1762, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_21fst_type)) {
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1762, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1762, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_5;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "fstlib/cext/pywrapfst.pyx":1768
 *     Returns a string indicating the FST type.
 *     """
 *     return self._fst.get().FstType()             # <<<<<<<<<<<<<<
 * 
 *   cpdef _FstSymbolTableView input_symbols(self):
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 1768, __pyx_L1_error)
  }
  __pyx_r = __pyx_v_self->_fst.get()->FstType();
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":1762
 *     return _weight
 * 
 *   cpdef string fst_type(self):             # <<<<<<<<<<<<<<
 *     """
 *     fst_type(self)
 */

  /* 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_WriteUnraisable("fstlib.cext.pywrapfst.Fst.fst_type", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_21fst_type(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_3Fst_20fst_type[] = "\n    fst_type(self)\n\n    Returns a string indicating the FST type.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_21fst_type(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("fst_type (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_3Fst_20fst_type(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_3Fst_20fst_type(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__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("fst_type", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_f_6fstlib_4cext_9pywrapfst_3Fst_fst_type(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1762, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.Fst.fst_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":1770
 *     return self._fst.get().FstType()
 * 
 *   cpdef _FstSymbolTableView input_symbols(self):             # <<<<<<<<<<<<<<
 *     """
 *     input_symbols(self)
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_23input_symbols(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static struct __pyx_obj_6fstlib_4cext_9pywrapfst__FstSymbolTableView *__pyx_f_6fstlib_4cext_9pywrapfst_3Fst_input_symbols(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_self, int __pyx_skip_dispatch) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst__FstSymbolTableView *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("input_symbols", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_input_symbols); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1770, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_23input_symbols)) {
        __Pyx_XDECREF(((PyObject *)__pyx_r));
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1770, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_6fstlib_4cext_9pywrapfst__FstSymbolTableView))))) __PYX_ERR(0, 1770, __pyx_L1_error)
        __pyx_r = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst__FstSymbolTableView *)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "fstlib/cext/pywrapfst.pyx":1776
 *     Returns the FST's input symbol table, or None if none is present.
 *     """
 *     if self._fst.get().InputSymbols() == NULL:             # <<<<<<<<<<<<<<
 *       return
 *     return _init_FstSymbolTableView(self._fst, input_side=True)
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 1776, __pyx_L1_error)
  }
  __pyx_t_5 = ((__pyx_v_self->_fst.get()->InputSymbols() == NULL) != 0);
  if (__pyx_t_5) {

    /* "fstlib/cext/pywrapfst.pyx":1777
 *     """
 *     if self._fst.get().InputSymbols() == NULL:
 *       return             # <<<<<<<<<<<<<<
 *     return _init_FstSymbolTableView(self._fst, input_side=True)
 * 
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_r = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst__FstSymbolTableView *)Py_None); __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "fstlib/cext/pywrapfst.pyx":1776
 *     Returns the FST's input symbol table, or None if none is present.
 *     """
 *     if self._fst.get().InputSymbols() == NULL:             # <<<<<<<<<<<<<<
 *       return
 *     return _init_FstSymbolTableView(self._fst, input_side=True)
 */
  }

  /* "fstlib/cext/pywrapfst.pyx":1778
 *     if self._fst.get().InputSymbols() == NULL:
 *       return
 *     return _init_FstSymbolTableView(self._fst, input_side=True)             # <<<<<<<<<<<<<<
 * 
 *   cpdef size_t num_arcs(self, int64 state) except *:
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 1778, __pyx_L1_error)
  }
  __pyx_t_1 = ((PyObject *)__pyx_f_6fstlib_4cext_9pywrapfst__init_FstSymbolTableView(__pyx_v_self->_fst, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1778, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst__FstSymbolTableView *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":1770
 *     return self._fst.get().FstType()
 * 
 *   cpdef _FstSymbolTableView input_symbols(self):             # <<<<<<<<<<<<<<
 *     """
 *     input_symbols(self)
 */

  /* 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("fstlib.cext.pywrapfst.Fst.input_symbols", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_23input_symbols(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_3Fst_22input_symbols[] = "\n    input_symbols(self)\n\n    Returns the FST's input symbol table, or None if none is present.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_23input_symbols(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("input_symbols (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_3Fst_22input_symbols(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_3Fst_22input_symbols(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__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("input_symbols", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_6fstlib_4cext_9pywrapfst_3Fst_input_symbols(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1770, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.Fst.input_symbols", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":1780
 *     return _init_FstSymbolTableView(self._fst, input_side=True)
 * 
 *   cpdef size_t num_arcs(self, int64 state) except *:             # <<<<<<<<<<<<<<
 *     """
 *     num_arcs(self, state)
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_25num_arcs(PyObject *__pyx_v_self, PyObject *__pyx_arg_state); /*proto*/
static size_t __pyx_f_6fstlib_4cext_9pywrapfst_3Fst_num_arcs(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_self, int64 __pyx_v_state, int __pyx_skip_dispatch) {
  size_t __pyx_v__result;
  size_t __pyx_r;
  __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;
  size_t __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("num_arcs", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_arcs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1780, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_25num_arcs)) {
        __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_v_state); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1780, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
          if (likely(__pyx_t_5)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
            __Pyx_INCREF(__pyx_t_5);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_4, function);
          }
        }
        __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1780, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_6 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_6 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1780, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_6;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "fstlib/cext/pywrapfst.pyx":1795
 *       FstIndexError: State index out of range.
 *     """
 *     cdef size_t _result = self._fst.get().NumArcs(state)             # <<<<<<<<<<<<<<
 *     if _result == SIZE_MAX:
 *       raise FstIndexError("State index out of range")
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 1795, __pyx_L1_error)
  }
  __pyx_v__result = __pyx_v_self->_fst.get()->NumArcs(__pyx_v_state);

  /* "fstlib/cext/pywrapfst.pyx":1796
 *     """
 *     cdef size_t _result = self._fst.get().NumArcs(state)
 *     if _result == SIZE_MAX:             # <<<<<<<<<<<<<<
 *       raise FstIndexError("State index out of range")
 *     return _result
 */
  __pyx_t_7 = ((__pyx_v__result == SIZE_MAX) != 0);
  if (unlikely(__pyx_t_7)) {

    /* "fstlib/cext/pywrapfst.pyx":1797
 *     cdef size_t _result = self._fst.get().NumArcs(state)
 *     if _result == SIZE_MAX:
 *       raise FstIndexError("State index out of range")             # <<<<<<<<<<<<<<
 *     return _result
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1797, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_kp_u_State_index_out_of_range) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_u_State_index_out_of_range);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1797, __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(0, 1797, __pyx_L1_error)

    /* "fstlib/cext/pywrapfst.pyx":1796
 *     """
 *     cdef size_t _result = self._fst.get().NumArcs(state)
 *     if _result == SIZE_MAX:             # <<<<<<<<<<<<<<
 *       raise FstIndexError("State index out of range")
 *     return _result
 */
  }

  /* "fstlib/cext/pywrapfst.pyx":1798
 *     if _result == SIZE_MAX:
 *       raise FstIndexError("State index out of range")
 *     return _result             # <<<<<<<<<<<<<<
 * 
 *   cpdef size_t num_input_epsilons(self, int64 state) except *:
 */
  __pyx_r = __pyx_v__result;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":1780
 *     return _init_FstSymbolTableView(self._fst, input_side=True)
 * 
 *   cpdef size_t num_arcs(self, int64 state) except *:             # <<<<<<<<<<<<<<
 *     """
 *     num_arcs(self, state)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.Fst.num_arcs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_25num_arcs(PyObject *__pyx_v_self, PyObject *__pyx_arg_state); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_3Fst_24num_arcs[] = "\n    num_arcs(self, state)\n\n    Returns the number of arcs leaving a state.\n\n    Args:\n      state: The integer index of a state.\n\n    Returns:\n      The number of arcs leaving that state.\n\n    Raises:\n      FstIndexError: State index out of range.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_25num_arcs(PyObject *__pyx_v_self, PyObject *__pyx_arg_state) {
  int64 __pyx_v_state;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("num_arcs (wrapper)", 0);
  assert(__pyx_arg_state); {
    __pyx_v_state = __Pyx_PyInt_As_int64_t(__pyx_arg_state); if (unlikely((__pyx_v_state == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1780, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.Fst.num_arcs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_3Fst_24num_arcs(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *)__pyx_v_self), ((int64)__pyx_v_state));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_3Fst_24num_arcs(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_self, int64 __pyx_v_state) {
  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("num_arcs", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6fstlib_4cext_9pywrapfst_3Fst_num_arcs(__pyx_v_self, __pyx_v_state, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1780, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1780, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.Fst.num_arcs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":1800
 *     return _result
 * 
 *   cpdef size_t num_input_epsilons(self, int64 state) except *:             # <<<<<<<<<<<<<<
 *     """
 *     num_input_epsilons(self, state)
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_27num_input_epsilons(PyObject *__pyx_v_self, PyObject *__pyx_arg_state); /*proto*/
static size_t __pyx_f_6fstlib_4cext_9pywrapfst_3Fst_num_input_epsilons(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_self, int64 __pyx_v_state, int __pyx_skip_dispatch) {
  size_t __pyx_v__result;
  size_t __pyx_r;
  __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;
  size_t __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("num_input_epsilons", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_input_epsilons); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1800, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_27num_input_epsilons)) {
        __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_v_state); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1800, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
          if (likely(__pyx_t_5)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
            __Pyx_INCREF(__pyx_t_5);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_4, function);
          }
        }
        __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1800, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_6 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_6 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1800, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_6;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "fstlib/cext/pywrapfst.pyx":1815
 *       FstIndexError: State index out of range.
 *     """
 *     cdef size_t _result = self._fst.get().NumInputEpsilons(state)             # <<<<<<<<<<<<<<
 *     if _result == SIZE_MAX:
 *       raise FstIndexError("State index out of range")
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 1815, __pyx_L1_error)
  }
  __pyx_v__result = __pyx_v_self->_fst.get()->NumInputEpsilons(__pyx_v_state);

  /* "fstlib/cext/pywrapfst.pyx":1816
 *     """
 *     cdef size_t _result = self._fst.get().NumInputEpsilons(state)
 *     if _result == SIZE_MAX:             # <<<<<<<<<<<<<<
 *       raise FstIndexError("State index out of range")
 *     return _result
 */
  __pyx_t_7 = ((__pyx_v__result == SIZE_MAX) != 0);
  if (unlikely(__pyx_t_7)) {

    /* "fstlib/cext/pywrapfst.pyx":1817
 *     cdef size_t _result = self._fst.get().NumInputEpsilons(state)
 *     if _result == SIZE_MAX:
 *       raise FstIndexError("State index out of range")             # <<<<<<<<<<<<<<
 *     return _result
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1817, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_kp_u_State_index_out_of_range) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_u_State_index_out_of_range);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1817, __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(0, 1817, __pyx_L1_error)

    /* "fstlib/cext/pywrapfst.pyx":1816
 *     """
 *     cdef size_t _result = self._fst.get().NumInputEpsilons(state)
 *     if _result == SIZE_MAX:             # <<<<<<<<<<<<<<
 *       raise FstIndexError("State index out of range")
 *     return _result
 */
  }

  /* "fstlib/cext/pywrapfst.pyx":1818
 *     if _result == SIZE_MAX:
 *       raise FstIndexError("State index out of range")
 *     return _result             # <<<<<<<<<<<<<<
 * 
 *   cpdef size_t num_output_epsilons(self, int64 state) except *:
 */
  __pyx_r = __pyx_v__result;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":1800
 *     return _result
 * 
 *   cpdef size_t num_input_epsilons(self, int64 state) except *:             # <<<<<<<<<<<<<<
 *     """
 *     num_input_epsilons(self, state)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.Fst.num_input_epsilons", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_27num_input_epsilons(PyObject *__pyx_v_self, PyObject *__pyx_arg_state); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_3Fst_26num_input_epsilons[] = "\n    num_input_epsilons(self, state)\n\n    Returns the number of arcs with epsilon input labels leaving a state.\n\n    Args:\n      state: The integer index of a state.\n\n    Returns:\n      The number of epsilon-input-labeled arcs leaving that state.\n\n    Raises:\n      FstIndexError: State index out of range.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_27num_input_epsilons(PyObject *__pyx_v_self, PyObject *__pyx_arg_state) {
  int64 __pyx_v_state;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("num_input_epsilons (wrapper)", 0);
  assert(__pyx_arg_state); {
    __pyx_v_state = __Pyx_PyInt_As_int64_t(__pyx_arg_state); if (unlikely((__pyx_v_state == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1800, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.Fst.num_input_epsilons", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_3Fst_26num_input_epsilons(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *)__pyx_v_self), ((int64)__pyx_v_state));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_3Fst_26num_input_epsilons(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_self, int64 __pyx_v_state) {
  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("num_input_epsilons", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6fstlib_4cext_9pywrapfst_3Fst_num_input_epsilons(__pyx_v_self, __pyx_v_state, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1800, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1800, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.Fst.num_input_epsilons", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":1820
 *     return _result
 * 
 *   cpdef size_t num_output_epsilons(self, int64 state) except *:             # <<<<<<<<<<<<<<
 *     """
 *     num_output_epsilons(self, state)
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_29num_output_epsilons(PyObject *__pyx_v_self, PyObject *__pyx_arg_state); /*proto*/
static size_t __pyx_f_6fstlib_4cext_9pywrapfst_3Fst_num_output_epsilons(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_self, int64 __pyx_v_state, int __pyx_skip_dispatch) {
  size_t __pyx_v__result;
  size_t __pyx_r;
  __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;
  size_t __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("num_output_epsilons", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_output_epsilons); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1820, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_29num_output_epsilons)) {
        __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_v_state); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1820, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
          if (likely(__pyx_t_5)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
            __Pyx_INCREF(__pyx_t_5);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_4, function);
          }
        }
        __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1820, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_6 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_6 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1820, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_6;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "fstlib/cext/pywrapfst.pyx":1835
 *       FstIndexError: State index out of range.
 *     """
 *     cdef size_t _result = self._fst.get().NumOutputEpsilons(state)             # <<<<<<<<<<<<<<
 *     if _result == SIZE_MAX:
 *       raise FstIndexError("State index out of range")
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 1835, __pyx_L1_error)
  }
  __pyx_v__result = __pyx_v_self->_fst.get()->NumOutputEpsilons(__pyx_v_state);

  /* "fstlib/cext/pywrapfst.pyx":1836
 *     """
 *     cdef size_t _result = self._fst.get().NumOutputEpsilons(state)
 *     if _result == SIZE_MAX:             # <<<<<<<<<<<<<<
 *       raise FstIndexError("State index out of range")
 *     return _result
 */
  __pyx_t_7 = ((__pyx_v__result == SIZE_MAX) != 0);
  if (unlikely(__pyx_t_7)) {

    /* "fstlib/cext/pywrapfst.pyx":1837
 *     cdef size_t _result = self._fst.get().NumOutputEpsilons(state)
 *     if _result == SIZE_MAX:
 *       raise FstIndexError("State index out of range")             # <<<<<<<<<<<<<<
 *     return _result
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1837, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_kp_u_State_index_out_of_range) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_u_State_index_out_of_range);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1837, __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(0, 1837, __pyx_L1_error)

    /* "fstlib/cext/pywrapfst.pyx":1836
 *     """
 *     cdef size_t _result = self._fst.get().NumOutputEpsilons(state)
 *     if _result == SIZE_MAX:             # <<<<<<<<<<<<<<
 *       raise FstIndexError("State index out of range")
 *     return _result
 */
  }

  /* "fstlib/cext/pywrapfst.pyx":1838
 *     if _result == SIZE_MAX:
 *       raise FstIndexError("State index out of range")
 *     return _result             # <<<<<<<<<<<<<<
 * 
 *   cpdef _FstSymbolTableView output_symbols(self):
 */
  __pyx_r = __pyx_v__result;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":1820
 *     return _result
 * 
 *   cpdef size_t num_output_epsilons(self, int64 state) except *:             # <<<<<<<<<<<<<<
 *     """
 *     num_output_epsilons(self, state)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.Fst.num_output_epsilons", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_29num_output_epsilons(PyObject *__pyx_v_self, PyObject *__pyx_arg_state); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_3Fst_28num_output_epsilons[] = "\n    num_output_epsilons(self, state)\n\n    Returns the number of arcs with epsilon output labels leaving a state.\n\n    Args:\n      state: The integer index of a state.\n\n    Returns:\n      The number of epsilon-output-labeled arcs leaving that state.\n\n    Raises:\n      FstIndexError: State index out of range.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_29num_output_epsilons(PyObject *__pyx_v_self, PyObject *__pyx_arg_state) {
  int64 __pyx_v_state;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("num_output_epsilons (wrapper)", 0);
  assert(__pyx_arg_state); {
    __pyx_v_state = __Pyx_PyInt_As_int64_t(__pyx_arg_state); if (unlikely((__pyx_v_state == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1820, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.Fst.num_output_epsilons", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_3Fst_28num_output_epsilons(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *)__pyx_v_self), ((int64)__pyx_v_state));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_3Fst_28num_output_epsilons(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_self, int64 __pyx_v_state) {
  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("num_output_epsilons", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6fstlib_4cext_9pywrapfst_3Fst_num_output_epsilons(__pyx_v_self, __pyx_v_state, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1820, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1820, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.Fst.num_output_epsilons", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":1840
 *     return _result
 * 
 *   cpdef _FstSymbolTableView output_symbols(self):             # <<<<<<<<<<<<<<
 *     """
 *     output_symbols(self)
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_31output_symbols(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static struct __pyx_obj_6fstlib_4cext_9pywrapfst__FstSymbolTableView *__pyx_f_6fstlib_4cext_9pywrapfst_3Fst_output_symbols(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_self, int __pyx_skip_dispatch) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst__FstSymbolTableView *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("output_symbols", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_output_symbols); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1840, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_31output_symbols)) {
        __Pyx_XDECREF(((PyObject *)__pyx_r));
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1840, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_6fstlib_4cext_9pywrapfst__FstSymbolTableView))))) __PYX_ERR(0, 1840, __pyx_L1_error)
        __pyx_r = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst__FstSymbolTableView *)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "fstlib/cext/pywrapfst.pyx":1846
 *     Returns the FST's output symbol table, or None if none is present.
 *     """
 *     if self._fst.get().OutputSymbols() == NULL:             # <<<<<<<<<<<<<<
 *       return
 *     return _init_FstSymbolTableView(self._fst, input_side=False)
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 1846, __pyx_L1_error)
  }
  __pyx_t_5 = ((__pyx_v_self->_fst.get()->OutputSymbols() == NULL) != 0);
  if (__pyx_t_5) {

    /* "fstlib/cext/pywrapfst.pyx":1847
 *     """
 *     if self._fst.get().OutputSymbols() == NULL:
 *       return             # <<<<<<<<<<<<<<
 *     return _init_FstSymbolTableView(self._fst, input_side=False)
 * 
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_r = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst__FstSymbolTableView *)Py_None); __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "fstlib/cext/pywrapfst.pyx":1846
 *     Returns the FST's output symbol table, or None if none is present.
 *     """
 *     if self._fst.get().OutputSymbols() == NULL:             # <<<<<<<<<<<<<<
 *       return
 *     return _init_FstSymbolTableView(self._fst, input_side=False)
 */
  }

  /* "fstlib/cext/pywrapfst.pyx":1848
 *     if self._fst.get().OutputSymbols() == NULL:
 *       return
 *     return _init_FstSymbolTableView(self._fst, input_side=False)             # <<<<<<<<<<<<<<
 * 
 *   cpdef string print(self, SymbolTableView isymbols=None,
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 1848, __pyx_L1_error)
  }
  __pyx_t_1 = ((PyObject *)__pyx_f_6fstlib_4cext_9pywrapfst__init_FstSymbolTableView(__pyx_v_self->_fst, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1848, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst__FstSymbolTableView *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":1840
 *     return _result
 * 
 *   cpdef _FstSymbolTableView output_symbols(self):             # <<<<<<<<<<<<<<
 *     """
 *     output_symbols(self)
 */

  /* 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("fstlib.cext.pywrapfst.Fst.output_symbols", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_31output_symbols(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_3Fst_30output_symbols[] = "\n    output_symbols(self)\n\n    Returns the FST's output symbol table, or None if none is present.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_31output_symbols(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("output_symbols (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_3Fst_30output_symbols(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_3Fst_30output_symbols(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__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("output_symbols", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_6fstlib_4cext_9pywrapfst_3Fst_output_symbols(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1840, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.Fst.output_symbols", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":1850
 *     return _init_FstSymbolTableView(self._fst, input_side=False)
 * 
 *   cpdef string print(self, SymbolTableView isymbols=None,             # <<<<<<<<<<<<<<
 *       SymbolTableView osymbols=None, SymbolTableView ssymbols=None,
 *       bool acceptor=False, bool show_weight_one=False,
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_33print(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static std::string __pyx_f_6fstlib_4cext_9pywrapfst_3Fst_print(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_3Fst_print *__pyx_optional_args) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_isymbols = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *)Py_None);

  /* "fstlib/cext/pywrapfst.pyx":1851
 * 
 *   cpdef string print(self, SymbolTableView isymbols=None,
 *       SymbolTableView osymbols=None, SymbolTableView ssymbols=None,             # <<<<<<<<<<<<<<
 *       bool acceptor=False, bool show_weight_one=False,
 *       missing_sym="") except *:
 */
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_osymbols = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *)Py_None);
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_ssymbols = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *)Py_None);

  /* "fstlib/cext/pywrapfst.pyx":1852
 *   cpdef string print(self, SymbolTableView isymbols=None,
 *       SymbolTableView osymbols=None, SymbolTableView ssymbols=None,
 *       bool acceptor=False, bool show_weight_one=False,             # <<<<<<<<<<<<<<
 *       missing_sym="") except *:
 *     """
 */
  bool __pyx_v_acceptor = ((bool)0);
  bool __pyx_v_show_weight_one = ((bool)0);
  PyObject *__pyx_v_missing_sym = ((PyObject *)__pyx_kp_u__11);
  fst::SymbolTable const *__pyx_v__isymbols;
  fst::SymbolTable const *__pyx_v__osymbols;
  fst::SymbolTable const *__pyx_v__ssymbols;
  std::stringstream __pyx_v__sstrm;
  std::string __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  std::string __pyx_t_9;
  int __pyx_t_10;
  int __pyx_t_11;
  fst::SymbolTable const *__pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("print", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_isymbols = __pyx_optional_args->isymbols;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_osymbols = __pyx_optional_args->osymbols;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_ssymbols = __pyx_optional_args->ssymbols;
          if (__pyx_optional_args->__pyx_n > 3) {
            __pyx_v_acceptor = __pyx_optional_args->acceptor;
            if (__pyx_optional_args->__pyx_n > 4) {
              __pyx_v_show_weight_one = __pyx_optional_args->show_weight_one;
              if (__pyx_optional_args->__pyx_n > 5) {
                __pyx_v_missing_sym = __pyx_optional_args->missing_sym;
              }
            }
          }
        }
      }
    }
  }

  /* "fstlib/cext/pywrapfst.pyx":1850
 *     return _init_FstSymbolTableView(self._fst, input_side=False)
 * 
 *   cpdef string print(self, SymbolTableView isymbols=None,             # <<<<<<<<<<<<<<
 *       SymbolTableView osymbols=None, SymbolTableView ssymbols=None,
 *       bool acceptor=False, bool show_weight_one=False,
 */
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_print); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1850, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_33print)) {
        __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_acceptor); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1850, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_show_weight_one); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1850, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_5 = __pyx_t_1; __pyx_t_6 = NULL;
        __pyx_t_7 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
          __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
          if (likely(__pyx_t_6)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
            __Pyx_INCREF(__pyx_t_6);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_5, function);
            __pyx_t_7 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_5)) {
          PyObject *__pyx_temp[7] = {__pyx_t_6, ((PyObject *)__pyx_v_isymbols), ((PyObject *)__pyx_v_osymbols), ((PyObject *)__pyx_v_ssymbols), __pyx_t_3, __pyx_t_4, __pyx_v_missing_sym};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 6+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1850, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
          PyObject *__pyx_temp[7] = {__pyx_t_6, ((PyObject *)__pyx_v_isymbols), ((PyObject *)__pyx_v_osymbols), ((PyObject *)__pyx_v_ssymbols), __pyx_t_3, __pyx_t_4, __pyx_v_missing_sym};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 6+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1850, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        {
          __pyx_t_8 = PyTuple_New(6+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1850, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          if (__pyx_t_6) {
            __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
          }
          __Pyx_INCREF(((PyObject *)__pyx_v_isymbols));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_isymbols));
          PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, ((PyObject *)__pyx_v_isymbols));
          __Pyx_INCREF(((PyObject *)__pyx_v_osymbols));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_osymbols));
          PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, ((PyObject *)__pyx_v_osymbols));
          __Pyx_INCREF(((PyObject *)__pyx_v_ssymbols));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_ssymbols));
          PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_7, ((PyObject *)__pyx_v_ssymbols));
          __Pyx_GIVEREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_8, 3+__pyx_t_7, __pyx_t_3);
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_8, 4+__pyx_t_7, __pyx_t_4);
          __Pyx_INCREF(__pyx_v_missing_sym);
          __Pyx_GIVEREF(__pyx_v_missing_sym);
          PyTuple_SET_ITEM(__pyx_t_8, 5+__pyx_t_7, __pyx_v_missing_sym);
          __pyx_t_3 = 0;
          __pyx_t_4 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1850, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        }
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_9 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1850, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_9;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "fstlib/cext/pywrapfst.pyx":1876
 *     """
 *     # Prints FST to stringstream, then returns resulting string.
 *     cdef const fst.SymbolTable *_isymbols = self._fst.get().InputSymbols()             # <<<<<<<<<<<<<<
 *     if isymbols is not None:
 *        _isymbols = isymbols._raw_ptr_or_raise()
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 1876, __pyx_L1_error)
  }
  __pyx_v__isymbols = __pyx_v_self->_fst.get()->InputSymbols();

  /* "fstlib/cext/pywrapfst.pyx":1877
 *     # Prints FST to stringstream, then returns resulting string.
 *     cdef const fst.SymbolTable *_isymbols = self._fst.get().InputSymbols()
 *     if isymbols is not None:             # <<<<<<<<<<<<<<
 *        _isymbols = isymbols._raw_ptr_or_raise()
 *     cdef const fst.SymbolTable *_osymbols = self._fst.get().OutputSymbols()
 */
  __pyx_t_10 = (((PyObject *)__pyx_v_isymbols) != Py_None);
  __pyx_t_11 = (__pyx_t_10 != 0);
  if (__pyx_t_11) {

    /* "fstlib/cext/pywrapfst.pyx":1878
 *     cdef const fst.SymbolTable *_isymbols = self._fst.get().InputSymbols()
 *     if isymbols is not None:
 *        _isymbols = isymbols._raw_ptr_or_raise()             # <<<<<<<<<<<<<<
 *     cdef const fst.SymbolTable *_osymbols = self._fst.get().OutputSymbols()
 *     if osymbols is not None:
 */
    if (unlikely(((PyObject *)__pyx_v_isymbols) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raw_ptr_or_raise");
      __PYX_ERR(0, 1878, __pyx_L1_error)
    }
    __pyx_t_12 = ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_SymbolTableView *)__pyx_v_isymbols->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_isymbols); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1878, __pyx_L1_error)
    __pyx_v__isymbols = __pyx_t_12;

    /* "fstlib/cext/pywrapfst.pyx":1877
 *     # Prints FST to stringstream, then returns resulting string.
 *     cdef const fst.SymbolTable *_isymbols = self._fst.get().InputSymbols()
 *     if isymbols is not None:             # <<<<<<<<<<<<<<
 *        _isymbols = isymbols._raw_ptr_or_raise()
 *     cdef const fst.SymbolTable *_osymbols = self._fst.get().OutputSymbols()
 */
  }

  /* "fstlib/cext/pywrapfst.pyx":1879
 *     if isymbols is not None:
 *        _isymbols = isymbols._raw_ptr_or_raise()
 *     cdef const fst.SymbolTable *_osymbols = self._fst.get().OutputSymbols()             # <<<<<<<<<<<<<<
 *     if osymbols is not None:
 *        _osymbols = osymbols._raw_ptr_or_raise()
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 1879, __pyx_L1_error)
  }
  __pyx_v__osymbols = __pyx_v_self->_fst.get()->OutputSymbols();

  /* "fstlib/cext/pywrapfst.pyx":1880
 *        _isymbols = isymbols._raw_ptr_or_raise()
 *     cdef const fst.SymbolTable *_osymbols = self._fst.get().OutputSymbols()
 *     if osymbols is not None:             # <<<<<<<<<<<<<<
 *        _osymbols = osymbols._raw_ptr_or_raise()
 *     cdef const fst.SymbolTable *_ssymbols = NULL
 */
  __pyx_t_11 = (((PyObject *)__pyx_v_osymbols) != Py_None);
  __pyx_t_10 = (__pyx_t_11 != 0);
  if (__pyx_t_10) {

    /* "fstlib/cext/pywrapfst.pyx":1881
 *     cdef const fst.SymbolTable *_osymbols = self._fst.get().OutputSymbols()
 *     if osymbols is not None:
 *        _osymbols = osymbols._raw_ptr_or_raise()             # <<<<<<<<<<<<<<
 *     cdef const fst.SymbolTable *_ssymbols = NULL
 *     if ssymbols is not None:
 */
    if (unlikely(((PyObject *)__pyx_v_osymbols) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raw_ptr_or_raise");
      __PYX_ERR(0, 1881, __pyx_L1_error)
    }
    __pyx_t_12 = ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_SymbolTableView *)__pyx_v_osymbols->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_osymbols); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1881, __pyx_L1_error)
    __pyx_v__osymbols = __pyx_t_12;

    /* "fstlib/cext/pywrapfst.pyx":1880
 *        _isymbols = isymbols._raw_ptr_or_raise()
 *     cdef const fst.SymbolTable *_osymbols = self._fst.get().OutputSymbols()
 *     if osymbols is not None:             # <<<<<<<<<<<<<<
 *        _osymbols = osymbols._raw_ptr_or_raise()
 *     cdef const fst.SymbolTable *_ssymbols = NULL
 */
  }

  /* "fstlib/cext/pywrapfst.pyx":1882
 *     if osymbols is not None:
 *        _osymbols = osymbols._raw_ptr_or_raise()
 *     cdef const fst.SymbolTable *_ssymbols = NULL             # <<<<<<<<<<<<<<
 *     if ssymbols is not None:
 *       _ssymbols = ssymbols._raw_ptr_or_raise()
 */
  __pyx_v__ssymbols = NULL;

  /* "fstlib/cext/pywrapfst.pyx":1883
 *        _osymbols = osymbols._raw_ptr_or_raise()
 *     cdef const fst.SymbolTable *_ssymbols = NULL
 *     if ssymbols is not None:             # <<<<<<<<<<<<<<
 *       _ssymbols = ssymbols._raw_ptr_or_raise()
 *     cdef stringstream _sstrm
 */
  __pyx_t_10 = (((PyObject *)__pyx_v_ssymbols) != Py_None);
  __pyx_t_11 = (__pyx_t_10 != 0);
  if (__pyx_t_11) {

    /* "fstlib/cext/pywrapfst.pyx":1884
 *     cdef const fst.SymbolTable *_ssymbols = NULL
 *     if ssymbols is not None:
 *       _ssymbols = ssymbols._raw_ptr_or_raise()             # <<<<<<<<<<<<<<
 *     cdef stringstream _sstrm
 *     fst.Print(deref(self._fst),
 */
    if (unlikely(((PyObject *)__pyx_v_ssymbols) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raw_ptr_or_raise");
      __PYX_ERR(0, 1884, __pyx_L1_error)
    }
    __pyx_t_12 = ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_SymbolTableView *)__pyx_v_ssymbols->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_ssymbols); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1884, __pyx_L1_error)
    __pyx_v__ssymbols = __pyx_t_12;

    /* "fstlib/cext/pywrapfst.pyx":1883
 *        _osymbols = osymbols._raw_ptr_or_raise()
 *     cdef const fst.SymbolTable *_ssymbols = NULL
 *     if ssymbols is not None:             # <<<<<<<<<<<<<<
 *       _ssymbols = ssymbols._raw_ptr_or_raise()
 *     cdef stringstream _sstrm
 */
  }

  /* "fstlib/cext/pywrapfst.pyx":1886
 *       _ssymbols = ssymbols._raw_ptr_or_raise()
 *     cdef stringstream _sstrm
 *     fst.Print(deref(self._fst),             # <<<<<<<<<<<<<<
 *               _sstrm,
 *               b"<pywrapfst>",
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 1886, __pyx_L1_error)
  }

  /* "fstlib/cext/pywrapfst.pyx":1894
 *               acceptor,
 *               show_weight_one,
 *               tostring(missing_sym))             # <<<<<<<<<<<<<<
 *     return _sstrm.str()
 * 
 */
  __pyx_t_9 = __pyx_f_6fstlib_4cext_9pywrapfst_tostring(__pyx_v_missing_sym); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1894, __pyx_L1_error)

  /* "fstlib/cext/pywrapfst.pyx":1886
 *       _ssymbols = ssymbols._raw_ptr_or_raise()
 *     cdef stringstream _sstrm
 *     fst.Print(deref(self._fst),             # <<<<<<<<<<<<<<
 *               _sstrm,
 *               b"<pywrapfst>",
 */
  fst::script::Print((*__pyx_v_self->_fst), __pyx_v__sstrm, __pyx_k_pywrapfst, __pyx_v__isymbols, __pyx_v__osymbols, __pyx_v__ssymbols, __pyx_v_acceptor, __pyx_v_show_weight_one, __pyx_t_9);

  /* "fstlib/cext/pywrapfst.pyx":1895
 *               show_weight_one,
 *               tostring(missing_sym))
 *     return _sstrm.str()             # <<<<<<<<<<<<<<
 * 
 *   def properties(self, mask, bool test):
 */
  __pyx_r = __pyx_v__sstrm.str();
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":1850
 *     return _init_FstSymbolTableView(self._fst, input_side=False)
 * 
 *   cpdef string print(self, SymbolTableView isymbols=None,             # <<<<<<<<<<<<<<
 *       SymbolTableView osymbols=None, SymbolTableView ssymbols=None,
 *       bool acceptor=False, bool show_weight_one=False,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.Fst.print", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_33print(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_3Fst_32print[] = "\n    print(self, isymbols=None, osymbols=None, ssymbols=None, acceptor=False,\n          show_weight_one=False, missing_sym=\"\")\n\n    Produces a human-readable string representation of the FST.\n\n    This method generates a human-readable string representation of the FST.\n    The caller may optionally specify SymbolTables used to label input labels,\n    output labels, or state labels, respectively.\n\n    Args:\n      isymbols: An optional symbol table used to label input symbols.\n      osymbols: An optional symbol table used to label output symbols.\n      ssymbols: An optional symbol table used to label states.\n      acceptor: Should the FST be rendered in acceptor format if possible?\n      show_weight_one: Should weights equivalent to semiring One be printed?\n      missing_symbol: The string to be printed when symbol table lookup fails.\n\n    Returns:\n      A formatted string representing the machine.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_33print(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_isymbols = 0;
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_osymbols = 0;
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_ssymbols = 0;
  bool __pyx_v_acceptor;
  bool __pyx_v_show_weight_one;
  PyObject *__pyx_v_missing_sym = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("print (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_isymbols,&__pyx_n_s_osymbols,&__pyx_n_s_ssymbols,&__pyx_n_s_acceptor,&__pyx_n_s_show_weight_one,&__pyx_n_s_missing_sym,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    values[0] = (PyObject *)((struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *)Py_None);

    /* "fstlib/cext/pywrapfst.pyx":1851
 * 
 *   cpdef string print(self, SymbolTableView isymbols=None,
 *       SymbolTableView osymbols=None, SymbolTableView ssymbols=None,             # <<<<<<<<<<<<<<
 *       bool acceptor=False, bool show_weight_one=False,
 *       missing_sym="") except *:
 */
    values[1] = (PyObject *)((struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *)Py_None);
    values[2] = (PyObject *)((struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *)Py_None);
    values[5] = ((PyObject *)__pyx_kp_u__11);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_isymbols);
          if (value) { values[0] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_osymbols);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ssymbols);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_acceptor);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_show_weight_one);
          if (value) { values[4] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_missing_sym);
          if (value) { values[5] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "print") < 0)) __PYX_ERR(0, 1850, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_isymbols = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *)values[0]);
    __pyx_v_osymbols = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *)values[1]);
    __pyx_v_ssymbols = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *)values[2]);
    if (values[3]) {
      __pyx_v_acceptor = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_acceptor == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1852, __pyx_L3_error)
    } else {

      /* "fstlib/cext/pywrapfst.pyx":1852
 *   cpdef string print(self, SymbolTableView isymbols=None,
 *       SymbolTableView osymbols=None, SymbolTableView ssymbols=None,
 *       bool acceptor=False, bool show_weight_one=False,             # <<<<<<<<<<<<<<
 *       missing_sym="") except *:
 *     """
 */
      __pyx_v_acceptor = ((bool)0);
    }
    if (values[4]) {
      __pyx_v_show_weight_one = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_show_weight_one == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1852, __pyx_L3_error)
    } else {
      __pyx_v_show_weight_one = ((bool)0);
    }
    __pyx_v_missing_sym = values[5];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("print", 0, 0, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1850, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.Fst.print", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_isymbols), __pyx_ptype_6fstlib_4cext_9pywrapfst_SymbolTableView, 1, "isymbols", 0))) __PYX_ERR(0, 1850, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_osymbols), __pyx_ptype_6fstlib_4cext_9pywrapfst_SymbolTableView, 1, "osymbols", 0))) __PYX_ERR(0, 1851, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ssymbols), __pyx_ptype_6fstlib_4cext_9pywrapfst_SymbolTableView, 1, "ssymbols", 0))) __PYX_ERR(0, 1851, __pyx_L1_error)
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_3Fst_32print(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *)__pyx_v_self), __pyx_v_isymbols, __pyx_v_osymbols, __pyx_v_ssymbols, __pyx_v_acceptor, __pyx_v_show_weight_one, __pyx_v_missing_sym);

  /* "fstlib/cext/pywrapfst.pyx":1850
 *     return _init_FstSymbolTableView(self._fst, input_side=False)
 * 
 *   cpdef string print(self, SymbolTableView isymbols=None,             # <<<<<<<<<<<<<<
 *       SymbolTableView osymbols=None, SymbolTableView ssymbols=None,
 *       bool acceptor=False, bool show_weight_one=False,
 */

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_3Fst_32print(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_isymbols, struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_osymbols, struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_ssymbols, bool __pyx_v_acceptor, bool __pyx_v_show_weight_one, PyObject *__pyx_v_missing_sym) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_3Fst_print __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("print", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 6;
  __pyx_t_2.isymbols = __pyx_v_isymbols;
  __pyx_t_2.osymbols = __pyx_v_osymbols;
  __pyx_t_2.ssymbols = __pyx_v_ssymbols;
  __pyx_t_2.acceptor = __pyx_v_acceptor;
  __pyx_t_2.show_weight_one = __pyx_v_show_weight_one;
  __pyx_t_2.missing_sym = __pyx_v_missing_sym;
  __pyx_t_1 = __pyx_vtabptr_6fstlib_4cext_9pywrapfst_Fst->print(__pyx_v_self, 1, &__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1850, __pyx_L1_error)
  __pyx_t_3 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1850, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.Fst.print", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":1897
 *     return _sstrm.str()
 * 
 *   def properties(self, mask, bool test):             # <<<<<<<<<<<<<<
 *     """
 *     properties(self, mask, test)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_35properties(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_3Fst_34properties[] = "\n    properties(self, mask, test)\n\n    Provides property bits.\n\n    This method provides user access to the properties attributes for the FST.\n    The resulting value is a long integer, but when it is cast to a boolean,\n    it represents whether or not the FST has the `mask` property.\n\n    Args:\n      mask: The property mask to be compared to the FST's properties.\n      test: Should any unknown values be computed before comparing against\n          the mask?\n\n    Returns:\n      A FstProperties representing a 64-bit bitmask of the requested properties.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_35properties(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_mask = 0;
  bool __pyx_v_test;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("properties (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mask,&__pyx_n_s_test,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_test)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("properties", 1, 2, 2, 1); __PYX_ERR(0, 1897, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "properties") < 0)) __PYX_ERR(0, 1897, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_mask = values[0];
    __pyx_v_test = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_test == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1897, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("properties", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1897, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.Fst.properties", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_3Fst_34properties(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *)__pyx_v_self), __pyx_v_mask, __pyx_v_test);

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_3Fst_34properties(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_self, PyObject *__pyx_v_mask, bool __pyx_v_test) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  uint64 __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("properties", 0);

  /* "fstlib/cext/pywrapfst.pyx":1915
 *       A FstProperties representing a 64-bit bitmask of the requested properties.
 *     """
 *     return FstProperties(self._fst.get().Properties(mask.value, test))             # <<<<<<<<<<<<<<
 * 
 *   @classmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FstProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1915, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 1915, __pyx_L1_error)
  }
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_mask, __pyx_n_s_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1915, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyInt_As_uint64_t(__pyx_t_3); if (unlikely((__pyx_t_4 == ((uint64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1915, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyInt_From_uint64_t(__pyx_v_self->_fst.get()->Properties(__pyx_t_4, __pyx_v_test)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1915, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1915, __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;

  /* "fstlib/cext/pywrapfst.pyx":1897
 *     return _sstrm.str()
 * 
 *   def properties(self, mask, bool test):             # <<<<<<<<<<<<<<
 *     """
 *     properties(self, mask, test)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.Fst.properties", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":1918
 * 
 *   @classmethod
 *   def read(cls, source):             # <<<<<<<<<<<<<<
 *     """
 *     read(source)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_37read(PyObject *__pyx_v_cls, PyObject *__pyx_v_source); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_3Fst_36read[] = "\n    read(source)\n\n    Reads an FST from a file.\n\n    Args:\n      source: The string location of the input file.\n\n    Returns:\n      An FST object.\n\n    Raises:\n      FstIOError: Read failed.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_37read(PyObject *__pyx_v_cls, PyObject *__pyx_v_source) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("read (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_3Fst_36read(((PyTypeObject*)__pyx_v_cls), ((PyObject *)__pyx_v_source));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_3Fst_36read(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_source) {
  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("read", 0);

  /* "fstlib/cext/pywrapfst.pyx":1933
 *       FstIOError: Read failed.
 *     """
 *     return _read_Fst(source)             # <<<<<<<<<<<<<<
 * 
 *   @classmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_6fstlib_4cext_9pywrapfst__read_Fst(__pyx_v_source, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1933, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":1918
 * 
 *   @classmethod
 *   def read(cls, source):             # <<<<<<<<<<<<<<
 *     """
 *     read(source)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.Fst.read", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":1936
 * 
 *   @classmethod
 *   def read_from_string(cls, state):             # <<<<<<<<<<<<<<
 *     """
 *     read_from_string(state)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_39read_from_string(PyObject *__pyx_v_cls, PyObject *__pyx_v_state); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_3Fst_38read_from_string[] = "\n    read_from_string(state)\n\n    Reads an FST from a serialized string.\n\n    Args:\n      state: A string containing the serialized FST.\n\n    Returns:\n      An FST object.\n\n    Raises:\n      FstIOError: Read failed.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_39read_from_string(PyObject *__pyx_v_cls, PyObject *__pyx_v_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("read_from_string (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_3Fst_38read_from_string(((PyTypeObject*)__pyx_v_cls), ((PyObject *)__pyx_v_state));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_3Fst_38read_from_string(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("read_from_string", 0);

  /* "fstlib/cext/pywrapfst.pyx":1951
 *       FstIOError: Read failed.
 *     """
 *     return _read_Fst_from_string(state)             # <<<<<<<<<<<<<<
 * 
 *   cpdef int64 start(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_v_state); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1951, __pyx_L1_error)
  __pyx_t_2 = ((PyObject *)__pyx_f_6fstlib_4cext_9pywrapfst__read_Fst_from_string(__pyx_t_1, 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1951, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":1936
 * 
 *   @classmethod
 *   def read_from_string(cls, state):             # <<<<<<<<<<<<<<
 *     """
 *     read_from_string(state)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.Fst.read_from_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":1953
 *     return _read_Fst_from_string(state)
 * 
 *   cpdef int64 start(self):             # <<<<<<<<<<<<<<
 *     """
 *     start(self)
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_41start(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static int64 __pyx_f_6fstlib_4cext_9pywrapfst_3Fst_start(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_self, int __pyx_skip_dispatch) {
  int64 __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int64 __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("start", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1953, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_41start)) {
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1953, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_5 = __Pyx_PyInt_As_int64_t(__pyx_t_2); if (unlikely((__pyx_t_5 == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1953, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_5;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "fstlib/cext/pywrapfst.pyx":1959
 *     Returns the start state.
 *     """
 *     return self._fst.get().Start()             # <<<<<<<<<<<<<<
 * 
 *   cpdef _StateIterator states(self):
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 1959, __pyx_L1_error)
  }
  __pyx_r = __pyx_v_self->_fst.get()->Start();
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":1953
 *     return _read_Fst_from_string(state)
 * 
 *   cpdef int64 start(self):             # <<<<<<<<<<<<<<
 *     """
 *     start(self)
 */

  /* 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_WriteUnraisable("fstlib.cext.pywrapfst.Fst.start", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_41start(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_3Fst_40start[] = "\n    start(self)\n\n    Returns the start state.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_41start(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("start (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_3Fst_40start(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_3Fst_40start(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__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("start", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_f_6fstlib_4cext_9pywrapfst_3Fst_start(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1953, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.Fst.start", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":1961
 *     return self._fst.get().Start()
 * 
 *   cpdef _StateIterator states(self):             # <<<<<<<<<<<<<<
 *     """
 *     states(self)
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_43states(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static struct __pyx_obj_6fstlib_4cext_9pywrapfst__StateIterator *__pyx_f_6fstlib_4cext_9pywrapfst_3Fst_states(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_self, int __pyx_skip_dispatch) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst__StateIterator *__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("states", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_states); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1961, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_43states)) {
        __Pyx_XDECREF(((PyObject *)__pyx_r));
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1961, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_6fstlib_4cext_9pywrapfst__StateIterator))))) __PYX_ERR(0, 1961, __pyx_L1_error)
        __pyx_r = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst__StateIterator *)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "fstlib/cext/pywrapfst.pyx":1970
 *       A _StateIterator object for the FST.
 *     """
 *     return _StateIterator(self)             # <<<<<<<<<<<<<<
 * 
 *   cpdef bool verify(self):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_6fstlib_4cext_9pywrapfst__StateIterator), ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1970, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst__StateIterator *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":1961
 *     return self._fst.get().Start()
 * 
 *   cpdef _StateIterator states(self):             # <<<<<<<<<<<<<<
 *     """
 *     states(self)
 */

  /* 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("fstlib.cext.pywrapfst.Fst.states", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_43states(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_3Fst_42states[] = "\n    states(self)\n\n    Returns an iterator over all states in the FST.\n\n    Returns:\n      A _StateIterator object for the FST.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_43states(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("states (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_3Fst_42states(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_3Fst_42states(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__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("states", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_6fstlib_4cext_9pywrapfst_3Fst_states(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1961, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.Fst.states", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":1972
 *     return _StateIterator(self)
 * 
 *   cpdef bool verify(self):             # <<<<<<<<<<<<<<
 *     """
 *     verify(self)
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_45verify(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static bool __pyx_f_6fstlib_4cext_9pywrapfst_3Fst_verify(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_self, int __pyx_skip_dispatch) {
  bool __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  bool __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("verify", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_verify); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1972, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_45verify)) {
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1972, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1972, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_5;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "fstlib/cext/pywrapfst.pyx":1981
 *       True if the contents are sane, False otherwise.
 *     """
 *     return fst.Verify(deref(self._fst))             # <<<<<<<<<<<<<<
 * 
 *   cpdef string weight_type(self):
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 1981, __pyx_L1_error)
  }
  __pyx_r = fst::script::Verify((*__pyx_v_self->_fst));
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":1972
 *     return _StateIterator(self)
 * 
 *   cpdef bool verify(self):             # <<<<<<<<<<<<<<
 *     """
 *     verify(self)
 */

  /* 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_WriteUnraisable("fstlib.cext.pywrapfst.Fst.verify", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_45verify(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_3Fst_44verify[] = "\n    verify(self)\n\n    Verifies that an FST's contents are sane.\n\n    Returns:\n      True if the contents are sane, False otherwise.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_45verify(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("verify (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_3Fst_44verify(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_3Fst_44verify(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__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("verify", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_6fstlib_4cext_9pywrapfst_3Fst_verify(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1972, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.Fst.verify", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":1983
 *     return fst.Verify(deref(self._fst))
 * 
 *   cpdef string weight_type(self):             # <<<<<<<<<<<<<<
 *     """
 *     weight_type(self)
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_47weight_type(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static std::string __pyx_f_6fstlib_4cext_9pywrapfst_3Fst_weight_type(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_self, int __pyx_skip_dispatch) {
  std::string __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  std::string __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("weight_type", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_weight_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1983, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_47weight_type)) {
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1983, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1983, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_5;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "fstlib/cext/pywrapfst.pyx":1992
 *       A string representing the weight type.
 *     """
 *     return self._fst.get().WeightType()             # <<<<<<<<<<<<<<
 * 
 *   cpdef void write(self, source) except *:
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 1992, __pyx_L1_error)
  }
  __pyx_r = __pyx_v_self->_fst.get()->WeightType();
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":1983
 *     return fst.Verify(deref(self._fst))
 * 
 *   cpdef string weight_type(self):             # <<<<<<<<<<<<<<
 *     """
 *     weight_type(self)
 */

  /* 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_WriteUnraisable("fstlib.cext.pywrapfst.Fst.weight_type", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_47weight_type(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_3Fst_46weight_type[] = "\n    weight_type(self)\n\n    Provides the FST's weight type.\n\n    Returns:\n      A string representing the weight type.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_47weight_type(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("weight_type (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_3Fst_46weight_type(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_3Fst_46weight_type(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__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("weight_type", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_f_6fstlib_4cext_9pywrapfst_3Fst_weight_type(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1983, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.Fst.weight_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":1994
 *     return self._fst.get().WeightType()
 * 
 *   cpdef void write(self, source) except *:             # <<<<<<<<<<<<<<
 *     """
 *     write(self, source)
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_49write(PyObject *__pyx_v_self, PyObject *__pyx_v_source); /*proto*/
static void __pyx_f_6fstlib_4cext_9pywrapfst_3Fst_write(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_self, PyObject *__pyx_v_source, int __pyx_skip_dispatch) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  std::string __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("write", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_write); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1994, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_49write)) {
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_source) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_source);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1994, __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;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "fstlib/cext/pywrapfst.pyx":2008
 *       FstIOError: Write failed.
 *     """
 *     if not self._fst.get().Write(path_tostring(source)):             # <<<<<<<<<<<<<<
 *       raise FstIOError(f"Write failed: {source!r}")
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 2008, __pyx_L1_error)
  }
  __pyx_t_5 = __pyx_f_6fstlib_4cext_9pywrapfst_path_tostring(__pyx_v_source); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2008, __pyx_L1_error)
  __pyx_t_6 = ((!(__pyx_v_self->_fst.get()->Write(__pyx_t_5) != 0)) != 0);
  if (unlikely(__pyx_t_6)) {

    /* "fstlib/cext/pywrapfst.pyx":2009
 *     """
 *     if not self._fst.get().Write(path_tostring(source)):
 *       raise FstIOError(f"Write failed: {source!r}")             # <<<<<<<<<<<<<<
 * 
 *   cpdef bytes write_to_string(self):
 */
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FstIOError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2009, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_source), __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2009, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Write_failed, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2009, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_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_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2009, __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(0, 2009, __pyx_L1_error)

    /* "fstlib/cext/pywrapfst.pyx":2008
 *       FstIOError: Write failed.
 *     """
 *     if not self._fst.get().Write(path_tostring(source)):             # <<<<<<<<<<<<<<
 *       raise FstIOError(f"Write failed: {source!r}")
 * 
 */
  }

  /* "fstlib/cext/pywrapfst.pyx":1994
 *     return self._fst.get().WeightType()
 * 
 *   cpdef void write(self, source) except *:             # <<<<<<<<<<<<<<
 *     """
 *     write(self, source)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.Fst.write", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_49write(PyObject *__pyx_v_self, PyObject *__pyx_v_source); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_3Fst_48write[] = "\n    write(self, source)\n\n    Serializes FST to a file.\n\n    This method writes the FST to a file in a binary format.\n\n    Args:\n      source: The string location of the output file.\n\n    Raises:\n      FstIOError: Write failed.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_49write(PyObject *__pyx_v_self, PyObject *__pyx_v_source) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("write (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_3Fst_48write(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *)__pyx_v_self), ((PyObject *)__pyx_v_source));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_3Fst_48write(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_self, PyObject *__pyx_v_source) {
  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("write", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_6fstlib_4cext_9pywrapfst_3Fst_write(__pyx_v_self, __pyx_v_source, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1994, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1994, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.Fst.write", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":2011
 *       raise FstIOError(f"Write failed: {source!r}")
 * 
 *   cpdef bytes write_to_string(self):             # <<<<<<<<<<<<<<
 *     """
 *     write_to_string(self)
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_51write_to_string(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_6fstlib_4cext_9pywrapfst_3Fst_write_to_string(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_self, int __pyx_skip_dispatch) {
  std::stringstream __pyx_v__sstrm;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("write_to_string", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_write_to_string); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2011, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_51write_to_string)) {
        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2011, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (!(likely(PyBytes_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 2011, __pyx_L1_error)
        __pyx_r = ((PyObject*)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "fstlib/cext/pywrapfst.pyx":2024
 *     """
 *     cdef stringstream _sstrm
 *     if not self._fst.get().Write(_sstrm, b"<pywrapfst>"):             # <<<<<<<<<<<<<<
 *       raise FstIOError("Write to string failed")
 *     return _sstrm.str()
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 2024, __pyx_L1_error)
  }
  __pyx_t_5 = ((!(__pyx_v_self->_fst.get()->Write(__pyx_v__sstrm, __pyx_k_pywrapfst) != 0)) != 0);
  if (unlikely(__pyx_t_5)) {

    /* "fstlib/cext/pywrapfst.pyx":2025
 *     cdef stringstream _sstrm
 *     if not self._fst.get().Write(_sstrm, b"<pywrapfst>"):
 *       raise FstIOError("Write to string failed")             # <<<<<<<<<<<<<<
 *     return _sstrm.str()
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FstIOError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2025, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_kp_u_Write_to_string_failed) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_u_Write_to_string_failed);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2025, __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(0, 2025, __pyx_L1_error)

    /* "fstlib/cext/pywrapfst.pyx":2024
 *     """
 *     cdef stringstream _sstrm
 *     if not self._fst.get().Write(_sstrm, b"<pywrapfst>"):             # <<<<<<<<<<<<<<
 *       raise FstIOError("Write to string failed")
 *     return _sstrm.str()
 */
  }

  /* "fstlib/cext/pywrapfst.pyx":2026
 *     if not self._fst.get().Write(_sstrm, b"<pywrapfst>"):
 *       raise FstIOError("Write to string failed")
 *     return _sstrm.str()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v__sstrm.str()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2026, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":2011
 *       raise FstIOError(f"Write failed: {source!r}")
 * 
 *   cpdef bytes write_to_string(self):             # <<<<<<<<<<<<<<
 *     """
 *     write_to_string(self)
 */

  /* 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("fstlib.cext.pywrapfst.Fst.write_to_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_51write_to_string(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_3Fst_50write_to_string[] = "\n    write_to_string(self)\n\n    Serializes FST to a string.\n\n    Returns:\n      A bytestring.\n\n    Raises:\n      FstIOError: Write to string failed.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_51write_to_string(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("write_to_string (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_3Fst_50write_to_string(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_3Fst_50write_to_string(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__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("write_to_string", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6fstlib_4cext_9pywrapfst_3Fst_write_to_string(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2011, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.Fst.write_to_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":2039
 *   """
 * 
 *   cdef void _check_mutating_imethod(self) except *:             # <<<<<<<<<<<<<<
 *     """Checks whether an operation mutating the FST has produced an error.
 * 
 */

static void __pyx_f_6fstlib_4cext_9pywrapfst_10MutableFst__check_mutating_imethod(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  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("_check_mutating_imethod", 0);

  /* "fstlib/cext/pywrapfst.pyx":2044
 *     This function is not visible to Python users.
 *     """
 *     if self._fst.get().Properties(fst.kError, True) == fst.kError:             # <<<<<<<<<<<<<<
 *       raise FstOpError("Operation failed")
 *   cdef void _add_arc(self, int64 state, Arc arc) except *:
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 2044, __pyx_L1_error)
  }
  __pyx_t_1 = ((__pyx_v_self->__pyx_base._fst.get()->Properties(fst::kError, 1) == fst::kError) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "fstlib/cext/pywrapfst.pyx":2045
 *     """
 *     if self._fst.get().Properties(fst.kError, True) == fst.kError:
 *       raise FstOpError("Operation failed")             # <<<<<<<<<<<<<<
 *   cdef void _add_arc(self, int64 state, Arc arc) except *:
 *     if not self._fst.get().ValidStateId(state):
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstOpError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2045, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_kp_u_Operation_failed) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_u_Operation_failed);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2045, __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(0, 2045, __pyx_L1_error)

    /* "fstlib/cext/pywrapfst.pyx":2044
 *     This function is not visible to Python users.
 *     """
 *     if self._fst.get().Properties(fst.kError, True) == fst.kError:             # <<<<<<<<<<<<<<
 *       raise FstOpError("Operation failed")
 *   cdef void _add_arc(self, int64 state, Arc arc) except *:
 */
  }

  /* "fstlib/cext/pywrapfst.pyx":2039
 *   """
 * 
 *   cdef void _check_mutating_imethod(self) except *:             # <<<<<<<<<<<<<<
 *     """Checks whether an operation mutating the FST has produced an error.
 * 
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.MutableFst._check_mutating_imethod", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "fstlib/cext/pywrapfst.pyx":2046
 *     if self._fst.get().Properties(fst.kError, True) == fst.kError:
 *       raise FstOpError("Operation failed")
 *   cdef void _add_arc(self, int64 state, Arc arc) except *:             # <<<<<<<<<<<<<<
 *     if not self._fst.get().ValidStateId(state):
 *       raise FstIndexError("State index out of range")
 */

static void __pyx_f_6fstlib_4cext_9pywrapfst_10MutableFst__add_arc(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, int64 __pyx_v_state, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Arc *__pyx_v_arc) {
  __Pyx_RefNannyDeclarations
  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("_add_arc", 0);

  /* "fstlib/cext/pywrapfst.pyx":2047
 *       raise FstOpError("Operation failed")
 *   cdef void _add_arc(self, int64 state, Arc arc) except *:
 *     if not self._fst.get().ValidStateId(state):             # <<<<<<<<<<<<<<
 *       raise FstIndexError("State index out of range")
 *     if not self._mfst.get().AddArc(state, deref(arc._arc)):
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 2047, __pyx_L1_error)
  }
  __pyx_t_1 = ((!(__pyx_v_self->__pyx_base._fst.get()->ValidStateId(__pyx_v_state) != 0)) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "fstlib/cext/pywrapfst.pyx":2048
 *   cdef void _add_arc(self, int64 state, Arc arc) except *:
 *     if not self._fst.get().ValidStateId(state):
 *       raise FstIndexError("State index out of range")             # <<<<<<<<<<<<<<
 *     if not self._mfst.get().AddArc(state, deref(arc._arc)):
 *       raise FstOpError("Incompatible or invalid weight type")
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2048, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_kp_u_State_index_out_of_range) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_u_State_index_out_of_range);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2048, __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(0, 2048, __pyx_L1_error)

    /* "fstlib/cext/pywrapfst.pyx":2047
 *       raise FstOpError("Operation failed")
 *   cdef void _add_arc(self, int64 state, Arc arc) except *:
 *     if not self._fst.get().ValidStateId(state):             # <<<<<<<<<<<<<<
 *       raise FstIndexError("State index out of range")
 *     if not self._mfst.get().AddArc(state, deref(arc._arc)):
 */
  }

  /* "fstlib/cext/pywrapfst.pyx":2049
 *     if not self._fst.get().ValidStateId(state):
 *       raise FstIndexError("State index out of range")
 *     if not self._mfst.get().AddArc(state, deref(arc._arc)):             # <<<<<<<<<<<<<<
 *       raise FstOpError("Incompatible or invalid weight type")
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
    __PYX_ERR(0, 2049, __pyx_L1_error)
  }
  if (unlikely(((PyObject *)__pyx_v_arc) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_arc");
    __PYX_ERR(0, 2049, __pyx_L1_error)
  }
  __pyx_t_1 = ((!(__pyx_v_self->_mfst.get()->AddArc(__pyx_v_state, (*__pyx_v_arc->_arc)) != 0)) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "fstlib/cext/pywrapfst.pyx":2050
 *       raise FstIndexError("State index out of range")
 *     if not self._mfst.get().AddArc(state, deref(arc._arc)):
 *       raise FstOpError("Incompatible or invalid weight type")             # <<<<<<<<<<<<<<
 * 
 *   def add_arc(self, int64 state, Arc arc):
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstOpError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2050, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_kp_u_Incompatible_or_invalid_weight_t) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_u_Incompatible_or_invalid_weight_t);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2050, __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(0, 2050, __pyx_L1_error)

    /* "fstlib/cext/pywrapfst.pyx":2049
 *     if not self._fst.get().ValidStateId(state):
 *       raise FstIndexError("State index out of range")
 *     if not self._mfst.get().AddArc(state, deref(arc._arc)):             # <<<<<<<<<<<<<<
 *       raise FstOpError("Incompatible or invalid weight type")
 * 
 */
  }

  /* "fstlib/cext/pywrapfst.pyx":2046
 *     if self._fst.get().Properties(fst.kError, True) == fst.kError:
 *       raise FstOpError("Operation failed")
 *   cdef void _add_arc(self, int64 state, Arc arc) except *:             # <<<<<<<<<<<<<<
 *     if not self._fst.get().ValidStateId(state):
 *       raise FstIndexError("State index out of range")
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.MutableFst._add_arc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "fstlib/cext/pywrapfst.pyx":2052
 *       raise FstOpError("Incompatible or invalid weight type")
 * 
 *   def add_arc(self, int64 state, Arc arc):             # <<<<<<<<<<<<<<
 *     """
 *     add_arc(self, state, arc)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_1add_arc(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_10MutableFst_add_arc[] = "\n    add_arc(self, state, arc)\n\n    Adds a new arc to the FST and return self.\n\n    Args:\n      state: The integer index of the source state.\n      arc: The arc to add.\n\n    Returns:\n      self.\n\n    Raises:\n      FstIndexError: State index out of range.\n      FstOpdexError: Incompatible or invalid weight type.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_1add_arc(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int64 __pyx_v_state;
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_Arc *__pyx_v_arc = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("add_arc (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_state,&__pyx_n_s_arc,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_state)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_arc)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("add_arc", 1, 2, 2, 1); __PYX_ERR(0, 2052, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add_arc") < 0)) __PYX_ERR(0, 2052, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_state = __Pyx_PyInt_As_int64_t(values[0]); if (unlikely((__pyx_v_state == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2052, __pyx_L3_error)
    __pyx_v_arc = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Arc *)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("add_arc", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2052, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.MutableFst.add_arc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arc), __pyx_ptype_6fstlib_4cext_9pywrapfst_Arc, 1, "arc", 0))) __PYX_ERR(0, 2052, __pyx_L1_error)
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_10MutableFst_add_arc(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *)__pyx_v_self), __pyx_v_state, __pyx_v_arc);

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_10MutableFst_add_arc(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, int64 __pyx_v_state, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Arc *__pyx_v_arc) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("add_arc", 0);

  /* "fstlib/cext/pywrapfst.pyx":2069
 *       FstOpdexError: Incompatible or invalid weight type.
 *     """
 *     self._add_arc(state, arc)             # <<<<<<<<<<<<<<
 *     return self
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_add_arc");
    __PYX_ERR(0, 2069, __pyx_L1_error)
  }
  ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_add_arc(__pyx_v_self, __pyx_v_state, __pyx_v_arc); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2069, __pyx_L1_error)

  /* "fstlib/cext/pywrapfst.pyx":2070
 *     """
 *     self._add_arc(state, arc)
 *     return self             # <<<<<<<<<<<<<<
 * 
 *   cpdef int64 add_state(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":2052
 *       raise FstOpError("Incompatible or invalid weight type")
 * 
 *   def add_arc(self, int64 state, Arc arc):             # <<<<<<<<<<<<<<
 *     """
 *     add_arc(self, state, arc)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.MutableFst.add_arc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":2072
 *     return self
 * 
 *   cpdef int64 add_state(self):             # <<<<<<<<<<<<<<
 *     """
 *     add_state(self)
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_3add_state(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static int64 __pyx_f_6fstlib_4cext_9pywrapfst_10MutableFst_add_state(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, int __pyx_skip_dispatch) {
  int64 __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int64 __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("add_state", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_state); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2072, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_3add_state)) {
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2072, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_5 = __Pyx_PyInt_As_int64_t(__pyx_t_2); if (unlikely((__pyx_t_5 == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2072, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_5;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "fstlib/cext/pywrapfst.pyx":2081
 *       The integer index of the new state.
 *     """
 *     return self._mfst.get().AddState()             # <<<<<<<<<<<<<<
 * 
 *   cpdef void add_states(self, size_t n):
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
    __PYX_ERR(0, 2081, __pyx_L1_error)
  }
  __pyx_r = __pyx_v_self->_mfst.get()->AddState();
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":2072
 *     return self
 * 
 *   cpdef int64 add_state(self):             # <<<<<<<<<<<<<<
 *     """
 *     add_state(self)
 */

  /* 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_WriteUnraisable("fstlib.cext.pywrapfst.MutableFst.add_state", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_3add_state(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_10MutableFst_2add_state[] = "\n    add_state(self)\n\n    Adds a new state to the FST and returns the state ID.\n\n    Returns:\n      The integer index of the new state.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_3add_state(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("add_state (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_10MutableFst_2add_state(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_10MutableFst_2add_state(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__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("add_state", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_f_6fstlib_4cext_9pywrapfst_10MutableFst_add_state(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2072, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.MutableFst.add_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":2083
 *     return self._mfst.get().AddState()
 * 
 *   cpdef void add_states(self, size_t n):             # <<<<<<<<<<<<<<
 *     """
 *     add_states(self, n)
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_5add_states(PyObject *__pyx_v_self, PyObject *__pyx_arg_n); /*proto*/
static void __pyx_f_6fstlib_4cext_9pywrapfst_10MutableFst_add_states(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, size_t __pyx_v_n, int __pyx_skip_dispatch) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("add_states", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_states); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2083, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_5add_states)) {
        __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2083, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
          if (likely(__pyx_t_5)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
            __Pyx_INCREF(__pyx_t_5);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_4, function);
          }
        }
        __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2083, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "fstlib/cext/pywrapfst.pyx":2092
 *       n: The number of states to add.
 *     """
 *     self._mfst.get().AddStates(n)             # <<<<<<<<<<<<<<
 * 
 *   cdef void _arcsort(self, sort_type="ilabel") except *:
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
    __PYX_ERR(0, 2092, __pyx_L1_error)
  }
  __pyx_v_self->_mfst.get()->AddStates(__pyx_v_n);

  /* "fstlib/cext/pywrapfst.pyx":2083
 *     return self._mfst.get().AddState()
 * 
 *   cpdef void add_states(self, size_t n):             # <<<<<<<<<<<<<<
 *     """
 *     add_states(self, n)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_WriteUnraisable("fstlib.cext.pywrapfst.MutableFst.add_states", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_5add_states(PyObject *__pyx_v_self, PyObject *__pyx_arg_n); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_10MutableFst_4add_states[] = "\n    add_states(self, n)\n\n    Adds n new states to the FST.\n\n    Args:\n      n: The number of states to add.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_5add_states(PyObject *__pyx_v_self, PyObject *__pyx_arg_n) {
  size_t __pyx_v_n;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("add_states (wrapper)", 0);
  assert(__pyx_arg_n); {
    __pyx_v_n = __Pyx_PyInt_As_size_t(__pyx_arg_n); if (unlikely((__pyx_v_n == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2083, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.MutableFst.add_states", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_10MutableFst_4add_states(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *)__pyx_v_self), ((size_t)__pyx_v_n));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_10MutableFst_4add_states(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, size_t __pyx_v_n) {
  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("add_states", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_6fstlib_4cext_9pywrapfst_10MutableFst_add_states(__pyx_v_self, __pyx_v_n, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2083, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.MutableFst.add_states", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":2094
 *     self._mfst.get().AddStates(n)
 * 
 *   cdef void _arcsort(self, sort_type="ilabel") except *:             # <<<<<<<<<<<<<<
 *     cdef fst.ArcSortType _sort_type
 *     if not fst.GetArcSortType(tostring(sort_type), addr(_sort_type)):
 */

static void __pyx_f_6fstlib_4cext_9pywrapfst_10MutableFst__arcsort(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_10MutableFst__arcsort *__pyx_optional_args) {
  PyObject *__pyx_v_sort_type = ((PyObject *)__pyx_n_u_ilabel);
  fst::script::ArcSortType __pyx_v__sort_type;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_arcsort", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_sort_type = __pyx_optional_args->sort_type;
    }
  }

  /* "fstlib/cext/pywrapfst.pyx":2096
 *   cdef void _arcsort(self, sort_type="ilabel") except *:
 *     cdef fst.ArcSortType _sort_type
 *     if not fst.GetArcSortType(tostring(sort_type), addr(_sort_type)):             # <<<<<<<<<<<<<<
 *       raise FstArgError(f"Unknown sort type: {sort_type!r}")
 *     fst.ArcSort(self._mfst.get(), _sort_type)
 */
  __pyx_t_1 = __pyx_f_6fstlib_4cext_9pywrapfst_tostring(__pyx_v_sort_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2096, __pyx_L1_error)
  __pyx_t_2 = ((!(fst::script::GetArcSortType(__pyx_t_1, (&__pyx_v__sort_type)) != 0)) != 0);
  if (unlikely(__pyx_t_2)) {

    /* "fstlib/cext/pywrapfst.pyx":2097
 *     cdef fst.ArcSortType _sort_type
 *     if not fst.GetArcSortType(tostring(sort_type), addr(_sort_type)):
 *       raise FstArgError(f"Unknown sort type: {sort_type!r}")             # <<<<<<<<<<<<<<
 *     fst.ArcSort(self._mfst.get(), _sort_type)
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FstArgError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2097, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_sort_type), __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2097, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Unknown_sort_type, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2097, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_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_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2097, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 2097, __pyx_L1_error)

    /* "fstlib/cext/pywrapfst.pyx":2096
 *   cdef void _arcsort(self, sort_type="ilabel") except *:
 *     cdef fst.ArcSortType _sort_type
 *     if not fst.GetArcSortType(tostring(sort_type), addr(_sort_type)):             # <<<<<<<<<<<<<<
 *       raise FstArgError(f"Unknown sort type: {sort_type!r}")
 *     fst.ArcSort(self._mfst.get(), _sort_type)
 */
  }

  /* "fstlib/cext/pywrapfst.pyx":2098
 *     if not fst.GetArcSortType(tostring(sort_type), addr(_sort_type)):
 *       raise FstArgError(f"Unknown sort type: {sort_type!r}")
 *     fst.ArcSort(self._mfst.get(), _sort_type)             # <<<<<<<<<<<<<<
 * 
 *   def arcsort(self, sort_type="ilabel"):
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
    __PYX_ERR(0, 2098, __pyx_L1_error)
  }
  fst::script::ArcSort(__pyx_v_self->_mfst.get(), __pyx_v__sort_type);

  /* "fstlib/cext/pywrapfst.pyx":2094
 *     self._mfst.get().AddStates(n)
 * 
 *   cdef void _arcsort(self, sort_type="ilabel") except *:             # <<<<<<<<<<<<<<
 *     cdef fst.ArcSortType _sort_type
 *     if not fst.GetArcSortType(tostring(sort_type), addr(_sort_type)):
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.MutableFst._arcsort", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "fstlib/cext/pywrapfst.pyx":2100
 *     fst.ArcSort(self._mfst.get(), _sort_type)
 * 
 *   def arcsort(self, sort_type="ilabel"):             # <<<<<<<<<<<<<<
 *     """
 *     arcsort(self, sort_type="ilabel")
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_7arcsort(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_10MutableFst_6arcsort[] = "\n    arcsort(self, sort_type=\"ilabel\")\n\n    Sorts arcs leaving each state of the FST.\n\n    This operation destructively sorts arcs leaving each state using either\n    input or output labels.\n\n    Args:\n      sort_type: Either \"ilabel\" (sort arcs according to input labels) or\n          \"olabel\" (sort arcs according to output labels).\n\n    Returns:\n      self.\n\n    Raises:\n      FstArgError: Unknown sort type.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_7arcsort(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_sort_type = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("arcsort (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sort_type,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)__pyx_n_u_ilabel);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sort_type);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "arcsort") < 0)) __PYX_ERR(0, 2100, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_sort_type = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("arcsort", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2100, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.MutableFst.arcsort", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_10MutableFst_6arcsort(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *)__pyx_v_self), __pyx_v_sort_type);

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_10MutableFst_6arcsort(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, PyObject *__pyx_v_sort_type) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_10MutableFst__arcsort __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("arcsort", 0);

  /* "fstlib/cext/pywrapfst.pyx":2119
 *       FstArgError: Unknown sort type.
 *     """
 *     self._arcsort(sort_type)             # <<<<<<<<<<<<<<
 *     return self
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_arcsort");
    __PYX_ERR(0, 2119, __pyx_L1_error)
  }
  __pyx_t_1.__pyx_n = 1;
  __pyx_t_1.sort_type = __pyx_v_sort_type;
  ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_arcsort(__pyx_v_self, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2119, __pyx_L1_error)

  /* "fstlib/cext/pywrapfst.pyx":2120
 *     """
 *     self._arcsort(sort_type)
 *     return self             # <<<<<<<<<<<<<<
 * 
 *   cdef void _closure(self, bool closure_plus=False):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":2100
 *     fst.ArcSort(self._mfst.get(), _sort_type)
 * 
 *   def arcsort(self, sort_type="ilabel"):             # <<<<<<<<<<<<<<
 *     """
 *     arcsort(self, sort_type="ilabel")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.MutableFst.arcsort", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":2122
 *     return self
 * 
 *   cdef void _closure(self, bool closure_plus=False):             # <<<<<<<<<<<<<<
 *     fst.Closure(self._mfst.get(), fst.GetClosureType(closure_plus))
 * 
 */

static void __pyx_f_6fstlib_4cext_9pywrapfst_10MutableFst__closure(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_10MutableFst__closure *__pyx_optional_args) {
  bool __pyx_v_closure_plus = ((bool)0);
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_closure", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_closure_plus = __pyx_optional_args->closure_plus;
    }
  }

  /* "fstlib/cext/pywrapfst.pyx":2123
 * 
 *   cdef void _closure(self, bool closure_plus=False):
 *     fst.Closure(self._mfst.get(), fst.GetClosureType(closure_plus))             # <<<<<<<<<<<<<<
 * 
 *   def closure(self, bool closure_plus=False):
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
    __PYX_ERR(0, 2123, __pyx_L1_error)
  }
  fst::script::Closure(__pyx_v_self->_mfst.get(), fst::script::GetClosureType(__pyx_v_closure_plus));

  /* "fstlib/cext/pywrapfst.pyx":2122
 *     return self
 * 
 *   cdef void _closure(self, bool closure_plus=False):             # <<<<<<<<<<<<<<
 *     fst.Closure(self._mfst.get(), fst.GetClosureType(closure_plus))
 * 
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("fstlib.cext.pywrapfst.MutableFst._closure", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "fstlib/cext/pywrapfst.pyx":2125
 *     fst.Closure(self._mfst.get(), fst.GetClosureType(closure_plus))
 * 
 *   def closure(self, bool closure_plus=False):             # <<<<<<<<<<<<<<
 *     """
 *     closure(self, closure_plus=False)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_9closure(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_10MutableFst_8closure[] = "\n    closure(self, closure_plus=False)\n\n    Computes concatenative closure.\n\n    This operation destructively converts the FST to its concatenative closure.\n    If A transduces string x to y with weight a, then the closure transduces x\n    to y with weight a, xx to yy with weight a \\otimes a, xxx to yyy with weight\n    a \\otimes a \\otimes a, and so on. The empty string is also transduced to\n    itself with semiring One if `closure_plus` is False.\n\n    Args:\n      closure_plus: If False, do not accept the empty string.\n\n    Returns:\n      self.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_9closure(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  bool __pyx_v_closure_plus;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("closure (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_closure_plus,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_closure_plus);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "closure") < 0)) __PYX_ERR(0, 2125, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    if (values[0]) {
      __pyx_v_closure_plus = __Pyx_PyObject_IsTrue(values[0]); if (unlikely((__pyx_v_closure_plus == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2125, __pyx_L3_error)
    } else {
      __pyx_v_closure_plus = ((bool)0);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("closure", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2125, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.MutableFst.closure", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_10MutableFst_8closure(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *)__pyx_v_self), __pyx_v_closure_plus);

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_10MutableFst_8closure(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, bool __pyx_v_closure_plus) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_10MutableFst__closure __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("closure", 0);

  /* "fstlib/cext/pywrapfst.pyx":2143
 *       self.
 *     """
 *     self._closure(closure_plus)             # <<<<<<<<<<<<<<
 *     return self
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_closure");
    __PYX_ERR(0, 2143, __pyx_L1_error)
  }
  __pyx_t_1.__pyx_n = 1;
  __pyx_t_1.closure_plus = __pyx_v_closure_plus;
  ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_closure(__pyx_v_self, &__pyx_t_1); 

  /* "fstlib/cext/pywrapfst.pyx":2144
 *     """
 *     self._closure(closure_plus)
 *     return self             # <<<<<<<<<<<<<<
 * 
 *   cdef void _concat(self, Fst fst2) except *:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":2125
 *     fst.Closure(self._mfst.get(), fst.GetClosureType(closure_plus))
 * 
 *   def closure(self, bool closure_plus=False):             # <<<<<<<<<<<<<<
 *     """
 *     closure(self, closure_plus=False)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.MutableFst.closure", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":2146
 *     return self
 * 
 *   cdef void _concat(self, Fst fst2) except *:             # <<<<<<<<<<<<<<
 *     fst.Concat(self._mfst.get(), deref(fst2._fst))
 *     self._check_mutating_imethod()
 */

static void __pyx_f_6fstlib_4cext_9pywrapfst_10MutableFst__concat(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_fst2) {
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_concat", 0);

  /* "fstlib/cext/pywrapfst.pyx":2147
 * 
 *   cdef void _concat(self, Fst fst2) except *:
 *     fst.Concat(self._mfst.get(), deref(fst2._fst))             # <<<<<<<<<<<<<<
 *     self._check_mutating_imethod()
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
    __PYX_ERR(0, 2147, __pyx_L1_error)
  }
  if (unlikely(((PyObject *)__pyx_v_fst2) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 2147, __pyx_L1_error)
  }
  fst::script::Concat(__pyx_v_self->_mfst.get(), (*__pyx_v_fst2->_fst));

  /* "fstlib/cext/pywrapfst.pyx":2148
 *   cdef void _concat(self, Fst fst2) except *:
 *     fst.Concat(self._mfst.get(), deref(fst2._fst))
 *     self._check_mutating_imethod()             # <<<<<<<<<<<<<<
 * 
 *   def concat(self, Fst fst2):
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_check_mutating_imethod");
    __PYX_ERR(0, 2148, __pyx_L1_error)
  }
  ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2148, __pyx_L1_error)

  /* "fstlib/cext/pywrapfst.pyx":2146
 *     return self
 * 
 *   cdef void _concat(self, Fst fst2) except *:             # <<<<<<<<<<<<<<
 *     fst.Concat(self._mfst.get(), deref(fst2._fst))
 *     self._check_mutating_imethod()
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.MutableFst._concat", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "fstlib/cext/pywrapfst.pyx":2150
 *     self._check_mutating_imethod()
 * 
 *   def concat(self, Fst fst2):             # <<<<<<<<<<<<<<
 *     """
 *     concat(self, fst2)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_11concat(PyObject *__pyx_v_self, PyObject *__pyx_v_fst2); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_10MutableFst_10concat[] = "\n    concat(self, fst2)\n\n    Computes the concatenation (product) of two FSTs.\n\n    This operation destructively concatenates the FST with a second FST. If A\n    transduces string x to y with weight a and B transduces string w to v with\n    weight b, then their concatenation transduces string xw to yv with weight a\n    \\otimes b.\n\n    Args:\n      fst2: The second input FST.\n\n    Returns:\n      self.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_11concat(PyObject *__pyx_v_self, PyObject *__pyx_v_fst2) {
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("concat (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fst2), __pyx_ptype_6fstlib_4cext_9pywrapfst_Fst, 1, "fst2", 0))) __PYX_ERR(0, 2150, __pyx_L1_error)
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_10MutableFst_10concat(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *)__pyx_v_self), ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *)__pyx_v_fst2));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_10MutableFst_10concat(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_fst2) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("concat", 0);

  /* "fstlib/cext/pywrapfst.pyx":2167
 *       self.
 *     """
 *     self._concat(fst2)             # <<<<<<<<<<<<<<
 *     return self
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_concat");
    __PYX_ERR(0, 2167, __pyx_L1_error)
  }
  ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_concat(__pyx_v_self, __pyx_v_fst2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2167, __pyx_L1_error)

  /* "fstlib/cext/pywrapfst.pyx":2168
 *     """
 *     self._concat(fst2)
 *     return self             # <<<<<<<<<<<<<<
 * 
 *   cdef void _connect(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":2150
 *     self._check_mutating_imethod()
 * 
 *   def concat(self, Fst fst2):             # <<<<<<<<<<<<<<
 *     """
 *     concat(self, fst2)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.MutableFst.concat", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":2170
 *     return self
 * 
 *   cdef void _connect(self):             # <<<<<<<<<<<<<<
 *     fst.Connect(self._mfst.get())
 * 
 */

static void __pyx_f_6fstlib_4cext_9pywrapfst_10MutableFst__connect(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_connect", 0);

  /* "fstlib/cext/pywrapfst.pyx":2171
 * 
 *   cdef void _connect(self):
 *     fst.Connect(self._mfst.get())             # <<<<<<<<<<<<<<
 * 
 *   def connect(self):
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
    __PYX_ERR(0, 2171, __pyx_L1_error)
  }
  fst::script::Connect(__pyx_v_self->_mfst.get());

  /* "fstlib/cext/pywrapfst.pyx":2170
 *     return self
 * 
 *   cdef void _connect(self):             # <<<<<<<<<<<<<<
 *     fst.Connect(self._mfst.get())
 * 
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("fstlib.cext.pywrapfst.MutableFst._connect", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "fstlib/cext/pywrapfst.pyx":2173
 *     fst.Connect(self._mfst.get())
 * 
 *   def connect(self):             # <<<<<<<<<<<<<<
 *     """
 *     connect(self)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_13connect(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_10MutableFst_12connect[] = "\n    connect(self)\n\n    Removes unsuccessful paths.\n\n    This operation destructively trims the FST, removing states and arcs that\n    are not part of any successful path.\n\n    Returns:\n      self.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_13connect(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("connect (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_10MutableFst_12connect(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_10MutableFst_12connect(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("connect", 0);

  /* "fstlib/cext/pywrapfst.pyx":2185
 *       self.
 *     """
 *     self._connect()             # <<<<<<<<<<<<<<
 *     return self
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_connect");
    __PYX_ERR(0, 2185, __pyx_L1_error)
  }
  ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_connect(__pyx_v_self);

  /* "fstlib/cext/pywrapfst.pyx":2186
 *     """
 *     self._connect()
 *     return self             # <<<<<<<<<<<<<<
 * 
 *   cdef void _decode(self, EncodeMapper mapper) except *:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":2173
 *     fst.Connect(self._mfst.get())
 * 
 *   def connect(self):             # <<<<<<<<<<<<<<
 *     """
 *     connect(self)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.MutableFst.connect", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":2188
 *     return self
 * 
 *   cdef void _decode(self, EncodeMapper mapper) except *:             # <<<<<<<<<<<<<<
 *     fst.Decode(self._mfst.get(), deref(mapper._mapper))
 *     self._check_mutating_imethod()
 */

static void __pyx_f_6fstlib_4cext_9pywrapfst_10MutableFst__decode(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *__pyx_v_mapper) {
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_decode", 0);

  /* "fstlib/cext/pywrapfst.pyx":2189
 * 
 *   cdef void _decode(self, EncodeMapper mapper) except *:
 *     fst.Decode(self._mfst.get(), deref(mapper._mapper))             # <<<<<<<<<<<<<<
 *     self._check_mutating_imethod()
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
    __PYX_ERR(0, 2189, __pyx_L1_error)
  }
  if (unlikely(((PyObject *)__pyx_v_mapper) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mapper");
    __PYX_ERR(0, 2189, __pyx_L1_error)
  }
  fst::script::Decode(__pyx_v_self->_mfst.get(), (*__pyx_v_mapper->_mapper));

  /* "fstlib/cext/pywrapfst.pyx":2190
 *   cdef void _decode(self, EncodeMapper mapper) except *:
 *     fst.Decode(self._mfst.get(), deref(mapper._mapper))
 *     self._check_mutating_imethod()             # <<<<<<<<<<<<<<
 * 
 *   def decode(self, EncodeMapper mapper):
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_check_mutating_imethod");
    __PYX_ERR(0, 2190, __pyx_L1_error)
  }
  ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2190, __pyx_L1_error)

  /* "fstlib/cext/pywrapfst.pyx":2188
 *     return self
 * 
 *   cdef void _decode(self, EncodeMapper mapper) except *:             # <<<<<<<<<<<<<<
 *     fst.Decode(self._mfst.get(), deref(mapper._mapper))
 *     self._check_mutating_imethod()
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.MutableFst._decode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "fstlib/cext/pywrapfst.pyx":2192
 *     self._check_mutating_imethod()
 * 
 *   def decode(self, EncodeMapper mapper):             # <<<<<<<<<<<<<<
 *     """
 *     decode(self, mapper)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_15decode(PyObject *__pyx_v_self, PyObject *__pyx_v_mapper); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_10MutableFst_14decode[] = "\n    decode(self, mapper)\n\n    Decodes encoded labels and/or weights.\n\n    This operation reverses the encoding performed by `encode`.\n\n    Args:\n      mapper: An EncodeMapper object used to encode the FST.\n\n    Returns:\n      self.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_15decode(PyObject *__pyx_v_self, PyObject *__pyx_v_mapper) {
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("decode (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mapper), __pyx_ptype_6fstlib_4cext_9pywrapfst_EncodeMapper, 1, "mapper", 0))) __PYX_ERR(0, 2192, __pyx_L1_error)
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_10MutableFst_14decode(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *)__pyx_v_self), ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *)__pyx_v_mapper));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_10MutableFst_14decode(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *__pyx_v_mapper) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("decode", 0);

  /* "fstlib/cext/pywrapfst.pyx":2206
 *       self.
 *     """
 *     self._decode(mapper)             # <<<<<<<<<<<<<<
 *     return self
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_decode");
    __PYX_ERR(0, 2206, __pyx_L1_error)
  }
  ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_decode(__pyx_v_self, __pyx_v_mapper); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2206, __pyx_L1_error)

  /* "fstlib/cext/pywrapfst.pyx":2207
 *     """
 *     self._decode(mapper)
 *     return self             # <<<<<<<<<<<<<<
 * 
 *   cdef void _delete_arcs(self, int64 state, size_t n=0) except *:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":2192
 *     self._check_mutating_imethod()
 * 
 *   def decode(self, EncodeMapper mapper):             # <<<<<<<<<<<<<<
 *     """
 *     decode(self, mapper)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.MutableFst.decode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":2209
 *     return self
 * 
 *   cdef void _delete_arcs(self, int64 state, size_t n=0) except *:             # <<<<<<<<<<<<<<
 *     if not (self._mfst.get().DeleteArcs(state, n) if n else
 *             self._mfst.get().DeleteArcs(state)):
 */

static void __pyx_f_6fstlib_4cext_9pywrapfst_10MutableFst__delete_arcs(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, int64 __pyx_v_state, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_10MutableFst__delete_arcs *__pyx_optional_args) {
  size_t __pyx_v_n = ((size_t)0);
  __Pyx_RefNannyDeclarations
  bool __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_delete_arcs", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_n = __pyx_optional_args->n;
    }
  }

  /* "fstlib/cext/pywrapfst.pyx":2210
 * 
 *   cdef void _delete_arcs(self, int64 state, size_t n=0) except *:
 *     if not (self._mfst.get().DeleteArcs(state, n) if n else             # <<<<<<<<<<<<<<
 *             self._mfst.get().DeleteArcs(state)):
 *       raise FstIndexError("State index out of range")
 */
  if ((__pyx_v_n != 0)) {
    if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
      __PYX_ERR(0, 2210, __pyx_L1_error)
    }
    __pyx_t_1 = __pyx_v_self->_mfst.get()->DeleteArcs(__pyx_v_state, __pyx_v_n);
  } else {

    /* "fstlib/cext/pywrapfst.pyx":2211
 *   cdef void _delete_arcs(self, int64 state, size_t n=0) except *:
 *     if not (self._mfst.get().DeleteArcs(state, n) if n else
 *             self._mfst.get().DeleteArcs(state)):             # <<<<<<<<<<<<<<
 *       raise FstIndexError("State index out of range")
 *     self._check_mutating_imethod()
 */
    if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
      __PYX_ERR(0, 2211, __pyx_L1_error)
    }
    __pyx_t_1 = __pyx_v_self->_mfst.get()->DeleteArcs(__pyx_v_state);
  }

  /* "fstlib/cext/pywrapfst.pyx":2210
 * 
 *   cdef void _delete_arcs(self, int64 state, size_t n=0) except *:
 *     if not (self._mfst.get().DeleteArcs(state, n) if n else             # <<<<<<<<<<<<<<
 *             self._mfst.get().DeleteArcs(state)):
 *       raise FstIndexError("State index out of range")
 */
  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
  if (unlikely(__pyx_t_2)) {

    /* "fstlib/cext/pywrapfst.pyx":2212
 *     if not (self._mfst.get().DeleteArcs(state, n) if n else
 *             self._mfst.get().DeleteArcs(state)):
 *       raise FstIndexError("State index out of range")             # <<<<<<<<<<<<<<
 *     self._check_mutating_imethod()
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2212, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_kp_u_State_index_out_of_range) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_kp_u_State_index_out_of_range);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2212, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 2212, __pyx_L1_error)

    /* "fstlib/cext/pywrapfst.pyx":2210
 * 
 *   cdef void _delete_arcs(self, int64 state, size_t n=0) except *:
 *     if not (self._mfst.get().DeleteArcs(state, n) if n else             # <<<<<<<<<<<<<<
 *             self._mfst.get().DeleteArcs(state)):
 *       raise FstIndexError("State index out of range")
 */
  }

  /* "fstlib/cext/pywrapfst.pyx":2213
 *             self._mfst.get().DeleteArcs(state)):
 *       raise FstIndexError("State index out of range")
 *     self._check_mutating_imethod()             # <<<<<<<<<<<<<<
 * 
 *   def delete_arcs(self, int64 state, size_t n=0):
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_check_mutating_imethod");
    __PYX_ERR(0, 2213, __pyx_L1_error)
  }
  ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2213, __pyx_L1_error)

  /* "fstlib/cext/pywrapfst.pyx":2209
 *     return self
 * 
 *   cdef void _delete_arcs(self, int64 state, size_t n=0) except *:             # <<<<<<<<<<<<<<
 *     if not (self._mfst.get().DeleteArcs(state, n) if n else
 *             self._mfst.get().DeleteArcs(state)):
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.MutableFst._delete_arcs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "fstlib/cext/pywrapfst.pyx":2215
 *     self._check_mutating_imethod()
 * 
 *   def delete_arcs(self, int64 state, size_t n=0):             # <<<<<<<<<<<<<<
 *     """
 *     delete_arcs(self, state, n=0)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_17delete_arcs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_10MutableFst_16delete_arcs[] = "\n    delete_arcs(self, state, n=0)\n\n    Deletes arcs leaving a particular state.\n\n    Args:\n      state: The integer index of a state.\n      n: An optional argument indicating how many arcs to be deleted. If this\n          argument is omitted or passed as zero, all arcs from this state are\n          deleted.\n\n    Returns:\n      self.\n\n    Raises:\n      FstIndexError: State index out of range.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_17delete_arcs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int64 __pyx_v_state;
  size_t __pyx_v_n;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("delete_arcs (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_state,&__pyx_n_s_n,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_state)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "delete_arcs") < 0)) __PYX_ERR(0, 2215, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_state = __Pyx_PyInt_As_int64_t(values[0]); if (unlikely((__pyx_v_state == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2215, __pyx_L3_error)
    if (values[1]) {
      __pyx_v_n = __Pyx_PyInt_As_size_t(values[1]); if (unlikely((__pyx_v_n == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2215, __pyx_L3_error)
    } else {
      __pyx_v_n = ((size_t)0);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("delete_arcs", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2215, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.MutableFst.delete_arcs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_10MutableFst_16delete_arcs(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *)__pyx_v_self), __pyx_v_state, __pyx_v_n);

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_10MutableFst_16delete_arcs(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, int64 __pyx_v_state, size_t __pyx_v_n) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_10MutableFst__delete_arcs __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("delete_arcs", 0);

  /* "fstlib/cext/pywrapfst.pyx":2233
 *       FstIndexError: State index out of range.
 *     """
 *     self._delete_arcs(state, n)             # <<<<<<<<<<<<<<
 *     return self
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_delete_arcs");
    __PYX_ERR(0, 2233, __pyx_L1_error)
  }
  __pyx_t_1.__pyx_n = 1;
  __pyx_t_1.n = __pyx_v_n;
  ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_delete_arcs(__pyx_v_self, __pyx_v_state, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2233, __pyx_L1_error)

  /* "fstlib/cext/pywrapfst.pyx":2234
 *     """
 *     self._delete_arcs(state, n)
 *     return self             # <<<<<<<<<<<<<<
 * 
 *   cdef void _delete_states(self, states=None) except *:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":2215
 *     self._check_mutating_imethod()
 * 
 *   def delete_arcs(self, int64 state, size_t n=0):             # <<<<<<<<<<<<<<
 *     """
 *     delete_arcs(self, state, n=0)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.MutableFst.delete_arcs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":2236
 *     return self
 * 
 *   cdef void _delete_states(self, states=None) except *:             # <<<<<<<<<<<<<<
 *     # Only the former signature has a possible indexing failure.
 *     if states:
 */

static void __pyx_f_6fstlib_4cext_9pywrapfst_10MutableFst__delete_states(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_10MutableFst__delete_states *__pyx_optional_args) {
  PyObject *__pyx_v_states = ((PyObject *)Py_None);
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  std::vector<int64>  __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_delete_states", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_states = __pyx_optional_args->states;
    }
  }

  /* "fstlib/cext/pywrapfst.pyx":2238
 *   cdef void _delete_states(self, states=None) except *:
 *     # Only the former signature has a possible indexing failure.
 *     if states:             # <<<<<<<<<<<<<<
 *       if not self._mfst.get().DeleteStates(<const vector[int64]> states):
 *         raise FstIndexError("State index out of range")
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_states); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 2238, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "fstlib/cext/pywrapfst.pyx":2239
 *     # Only the former signature has a possible indexing failure.
 *     if states:
 *       if not self._mfst.get().DeleteStates(<const vector[int64]> states):             # <<<<<<<<<<<<<<
 *         raise FstIndexError("State index out of range")
 *     else:
 */
    if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
      __PYX_ERR(0, 2239, __pyx_L1_error)
    }
    __pyx_t_2 = __pyx_convert_vector_from_py_int64(__pyx_v_states); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2239, __pyx_L1_error)
    __pyx_t_1 = ((!(__pyx_v_self->_mfst.get()->DeleteStates(((std::vector<int64>  const )__pyx_t_2)) != 0)) != 0);
    if (unlikely(__pyx_t_1)) {

      /* "fstlib/cext/pywrapfst.pyx":2240
 *     if states:
 *       if not self._mfst.get().DeleteStates(<const vector[int64]> states):
 *         raise FstIndexError("State index out of range")             # <<<<<<<<<<<<<<
 *     else:
 *       self._mfst.get().DeleteStates()
 */
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2240, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_kp_u_State_index_out_of_range) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_kp_u_State_index_out_of_range);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2240, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __PYX_ERR(0, 2240, __pyx_L1_error)

      /* "fstlib/cext/pywrapfst.pyx":2239
 *     # Only the former signature has a possible indexing failure.
 *     if states:
 *       if not self._mfst.get().DeleteStates(<const vector[int64]> states):             # <<<<<<<<<<<<<<
 *         raise FstIndexError("State index out of range")
 *     else:
 */
    }

    /* "fstlib/cext/pywrapfst.pyx":2238
 *   cdef void _delete_states(self, states=None) except *:
 *     # Only the former signature has a possible indexing failure.
 *     if states:             # <<<<<<<<<<<<<<
 *       if not self._mfst.get().DeleteStates(<const vector[int64]> states):
 *         raise FstIndexError("State index out of range")
 */
    goto __pyx_L3;
  }

  /* "fstlib/cext/pywrapfst.pyx":2242
 *         raise FstIndexError("State index out of range")
 *     else:
 *       self._mfst.get().DeleteStates()             # <<<<<<<<<<<<<<
 *     self._check_mutating_imethod()
 * 
 */
  /*else*/ {
    if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
      __PYX_ERR(0, 2242, __pyx_L1_error)
    }
    __pyx_v_self->_mfst.get()->DeleteStates();
  }
  __pyx_L3:;

  /* "fstlib/cext/pywrapfst.pyx":2243
 *     else:
 *       self._mfst.get().DeleteStates()
 *     self._check_mutating_imethod()             # <<<<<<<<<<<<<<
 * 
 *   def delete_states(self, states=None):
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_check_mutating_imethod");
    __PYX_ERR(0, 2243, __pyx_L1_error)
  }
  ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2243, __pyx_L1_error)

  /* "fstlib/cext/pywrapfst.pyx":2236
 *     return self
 * 
 *   cdef void _delete_states(self, states=None) except *:             # <<<<<<<<<<<<<<
 *     # Only the former signature has a possible indexing failure.
 *     if states:
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.MutableFst._delete_states", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "fstlib/cext/pywrapfst.pyx":2245
 *     self._check_mutating_imethod()
 * 
 *   def delete_states(self, states=None):             # <<<<<<<<<<<<<<
 *     """
 *     delete_states(self, states=None)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_19delete_states(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_10MutableFst_18delete_states[] = "\n    delete_states(self, states=None)\n\n    Deletes states.\n\n    Args:\n      states: An optional iterable of integer indices of the states to be\n          deleted. If this argument is omitted, all states are deleted.\n\n    Returns:\n      self.\n\n    Raises:\n      FstIndexError: State index out of range.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_19delete_states(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_states = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("delete_states (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_states,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_states);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "delete_states") < 0)) __PYX_ERR(0, 2245, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_states = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("delete_states", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2245, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.MutableFst.delete_states", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_10MutableFst_18delete_states(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *)__pyx_v_self), __pyx_v_states);

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_10MutableFst_18delete_states(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, PyObject *__pyx_v_states) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_10MutableFst__delete_states __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("delete_states", 0);

  /* "fstlib/cext/pywrapfst.pyx":2261
 *       FstIndexError: State index out of range.
 *     """
 *     self._delete_states(states)             # <<<<<<<<<<<<<<
 *     return self
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_delete_states");
    __PYX_ERR(0, 2261, __pyx_L1_error)
  }
  __pyx_t_1.__pyx_n = 1;
  __pyx_t_1.states = __pyx_v_states;
  ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_delete_states(__pyx_v_self, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2261, __pyx_L1_error)

  /* "fstlib/cext/pywrapfst.pyx":2262
 *     """
 *     self._delete_states(states)
 *     return self             # <<<<<<<<<<<<<<
 * 
 *   cdef void _encode(self, EncodeMapper mapper) except *:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":2245
 *     self._check_mutating_imethod()
 * 
 *   def delete_states(self, states=None):             # <<<<<<<<<<<<<<
 *     """
 *     delete_states(self, states=None)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.MutableFst.delete_states", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":2264
 *     return self
 * 
 *   cdef void _encode(self, EncodeMapper mapper) except *:             # <<<<<<<<<<<<<<
 *     fst.Encode(self._mfst.get(), mapper._mapper.get())
 *     self._check_mutating_imethod()
 */

static void __pyx_f_6fstlib_4cext_9pywrapfst_10MutableFst__encode(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *__pyx_v_mapper) {
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_encode", 0);

  /* "fstlib/cext/pywrapfst.pyx":2265
 * 
 *   cdef void _encode(self, EncodeMapper mapper) except *:
 *     fst.Encode(self._mfst.get(), mapper._mapper.get())             # <<<<<<<<<<<<<<
 *     self._check_mutating_imethod()
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
    __PYX_ERR(0, 2265, __pyx_L1_error)
  }
  if (unlikely(((PyObject *)__pyx_v_mapper) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mapper");
    __PYX_ERR(0, 2265, __pyx_L1_error)
  }
  fst::script::Encode(__pyx_v_self->_mfst.get(), __pyx_v_mapper->_mapper.get());

  /* "fstlib/cext/pywrapfst.pyx":2266
 *   cdef void _encode(self, EncodeMapper mapper) except *:
 *     fst.Encode(self._mfst.get(), mapper._mapper.get())
 *     self._check_mutating_imethod()             # <<<<<<<<<<<<<<
 * 
 *   def encode(self, EncodeMapper mapper):
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_check_mutating_imethod");
    __PYX_ERR(0, 2266, __pyx_L1_error)
  }
  ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2266, __pyx_L1_error)

  /* "fstlib/cext/pywrapfst.pyx":2264
 *     return self
 * 
 *   cdef void _encode(self, EncodeMapper mapper) except *:             # <<<<<<<<<<<<<<
 *     fst.Encode(self._mfst.get(), mapper._mapper.get())
 *     self._check_mutating_imethod()
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.MutableFst._encode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "fstlib/cext/pywrapfst.pyx":2268
 *     self._check_mutating_imethod()
 * 
 *   def encode(self, EncodeMapper mapper):             # <<<<<<<<<<<<<<
 *     """
 *     encode(self, mapper)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_21encode(PyObject *__pyx_v_self, PyObject *__pyx_v_mapper); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_10MutableFst_20encode[] = "\n    encode(self, mapper)\n\n    Encodes labels and/or weights.\n\n    This operation allows for the representation of a weighted transducer as a\n    weighted acceptor, an unweighted transducer, or an unweighted acceptor by\n    considering the pair (input label, output label), the pair (input label,\n    weight), or the triple (input label, output label, weight) as a single\n    label. Applying this operation mutates the EncodeMapper argument, which\n    can then be used to decode.\n\n    Args:\n      mapper: An EncodeMapper object to be used as the mapper.\n\n    Returns:\n      self.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_21encode(PyObject *__pyx_v_self, PyObject *__pyx_v_mapper) {
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("encode (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mapper), __pyx_ptype_6fstlib_4cext_9pywrapfst_EncodeMapper, 1, "mapper", 0))) __PYX_ERR(0, 2268, __pyx_L1_error)
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_10MutableFst_20encode(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *)__pyx_v_self), ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *)__pyx_v_mapper));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_10MutableFst_20encode(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *__pyx_v_mapper) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("encode", 0);

  /* "fstlib/cext/pywrapfst.pyx":2287
 *       self.
 *     """
 *     self._encode(mapper)             # <<<<<<<<<<<<<<
 *     return self
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_encode");
    __PYX_ERR(0, 2287, __pyx_L1_error)
  }
  ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_encode(__pyx_v_self, __pyx_v_mapper); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2287, __pyx_L1_error)

  /* "fstlib/cext/pywrapfst.pyx":2288
 *     """
 *     self._encode(mapper)
 *     return self             # <<<<<<<<<<<<<<
 * 
 *   cdef void _invert(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":2268
 *     self._check_mutating_imethod()
 * 
 *   def encode(self, EncodeMapper mapper):             # <<<<<<<<<<<<<<
 *     """
 *     encode(self, mapper)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.MutableFst.encode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":2290
 *     return self
 * 
 *   cdef void _invert(self):             # <<<<<<<<<<<<<<
 *     fst.Invert(self._mfst.get())
 * 
 */

static void __pyx_f_6fstlib_4cext_9pywrapfst_10MutableFst__invert(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_invert", 0);

  /* "fstlib/cext/pywrapfst.pyx":2291
 * 
 *   cdef void _invert(self):
 *     fst.Invert(self._mfst.get())             # <<<<<<<<<<<<<<
 * 
 *   def invert(self):
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
    __PYX_ERR(0, 2291, __pyx_L1_error)
  }
  fst::script::Invert(__pyx_v_self->_mfst.get());

  /* "fstlib/cext/pywrapfst.pyx":2290
 *     return self
 * 
 *   cdef void _invert(self):             # <<<<<<<<<<<<<<
 *     fst.Invert(self._mfst.get())
 * 
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("fstlib.cext.pywrapfst.MutableFst._invert", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "fstlib/cext/pywrapfst.pyx":2293
 *     fst.Invert(self._mfst.get())
 * 
 *   def invert(self):             # <<<<<<<<<<<<<<
 *     """
 *     invert(self)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_23invert(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_10MutableFst_22invert[] = "\n    invert(self)\n\n    Inverts the FST's transduction.\n\n    This operation destructively inverts the FST's transduction by exchanging\n    input and output labels.\n\n    Returns:\n      self.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_23invert(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("invert (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_10MutableFst_22invert(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_10MutableFst_22invert(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("invert", 0);

  /* "fstlib/cext/pywrapfst.pyx":2305
 *       self.
 *     """
 *     self._invert()             # <<<<<<<<<<<<<<
 *     return self
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_invert");
    __PYX_ERR(0, 2305, __pyx_L1_error)
  }
  ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_invert(__pyx_v_self);

  /* "fstlib/cext/pywrapfst.pyx":2306
 *     """
 *     self._invert()
 *     return self             # <<<<<<<<<<<<<<
 * 
 *   cdef void _minimize(self,
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":2293
 *     fst.Invert(self._mfst.get())
 * 
 *   def invert(self):             # <<<<<<<<<<<<<<
 *     """
 *     invert(self)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.MutableFst.invert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":2308
 *     return self
 * 
 *   cdef void _minimize(self,             # <<<<<<<<<<<<<<
 *                       float delta=fst.kShortestDelta,
 *                       bool allow_nondet=False) except *:
 */

static void __pyx_f_6fstlib_4cext_9pywrapfst_10MutableFst__minimize(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_10MutableFst__minimize *__pyx_optional_args) {
  float __pyx_v_delta = __pyx_k__12;

  /* "fstlib/cext/pywrapfst.pyx":2310
 *   cdef void _minimize(self,
 *                       float delta=fst.kShortestDelta,
 *                       bool allow_nondet=False) except *:             # <<<<<<<<<<<<<<
 *     # This runs in-place when the second argument is null.
 *     fst.Minimize(self._mfst.get(), NULL, delta, allow_nondet)
 */
  bool __pyx_v_allow_nondet = ((bool)0);
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_minimize", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_delta = __pyx_optional_args->delta;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_allow_nondet = __pyx_optional_args->allow_nondet;
      }
    }
  }

  /* "fstlib/cext/pywrapfst.pyx":2312
 *                       bool allow_nondet=False) except *:
 *     # This runs in-place when the second argument is null.
 *     fst.Minimize(self._mfst.get(), NULL, delta, allow_nondet)             # <<<<<<<<<<<<<<
 *     self._check_mutating_imethod()
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
    __PYX_ERR(0, 2312, __pyx_L1_error)
  }
  fst::script::Minimize(__pyx_v_self->_mfst.get(), NULL, __pyx_v_delta, __pyx_v_allow_nondet);

  /* "fstlib/cext/pywrapfst.pyx":2313
 *     # This runs in-place when the second argument is null.
 *     fst.Minimize(self._mfst.get(), NULL, delta, allow_nondet)
 *     self._check_mutating_imethod()             # <<<<<<<<<<<<<<
 * 
 *   def minimize(self, float delta=fst.kShortestDelta, bool allow_nondet=False):
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_check_mutating_imethod");
    __PYX_ERR(0, 2313, __pyx_L1_error)
  }
  ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2313, __pyx_L1_error)

  /* "fstlib/cext/pywrapfst.pyx":2308
 *     return self
 * 
 *   cdef void _minimize(self,             # <<<<<<<<<<<<<<
 *                       float delta=fst.kShortestDelta,
 *                       bool allow_nondet=False) except *:
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.MutableFst._minimize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "fstlib/cext/pywrapfst.pyx":2315
 *     self._check_mutating_imethod()
 * 
 *   def minimize(self, float delta=fst.kShortestDelta, bool allow_nondet=False):             # <<<<<<<<<<<<<<
 *     """
 *     minimize(self, delta=1e-6, allow_nondet=False)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_25minimize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_10MutableFst_24minimize[] = "\n    minimize(self, delta=1e-6, allow_nondet=False)\n\n    Minimizes the FST.\n\n    This operation destructively performs the minimization of deterministic\n    weighted automata and transducers. If the input FST A is an acceptor, this\n    operation produces the minimal acceptor B equivalent to A, i.e. the\n    acceptor with a minimal number of states that is equivalent to A. If the\n    input FST A is a transducer, this operation internally builds an equivalent\n    transducer with a minimal number of states. However, this minimality is\n    obtained by allowing transition having strings of symbols as output labels,\n    this known in the litterature as a real-time transducer. Such transducers\n    are not directly supported by the library. This function will convert such\n    transducer by expanding each string-labeled transition into a sequence of\n    transitions. This will results in the creation of new states, hence losing\n    the minimality property.\n\n    Args:\n      delta: Comparison/quantization delta.\n      allow_nondet: Attempt minimization of non-deterministic FST?\n\n    Returns:\n      self.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_25minimize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  float __pyx_v_delta;
  bool __pyx_v_allow_nondet;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("minimize (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_delta,&__pyx_n_s_allow_nondet,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_delta);
          if (value) { values[0] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_allow_nondet);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "minimize") < 0)) __PYX_ERR(0, 2315, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    if (values[0]) {
      __pyx_v_delta = __pyx_PyFloat_AsFloat(values[0]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 2315, __pyx_L3_error)
    } else {
      __pyx_v_delta = __pyx_k__13;
    }
    if (values[1]) {
      __pyx_v_allow_nondet = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_allow_nondet == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2315, __pyx_L3_error)
    } else {
      __pyx_v_allow_nondet = ((bool)0);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("minimize", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2315, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.MutableFst.minimize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_10MutableFst_24minimize(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *)__pyx_v_self), __pyx_v_delta, __pyx_v_allow_nondet);

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_10MutableFst_24minimize(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, float __pyx_v_delta, bool __pyx_v_allow_nondet) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_10MutableFst__minimize __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("minimize", 0);

  /* "fstlib/cext/pywrapfst.pyx":2341
 *       self.
 *     """
 *     self._minimize(delta, allow_nondet)             # <<<<<<<<<<<<<<
 *     return self
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_minimize");
    __PYX_ERR(0, 2341, __pyx_L1_error)
  }
  __pyx_t_1.__pyx_n = 2;
  __pyx_t_1.delta = __pyx_v_delta;
  __pyx_t_1.allow_nondet = __pyx_v_allow_nondet;
  ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_minimize(__pyx_v_self, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2341, __pyx_L1_error)

  /* "fstlib/cext/pywrapfst.pyx":2342
 *     """
 *     self._minimize(delta, allow_nondet)
 *     return self             # <<<<<<<<<<<<<<
 * 
 *   cpdef _MutableArcIterator mutable_arcs(self, int64 state):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":2315
 *     self._check_mutating_imethod()
 * 
 *   def minimize(self, float delta=fst.kShortestDelta, bool allow_nondet=False):             # <<<<<<<<<<<<<<
 *     """
 *     minimize(self, delta=1e-6, allow_nondet=False)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.MutableFst.minimize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":2344
 *     return self
 * 
 *   cpdef _MutableArcIterator mutable_arcs(self, int64 state):             # <<<<<<<<<<<<<<
 *     """
 *     mutable_arcs(self, state)
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_27mutable_arcs(PyObject *__pyx_v_self, PyObject *__pyx_arg_state); /*proto*/
static struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableArcIterator *__pyx_f_6fstlib_4cext_9pywrapfst_10MutableFst_mutable_arcs(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, int64 __pyx_v_state, int __pyx_skip_dispatch) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableArcIterator *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("mutable_arcs", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_mutable_arcs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2344, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_27mutable_arcs)) {
        __Pyx_XDECREF(((PyObject *)__pyx_r));
        __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_v_state); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2344, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
          if (likely(__pyx_t_5)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
            __Pyx_INCREF(__pyx_t_5);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_4, function);
          }
        }
        __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2344, __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_6fstlib_4cext_9pywrapfst__MutableArcIterator))))) __PYX_ERR(0, 2344, __pyx_L1_error)
        __pyx_r = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableArcIterator *)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "fstlib/cext/pywrapfst.pyx":2356
 *       A _MutableArcIterator.
 *     """
 *     return _MutableArcIterator(self, state)             # <<<<<<<<<<<<<<
 * 
 *   def mutable_input_symbols(self):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_state); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2356, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2356, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6fstlib_4cext_9pywrapfst__MutableArcIterator), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2356, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableArcIterator *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":2344
 *     return self
 * 
 *   cpdef _MutableArcIterator mutable_arcs(self, int64 state):             # <<<<<<<<<<<<<<
 *     """
 *     mutable_arcs(self, state)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.MutableFst.mutable_arcs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_27mutable_arcs(PyObject *__pyx_v_self, PyObject *__pyx_arg_state); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_10MutableFst_26mutable_arcs[] = "\n    mutable_arcs(self, state)\n\n    Returns a mutable iterator over arcs leaving the specified state.\n\n    Args:\n      state: The source state ID.\n\n    Returns:\n      A _MutableArcIterator.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_27mutable_arcs(PyObject *__pyx_v_self, PyObject *__pyx_arg_state) {
  int64 __pyx_v_state;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("mutable_arcs (wrapper)", 0);
  assert(__pyx_arg_state); {
    __pyx_v_state = __Pyx_PyInt_As_int64_t(__pyx_arg_state); if (unlikely((__pyx_v_state == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2344, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.MutableFst.mutable_arcs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_10MutableFst_26mutable_arcs(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *)__pyx_v_self), ((int64)__pyx_v_state));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_10MutableFst_26mutable_arcs(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, int64 __pyx_v_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("mutable_arcs", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_6fstlib_4cext_9pywrapfst_10MutableFst_mutable_arcs(__pyx_v_self, __pyx_v_state, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2344, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.MutableFst.mutable_arcs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":2358
 *     return _MutableArcIterator(self, state)
 * 
 *   def mutable_input_symbols(self):             # <<<<<<<<<<<<<<
 *     """
 *     mutable_input_symbols(self)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_29mutable_input_symbols(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_10MutableFst_28mutable_input_symbols[] = "\n    mutable_input_symbols(self)\n\n    Returns the FST's (mutable) input symbol table, or None if none is present.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_29mutable_input_symbols(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("mutable_input_symbols (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_10MutableFst_28mutable_input_symbols(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_10MutableFst_28mutable_input_symbols(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__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("mutable_input_symbols", 0);

  /* "fstlib/cext/pywrapfst.pyx":2364
 *     Returns the FST's (mutable) input symbol table, or None if none is present.
 *     """
 *     if self._mfst.get().MutableInputSymbols() == NULL:             # <<<<<<<<<<<<<<
 *       return
 *     return _init_MutableFstSymbolTableView(self._mfst, input_side=True)
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
    __PYX_ERR(0, 2364, __pyx_L1_error)
  }
  __pyx_t_1 = ((__pyx_v_self->_mfst.get()->MutableInputSymbols() == NULL) != 0);
  if (__pyx_t_1) {

    /* "fstlib/cext/pywrapfst.pyx":2365
 *     """
 *     if self._mfst.get().MutableInputSymbols() == NULL:
 *       return             # <<<<<<<<<<<<<<
 *     return _init_MutableFstSymbolTableView(self._mfst, input_side=True)
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "fstlib/cext/pywrapfst.pyx":2364
 *     Returns the FST's (mutable) input symbol table, or None if none is present.
 *     """
 *     if self._mfst.get().MutableInputSymbols() == NULL:             # <<<<<<<<<<<<<<
 *       return
 *     return _init_MutableFstSymbolTableView(self._mfst, input_side=True)
 */
  }

  /* "fstlib/cext/pywrapfst.pyx":2366
 *     if self._mfst.get().MutableInputSymbols() == NULL:
 *       return
 *     return _init_MutableFstSymbolTableView(self._mfst, input_side=True)             # <<<<<<<<<<<<<<
 * 
 *   def mutable_output_symbols(self):
 */
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
    __PYX_ERR(0, 2366, __pyx_L1_error)
  }
  __pyx_t_2 = ((PyObject *)__pyx_f_6fstlib_4cext_9pywrapfst__init_MutableFstSymbolTableView(__pyx_v_self->_mfst, 1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2366, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":2358
 *     return _MutableArcIterator(self, state)
 * 
 *   def mutable_input_symbols(self):             # <<<<<<<<<<<<<<
 *     """
 *     mutable_input_symbols(self)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.MutableFst.mutable_input_symbols", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":2368
 *     return _init_MutableFstSymbolTableView(self._mfst, input_side=True)
 * 
 *   def mutable_output_symbols(self):             # <<<<<<<<<<<<<<
 *     """
 *     mutable_output_symbols(self)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_31mutable_output_symbols(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_10MutableFst_30mutable_output_symbols[] = "\n    mutable_output_symbols(self)\n\n    Returns the FST's (mutable) output symbol table, or None if none is present.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_31mutable_output_symbols(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("mutable_output_symbols (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_10MutableFst_30mutable_output_symbols(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_10MutableFst_30mutable_output_symbols(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__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("mutable_output_symbols", 0);

  /* "fstlib/cext/pywrapfst.pyx":2374
 *     Returns the FST's (mutable) output symbol table, or None if none is present.
 *     """
 *     if self._mfst.get().MutableOutputSymbols() == NULL:             # <<<<<<<<<<<<<<
 *       return
 *     return _init_MutableFstSymbolTableView(self._mfst, input_side=False)
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
    __PYX_ERR(0, 2374, __pyx_L1_error)
  }
  __pyx_t_1 = ((__pyx_v_self->_mfst.get()->MutableOutputSymbols() == NULL) != 0);
  if (__pyx_t_1) {

    /* "fstlib/cext/pywrapfst.pyx":2375
 *     """
 *     if self._mfst.get().MutableOutputSymbols() == NULL:
 *       return             # <<<<<<<<<<<<<<
 *     return _init_MutableFstSymbolTableView(self._mfst, input_side=False)
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "fstlib/cext/pywrapfst.pyx":2374
 *     Returns the FST's (mutable) output symbol table, or None if none is present.
 *     """
 *     if self._mfst.get().MutableOutputSymbols() == NULL:             # <<<<<<<<<<<<<<
 *       return
 *     return _init_MutableFstSymbolTableView(self._mfst, input_side=False)
 */
  }

  /* "fstlib/cext/pywrapfst.pyx":2376
 *     if self._mfst.get().MutableOutputSymbols() == NULL:
 *       return
 *     return _init_MutableFstSymbolTableView(self._mfst, input_side=False)             # <<<<<<<<<<<<<<
 * 
 *   cpdef int64 num_states(self):
 */
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
    __PYX_ERR(0, 2376, __pyx_L1_error)
  }
  __pyx_t_2 = ((PyObject *)__pyx_f_6fstlib_4cext_9pywrapfst__init_MutableFstSymbolTableView(__pyx_v_self->_mfst, 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2376, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":2368
 *     return _init_MutableFstSymbolTableView(self._mfst, input_side=True)
 * 
 *   def mutable_output_symbols(self):             # <<<<<<<<<<<<<<
 *     """
 *     mutable_output_symbols(self)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.MutableFst.mutable_output_symbols", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":2378
 *     return _init_MutableFstSymbolTableView(self._mfst, input_side=False)
 * 
 *   cpdef int64 num_states(self):             # <<<<<<<<<<<<<<
 *     """
 *     num_states(self)
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_33num_states(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static int64 __pyx_f_6fstlib_4cext_9pywrapfst_10MutableFst_num_states(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, int __pyx_skip_dispatch) {
  int64 __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int64 __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("num_states", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_states); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2378, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_33num_states)) {
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2378, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_5 = __Pyx_PyInt_As_int64_t(__pyx_t_2); if (unlikely((__pyx_t_5 == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2378, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_5;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "fstlib/cext/pywrapfst.pyx":2384
 *     Returns the number of states.
 *     """
 *     return self._mfst.get().NumStates()             # <<<<<<<<<<<<<<
 * 
 *   cdef void _project(self, project_type) except *:
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
    __PYX_ERR(0, 2384, __pyx_L1_error)
  }
  __pyx_r = __pyx_v_self->_mfst.get()->NumStates();
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":2378
 *     return _init_MutableFstSymbolTableView(self._mfst, input_side=False)
 * 
 *   cpdef int64 num_states(self):             # <<<<<<<<<<<<<<
 *     """
 *     num_states(self)
 */

  /* 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_WriteUnraisable("fstlib.cext.pywrapfst.MutableFst.num_states", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_33num_states(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_10MutableFst_32num_states[] = "\n    num_states(self)\n\n    Returns the number of states.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_33num_states(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("num_states (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_10MutableFst_32num_states(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_10MutableFst_32num_states(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__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("num_states", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_f_6fstlib_4cext_9pywrapfst_10MutableFst_num_states(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2378, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.MutableFst.num_states", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":2386
 *     return self._mfst.get().NumStates()
 * 
 *   cdef void _project(self, project_type) except *:             # <<<<<<<<<<<<<<
 *     fst.Project(self._mfst.get(), _get_project_type(tostring(project_type)))
 * 
 */

static void __pyx_f_6fstlib_4cext_9pywrapfst_10MutableFst__project(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, PyObject *__pyx_v_project_type) {
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  fst::ProjectType __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_project", 0);

  /* "fstlib/cext/pywrapfst.pyx":2387
 * 
 *   cdef void _project(self, project_type) except *:
 *     fst.Project(self._mfst.get(), _get_project_type(tostring(project_type)))             # <<<<<<<<<<<<<<
 * 
 *   def project(self, project_type):
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
    __PYX_ERR(0, 2387, __pyx_L1_error)
  }
  __pyx_t_1 = __pyx_f_6fstlib_4cext_9pywrapfst_tostring(__pyx_v_project_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2387, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_6fstlib_4cext_9pywrapfst__get_project_type(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2387, __pyx_L1_error)
  fst::script::Project(__pyx_v_self->_mfst.get(), __pyx_t_2);

  /* "fstlib/cext/pywrapfst.pyx":2386
 *     return self._mfst.get().NumStates()
 * 
 *   cdef void _project(self, project_type) except *:             # <<<<<<<<<<<<<<
 *     fst.Project(self._mfst.get(), _get_project_type(tostring(project_type)))
 * 
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.MutableFst._project", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "fstlib/cext/pywrapfst.pyx":2389
 *     fst.Project(self._mfst.get(), _get_project_type(tostring(project_type)))
 * 
 *   def project(self, project_type):             # <<<<<<<<<<<<<<
 *     """
 *     project(self, project_type)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_35project(PyObject *__pyx_v_self, PyObject *__pyx_v_project_type); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_10MutableFst_34project[] = "\n    project(self, project_type)\n\n    Converts the FST to an acceptor using input or output labels.\n\n    This operation destructively projects an FST onto its domain or range by\n    either copying each arc's input label to its output label (the default) or\n    vice versa.\n\n    Args:\n      project_type: A string matching a known projection type; one of:\n          \"input\", \"output\".\n\n    Returns:\n      self.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_35project(PyObject *__pyx_v_self, PyObject *__pyx_v_project_type) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("project (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_10MutableFst_34project(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *)__pyx_v_self), ((PyObject *)__pyx_v_project_type));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_10MutableFst_34project(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, PyObject *__pyx_v_project_type) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("project", 0);

  /* "fstlib/cext/pywrapfst.pyx":2406
 *       self.
 *     """
 *     self._project(project_type)             # <<<<<<<<<<<<<<
 *     return self
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_project");
    __PYX_ERR(0, 2406, __pyx_L1_error)
  }
  ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_project(__pyx_v_self, __pyx_v_project_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2406, __pyx_L1_error)

  /* "fstlib/cext/pywrapfst.pyx":2407
 *     """
 *     self._project(project_type)
 *     return self             # <<<<<<<<<<<<<<
 * 
 *   cdef void _prune(self,
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":2389
 *     fst.Project(self._mfst.get(), _get_project_type(tostring(project_type)))
 * 
 *   def project(self, project_type):             # <<<<<<<<<<<<<<
 *     """
 *     project(self, project_type)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.MutableFst.project", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":2409
 *     return self
 * 
 *   cdef void _prune(self,             # <<<<<<<<<<<<<<
 *                    float delta=fst.kDelta,
 *                    int64 nstate=fst.kNoStateId,
 */

static void __pyx_f_6fstlib_4cext_9pywrapfst_10MutableFst__prune(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_10MutableFst__prune *__pyx_optional_args) {
  float __pyx_v_delta = __pyx_k__14;
  int64 __pyx_v_nstate = __pyx_k__15;

  /* "fstlib/cext/pywrapfst.pyx":2412
 *                    float delta=fst.kDelta,
 *                    int64 nstate=fst.kNoStateId,
 *                    weight=None) except *:             # <<<<<<<<<<<<<<
 *     # Threshold is set to semiring Zero (no pruning) if no weight is specified.
 *     cdef fst.WeightClass _weight = _get_WeightClass_or_zero(self.weight_type(),
 */
  PyObject *__pyx_v_weight = ((PyObject *)Py_None);
  fst::script::WeightClass __pyx_v__weight;
  __Pyx_RefNannyDeclarations
  fst::script::WeightClass __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_prune", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_delta = __pyx_optional_args->delta;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_nstate = __pyx_optional_args->nstate;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_weight = __pyx_optional_args->weight;
        }
      }
    }
  }

  /* "fstlib/cext/pywrapfst.pyx":2414
 *                    weight=None) except *:
 *     # Threshold is set to semiring Zero (no pruning) if no weight is specified.
 *     cdef fst.WeightClass _weight = _get_WeightClass_or_zero(self.weight_type(),             # <<<<<<<<<<<<<<
 *                                                             weight)
 *     fst.Prune(self._mfst.get(), _weight, nstate, delta)
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "weight_type");
    __PYX_ERR(0, 2414, __pyx_L1_error)
  }

  /* "fstlib/cext/pywrapfst.pyx":2415
 *     # Threshold is set to semiring Zero (no pruning) if no weight is specified.
 *     cdef fst.WeightClass _weight = _get_WeightClass_or_zero(self.weight_type(),
 *                                                             weight)             # <<<<<<<<<<<<<<
 *     fst.Prune(self._mfst.get(), _weight, nstate, delta)
 *     self._check_mutating_imethod()
 */
  __pyx_t_1 = __pyx_f_6fstlib_4cext_9pywrapfst__get_WeightClass_or_zero(((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.weight_type(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *)__pyx_v_self), 0), __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2414, __pyx_L1_error)
  __pyx_v__weight = __pyx_t_1;

  /* "fstlib/cext/pywrapfst.pyx":2416
 *     cdef fst.WeightClass _weight = _get_WeightClass_or_zero(self.weight_type(),
 *                                                             weight)
 *     fst.Prune(self._mfst.get(), _weight, nstate, delta)             # <<<<<<<<<<<<<<
 *     self._check_mutating_imethod()
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
    __PYX_ERR(0, 2416, __pyx_L1_error)
  }
  fst::script::Prune(__pyx_v_self->_mfst.get(), __pyx_v__weight, __pyx_v_nstate, __pyx_v_delta);

  /* "fstlib/cext/pywrapfst.pyx":2417
 *                                                             weight)
 *     fst.Prune(self._mfst.get(), _weight, nstate, delta)
 *     self._check_mutating_imethod()             # <<<<<<<<<<<<<<
 * 
 *   def prune(self,
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_check_mutating_imethod");
    __PYX_ERR(0, 2417, __pyx_L1_error)
  }
  ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2417, __pyx_L1_error)

  /* "fstlib/cext/pywrapfst.pyx":2409
 *     return self
 * 
 *   cdef void _prune(self,             # <<<<<<<<<<<<<<
 *                    float delta=fst.kDelta,
 *                    int64 nstate=fst.kNoStateId,
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.MutableFst._prune", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "fstlib/cext/pywrapfst.pyx":2419
 *     self._check_mutating_imethod()
 * 
 *   def prune(self,             # <<<<<<<<<<<<<<
 *             float delta=fst.kDelta,
 *             int64 nstate=fst.kNoStateId,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_37prune(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_10MutableFst_36prune[] = "\n    prune(self, delta=0.0009765625, nstate=NO_STATE_ID, weight=None)\n\n    Removes paths with weights below a certain threshold.\n\n    This operation deletes states and arcs in the input FST that do not belong\n    to a successful path whose weight is no more (w.r.t the natural semiring\n    order) than the threshold t \\otimes-times the weight of the shortest path in\n    the input FST. Weights must be commutative and have the path property.\n\n    Args:\n      delta: Comparison/quantization delta.\n      nstate: State number threshold.\n      weight: A Weight or weight string indicating the desired weight threshold\n          below which paths are pruned; if omitted, no paths are pruned.\n\n    Returns:\n      self.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_37prune(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  float __pyx_v_delta;
  int64 __pyx_v_nstate;
  PyObject *__pyx_v_weight = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("prune (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_delta,&__pyx_n_s_nstate,&__pyx_n_s_weight,0};
    PyObject* values[3] = {0,0,0};

    /* "fstlib/cext/pywrapfst.pyx":2422
 *             float delta=fst.kDelta,
 *             int64 nstate=fst.kNoStateId,
 *             weight=None):             # <<<<<<<<<<<<<<
 *     """
 *     prune(self, delta=0.0009765625, nstate=NO_STATE_ID, weight=None)
 */
    values[2] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_delta);
          if (value) { values[0] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nstate);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_weight);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "prune") < 0)) __PYX_ERR(0, 2419, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    if (values[0]) {
      __pyx_v_delta = __pyx_PyFloat_AsFloat(values[0]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 2420, __pyx_L3_error)
    } else {
      __pyx_v_delta = __pyx_k__16;
    }
    if (values[1]) {
      __pyx_v_nstate = __Pyx_PyInt_As_int64_t(values[1]); if (unlikely((__pyx_v_nstate == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2421, __pyx_L3_error)
    } else {
      __pyx_v_nstate = __pyx_k__17;
    }
    __pyx_v_weight = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("prune", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2419, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.MutableFst.prune", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_10MutableFst_36prune(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *)__pyx_v_self), __pyx_v_delta, __pyx_v_nstate, __pyx_v_weight);

  /* "fstlib/cext/pywrapfst.pyx":2419
 *     self._check_mutating_imethod()
 * 
 *   def prune(self,             # <<<<<<<<<<<<<<
 *             float delta=fst.kDelta,
 *             int64 nstate=fst.kNoStateId,
 */

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_10MutableFst_36prune(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, float __pyx_v_delta, int64 __pyx_v_nstate, PyObject *__pyx_v_weight) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_10MutableFst__prune __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("prune", 0);

  /* "fstlib/cext/pywrapfst.pyx":2442
 *       self.
 *     """
 *     self._prune(delta, nstate, weight)             # <<<<<<<<<<<<<<
 *     return self
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_prune");
    __PYX_ERR(0, 2442, __pyx_L1_error)
  }
  __pyx_t_1.__pyx_n = 3;
  __pyx_t_1.delta = __pyx_v_delta;
  __pyx_t_1.nstate = __pyx_v_nstate;
  __pyx_t_1.weight = __pyx_v_weight;
  ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_prune(__pyx_v_self, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2442, __pyx_L1_error)

  /* "fstlib/cext/pywrapfst.pyx":2443
 *     """
 *     self._prune(delta, nstate, weight)
 *     return self             # <<<<<<<<<<<<<<
 * 
 *   cdef void _push(self,
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":2419
 *     self._check_mutating_imethod()
 * 
 *   def prune(self,             # <<<<<<<<<<<<<<
 *             float delta=fst.kDelta,
 *             int64 nstate=fst.kNoStateId,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.MutableFst.prune", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":2445
 *     return self
 * 
 *   cdef void _push(self,             # <<<<<<<<<<<<<<
 *                   float delta=fst.kShortestDelta,
 *                   bool remove_total_weight=False,
 */

static void __pyx_f_6fstlib_4cext_9pywrapfst_10MutableFst__push(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_10MutableFst__push *__pyx_optional_args) {
  float __pyx_v_delta = __pyx_k__18;

  /* "fstlib/cext/pywrapfst.pyx":2447
 *   cdef void _push(self,
 *                   float delta=fst.kShortestDelta,
 *                   bool remove_total_weight=False,             # <<<<<<<<<<<<<<
 *                   bool to_final=False):
 *     fst.Push(self._mfst.get(),
 */
  bool __pyx_v_remove_total_weight = ((bool)0);

  /* "fstlib/cext/pywrapfst.pyx":2448
 *                   float delta=fst.kShortestDelta,
 *                   bool remove_total_weight=False,
 *                   bool to_final=False):             # <<<<<<<<<<<<<<
 *     fst.Push(self._mfst.get(),
 *              fst.GetReweightType(to_final),
 */
  bool __pyx_v_to_final = ((bool)0);
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_push", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_delta = __pyx_optional_args->delta;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_remove_total_weight = __pyx_optional_args->remove_total_weight;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_to_final = __pyx_optional_args->to_final;
        }
      }
    }
  }

  /* "fstlib/cext/pywrapfst.pyx":2449
 *                   bool remove_total_weight=False,
 *                   bool to_final=False):
 *     fst.Push(self._mfst.get(),             # <<<<<<<<<<<<<<
 *              fst.GetReweightType(to_final),
 *              delta,
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
    __PYX_ERR(0, 2449, __pyx_L1_error)
  }

  /* "fstlib/cext/pywrapfst.pyx":2452
 *              fst.GetReweightType(to_final),
 *              delta,
 *              remove_total_weight)             # <<<<<<<<<<<<<<
 * 
 *   def push(self,
 */
  fst::script::Push(__pyx_v_self->_mfst.get(), fst::script::GetReweightType(__pyx_v_to_final), __pyx_v_delta, __pyx_v_remove_total_weight);

  /* "fstlib/cext/pywrapfst.pyx":2445
 *     return self
 * 
 *   cdef void _push(self,             # <<<<<<<<<<<<<<
 *                   float delta=fst.kShortestDelta,
 *                   bool remove_total_weight=False,
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("fstlib.cext.pywrapfst.MutableFst._push", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "fstlib/cext/pywrapfst.pyx":2454
 *              remove_total_weight)
 * 
 *   def push(self,             # <<<<<<<<<<<<<<
 *            float delta=fst.kShortestDelta,
 *            bool remove_total_weight=False,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_39push(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_10MutableFst_38push[] = "\n    push(self, delta=1-e6, remove_total_weight=False, to_final=False)\n\n    Pushes weights towards the initial or final states.\n\n    This operation destructively produces an equivalent transducer by pushing\n    the weights towards the initial state or toward the final states. When\n    pushing weights towards the initial state, the sum of the weight of the\n    outgoing transitions and final weight at any non-initial state is equal to\n    one in the resulting machine. When pushing weights towards the final states,\n    the sum of the weight of the incoming transitions at any state is equal to\n    one. Weights need to be left distributive when pushing towards the initial\n    state and right distributive when pushing towards the final states.\n\n    Args:\n      delta: Comparison/quantization delta.\n      remove_total_weight: If pushing weights, should the total weight be\n          removed?\n      to_final: Push towards final states?\n\n    Returns:\n      self.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_39push(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  float __pyx_v_delta;
  bool __pyx_v_remove_total_weight;
  bool __pyx_v_to_final;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("push (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_delta,&__pyx_n_s_remove_total_weight,&__pyx_n_s_to_final,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_delta);
          if (value) { values[0] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_remove_total_weight);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_to_final);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "push") < 0)) __PYX_ERR(0, 2454, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    if (values[0]) {
      __pyx_v_delta = __pyx_PyFloat_AsFloat(values[0]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 2455, __pyx_L3_error)
    } else {
      __pyx_v_delta = __pyx_k__19;
    }
    if (values[1]) {
      __pyx_v_remove_total_weight = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_remove_total_weight == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2456, __pyx_L3_error)
    } else {

      /* "fstlib/cext/pywrapfst.pyx":2456
 *   def push(self,
 *            float delta=fst.kShortestDelta,
 *            bool remove_total_weight=False,             # <<<<<<<<<<<<<<
 *            bool to_final=False):
 *     """
 */
      __pyx_v_remove_total_weight = ((bool)0);
    }
    if (values[2]) {
      __pyx_v_to_final = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_to_final == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2457, __pyx_L3_error)
    } else {

      /* "fstlib/cext/pywrapfst.pyx":2457
 *            float delta=fst.kShortestDelta,
 *            bool remove_total_weight=False,
 *            bool to_final=False):             # <<<<<<<<<<<<<<
 *     """
 *     push(self, delta=1-e6, remove_total_weight=False, to_final=False)
 */
      __pyx_v_to_final = ((bool)0);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("push", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2454, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.MutableFst.push", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_10MutableFst_38push(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *)__pyx_v_self), __pyx_v_delta, __pyx_v_remove_total_weight, __pyx_v_to_final);

  /* "fstlib/cext/pywrapfst.pyx":2454
 *              remove_total_weight)
 * 
 *   def push(self,             # <<<<<<<<<<<<<<
 *            float delta=fst.kShortestDelta,
 *            bool remove_total_weight=False,
 */

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_10MutableFst_38push(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, float __pyx_v_delta, bool __pyx_v_remove_total_weight, bool __pyx_v_to_final) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_10MutableFst__push __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("push", 0);

  /* "fstlib/cext/pywrapfst.pyx":2481
 *       self.
 *     """
 *     self._push(delta, remove_total_weight, to_final)             # <<<<<<<<<<<<<<
 *     return self
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_push");
    __PYX_ERR(0, 2481, __pyx_L1_error)
  }
  __pyx_t_1.__pyx_n = 3;
  __pyx_t_1.delta = __pyx_v_delta;
  __pyx_t_1.remove_total_weight = __pyx_v_remove_total_weight;
  __pyx_t_1.to_final = __pyx_v_to_final;
  ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_push(__pyx_v_self, &__pyx_t_1); 

  /* "fstlib/cext/pywrapfst.pyx":2482
 *     """
 *     self._push(delta, remove_total_weight, to_final)
 *     return self             # <<<<<<<<<<<<<<
 * 
 *   cdef void _relabel_pairs(self, ipairs=None, opairs=None) except *:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":2454
 *              remove_total_weight)
 * 
 *   def push(self,             # <<<<<<<<<<<<<<
 *            float delta=fst.kShortestDelta,
 *            bool remove_total_weight=False,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.MutableFst.push", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":2484
 *     return self
 * 
 *   cdef void _relabel_pairs(self, ipairs=None, opairs=None) except *:             # <<<<<<<<<<<<<<
 *     cdef vector[fst.LabelPair] _ipairs
 *     cdef vector[fst.LabelPair] _opairs
 */

static void __pyx_f_6fstlib_4cext_9pywrapfst_10MutableFst__relabel_pairs(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_10MutableFst__relabel_pairs *__pyx_optional_args) {
  PyObject *__pyx_v_ipairs = ((PyObject *)Py_None);
  PyObject *__pyx_v_opairs = ((PyObject *)Py_None);
  std::vector<__pyx_t_10cpywrapfst_LabelPair>  __pyx_v__ipairs;
  std::vector<__pyx_t_10cpywrapfst_LabelPair>  __pyx_v__opairs;
  PyObject *__pyx_v_before = NULL;
  PyObject *__pyx_v_after = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *(*__pyx_t_9)(PyObject *);
  int64 __pyx_t_10;
  int64 __pyx_t_11;
  __pyx_t_10cpywrapfst_LabelPair __pyx_t_12;
  int __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_relabel_pairs", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_ipairs = __pyx_optional_args->ipairs;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_opairs = __pyx_optional_args->opairs;
      }
    }
  }

  /* "fstlib/cext/pywrapfst.pyx":2487
 *     cdef vector[fst.LabelPair] _ipairs
 *     cdef vector[fst.LabelPair] _opairs
 *     if ipairs:             # <<<<<<<<<<<<<<
 *       for (before, after) in ipairs:
 *         _ipairs.push_back(fst.LabelPair(before, after))
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_ipairs); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 2487, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "fstlib/cext/pywrapfst.pyx":2488
 *     cdef vector[fst.LabelPair] _opairs
 *     if ipairs:
 *       for (before, after) in ipairs:             # <<<<<<<<<<<<<<
 *         _ipairs.push_back(fst.LabelPair(before, after))
 *     if opairs:
 */
    if (likely(PyList_CheckExact(__pyx_v_ipairs)) || PyTuple_CheckExact(__pyx_v_ipairs)) {
      __pyx_t_2 = __pyx_v_ipairs; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
      __pyx_t_4 = NULL;
    } else {
      __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_ipairs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2488, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2488, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_4)) {
        if (likely(PyList_CheckExact(__pyx_t_2))) {
          if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 2488, __pyx_L1_error)
          #else
          __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2488, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          #endif
        } else {
          if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 2488, __pyx_L1_error)
          #else
          __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2488, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          #endif
        }
      } else {
        __pyx_t_5 = __pyx_t_4(__pyx_t_2);
        if (unlikely(!__pyx_t_5)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 2488, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_5);
      }
      if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) {
        PyObject* sequence = __pyx_t_5;
        Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
        if (unlikely(size != 2)) {
          if (size > 2) __Pyx_RaiseTooManyValuesError(2);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          __PYX_ERR(0, 2488, __pyx_L1_error)
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); 
        } else {
          __pyx_t_6 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_7 = PyList_GET_ITEM(sequence, 1); 
        }
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_7);
        #else
        __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2488, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2488, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        #endif
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      } else {
        Py_ssize_t index = -1;
        __pyx_t_8 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2488, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext;
        index = 0; __pyx_t_6 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_6)) goto __pyx_L6_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_6);
        index = 1; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L6_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_7);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) __PYX_ERR(0, 2488, __pyx_L1_error)
        __pyx_t_9 = NULL;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        goto __pyx_L7_unpacking_done;
        __pyx_L6_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_9 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        __PYX_ERR(0, 2488, __pyx_L1_error)
        __pyx_L7_unpacking_done:;
      }
      __Pyx_XDECREF_SET(__pyx_v_before, __pyx_t_6);
      __pyx_t_6 = 0;
      __Pyx_XDECREF_SET(__pyx_v_after, __pyx_t_7);
      __pyx_t_7 = 0;

      /* "fstlib/cext/pywrapfst.pyx":2489
 *     if ipairs:
 *       for (before, after) in ipairs:
 *         _ipairs.push_back(fst.LabelPair(before, after))             # <<<<<<<<<<<<<<
 *     if opairs:
 *       for (before, after) in opairs:
 */
      __pyx_t_10 = __Pyx_PyInt_As_int64_t(__pyx_v_before); if (unlikely((__pyx_t_10 == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2489, __pyx_L1_error)
      __pyx_t_11 = __Pyx_PyInt_As_int64_t(__pyx_v_after); if (unlikely((__pyx_t_11 == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2489, __pyx_L1_error)
      try {
        __pyx_t_12 = __pyx_t_10cpywrapfst_LabelPair(__pyx_t_10, __pyx_t_11);
      } catch(...) {
        __Pyx_CppExn2PyErr();
        __PYX_ERR(0, 2489, __pyx_L1_error)
      }
      try {
        __pyx_v__ipairs.push_back(__pyx_t_12);
      } catch(...) {
        __Pyx_CppExn2PyErr();
        __PYX_ERR(0, 2489, __pyx_L1_error)
      }

      /* "fstlib/cext/pywrapfst.pyx":2488
 *     cdef vector[fst.LabelPair] _opairs
 *     if ipairs:
 *       for (before, after) in ipairs:             # <<<<<<<<<<<<<<
 *         _ipairs.push_back(fst.LabelPair(before, after))
 *     if opairs:
 */
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "fstlib/cext/pywrapfst.pyx":2487
 *     cdef vector[fst.LabelPair] _ipairs
 *     cdef vector[fst.LabelPair] _opairs
 *     if ipairs:             # <<<<<<<<<<<<<<
 *       for (before, after) in ipairs:
 *         _ipairs.push_back(fst.LabelPair(before, after))
 */
  }

  /* "fstlib/cext/pywrapfst.pyx":2490
 *       for (before, after) in ipairs:
 *         _ipairs.push_back(fst.LabelPair(before, after))
 *     if opairs:             # <<<<<<<<<<<<<<
 *       for (before, after) in opairs:
 *         _opairs.push_back(fst.LabelPair(before, after))
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_opairs); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 2490, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "fstlib/cext/pywrapfst.pyx":2491
 *         _ipairs.push_back(fst.LabelPair(before, after))
 *     if opairs:
 *       for (before, after) in opairs:             # <<<<<<<<<<<<<<
 *         _opairs.push_back(fst.LabelPair(before, after))
 *     if _ipairs.empty() and _opairs.empty():
 */
    if (likely(PyList_CheckExact(__pyx_v_opairs)) || PyTuple_CheckExact(__pyx_v_opairs)) {
      __pyx_t_2 = __pyx_v_opairs; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
      __pyx_t_4 = NULL;
    } else {
      __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_opairs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2491, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2491, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_4)) {
        if (likely(PyList_CheckExact(__pyx_t_2))) {
          if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 2491, __pyx_L1_error)
          #else
          __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2491, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          #endif
        } else {
          if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 2491, __pyx_L1_error)
          #else
          __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2491, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          #endif
        }
      } else {
        __pyx_t_5 = __pyx_t_4(__pyx_t_2);
        if (unlikely(!__pyx_t_5)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 2491, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_5);
      }
      if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) {
        PyObject* sequence = __pyx_t_5;
        Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
        if (unlikely(size != 2)) {
          if (size > 2) __Pyx_RaiseTooManyValuesError(2);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          __PYX_ERR(0, 2491, __pyx_L1_error)
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); 
        } else {
          __pyx_t_7 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_6 = PyList_GET_ITEM(sequence, 1); 
        }
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_6);
        #else
        __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2491, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2491, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        #endif
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      } else {
        Py_ssize_t index = -1;
        __pyx_t_8 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2491, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext;
        index = 0; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L11_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_7);
        index = 1; __pyx_t_6 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_6)) goto __pyx_L11_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_6);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) __PYX_ERR(0, 2491, __pyx_L1_error)
        __pyx_t_9 = NULL;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        goto __pyx_L12_unpacking_done;
        __pyx_L11_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_9 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        __PYX_ERR(0, 2491, __pyx_L1_error)
        __pyx_L12_unpacking_done:;
      }
      __Pyx_XDECREF_SET(__pyx_v_before, __pyx_t_7);
      __pyx_t_7 = 0;
      __Pyx_XDECREF_SET(__pyx_v_after, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "fstlib/cext/pywrapfst.pyx":2492
 *     if opairs:
 *       for (before, after) in opairs:
 *         _opairs.push_back(fst.LabelPair(before, after))             # <<<<<<<<<<<<<<
 *     if _ipairs.empty() and _opairs.empty():
 *       raise FstArgError("No relabeling pairs specified")
 */
      __pyx_t_11 = __Pyx_PyInt_As_int64_t(__pyx_v_before); if (unlikely((__pyx_t_11 == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2492, __pyx_L1_error)
      __pyx_t_10 = __Pyx_PyInt_As_int64_t(__pyx_v_after); if (unlikely((__pyx_t_10 == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2492, __pyx_L1_error)
      try {
        __pyx_t_12 = __pyx_t_10cpywrapfst_LabelPair(__pyx_t_11, __pyx_t_10);
      } catch(...) {
        __Pyx_CppExn2PyErr();
        __PYX_ERR(0, 2492, __pyx_L1_error)
      }
      try {
        __pyx_v__opairs.push_back(__pyx_t_12);
      } catch(...) {
        __Pyx_CppExn2PyErr();
        __PYX_ERR(0, 2492, __pyx_L1_error)
      }

      /* "fstlib/cext/pywrapfst.pyx":2491
 *         _ipairs.push_back(fst.LabelPair(before, after))
 *     if opairs:
 *       for (before, after) in opairs:             # <<<<<<<<<<<<<<
 *         _opairs.push_back(fst.LabelPair(before, after))
 *     if _ipairs.empty() and _opairs.empty():
 */
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "fstlib/cext/pywrapfst.pyx":2490
 *       for (before, after) in ipairs:
 *         _ipairs.push_back(fst.LabelPair(before, after))
 *     if opairs:             # <<<<<<<<<<<<<<
 *       for (before, after) in opairs:
 *         _opairs.push_back(fst.LabelPair(before, after))
 */
  }

  /* "fstlib/cext/pywrapfst.pyx":2493
 *       for (before, after) in opairs:
 *         _opairs.push_back(fst.LabelPair(before, after))
 *     if _ipairs.empty() and _opairs.empty():             # <<<<<<<<<<<<<<
 *       raise FstArgError("No relabeling pairs specified")
 *     fst.Relabel(self._mfst.get(), _ipairs, _opairs)
 */
  __pyx_t_13 = (__pyx_v__ipairs.empty() != 0);
  if (__pyx_t_13) {
  } else {
    __pyx_t_1 = __pyx_t_13;
    goto __pyx_L14_bool_binop_done;
  }
  __pyx_t_13 = (__pyx_v__opairs.empty() != 0);
  __pyx_t_1 = __pyx_t_13;
  __pyx_L14_bool_binop_done:;
  if (unlikely(__pyx_t_1)) {

    /* "fstlib/cext/pywrapfst.pyx":2494
 *         _opairs.push_back(fst.LabelPair(before, after))
 *     if _ipairs.empty() and _opairs.empty():
 *       raise FstArgError("No relabeling pairs specified")             # <<<<<<<<<<<<<<
 *     fst.Relabel(self._mfst.get(), _ipairs, _opairs)
 *     self._check_mutating_imethod()
 */
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_FstArgError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2494, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_kp_u_No_relabeling_pairs_specified) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_kp_u_No_relabeling_pairs_specified);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2494, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 2494, __pyx_L1_error)

    /* "fstlib/cext/pywrapfst.pyx":2493
 *       for (before, after) in opairs:
 *         _opairs.push_back(fst.LabelPair(before, after))
 *     if _ipairs.empty() and _opairs.empty():             # <<<<<<<<<<<<<<
 *       raise FstArgError("No relabeling pairs specified")
 *     fst.Relabel(self._mfst.get(), _ipairs, _opairs)
 */
  }

  /* "fstlib/cext/pywrapfst.pyx":2495
 *     if _ipairs.empty() and _opairs.empty():
 *       raise FstArgError("No relabeling pairs specified")
 *     fst.Relabel(self._mfst.get(), _ipairs, _opairs)             # <<<<<<<<<<<<<<
 *     self._check_mutating_imethod()
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
    __PYX_ERR(0, 2495, __pyx_L1_error)
  }
  fst::script::Relabel(__pyx_v_self->_mfst.get(), __pyx_v__ipairs, __pyx_v__opairs);

  /* "fstlib/cext/pywrapfst.pyx":2496
 *       raise FstArgError("No relabeling pairs specified")
 *     fst.Relabel(self._mfst.get(), _ipairs, _opairs)
 *     self._check_mutating_imethod()             # <<<<<<<<<<<<<<
 * 
 *   def relabel_pairs(self, ipairs=None, opairs=None):
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_check_mutating_imethod");
    __PYX_ERR(0, 2496, __pyx_L1_error)
  }
  ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2496, __pyx_L1_error)

  /* "fstlib/cext/pywrapfst.pyx":2484
 *     return self
 * 
 *   cdef void _relabel_pairs(self, ipairs=None, opairs=None) except *:             # <<<<<<<<<<<<<<
 *     cdef vector[fst.LabelPair] _ipairs
 *     cdef vector[fst.LabelPair] _opairs
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.MutableFst._relabel_pairs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_before);
  __Pyx_XDECREF(__pyx_v_after);
  __Pyx_RefNannyFinishContext();
}

/* "fstlib/cext/pywrapfst.pyx":2498
 *     self._check_mutating_imethod()
 * 
 *   def relabel_pairs(self, ipairs=None, opairs=None):             # <<<<<<<<<<<<<<
 *     """
 *     relabel_pairs(self, ipairs=None, opairs=None)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_41relabel_pairs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_10MutableFst_40relabel_pairs[] = "\n    relabel_pairs(self, ipairs=None, opairs=None)\n\n    Replaces input and/or output labels using pairs of labels.\n\n    This operation destructively relabels the input and/or output labels of the\n    FST using pairs of the form (old_ID, new_ID); omitted indices are\n    identity-mapped.\n\n    Args:\n      ipairs: An iterable containing (older index, newer index) integer pairs.\n      opairs: An iterable containing (older index, newer index) integer pairs.\n\n    Returns:\n      self.\n\n    Raises:\n      FstArgError: No relabeling pairs specified.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_41relabel_pairs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_ipairs = 0;
  PyObject *__pyx_v_opairs = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("relabel_pairs (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ipairs,&__pyx_n_s_opairs,0};
    PyObject* values[2] = {0,0};
    values[0] = ((PyObject *)Py_None);
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ipairs);
          if (value) { values[0] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_opairs);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "relabel_pairs") < 0)) __PYX_ERR(0, 2498, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_ipairs = values[0];
    __pyx_v_opairs = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("relabel_pairs", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2498, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.MutableFst.relabel_pairs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_10MutableFst_40relabel_pairs(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *)__pyx_v_self), __pyx_v_ipairs, __pyx_v_opairs);

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_10MutableFst_40relabel_pairs(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, PyObject *__pyx_v_ipairs, PyObject *__pyx_v_opairs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_10MutableFst__relabel_pairs __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("relabel_pairs", 0);

  /* "fstlib/cext/pywrapfst.pyx":2518
 *       FstArgError: No relabeling pairs specified.
 *     """
 *     self._relabel_pairs(ipairs, opairs)             # <<<<<<<<<<<<<<
 *     return self
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_relabel_pairs");
    __PYX_ERR(0, 2518, __pyx_L1_error)
  }
  __pyx_t_1.__pyx_n = 2;
  __pyx_t_1.ipairs = __pyx_v_ipairs;
  __pyx_t_1.opairs = __pyx_v_opairs;
  ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_relabel_pairs(__pyx_v_self, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2518, __pyx_L1_error)

  /* "fstlib/cext/pywrapfst.pyx":2519
 *     """
 *     self._relabel_pairs(ipairs, opairs)
 *     return self             # <<<<<<<<<<<<<<
 * 
 *   cdef void _relabel_tables(self,
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":2498
 *     self._check_mutating_imethod()
 * 
 *   def relabel_pairs(self, ipairs=None, opairs=None):             # <<<<<<<<<<<<<<
 *     """
 *     relabel_pairs(self, ipairs=None, opairs=None)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.MutableFst.relabel_pairs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":2521
 *     return self
 * 
 *   cdef void _relabel_tables(self,             # <<<<<<<<<<<<<<
 *                             SymbolTableView old_isymbols=None,
 *                             SymbolTableView new_isymbols=None,
 */

static void __pyx_f_6fstlib_4cext_9pywrapfst_10MutableFst__relabel_tables(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_10MutableFst__relabel_tables *__pyx_optional_args) {

  /* "fstlib/cext/pywrapfst.pyx":2522
 * 
 *   cdef void _relabel_tables(self,
 *                             SymbolTableView old_isymbols=None,             # <<<<<<<<<<<<<<
 *                             SymbolTableView new_isymbols=None,
 *                             unknown_isymbol="",
 */
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_old_isymbols = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *)Py_None);

  /* "fstlib/cext/pywrapfst.pyx":2523
 *   cdef void _relabel_tables(self,
 *                             SymbolTableView old_isymbols=None,
 *                             SymbolTableView new_isymbols=None,             # <<<<<<<<<<<<<<
 *                             unknown_isymbol="",
 *                             bool attach_new_isymbols=True,
 */
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_new_isymbols = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *)Py_None);
  PyObject *__pyx_v_unknown_isymbol = ((PyObject *)__pyx_kp_u__11);

  /* "fstlib/cext/pywrapfst.pyx":2525
 *                             SymbolTableView new_isymbols=None,
 *                             unknown_isymbol="",
 *                             bool attach_new_isymbols=True,             # <<<<<<<<<<<<<<
 *                             SymbolTableView old_osymbols=None,
 *                             SymbolTableView new_osymbols=None,
 */
  bool __pyx_v_attach_new_isymbols = ((bool)1);

  /* "fstlib/cext/pywrapfst.pyx":2526
 *                             unknown_isymbol="",
 *                             bool attach_new_isymbols=True,
 *                             SymbolTableView old_osymbols=None,             # <<<<<<<<<<<<<<
 *                             SymbolTableView new_osymbols=None,
 *                             unknown_osymbol="",
 */
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_old_osymbols = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *)Py_None);

  /* "fstlib/cext/pywrapfst.pyx":2527
 *                             bool attach_new_isymbols=True,
 *                             SymbolTableView old_osymbols=None,
 *                             SymbolTableView new_osymbols=None,             # <<<<<<<<<<<<<<
 *                             unknown_osymbol="",
 *                             bool attach_new_osymbols=True) except *:
 */
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_new_osymbols = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *)Py_None);
  PyObject *__pyx_v_unknown_osymbol = ((PyObject *)__pyx_kp_u__11);

  /* "fstlib/cext/pywrapfst.pyx":2529
 *                             SymbolTableView new_osymbols=None,
 *                             unknown_osymbol="",
 *                             bool attach_new_osymbols=True) except *:             # <<<<<<<<<<<<<<
 *     if new_isymbols is None and new_osymbols is None:
 *       raise FstArgError("No new SymbolTables specified")
 */
  bool __pyx_v_attach_new_osymbols = ((bool)1);
  fst::SymbolTable const *__pyx_v__old_isymbols;
  fst::SymbolTable const *__pyx_v__old_osymbols;
  fst::SymbolTable const *__pyx_v__new_isymbols;
  fst::SymbolTable const *__pyx_v__new_osymbols;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  fst::SymbolTable const *__pyx_t_7;
  std::string __pyx_t_8;
  std::string __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_relabel_tables", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_old_isymbols = __pyx_optional_args->old_isymbols;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_new_isymbols = __pyx_optional_args->new_isymbols;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_unknown_isymbol = __pyx_optional_args->unknown_isymbol;
          if (__pyx_optional_args->__pyx_n > 3) {
            __pyx_v_attach_new_isymbols = __pyx_optional_args->attach_new_isymbols;
            if (__pyx_optional_args->__pyx_n > 4) {
              __pyx_v_old_osymbols = __pyx_optional_args->old_osymbols;
              if (__pyx_optional_args->__pyx_n > 5) {
                __pyx_v_new_osymbols = __pyx_optional_args->new_osymbols;
                if (__pyx_optional_args->__pyx_n > 6) {
                  __pyx_v_unknown_osymbol = __pyx_optional_args->unknown_osymbol;
                  if (__pyx_optional_args->__pyx_n > 7) {
                    __pyx_v_attach_new_osymbols = __pyx_optional_args->attach_new_osymbols;
                  }
                }
              }
            }
          }
        }
      }
    }
  }

  /* "fstlib/cext/pywrapfst.pyx":2530
 *                             unknown_osymbol="",
 *                             bool attach_new_osymbols=True) except *:
 *     if new_isymbols is None and new_osymbols is None:             # <<<<<<<<<<<<<<
 *       raise FstArgError("No new SymbolTables specified")
 *     cdef const fst.SymbolTable *_old_isymbols = self._fst.get().InputSymbols()
 */
  __pyx_t_2 = (((PyObject *)__pyx_v_new_isymbols) == Py_None);
  __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 = (((PyObject *)__pyx_v_new_osymbols) == Py_None);
  __pyx_t_2 = (__pyx_t_3 != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (unlikely(__pyx_t_1)) {

    /* "fstlib/cext/pywrapfst.pyx":2531
 *                             bool attach_new_osymbols=True) except *:
 *     if new_isymbols is None and new_osymbols is None:
 *       raise FstArgError("No new SymbolTables specified")             # <<<<<<<<<<<<<<
 *     cdef const fst.SymbolTable *_old_isymbols = self._fst.get().InputSymbols()
 *     if old_isymbols is not None:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_FstArgError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2531, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_kp_u_No_new_SymbolTables_specified) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_kp_u_No_new_SymbolTables_specified);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2531, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(0, 2531, __pyx_L1_error)

    /* "fstlib/cext/pywrapfst.pyx":2530
 *                             unknown_osymbol="",
 *                             bool attach_new_osymbols=True) except *:
 *     if new_isymbols is None and new_osymbols is None:             # <<<<<<<<<<<<<<
 *       raise FstArgError("No new SymbolTables specified")
 *     cdef const fst.SymbolTable *_old_isymbols = self._fst.get().InputSymbols()
 */
  }

  /* "fstlib/cext/pywrapfst.pyx":2532
 *     if new_isymbols is None and new_osymbols is None:
 *       raise FstArgError("No new SymbolTables specified")
 *     cdef const fst.SymbolTable *_old_isymbols = self._fst.get().InputSymbols()             # <<<<<<<<<<<<<<
 *     if old_isymbols is not None:
 *       _old_isymbols = old_isymbols._raw_ptr_or_raise()
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 2532, __pyx_L1_error)
  }
  __pyx_v__old_isymbols = __pyx_v_self->__pyx_base._fst.get()->InputSymbols();

  /* "fstlib/cext/pywrapfst.pyx":2533
 *       raise FstArgError("No new SymbolTables specified")
 *     cdef const fst.SymbolTable *_old_isymbols = self._fst.get().InputSymbols()
 *     if old_isymbols is not None:             # <<<<<<<<<<<<<<
 *       _old_isymbols = old_isymbols._raw_ptr_or_raise()
 *     cdef const fst.SymbolTable *_old_osymbols = self._fst.get().OutputSymbols()
 */
  __pyx_t_1 = (((PyObject *)__pyx_v_old_isymbols) != Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "fstlib/cext/pywrapfst.pyx":2534
 *     cdef const fst.SymbolTable *_old_isymbols = self._fst.get().InputSymbols()
 *     if old_isymbols is not None:
 *       _old_isymbols = old_isymbols._raw_ptr_or_raise()             # <<<<<<<<<<<<<<
 *     cdef const fst.SymbolTable *_old_osymbols = self._fst.get().OutputSymbols()
 *     if old_osymbols is not None:
 */
    if (unlikely(((PyObject *)__pyx_v_old_isymbols) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raw_ptr_or_raise");
      __PYX_ERR(0, 2534, __pyx_L1_error)
    }
    __pyx_t_7 = ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_SymbolTableView *)__pyx_v_old_isymbols->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_old_isymbols); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2534, __pyx_L1_error)
    __pyx_v__old_isymbols = __pyx_t_7;

    /* "fstlib/cext/pywrapfst.pyx":2533
 *       raise FstArgError("No new SymbolTables specified")
 *     cdef const fst.SymbolTable *_old_isymbols = self._fst.get().InputSymbols()
 *     if old_isymbols is not None:             # <<<<<<<<<<<<<<
 *       _old_isymbols = old_isymbols._raw_ptr_or_raise()
 *     cdef const fst.SymbolTable *_old_osymbols = self._fst.get().OutputSymbols()
 */
  }

  /* "fstlib/cext/pywrapfst.pyx":2535
 *     if old_isymbols is not None:
 *       _old_isymbols = old_isymbols._raw_ptr_or_raise()
 *     cdef const fst.SymbolTable *_old_osymbols = self._fst.get().OutputSymbols()             # <<<<<<<<<<<<<<
 *     if old_osymbols is not None:
 *        _old_osymbols = old_osymbols._raw_ptr_or_raise()
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 2535, __pyx_L1_error)
  }
  __pyx_v__old_osymbols = __pyx_v_self->__pyx_base._fst.get()->OutputSymbols();

  /* "fstlib/cext/pywrapfst.pyx":2536
 *       _old_isymbols = old_isymbols._raw_ptr_or_raise()
 *     cdef const fst.SymbolTable *_old_osymbols = self._fst.get().OutputSymbols()
 *     if old_osymbols is not None:             # <<<<<<<<<<<<<<
 *        _old_osymbols = old_osymbols._raw_ptr_or_raise()
 *     cdef const fst.SymbolTable *_new_isymbols = NULL
 */
  __pyx_t_2 = (((PyObject *)__pyx_v_old_osymbols) != Py_None);
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "fstlib/cext/pywrapfst.pyx":2537
 *     cdef const fst.SymbolTable *_old_osymbols = self._fst.get().OutputSymbols()
 *     if old_osymbols is not None:
 *        _old_osymbols = old_osymbols._raw_ptr_or_raise()             # <<<<<<<<<<<<<<
 *     cdef const fst.SymbolTable *_new_isymbols = NULL
 *     if new_isymbols is not None:
 */
    if (unlikely(((PyObject *)__pyx_v_old_osymbols) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raw_ptr_or_raise");
      __PYX_ERR(0, 2537, __pyx_L1_error)
    }
    __pyx_t_7 = ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_SymbolTableView *)__pyx_v_old_osymbols->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_old_osymbols); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2537, __pyx_L1_error)
    __pyx_v__old_osymbols = __pyx_t_7;

    /* "fstlib/cext/pywrapfst.pyx":2536
 *       _old_isymbols = old_isymbols._raw_ptr_or_raise()
 *     cdef const fst.SymbolTable *_old_osymbols = self._fst.get().OutputSymbols()
 *     if old_osymbols is not None:             # <<<<<<<<<<<<<<
 *        _old_osymbols = old_osymbols._raw_ptr_or_raise()
 *     cdef const fst.SymbolTable *_new_isymbols = NULL
 */
  }

  /* "fstlib/cext/pywrapfst.pyx":2538
 *     if old_osymbols is not None:
 *        _old_osymbols = old_osymbols._raw_ptr_or_raise()
 *     cdef const fst.SymbolTable *_new_isymbols = NULL             # <<<<<<<<<<<<<<
 *     if new_isymbols is not None:
 *       _new_isymbols = new_isymbols._raw_ptr_or_raise()
 */
  __pyx_v__new_isymbols = NULL;

  /* "fstlib/cext/pywrapfst.pyx":2539
 *        _old_osymbols = old_osymbols._raw_ptr_or_raise()
 *     cdef const fst.SymbolTable *_new_isymbols = NULL
 *     if new_isymbols is not None:             # <<<<<<<<<<<<<<
 *       _new_isymbols = new_isymbols._raw_ptr_or_raise()
 *     cdef const fst.SymbolTable *_new_osymbols = NULL
 */
  __pyx_t_1 = (((PyObject *)__pyx_v_new_isymbols) != Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "fstlib/cext/pywrapfst.pyx":2540
 *     cdef const fst.SymbolTable *_new_isymbols = NULL
 *     if new_isymbols is not None:
 *       _new_isymbols = new_isymbols._raw_ptr_or_raise()             # <<<<<<<<<<<<<<
 *     cdef const fst.SymbolTable *_new_osymbols = NULL
 *     if new_osymbols is not None:
 */
    if (unlikely(((PyObject *)__pyx_v_new_isymbols) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raw_ptr_or_raise");
      __PYX_ERR(0, 2540, __pyx_L1_error)
    }
    __pyx_t_7 = ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_SymbolTableView *)__pyx_v_new_isymbols->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_new_isymbols); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2540, __pyx_L1_error)
    __pyx_v__new_isymbols = __pyx_t_7;

    /* "fstlib/cext/pywrapfst.pyx":2539
 *        _old_osymbols = old_osymbols._raw_ptr_or_raise()
 *     cdef const fst.SymbolTable *_new_isymbols = NULL
 *     if new_isymbols is not None:             # <<<<<<<<<<<<<<
 *       _new_isymbols = new_isymbols._raw_ptr_or_raise()
 *     cdef const fst.SymbolTable *_new_osymbols = NULL
 */
  }

  /* "fstlib/cext/pywrapfst.pyx":2541
 *     if new_isymbols is not None:
 *       _new_isymbols = new_isymbols._raw_ptr_or_raise()
 *     cdef const fst.SymbolTable *_new_osymbols = NULL             # <<<<<<<<<<<<<<
 *     if new_osymbols is not None:
 *       _new_osymbols = new_osymbols._raw_ptr_or_raise()
 */
  __pyx_v__new_osymbols = NULL;

  /* "fstlib/cext/pywrapfst.pyx":2542
 *       _new_isymbols = new_isymbols._raw_ptr_or_raise()
 *     cdef const fst.SymbolTable *_new_osymbols = NULL
 *     if new_osymbols is not None:             # <<<<<<<<<<<<<<
 *       _new_osymbols = new_osymbols._raw_ptr_or_raise()
 *     fst.Relabel(self._mfst.get(),
 */
  __pyx_t_2 = (((PyObject *)__pyx_v_new_osymbols) != Py_None);
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "fstlib/cext/pywrapfst.pyx":2543
 *     cdef const fst.SymbolTable *_new_osymbols = NULL
 *     if new_osymbols is not None:
 *       _new_osymbols = new_osymbols._raw_ptr_or_raise()             # <<<<<<<<<<<<<<
 *     fst.Relabel(self._mfst.get(),
 *         _old_isymbols,
 */
    if (unlikely(((PyObject *)__pyx_v_new_osymbols) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raw_ptr_or_raise");
      __PYX_ERR(0, 2543, __pyx_L1_error)
    }
    __pyx_t_7 = ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_SymbolTableView *)__pyx_v_new_osymbols->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_new_osymbols); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2543, __pyx_L1_error)
    __pyx_v__new_osymbols = __pyx_t_7;

    /* "fstlib/cext/pywrapfst.pyx":2542
 *       _new_isymbols = new_isymbols._raw_ptr_or_raise()
 *     cdef const fst.SymbolTable *_new_osymbols = NULL
 *     if new_osymbols is not None:             # <<<<<<<<<<<<<<
 *       _new_osymbols = new_osymbols._raw_ptr_or_raise()
 *     fst.Relabel(self._mfst.get(),
 */
  }

  /* "fstlib/cext/pywrapfst.pyx":2544
 *     if new_osymbols is not None:
 *       _new_osymbols = new_osymbols._raw_ptr_or_raise()
 *     fst.Relabel(self._mfst.get(),             # <<<<<<<<<<<<<<
 *         _old_isymbols,
 *         _new_isymbols,
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
    __PYX_ERR(0, 2544, __pyx_L1_error)
  }

  /* "fstlib/cext/pywrapfst.pyx":2547
 *         _old_isymbols,
 *         _new_isymbols,
 *         tostring(unknown_isymbol),             # <<<<<<<<<<<<<<
 *         attach_new_isymbols,
 *         _old_osymbols,
 */
  __pyx_t_8 = __pyx_f_6fstlib_4cext_9pywrapfst_tostring(__pyx_v_unknown_isymbol); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2547, __pyx_L1_error)

  /* "fstlib/cext/pywrapfst.pyx":2551
 *         _old_osymbols,
 *         _new_osymbols,
 *         tostring(unknown_osymbol),             # <<<<<<<<<<<<<<
 *         attach_new_osymbols)
 *     self._check_mutating_imethod()
 */
  __pyx_t_9 = __pyx_f_6fstlib_4cext_9pywrapfst_tostring(__pyx_v_unknown_osymbol); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2551, __pyx_L1_error)

  /* "fstlib/cext/pywrapfst.pyx":2544
 *     if new_osymbols is not None:
 *       _new_osymbols = new_osymbols._raw_ptr_or_raise()
 *     fst.Relabel(self._mfst.get(),             # <<<<<<<<<<<<<<
 *         _old_isymbols,
 *         _new_isymbols,
 */
  fst::script::Relabel(__pyx_v_self->_mfst.get(), __pyx_v__old_isymbols, __pyx_v__new_isymbols, __pyx_t_8, __pyx_v_attach_new_isymbols, __pyx_v__old_osymbols, __pyx_v__new_osymbols, __pyx_t_9, __pyx_v_attach_new_osymbols);

  /* "fstlib/cext/pywrapfst.pyx":2553
 *         tostring(unknown_osymbol),
 *         attach_new_osymbols)
 *     self._check_mutating_imethod()             # <<<<<<<<<<<<<<
 * 
 *   def relabel_tables(self,
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_check_mutating_imethod");
    __PYX_ERR(0, 2553, __pyx_L1_error)
  }
  ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2553, __pyx_L1_error)

  /* "fstlib/cext/pywrapfst.pyx":2521
 *     return self
 * 
 *   cdef void _relabel_tables(self,             # <<<<<<<<<<<<<<
 *                             SymbolTableView old_isymbols=None,
 *                             SymbolTableView new_isymbols=None,
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.MutableFst._relabel_tables", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "fstlib/cext/pywrapfst.pyx":2555
 *     self._check_mutating_imethod()
 * 
 *   def relabel_tables(self,             # <<<<<<<<<<<<<<
 *                      SymbolTableView old_isymbols=None,
 *                      SymbolTableView new_isymbols=None,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_43relabel_tables(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_10MutableFst_42relabel_tables[] = "\n    relabel_tables(self, old_isymbols=None, new_isymbols=None,\n                   unknown_isymbol=\"\", attach_new_isymbols=True,\n                   old_osymbols=None, new_osymbols=None,\n                   unknown_osymbol=\"\", attach_new_osymbols=True)\n\n    Replaces input and/or output labels using SymbolTables.\n\n    This operation destructively relabels the input and/or output labels of the\n    FST using user-specified symbol tables; omitted symbols are identity-mapped.\n\n    Args:\n       old_isymbols: The old SymbolTable for input labels, defaulting to the\n          FST's input symbol table.\n       new_isymbols: A SymbolTable used to relabel the input labels\n       unknown_isymbol: Input symbol to use to relabel OOVs (if empty,\n          OOVs raise an exception)\n       attach_new_isymbols: Should new_isymbols be made the FST's input symbol\n          table?\n       old_osymbols: The old SymbolTable for output labels, defaulting to the\n          FST's output symbol table.\n       new_osymbols: A SymbolTable used to relabel the output labels.\n       unknown_osymbol: Outnput symbol to use to relabel OOVs (if empty,\n          OOVs raise an exception)\n       attach_new_isymbols: Should new_osymbols be made the FST's output symbol\n          table?\n\n    Returns:\n      self.\n\n    Raises:\n      FstArgError: No SymbolTable specified.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_43relabel_tables(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_old_isymbols = 0;
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_new_isymbols = 0;
  PyObject *__pyx_v_unknown_isymbol = 0;
  bool __pyx_v_attach_new_isymbols;
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_old_osymbols = 0;
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_new_osymbols = 0;
  PyObject *__pyx_v_unknown_osymbol = 0;
  bool __pyx_v_attach_new_osymbols;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("relabel_tables (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_old_isymbols,&__pyx_n_s_new_isymbols,&__pyx_n_s_unknown_isymbol,&__pyx_n_s_attach_new_isymbols,&__pyx_n_s_old_osymbols,&__pyx_n_s_new_osymbols,&__pyx_n_s_unknown_osymbol,&__pyx_n_s_attach_new_osymbols,0};
    PyObject* values[8] = {0,0,0,0,0,0,0,0};

    /* "fstlib/cext/pywrapfst.pyx":2556
 * 
 *   def relabel_tables(self,
 *                      SymbolTableView old_isymbols=None,             # <<<<<<<<<<<<<<
 *                      SymbolTableView new_isymbols=None,
 *                      unknown_isymbol="",
 */
    values[0] = (PyObject *)((struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *)Py_None);

    /* "fstlib/cext/pywrapfst.pyx":2557
 *   def relabel_tables(self,
 *                      SymbolTableView old_isymbols=None,
 *                      SymbolTableView new_isymbols=None,             # <<<<<<<<<<<<<<
 *                      unknown_isymbol="",
 *                      bool attach_new_isymbols=True,
 */
    values[1] = (PyObject *)((struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *)Py_None);
    values[2] = ((PyObject *)__pyx_kp_u__11);

    /* "fstlib/cext/pywrapfst.pyx":2560
 *                      unknown_isymbol="",
 *                      bool attach_new_isymbols=True,
 *                      SymbolTableView old_osymbols=None,             # <<<<<<<<<<<<<<
 *                      SymbolTableView new_osymbols=None,
 *                      unknown_osymbol="",
 */
    values[4] = (PyObject *)((struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *)Py_None);

    /* "fstlib/cext/pywrapfst.pyx":2561
 *                      bool attach_new_isymbols=True,
 *                      SymbolTableView old_osymbols=None,
 *                      SymbolTableView new_osymbols=None,             # <<<<<<<<<<<<<<
 *                      unknown_osymbol="",
 *                      bool attach_new_osymbols=True):
 */
    values[5] = (PyObject *)((struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *)Py_None);
    values[6] = ((PyObject *)__pyx_kp_u__11);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_old_isymbols);
          if (value) { values[0] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_new_isymbols);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_unknown_isymbol);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_attach_new_isymbols);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_old_osymbols);
          if (value) { values[4] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_new_osymbols);
          if (value) { values[5] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_unknown_osymbol);
          if (value) { values[6] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_attach_new_osymbols);
          if (value) { values[7] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "relabel_tables") < 0)) __PYX_ERR(0, 2555, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_old_isymbols = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *)values[0]);
    __pyx_v_new_isymbols = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *)values[1]);
    __pyx_v_unknown_isymbol = values[2];
    if (values[3]) {
      __pyx_v_attach_new_isymbols = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_attach_new_isymbols == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2559, __pyx_L3_error)
    } else {

      /* "fstlib/cext/pywrapfst.pyx":2559
 *                      SymbolTableView new_isymbols=None,
 *                      unknown_isymbol="",
 *                      bool attach_new_isymbols=True,             # <<<<<<<<<<<<<<
 *                      SymbolTableView old_osymbols=None,
 *                      SymbolTableView new_osymbols=None,
 */
      __pyx_v_attach_new_isymbols = ((bool)1);
    }
    __pyx_v_old_osymbols = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *)values[4]);
    __pyx_v_new_osymbols = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *)values[5]);
    __pyx_v_unknown_osymbol = values[6];
    if (values[7]) {
      __pyx_v_attach_new_osymbols = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_attach_new_osymbols == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2563, __pyx_L3_error)
    } else {

      /* "fstlib/cext/pywrapfst.pyx":2563
 *                      SymbolTableView new_osymbols=None,
 *                      unknown_osymbol="",
 *                      bool attach_new_osymbols=True):             # <<<<<<<<<<<<<<
 *     """
 *     relabel_tables(self, old_isymbols=None, new_isymbols=None,
 */
      __pyx_v_attach_new_osymbols = ((bool)1);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("relabel_tables", 0, 0, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2555, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.MutableFst.relabel_tables", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_old_isymbols), __pyx_ptype_6fstlib_4cext_9pywrapfst_SymbolTableView, 1, "old_isymbols", 0))) __PYX_ERR(0, 2556, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_new_isymbols), __pyx_ptype_6fstlib_4cext_9pywrapfst_SymbolTableView, 1, "new_isymbols", 0))) __PYX_ERR(0, 2557, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_old_osymbols), __pyx_ptype_6fstlib_4cext_9pywrapfst_SymbolTableView, 1, "old_osymbols", 0))) __PYX_ERR(0, 2560, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_new_osymbols), __pyx_ptype_6fstlib_4cext_9pywrapfst_SymbolTableView, 1, "new_osymbols", 0))) __PYX_ERR(0, 2561, __pyx_L1_error)
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_10MutableFst_42relabel_tables(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *)__pyx_v_self), __pyx_v_old_isymbols, __pyx_v_new_isymbols, __pyx_v_unknown_isymbol, __pyx_v_attach_new_isymbols, __pyx_v_old_osymbols, __pyx_v_new_osymbols, __pyx_v_unknown_osymbol, __pyx_v_attach_new_osymbols);

  /* "fstlib/cext/pywrapfst.pyx":2555
 *     self._check_mutating_imethod()
 * 
 *   def relabel_tables(self,             # <<<<<<<<<<<<<<
 *                      SymbolTableView old_isymbols=None,
 *                      SymbolTableView new_isymbols=None,
 */

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_10MutableFst_42relabel_tables(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_old_isymbols, struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_new_isymbols, PyObject *__pyx_v_unknown_isymbol, bool __pyx_v_attach_new_isymbols, struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_old_osymbols, struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_new_osymbols, PyObject *__pyx_v_unknown_osymbol, bool __pyx_v_attach_new_osymbols) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_10MutableFst__relabel_tables __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("relabel_tables", 0);

  /* "fstlib/cext/pywrapfst.pyx":2597
 *       FstArgError: No SymbolTable specified.
 *     """
 *     self._relabel_tables(old_isymbols,             # <<<<<<<<<<<<<<
 *                          new_isymbols,
 *                          unknown_isymbol,
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_relabel_tables");
    __PYX_ERR(0, 2597, __pyx_L1_error)
  }

  /* "fstlib/cext/pywrapfst.pyx":2604
 *                          new_osymbols,
 *                          unknown_osymbol,
 *                          attach_new_osymbols)             # <<<<<<<<<<<<<<
 *     return self
 * 
 */
  __pyx_t_1.__pyx_n = 8;
  __pyx_t_1.old_isymbols = __pyx_v_old_isymbols;
  __pyx_t_1.new_isymbols = __pyx_v_new_isymbols;
  __pyx_t_1.unknown_isymbol = __pyx_v_unknown_isymbol;
  __pyx_t_1.attach_new_isymbols = __pyx_v_attach_new_isymbols;
  __pyx_t_1.old_osymbols = __pyx_v_old_osymbols;
  __pyx_t_1.new_osymbols = __pyx_v_new_osymbols;
  __pyx_t_1.unknown_osymbol = __pyx_v_unknown_osymbol;
  __pyx_t_1.attach_new_osymbols = __pyx_v_attach_new_osymbols;
  ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_relabel_tables(__pyx_v_self, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2597, __pyx_L1_error)

  /* "fstlib/cext/pywrapfst.pyx":2605
 *                          unknown_osymbol,
 *                          attach_new_osymbols)
 *     return self             # <<<<<<<<<<<<<<
 * 
 *   cdef void _reserve_arcs(self, int64 state, size_t n) except *:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":2555
 *     self._check_mutating_imethod()
 * 
 *   def relabel_tables(self,             # <<<<<<<<<<<<<<
 *                      SymbolTableView old_isymbols=None,
 *                      SymbolTableView new_isymbols=None,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.MutableFst.relabel_tables", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":2607
 *     return self
 * 
 *   cdef void _reserve_arcs(self, int64 state, size_t n) except *:             # <<<<<<<<<<<<<<
 *     if not self._mfst.get().ReserveArcs(state, n):
 *       raise FstIndexError("State index out of range")
 */

static void __pyx_f_6fstlib_4cext_9pywrapfst_10MutableFst__reserve_arcs(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, int64 __pyx_v_state, size_t __pyx_v_n) {
  __Pyx_RefNannyDeclarations
  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("_reserve_arcs", 0);

  /* "fstlib/cext/pywrapfst.pyx":2608
 * 
 *   cdef void _reserve_arcs(self, int64 state, size_t n) except *:
 *     if not self._mfst.get().ReserveArcs(state, n):             # <<<<<<<<<<<<<<
 *       raise FstIndexError("State index out of range")
 *     self._check_mutating_imethod()
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
    __PYX_ERR(0, 2608, __pyx_L1_error)
  }
  __pyx_t_1 = ((!(__pyx_v_self->_mfst.get()->ReserveArcs(__pyx_v_state, __pyx_v_n) != 0)) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "fstlib/cext/pywrapfst.pyx":2609
 *   cdef void _reserve_arcs(self, int64 state, size_t n) except *:
 *     if not self._mfst.get().ReserveArcs(state, n):
 *       raise FstIndexError("State index out of range")             # <<<<<<<<<<<<<<
 *     self._check_mutating_imethod()
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2609, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_kp_u_State_index_out_of_range) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_u_State_index_out_of_range);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2609, __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(0, 2609, __pyx_L1_error)

    /* "fstlib/cext/pywrapfst.pyx":2608
 * 
 *   cdef void _reserve_arcs(self, int64 state, size_t n) except *:
 *     if not self._mfst.get().ReserveArcs(state, n):             # <<<<<<<<<<<<<<
 *       raise FstIndexError("State index out of range")
 *     self._check_mutating_imethod()
 */
  }

  /* "fstlib/cext/pywrapfst.pyx":2610
 *     if not self._mfst.get().ReserveArcs(state, n):
 *       raise FstIndexError("State index out of range")
 *     self._check_mutating_imethod()             # <<<<<<<<<<<<<<
 * 
 *   def reserve_arcs(self, int64 state, size_t n):
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_check_mutating_imethod");
    __PYX_ERR(0, 2610, __pyx_L1_error)
  }
  ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2610, __pyx_L1_error)

  /* "fstlib/cext/pywrapfst.pyx":2607
 *     return self
 * 
 *   cdef void _reserve_arcs(self, int64 state, size_t n) except *:             # <<<<<<<<<<<<<<
 *     if not self._mfst.get().ReserveArcs(state, n):
 *       raise FstIndexError("State index out of range")
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.MutableFst._reserve_arcs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "fstlib/cext/pywrapfst.pyx":2612
 *     self._check_mutating_imethod()
 * 
 *   def reserve_arcs(self, int64 state, size_t n):             # <<<<<<<<<<<<<<
 *     """
 *     reserve_arcs(self, state, n)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_45reserve_arcs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_10MutableFst_44reserve_arcs[] = "\n    reserve_arcs(self, state, n)\n\n    Reserve n arcs at a particular state (best effort).\n\n    Args:\n      state: The integer index of a state.\n      n: The number of arcs to reserve.\n\n    Returns:\n      self.\n\n    Raises:\n      FstIndexError: State index out of range.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_45reserve_arcs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int64 __pyx_v_state;
  size_t __pyx_v_n;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("reserve_arcs (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_state,&__pyx_n_s_n,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_state)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("reserve_arcs", 1, 2, 2, 1); __PYX_ERR(0, 2612, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "reserve_arcs") < 0)) __PYX_ERR(0, 2612, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_state = __Pyx_PyInt_As_int64_t(values[0]); if (unlikely((__pyx_v_state == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2612, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyInt_As_size_t(values[1]); if (unlikely((__pyx_v_n == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2612, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("reserve_arcs", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2612, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.MutableFst.reserve_arcs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_10MutableFst_44reserve_arcs(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *)__pyx_v_self), __pyx_v_state, __pyx_v_n);

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_10MutableFst_44reserve_arcs(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, int64 __pyx_v_state, size_t __pyx_v_n) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("reserve_arcs", 0);

  /* "fstlib/cext/pywrapfst.pyx":2628
 *       FstIndexError: State index out of range.
 *     """
 *     self._reserve_arcs(state, n)             # <<<<<<<<<<<<<<
 *     return self
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_reserve_arcs");
    __PYX_ERR(0, 2628, __pyx_L1_error)
  }
  ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_reserve_arcs(__pyx_v_self, __pyx_v_state, __pyx_v_n); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2628, __pyx_L1_error)

  /* "fstlib/cext/pywrapfst.pyx":2629
 *     """
 *     self._reserve_arcs(state, n)
 *     return self             # <<<<<<<<<<<<<<
 * 
 *   cdef void _reserve_states(self, int64 n):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":2612
 *     self._check_mutating_imethod()
 * 
 *   def reserve_arcs(self, int64 state, size_t n):             # <<<<<<<<<<<<<<
 *     """
 *     reserve_arcs(self, state, n)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.MutableFst.reserve_arcs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":2631
 *     return self
 * 
 *   cdef void _reserve_states(self, int64 n):             # <<<<<<<<<<<<<<
 *     self._mfst.get().ReserveStates(n)
 * 
 */

static void __pyx_f_6fstlib_4cext_9pywrapfst_10MutableFst__reserve_states(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, int64 __pyx_v_n) {
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_reserve_states", 0);

  /* "fstlib/cext/pywrapfst.pyx":2632
 * 
 *   cdef void _reserve_states(self, int64 n):
 *     self._mfst.get().ReserveStates(n)             # <<<<<<<<<<<<<<
 * 
 *   def reserve_states(self, int64 n):
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
    __PYX_ERR(0, 2632, __pyx_L1_error)
  }
  __pyx_v_self->_mfst.get()->ReserveStates(__pyx_v_n);

  /* "fstlib/cext/pywrapfst.pyx":2631
 *     return self
 * 
 *   cdef void _reserve_states(self, int64 n):             # <<<<<<<<<<<<<<
 *     self._mfst.get().ReserveStates(n)
 * 
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("fstlib.cext.pywrapfst.MutableFst._reserve_states", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "fstlib/cext/pywrapfst.pyx":2634
 *     self._mfst.get().ReserveStates(n)
 * 
 *   def reserve_states(self, int64 n):             # <<<<<<<<<<<<<<
 *     """
 *     reserve_states(self, n)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_47reserve_states(PyObject *__pyx_v_self, PyObject *__pyx_arg_n); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_10MutableFst_46reserve_states[] = "\n    reserve_states(self, n)\n\n    Reserve n states (best effort).\n\n    Args:\n      n: The number of states to reserve.\n\n    Returns:\n      self.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_47reserve_states(PyObject *__pyx_v_self, PyObject *__pyx_arg_n) {
  int64 __pyx_v_n;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("reserve_states (wrapper)", 0);
  assert(__pyx_arg_n); {
    __pyx_v_n = __Pyx_PyInt_As_int64_t(__pyx_arg_n); if (unlikely((__pyx_v_n == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2634, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.MutableFst.reserve_states", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_10MutableFst_46reserve_states(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *)__pyx_v_self), ((int64)__pyx_v_n));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_10MutableFst_46reserve_states(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, int64 __pyx_v_n) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("reserve_states", 0);

  /* "fstlib/cext/pywrapfst.pyx":2646
 *       self.
 *     """
 *     self._reserve_states(n)             # <<<<<<<<<<<<<<
 *     return self
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_reserve_states");
    __PYX_ERR(0, 2646, __pyx_L1_error)
  }
  ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_reserve_states(__pyx_v_self, __pyx_v_n);

  /* "fstlib/cext/pywrapfst.pyx":2647
 *     """
 *     self._reserve_states(n)
 *     return self             # <<<<<<<<<<<<<<
 * 
 *   cdef void _reweight(self, potentials, bool to_final=False) except *:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":2634
 *     self._mfst.get().ReserveStates(n)
 * 
 *   def reserve_states(self, int64 n):             # <<<<<<<<<<<<<<
 *     """
 *     reserve_states(self, n)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.MutableFst.reserve_states", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":2649
 *     return self
 * 
 *   cdef void _reweight(self, potentials, bool to_final=False) except *:             # <<<<<<<<<<<<<<
 *     cdef string _weight_type = self.weight_type()
 *     cdef vector[fst.WeightClass] _potentials
 */

static void __pyx_f_6fstlib_4cext_9pywrapfst_10MutableFst__reweight(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, PyObject *__pyx_v_potentials, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_10MutableFst__reweight *__pyx_optional_args) {
  bool __pyx_v_to_final = ((bool)0);
  std::string __pyx_v__weight_type;
  std::vector<fst::script::WeightClass>  __pyx_v__potentials;
  PyObject *__pyx_v_weight = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  fst::script::WeightClass __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_reweight", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_to_final = __pyx_optional_args->to_final;
    }
  }

  /* "fstlib/cext/pywrapfst.pyx":2650
 * 
 *   cdef void _reweight(self, potentials, bool to_final=False) except *:
 *     cdef string _weight_type = self.weight_type()             # <<<<<<<<<<<<<<
 *     cdef vector[fst.WeightClass] _potentials
 *     for weight in potentials:
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "weight_type");
    __PYX_ERR(0, 2650, __pyx_L1_error)
  }
  __pyx_v__weight_type = ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.weight_type(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *)__pyx_v_self), 0);

  /* "fstlib/cext/pywrapfst.pyx":2652
 *     cdef string _weight_type = self.weight_type()
 *     cdef vector[fst.WeightClass] _potentials
 *     for weight in potentials:             # <<<<<<<<<<<<<<
 *       _potentials.push_back(_get_WeightClass_or_one(_weight_type, weight))
 *     fst.Reweight(self._mfst.get(), _potentials, fst.GetReweightType(to_final))
 */
  if (likely(PyList_CheckExact(__pyx_v_potentials)) || PyTuple_CheckExact(__pyx_v_potentials)) {
    __pyx_t_1 = __pyx_v_potentials; __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_potentials); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2652, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2652, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 2652, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2652, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 2652, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2652, __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, 2652, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_weight, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "fstlib/cext/pywrapfst.pyx":2653
 *     cdef vector[fst.WeightClass] _potentials
 *     for weight in potentials:
 *       _potentials.push_back(_get_WeightClass_or_one(_weight_type, weight))             # <<<<<<<<<<<<<<
 *     fst.Reweight(self._mfst.get(), _potentials, fst.GetReweightType(to_final))
 *     self._check_mutating_imethod()
 */
    __pyx_t_5 = __pyx_f_6fstlib_4cext_9pywrapfst__get_WeightClass_or_one(__pyx_v__weight_type, __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2653, __pyx_L1_error)
    try {
      __pyx_v__potentials.push_back(__pyx_t_5);
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(0, 2653, __pyx_L1_error)
    }

    /* "fstlib/cext/pywrapfst.pyx":2652
 *     cdef string _weight_type = self.weight_type()
 *     cdef vector[fst.WeightClass] _potentials
 *     for weight in potentials:             # <<<<<<<<<<<<<<
 *       _potentials.push_back(_get_WeightClass_or_one(_weight_type, weight))
 *     fst.Reweight(self._mfst.get(), _potentials, fst.GetReweightType(to_final))
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "fstlib/cext/pywrapfst.pyx":2654
 *     for weight in potentials:
 *       _potentials.push_back(_get_WeightClass_or_one(_weight_type, weight))
 *     fst.Reweight(self._mfst.get(), _potentials, fst.GetReweightType(to_final))             # <<<<<<<<<<<<<<
 *     self._check_mutating_imethod()
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
    __PYX_ERR(0, 2654, __pyx_L1_error)
  }
  fst::script::Reweight(__pyx_v_self->_mfst.get(), __pyx_v__potentials, fst::script::GetReweightType(__pyx_v_to_final));

  /* "fstlib/cext/pywrapfst.pyx":2655
 *       _potentials.push_back(_get_WeightClass_or_one(_weight_type, weight))
 *     fst.Reweight(self._mfst.get(), _potentials, fst.GetReweightType(to_final))
 *     self._check_mutating_imethod()             # <<<<<<<<<<<<<<
 * 
 *   def reweight(self, potentials, bool to_final=False):
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_check_mutating_imethod");
    __PYX_ERR(0, 2655, __pyx_L1_error)
  }
  ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2655, __pyx_L1_error)

  /* "fstlib/cext/pywrapfst.pyx":2649
 *     return self
 * 
 *   cdef void _reweight(self, potentials, bool to_final=False) except *:             # <<<<<<<<<<<<<<
 *     cdef string _weight_type = self.weight_type()
 *     cdef vector[fst.WeightClass] _potentials
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.MutableFst._reweight", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_weight);
  __Pyx_RefNannyFinishContext();
}

/* "fstlib/cext/pywrapfst.pyx":2657
 *     self._check_mutating_imethod()
 * 
 *   def reweight(self, potentials, bool to_final=False):             # <<<<<<<<<<<<<<
 *     """
 *     reweight(self, potentials, to_final=False)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_49reweight(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_10MutableFst_48reweight[] = "\n    reweight(self, potentials, to_final=False)\n\n    Reweights an FST using an iterable of potentials.\n\n    This operation destructively reweights an FST according to the potentials\n    and in the direction specified by the user. An arc of weight w, with an\n    origin state of potential p and destination state of potential q, is\n    reweighted by p^{-1} \\otimes (w \\otimes q) when reweighting towards the\n    initial state, and by (p \\otimes w) \\otimes q^{-1} when reweighting towards\n    the final states. The weights must be left distributive when reweighting\n    towards the initial state and right distributive when reweighting towards\n    the final states (e.g., TropicalWeight and LogWeight).\n\n    Args:\n      potentials: An iterable of Weight or weight strings.\n      to_final: Push towards final states?\n\n    Returns:\n      self.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_49reweight(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_potentials = 0;
  bool __pyx_v_to_final;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("reweight (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_potentials,&__pyx_n_s_to_final,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_potentials)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_to_final);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "reweight") < 0)) __PYX_ERR(0, 2657, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_potentials = values[0];
    if (values[1]) {
      __pyx_v_to_final = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_to_final == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2657, __pyx_L3_error)
    } else {
      __pyx_v_to_final = ((bool)0);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("reweight", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2657, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.MutableFst.reweight", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_10MutableFst_48reweight(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *)__pyx_v_self), __pyx_v_potentials, __pyx_v_to_final);

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_10MutableFst_48reweight(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, PyObject *__pyx_v_potentials, bool __pyx_v_to_final) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_10MutableFst__reweight __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("reweight", 0);

  /* "fstlib/cext/pywrapfst.pyx":2679
 *       self.
 *     """
 *     self._reweight(potentials, to_final)             # <<<<<<<<<<<<<<
 *     return self
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_reweight");
    __PYX_ERR(0, 2679, __pyx_L1_error)
  }
  __pyx_t_1.__pyx_n = 1;
  __pyx_t_1.to_final = __pyx_v_to_final;
  ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_reweight(__pyx_v_self, __pyx_v_potentials, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2679, __pyx_L1_error)

  /* "fstlib/cext/pywrapfst.pyx":2680
 *     """
 *     self._reweight(potentials, to_final)
 *     return self             # <<<<<<<<<<<<<<
 * 
 *   cdef void _rmepsilon(self,
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":2657
 *     self._check_mutating_imethod()
 * 
 *   def reweight(self, potentials, bool to_final=False):             # <<<<<<<<<<<<<<
 *     """
 *     reweight(self, potentials, to_final=False)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.MutableFst.reweight", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":2682
 *     return self
 * 
 *   cdef void _rmepsilon(self,             # <<<<<<<<<<<<<<
 *                        queue_type="auto",
 *                        bool connect=True,
 */

static void __pyx_f_6fstlib_4cext_9pywrapfst_10MutableFst__rmepsilon(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_10MutableFst__rmepsilon *__pyx_optional_args) {
  PyObject *__pyx_v_queue_type = ((PyObject *)__pyx_n_u_auto);

  /* "fstlib/cext/pywrapfst.pyx":2684
 *   cdef void _rmepsilon(self,
 *                        queue_type="auto",
 *                        bool connect=True,             # <<<<<<<<<<<<<<
 *                        weight=None,
 *                        int64 nstate=fst.kNoStateId,
 */
  bool __pyx_v_connect = ((bool)1);

  /* "fstlib/cext/pywrapfst.pyx":2685
 *                        queue_type="auto",
 *                        bool connect=True,
 *                        weight=None,             # <<<<<<<<<<<<<<
 *                        int64 nstate=fst.kNoStateId,
 *                        float delta=fst.kShortestDelta) except *:
 */
  PyObject *__pyx_v_weight = ((PyObject *)Py_None);
  int64 __pyx_v_nstate = __pyx_k__20;
  float __pyx_v_delta = __pyx_k__21;
  fst::script::WeightClass __pyx_v__weight;
  std::unique_ptr<fst::script::RmEpsilonOptions>  __pyx_v__opts;
  __Pyx_RefNannyDeclarations
  fst::script::WeightClass __pyx_t_1;
  std::string __pyx_t_2;
  enum fst::QueueType __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_rmepsilon", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_queue_type = __pyx_optional_args->queue_type;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_connect = __pyx_optional_args->connect;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_weight = __pyx_optional_args->weight;
          if (__pyx_optional_args->__pyx_n > 3) {
            __pyx_v_nstate = __pyx_optional_args->nstate;
            if (__pyx_optional_args->__pyx_n > 4) {
              __pyx_v_delta = __pyx_optional_args->delta;
            }
          }
        }
      }
    }
  }

  /* "fstlib/cext/pywrapfst.pyx":2688
 *                        int64 nstate=fst.kNoStateId,
 *                        float delta=fst.kShortestDelta) except *:
 *     cdef fst.WeightClass _weight = _get_WeightClass_or_zero(self.weight_type(),             # <<<<<<<<<<<<<<
 *                                                             weight)
 *     cdef unique_ptr[fst.RmEpsilonOptions] _opts
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "weight_type");
    __PYX_ERR(0, 2688, __pyx_L1_error)
  }

  /* "fstlib/cext/pywrapfst.pyx":2689
 *                        float delta=fst.kShortestDelta) except *:
 *     cdef fst.WeightClass _weight = _get_WeightClass_or_zero(self.weight_type(),
 *                                                             weight)             # <<<<<<<<<<<<<<
 *     cdef unique_ptr[fst.RmEpsilonOptions] _opts
 *     _opts.reset(
 */
  __pyx_t_1 = __pyx_f_6fstlib_4cext_9pywrapfst__get_WeightClass_or_zero(((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.weight_type(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *)__pyx_v_self), 0), __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2688, __pyx_L1_error)
  __pyx_v__weight = __pyx_t_1;

  /* "fstlib/cext/pywrapfst.pyx":2692
 *     cdef unique_ptr[fst.RmEpsilonOptions] _opts
 *     _opts.reset(
 *         new fst.RmEpsilonOptions(_get_queue_type(tostring(queue_type)),             # <<<<<<<<<<<<<<
 *                                  connect,
 *                                  _weight,
 */
  __pyx_t_2 = __pyx_f_6fstlib_4cext_9pywrapfst_tostring(__pyx_v_queue_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2692, __pyx_L1_error)
  __pyx_t_3 = __pyx_f_6fstlib_4cext_9pywrapfst__get_queue_type(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2692, __pyx_L1_error)

  /* "fstlib/cext/pywrapfst.pyx":2691
 *                                                             weight)
 *     cdef unique_ptr[fst.RmEpsilonOptions] _opts
 *     _opts.reset(             # <<<<<<<<<<<<<<
 *         new fst.RmEpsilonOptions(_get_queue_type(tostring(queue_type)),
 *                                  connect,
 */
  __pyx_v__opts.reset(new fst::script::RmEpsilonOptions(__pyx_t_3, __pyx_v_connect, __pyx_v__weight, __pyx_v_nstate, __pyx_v_delta));

  /* "fstlib/cext/pywrapfst.pyx":2697
 *                                  nstate,
 *                                  delta))
 *     fst.RmEpsilon(self._mfst.get(), deref(_opts))             # <<<<<<<<<<<<<<
 *     self._check_mutating_imethod()
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
    __PYX_ERR(0, 2697, __pyx_L1_error)
  }
  fst::script::RmEpsilon(__pyx_v_self->_mfst.get(), (*__pyx_v__opts));

  /* "fstlib/cext/pywrapfst.pyx":2698
 *                                  delta))
 *     fst.RmEpsilon(self._mfst.get(), deref(_opts))
 *     self._check_mutating_imethod()             # <<<<<<<<<<<<<<
 * 
 *   def rmepsilon(self,
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_check_mutating_imethod");
    __PYX_ERR(0, 2698, __pyx_L1_error)
  }
  ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2698, __pyx_L1_error)

  /* "fstlib/cext/pywrapfst.pyx":2682
 *     return self
 * 
 *   cdef void _rmepsilon(self,             # <<<<<<<<<<<<<<
 *                        queue_type="auto",
 *                        bool connect=True,
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.MutableFst._rmepsilon", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "fstlib/cext/pywrapfst.pyx":2700
 *     self._check_mutating_imethod()
 * 
 *   def rmepsilon(self,             # <<<<<<<<<<<<<<
 *                 queue_type="auto",
 *                 bool connect=True,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_51rmepsilon(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_10MutableFst_50rmepsilon[] = "\n    rmepsilon(self, queue_type=\"auto\", connect=True, weight=None,\n              nstate=NO_STATE_ID, delta=1e-6):\n\n    Removes epsilon transitions.\n\n    This operation destructively removes epsilon transitions, i.e., those where\n    both input and output labels are epsilon) from an FST.\n\n    Args:\n      queue_type: A string matching a known queue type; one of: \"auto\", \"fifo\",\n          \"lifo\", \"shortest\", \"state\", \"top\".\n      connect: Should output be trimmed?\n      weight: A Weight or weight string indicating the desired weight threshold\n          below which paths are pruned; if omitted, no paths are pruned.\n      nstate: State number threshold.\n      delta: Comparison/quantization delta.\n\n    Returns:\n      self.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_51rmepsilon(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_queue_type = 0;
  bool __pyx_v_connect;
  PyObject *__pyx_v_weight = 0;
  int64 __pyx_v_nstate;
  float __pyx_v_delta;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("rmepsilon (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_queue_type,&__pyx_n_s_connect,&__pyx_n_s_weight,&__pyx_n_s_nstate,&__pyx_n_s_delta,0};
    PyObject* values[5] = {0,0,0,0,0};
    values[0] = ((PyObject *)__pyx_n_u_auto);

    /* "fstlib/cext/pywrapfst.pyx":2703
 *                 queue_type="auto",
 *                 bool connect=True,
 *                 weight=None,             # <<<<<<<<<<<<<<
 *                 int64 nstate=fst.kNoStateId,
 *                 float delta=fst.kShortestDelta):
 */
    values[2] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_queue_type);
          if (value) { values[0] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_connect);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_weight);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nstate);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_delta);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "rmepsilon") < 0)) __PYX_ERR(0, 2700, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_queue_type = values[0];
    if (values[1]) {
      __pyx_v_connect = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_connect == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2702, __pyx_L3_error)
    } else {

      /* "fstlib/cext/pywrapfst.pyx":2702
 *   def rmepsilon(self,
 *                 queue_type="auto",
 *                 bool connect=True,             # <<<<<<<<<<<<<<
 *                 weight=None,
 *                 int64 nstate=fst.kNoStateId,
 */
      __pyx_v_connect = ((bool)1);
    }
    __pyx_v_weight = values[2];
    if (values[3]) {
      __pyx_v_nstate = __Pyx_PyInt_As_int64_t(values[3]); if (unlikely((__pyx_v_nstate == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2704, __pyx_L3_error)
    } else {
      __pyx_v_nstate = __pyx_k__22;
    }
    if (values[4]) {
      __pyx_v_delta = __pyx_PyFloat_AsFloat(values[4]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 2705, __pyx_L3_error)
    } else {
      __pyx_v_delta = __pyx_k__23;
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("rmepsilon", 0, 0, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2700, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.MutableFst.rmepsilon", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_10MutableFst_50rmepsilon(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *)__pyx_v_self), __pyx_v_queue_type, __pyx_v_connect, __pyx_v_weight, __pyx_v_nstate, __pyx_v_delta);

  /* "fstlib/cext/pywrapfst.pyx":2700
 *     self._check_mutating_imethod()
 * 
 *   def rmepsilon(self,             # <<<<<<<<<<<<<<
 *                 queue_type="auto",
 *                 bool connect=True,
 */

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_10MutableFst_50rmepsilon(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, PyObject *__pyx_v_queue_type, bool __pyx_v_connect, PyObject *__pyx_v_weight, int64 __pyx_v_nstate, float __pyx_v_delta) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_10MutableFst__rmepsilon __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("rmepsilon", 0);

  /* "fstlib/cext/pywrapfst.pyx":2727
 *       self.
 *     """
 *     self._rmepsilon(queue_type, connect, weight, nstate, delta)             # <<<<<<<<<<<<<<
 *     return self
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_rmepsilon");
    __PYX_ERR(0, 2727, __pyx_L1_error)
  }
  __pyx_t_1.__pyx_n = 5;
  __pyx_t_1.queue_type = __pyx_v_queue_type;
  __pyx_t_1.connect = __pyx_v_connect;
  __pyx_t_1.weight = __pyx_v_weight;
  __pyx_t_1.nstate = __pyx_v_nstate;
  __pyx_t_1.delta = __pyx_v_delta;
  ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_rmepsilon(__pyx_v_self, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2727, __pyx_L1_error)

  /* "fstlib/cext/pywrapfst.pyx":2728
 *     """
 *     self._rmepsilon(queue_type, connect, weight, nstate, delta)
 *     return self             # <<<<<<<<<<<<<<
 * 
 *   cdef void _set_final(self, int64 state, weight=None) except *:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":2700
 *     self._check_mutating_imethod()
 * 
 *   def rmepsilon(self,             # <<<<<<<<<<<<<<
 *                 queue_type="auto",
 *                 bool connect=True,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.MutableFst.rmepsilon", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":2730
 *     return self
 * 
 *   cdef void _set_final(self, int64 state, weight=None) except *:             # <<<<<<<<<<<<<<
 *     if not self._mfst.get().ValidStateId(state):
 *       raise FstIndexError("State index out of range")
 */

static void __pyx_f_6fstlib_4cext_9pywrapfst_10MutableFst__set_final(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, int64 __pyx_v_state, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_10MutableFst__set_final *__pyx_optional_args) {
  PyObject *__pyx_v_weight = ((PyObject *)Py_None);
  fst::script::WeightClass __pyx_v__weight;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  fst::script::WeightClass __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_set_final", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_weight = __pyx_optional_args->weight;
    }
  }

  /* "fstlib/cext/pywrapfst.pyx":2731
 * 
 *   cdef void _set_final(self, int64 state, weight=None) except *:
 *     if not self._mfst.get().ValidStateId(state):             # <<<<<<<<<<<<<<
 *       raise FstIndexError("State index out of range")
 *     cdef fst.WeightClass _weight = _get_WeightClass_or_one(self.weight_type(),
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
    __PYX_ERR(0, 2731, __pyx_L1_error)
  }
  __pyx_t_1 = ((!(__pyx_v_self->_mfst.get()->ValidStateId(__pyx_v_state) != 0)) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "fstlib/cext/pywrapfst.pyx":2732
 *   cdef void _set_final(self, int64 state, weight=None) except *:
 *     if not self._mfst.get().ValidStateId(state):
 *       raise FstIndexError("State index out of range")             # <<<<<<<<<<<<<<
 *     cdef fst.WeightClass _weight = _get_WeightClass_or_one(self.weight_type(),
 *                                                           weight)
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2732, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_kp_u_State_index_out_of_range) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_u_State_index_out_of_range);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2732, __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(0, 2732, __pyx_L1_error)

    /* "fstlib/cext/pywrapfst.pyx":2731
 * 
 *   cdef void _set_final(self, int64 state, weight=None) except *:
 *     if not self._mfst.get().ValidStateId(state):             # <<<<<<<<<<<<<<
 *       raise FstIndexError("State index out of range")
 *     cdef fst.WeightClass _weight = _get_WeightClass_or_one(self.weight_type(),
 */
  }

  /* "fstlib/cext/pywrapfst.pyx":2733
 *     if not self._mfst.get().ValidStateId(state):
 *       raise FstIndexError("State index out of range")
 *     cdef fst.WeightClass _weight = _get_WeightClass_or_one(self.weight_type(),             # <<<<<<<<<<<<<<
 *                                                           weight)
 *     if not self._mfst.get().SetFinal(state, _weight):
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "weight_type");
    __PYX_ERR(0, 2733, __pyx_L1_error)
  }

  /* "fstlib/cext/pywrapfst.pyx":2734
 *       raise FstIndexError("State index out of range")
 *     cdef fst.WeightClass _weight = _get_WeightClass_or_one(self.weight_type(),
 *                                                           weight)             # <<<<<<<<<<<<<<
 *     if not self._mfst.get().SetFinal(state, _weight):
 *       raise FstOpError("Incompatible or invalid weight")
 */
  __pyx_t_5 = __pyx_f_6fstlib_4cext_9pywrapfst__get_WeightClass_or_one(((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.weight_type(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *)__pyx_v_self), 0), __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2733, __pyx_L1_error)
  __pyx_v__weight = __pyx_t_5;

  /* "fstlib/cext/pywrapfst.pyx":2735
 *     cdef fst.WeightClass _weight = _get_WeightClass_or_one(self.weight_type(),
 *                                                           weight)
 *     if not self._mfst.get().SetFinal(state, _weight):             # <<<<<<<<<<<<<<
 *       raise FstOpError("Incompatible or invalid weight")
 *     self._check_mutating_imethod()
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
    __PYX_ERR(0, 2735, __pyx_L1_error)
  }
  __pyx_t_1 = ((!(__pyx_v_self->_mfst.get()->SetFinal(__pyx_v_state, __pyx_v__weight) != 0)) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "fstlib/cext/pywrapfst.pyx":2736
 *                                                           weight)
 *     if not self._mfst.get().SetFinal(state, _weight):
 *       raise FstOpError("Incompatible or invalid weight")             # <<<<<<<<<<<<<<
 *     self._check_mutating_imethod()
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstOpError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2736, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_kp_u_Incompatible_or_invalid_weight) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_u_Incompatible_or_invalid_weight);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2736, __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(0, 2736, __pyx_L1_error)

    /* "fstlib/cext/pywrapfst.pyx":2735
 *     cdef fst.WeightClass _weight = _get_WeightClass_or_one(self.weight_type(),
 *                                                           weight)
 *     if not self._mfst.get().SetFinal(state, _weight):             # <<<<<<<<<<<<<<
 *       raise FstOpError("Incompatible or invalid weight")
 *     self._check_mutating_imethod()
 */
  }

  /* "fstlib/cext/pywrapfst.pyx":2737
 *     if not self._mfst.get().SetFinal(state, _weight):
 *       raise FstOpError("Incompatible or invalid weight")
 *     self._check_mutating_imethod()             # <<<<<<<<<<<<<<
 * 
 *   def set_final(self, int64 state, weight=None):
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_check_mutating_imethod");
    __PYX_ERR(0, 2737, __pyx_L1_error)
  }
  ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2737, __pyx_L1_error)

  /* "fstlib/cext/pywrapfst.pyx":2730
 *     return self
 * 
 *   cdef void _set_final(self, int64 state, weight=None) except *:             # <<<<<<<<<<<<<<
 *     if not self._mfst.get().ValidStateId(state):
 *       raise FstIndexError("State index out of range")
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.MutableFst._set_final", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "fstlib/cext/pywrapfst.pyx":2739
 *     self._check_mutating_imethod()
 * 
 *   def set_final(self, int64 state, weight=None):             # <<<<<<<<<<<<<<
 *     """
 *     set_final(self, state, weight)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_53set_final(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_10MutableFst_52set_final[] = "\n    set_final(self, state, weight)\n\n    Sets the final weight for a state.\n\n    Args:\n      state: The integer index of a state.\n      weight: A Weight or weight string indicating the desired final weight; if\n          omitted, it is set to semiring One.\n\n    Returns:\n      self.\n\n    Raises:\n      FstIndexError: State index out of range.\n      FstOpError: Incompatible or invalid weight.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_53set_final(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int64 __pyx_v_state;
  PyObject *__pyx_v_weight = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_final (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_state,&__pyx_n_s_weight,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_state)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_weight);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_final") < 0)) __PYX_ERR(0, 2739, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_state = __Pyx_PyInt_As_int64_t(values[0]); if (unlikely((__pyx_v_state == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2739, __pyx_L3_error)
    __pyx_v_weight = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_final", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2739, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.MutableFst.set_final", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_10MutableFst_52set_final(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *)__pyx_v_self), __pyx_v_state, __pyx_v_weight);

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_10MutableFst_52set_final(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, int64 __pyx_v_state, PyObject *__pyx_v_weight) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_10MutableFst__set_final __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_final", 0);

  /* "fstlib/cext/pywrapfst.pyx":2757
 *       FstOpError: Incompatible or invalid weight.
 *     """
 *     self._set_final(state, weight)             # <<<<<<<<<<<<<<
 *     return self
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_set_final");
    __PYX_ERR(0, 2757, __pyx_L1_error)
  }
  __pyx_t_1.__pyx_n = 1;
  __pyx_t_1.weight = __pyx_v_weight;
  ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_set_final(__pyx_v_self, __pyx_v_state, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2757, __pyx_L1_error)

  /* "fstlib/cext/pywrapfst.pyx":2758
 *     """
 *     self._set_final(state, weight)
 *     return self             # <<<<<<<<<<<<<<
 * 
 *   cdef void _set_input_symbols(self, SymbolTableView symbols) except *:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":2739
 *     self._check_mutating_imethod()
 * 
 *   def set_final(self, int64 state, weight=None):             # <<<<<<<<<<<<<<
 *     """
 *     set_final(self, state, weight)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.MutableFst.set_final", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":2760
 *     return self
 * 
 *   cdef void _set_input_symbols(self, SymbolTableView symbols) except *:             # <<<<<<<<<<<<<<
 *     if symbols is None:
 *       self._mfst.get().SetInputSymbols(NULL)
 */

static void __pyx_f_6fstlib_4cext_9pywrapfst_10MutableFst__set_input_symbols(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_symbols) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  fst::SymbolTable const *__pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_set_input_symbols", 0);

  /* "fstlib/cext/pywrapfst.pyx":2761
 * 
 *   cdef void _set_input_symbols(self, SymbolTableView symbols) except *:
 *     if symbols is None:             # <<<<<<<<<<<<<<
 *       self._mfst.get().SetInputSymbols(NULL)
 *       return
 */
  __pyx_t_1 = (((PyObject *)__pyx_v_symbols) == Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "fstlib/cext/pywrapfst.pyx":2762
 *   cdef void _set_input_symbols(self, SymbolTableView symbols) except *:
 *     if symbols is None:
 *       self._mfst.get().SetInputSymbols(NULL)             # <<<<<<<<<<<<<<
 *       return
 *     self._mfst.get().SetInputSymbols(symbols._raw_ptr_or_raise())
 */
    if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
      __PYX_ERR(0, 2762, __pyx_L1_error)
    }
    __pyx_v_self->_mfst.get()->SetInputSymbols(NULL);

    /* "fstlib/cext/pywrapfst.pyx":2763
 *     if symbols is None:
 *       self._mfst.get().SetInputSymbols(NULL)
 *       return             # <<<<<<<<<<<<<<
 *     self._mfst.get().SetInputSymbols(symbols._raw_ptr_or_raise())
 * 
 */
    goto __pyx_L0;

    /* "fstlib/cext/pywrapfst.pyx":2761
 * 
 *   cdef void _set_input_symbols(self, SymbolTableView symbols) except *:
 *     if symbols is None:             # <<<<<<<<<<<<<<
 *       self._mfst.get().SetInputSymbols(NULL)
 *       return
 */
  }

  /* "fstlib/cext/pywrapfst.pyx":2764
 *       self._mfst.get().SetInputSymbols(NULL)
 *       return
 *     self._mfst.get().SetInputSymbols(symbols._raw_ptr_or_raise())             # <<<<<<<<<<<<<<
 * 
 *   def set_input_symbols(self, SymbolTableView symbols):
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
    __PYX_ERR(0, 2764, __pyx_L1_error)
  }
  if (unlikely(((PyObject *)__pyx_v_symbols) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raw_ptr_or_raise");
    __PYX_ERR(0, 2764, __pyx_L1_error)
  }
  __pyx_t_3 = ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_SymbolTableView *)__pyx_v_symbols->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_symbols); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2764, __pyx_L1_error)
  __pyx_v_self->_mfst.get()->SetInputSymbols(__pyx_t_3);

  /* "fstlib/cext/pywrapfst.pyx":2760
 *     return self
 * 
 *   cdef void _set_input_symbols(self, SymbolTableView symbols) except *:             # <<<<<<<<<<<<<<
 *     if symbols is None:
 *       self._mfst.get().SetInputSymbols(NULL)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.MutableFst._set_input_symbols", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "fstlib/cext/pywrapfst.pyx":2766
 *     self._mfst.get().SetInputSymbols(symbols._raw_ptr_or_raise())
 * 
 *   def set_input_symbols(self, SymbolTableView symbols):             # <<<<<<<<<<<<<<
 *     """
 *     set_input_symbols(self, symbols)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_55set_input_symbols(PyObject *__pyx_v_self, PyObject *__pyx_v_symbols); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_10MutableFst_54set_input_symbols[] = "\n    set_input_symbols(self, symbols)\n\n    Sets the input symbol table.\n\n    Passing None as a value will delete the input symbol table.\n\n    Args:\n      symbols: A SymbolTable.\n\n    Returns:\n      self.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_55set_input_symbols(PyObject *__pyx_v_self, PyObject *__pyx_v_symbols) {
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_input_symbols (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_symbols), __pyx_ptype_6fstlib_4cext_9pywrapfst_SymbolTableView, 1, "symbols", 0))) __PYX_ERR(0, 2766, __pyx_L1_error)
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_10MutableFst_54set_input_symbols(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *)__pyx_v_self), ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *)__pyx_v_symbols));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_10MutableFst_54set_input_symbols(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_symbols) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_input_symbols", 0);

  /* "fstlib/cext/pywrapfst.pyx":2780
 *       self.
 *     """
 *     self._set_input_symbols(symbols)             # <<<<<<<<<<<<<<
 *     return self
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_set_input_symbols");
    __PYX_ERR(0, 2780, __pyx_L1_error)
  }
  ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_set_input_symbols(__pyx_v_self, __pyx_v_symbols); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2780, __pyx_L1_error)

  /* "fstlib/cext/pywrapfst.pyx":2781
 *     """
 *     self._set_input_symbols(symbols)
 *     return self             # <<<<<<<<<<<<<<
 * 
 *   cdef void _set_output_symbols(self, SymbolTableView symbols) except *:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":2766
 *     self._mfst.get().SetInputSymbols(symbols._raw_ptr_or_raise())
 * 
 *   def set_input_symbols(self, SymbolTableView symbols):             # <<<<<<<<<<<<<<
 *     """
 *     set_input_symbols(self, symbols)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.MutableFst.set_input_symbols", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":2783
 *     return self
 * 
 *   cdef void _set_output_symbols(self, SymbolTableView symbols) except *:             # <<<<<<<<<<<<<<
 *     if symbols is None:
 *       self._mfst.get().SetOutputSymbols(NULL)
 */

static void __pyx_f_6fstlib_4cext_9pywrapfst_10MutableFst__set_output_symbols(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_symbols) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  fst::SymbolTable const *__pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_set_output_symbols", 0);

  /* "fstlib/cext/pywrapfst.pyx":2784
 * 
 *   cdef void _set_output_symbols(self, SymbolTableView symbols) except *:
 *     if symbols is None:             # <<<<<<<<<<<<<<
 *       self._mfst.get().SetOutputSymbols(NULL)
 *       return
 */
  __pyx_t_1 = (((PyObject *)__pyx_v_symbols) == Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "fstlib/cext/pywrapfst.pyx":2785
 *   cdef void _set_output_symbols(self, SymbolTableView symbols) except *:
 *     if symbols is None:
 *       self._mfst.get().SetOutputSymbols(NULL)             # <<<<<<<<<<<<<<
 *       return
 *     self._mfst.get().SetOutputSymbols(symbols._raw_ptr_or_raise())
 */
    if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
      __PYX_ERR(0, 2785, __pyx_L1_error)
    }
    __pyx_v_self->_mfst.get()->SetOutputSymbols(NULL);

    /* "fstlib/cext/pywrapfst.pyx":2786
 *     if symbols is None:
 *       self._mfst.get().SetOutputSymbols(NULL)
 *       return             # <<<<<<<<<<<<<<
 *     self._mfst.get().SetOutputSymbols(symbols._raw_ptr_or_raise())
 * 
 */
    goto __pyx_L0;

    /* "fstlib/cext/pywrapfst.pyx":2784
 * 
 *   cdef void _set_output_symbols(self, SymbolTableView symbols) except *:
 *     if symbols is None:             # <<<<<<<<<<<<<<
 *       self._mfst.get().SetOutputSymbols(NULL)
 *       return
 */
  }

  /* "fstlib/cext/pywrapfst.pyx":2787
 *       self._mfst.get().SetOutputSymbols(NULL)
 *       return
 *     self._mfst.get().SetOutputSymbols(symbols._raw_ptr_or_raise())             # <<<<<<<<<<<<<<
 * 
 *   def set_output_symbols(self, SymbolTableView symbols):
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
    __PYX_ERR(0, 2787, __pyx_L1_error)
  }
  if (unlikely(((PyObject *)__pyx_v_symbols) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raw_ptr_or_raise");
    __PYX_ERR(0, 2787, __pyx_L1_error)
  }
  __pyx_t_3 = ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_SymbolTableView *)__pyx_v_symbols->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_symbols); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2787, __pyx_L1_error)
  __pyx_v_self->_mfst.get()->SetOutputSymbols(__pyx_t_3);

  /* "fstlib/cext/pywrapfst.pyx":2783
 *     return self
 * 
 *   cdef void _set_output_symbols(self, SymbolTableView symbols) except *:             # <<<<<<<<<<<<<<
 *     if symbols is None:
 *       self._mfst.get().SetOutputSymbols(NULL)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.MutableFst._set_output_symbols", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "fstlib/cext/pywrapfst.pyx":2789
 *     self._mfst.get().SetOutputSymbols(symbols._raw_ptr_or_raise())
 * 
 *   def set_output_symbols(self, SymbolTableView symbols):             # <<<<<<<<<<<<<<
 *     """
 *     set_output_symbols(self, symbols)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_57set_output_symbols(PyObject *__pyx_v_self, PyObject *__pyx_v_symbols); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_10MutableFst_56set_output_symbols[] = "\n    set_output_symbols(self, symbols)\n\n    Sets the output symbol table.\n\n    Passing None as a value will delete the output symbol table.\n\n    Args:\n      symbols: A SymbolTable.\n\n    Returns:\n      self.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_57set_output_symbols(PyObject *__pyx_v_self, PyObject *__pyx_v_symbols) {
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_output_symbols (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_symbols), __pyx_ptype_6fstlib_4cext_9pywrapfst_SymbolTableView, 1, "symbols", 0))) __PYX_ERR(0, 2789, __pyx_L1_error)
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_10MutableFst_56set_output_symbols(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *)__pyx_v_self), ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *)__pyx_v_symbols));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_10MutableFst_56set_output_symbols(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *__pyx_v_symbols) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_output_symbols", 0);

  /* "fstlib/cext/pywrapfst.pyx":2803
 *       self.
 *     """
 *     self._set_output_symbols(symbols)             # <<<<<<<<<<<<<<
 *     return self
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_set_output_symbols");
    __PYX_ERR(0, 2803, __pyx_L1_error)
  }
  ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_set_output_symbols(__pyx_v_self, __pyx_v_symbols); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2803, __pyx_L1_error)

  /* "fstlib/cext/pywrapfst.pyx":2804
 *     """
 *     self._set_output_symbols(symbols)
 *     return self             # <<<<<<<<<<<<<<
 * 
 *   def set_properties(self, props, mask):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":2789
 *     self._mfst.get().SetOutputSymbols(symbols._raw_ptr_or_raise())
 * 
 *   def set_output_symbols(self, SymbolTableView symbols):             # <<<<<<<<<<<<<<
 *     """
 *     set_output_symbols(self, symbols)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.MutableFst.set_output_symbols", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":2806
 *     return self
 * 
 *   def set_properties(self, props, mask):             # <<<<<<<<<<<<<<
 *     """
 *     set_properties(self, props, mask)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_59set_properties(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_10MutableFst_58set_properties[] = "\n    set_properties(self, props, mask)\n\n    Sets the properties bits.\n\n    Args:\n      props: The properties to be set.\n      mask: A mask to be applied to the `props` argument before setting the\n          FST's properties.\n\n    Returns:\n      self.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_59set_properties(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_props = 0;
  PyObject *__pyx_v_mask = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_properties (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_props,&__pyx_n_s_mask,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_props)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_properties", 1, 2, 2, 1); __PYX_ERR(0, 2806, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_properties") < 0)) __PYX_ERR(0, 2806, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_props = values[0];
    __pyx_v_mask = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_properties", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2806, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.MutableFst.set_properties", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_10MutableFst_58set_properties(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *)__pyx_v_self), __pyx_v_props, __pyx_v_mask);

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_10MutableFst_58set_properties(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, PyObject *__pyx_v_props, PyObject *__pyx_v_mask) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  uint64 __pyx_t_2;
  uint64 __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_properties", 0);

  /* "fstlib/cext/pywrapfst.pyx":2820
 *       self.
 *     """
 *     self._mfst.get().SetProperties(props.value, mask.value)             # <<<<<<<<<<<<<<
 *     return self
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
    __PYX_ERR(0, 2820, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_props, __pyx_n_s_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2820, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_As_uint64_t(__pyx_t_1); if (unlikely((__pyx_t_2 == ((uint64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2820, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_mask, __pyx_n_s_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2820, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyInt_As_uint64_t(__pyx_t_1); if (unlikely((__pyx_t_3 == ((uint64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2820, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_self->_mfst.get()->SetProperties(__pyx_t_2, __pyx_t_3);

  /* "fstlib/cext/pywrapfst.pyx":2821
 *     """
 *     self._mfst.get().SetProperties(props.value, mask.value)
 *     return self             # <<<<<<<<<<<<<<
 * 
 *   cdef void _set_start(self, int64 state) except *:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":2806
 *     return self
 * 
 *   def set_properties(self, props, mask):             # <<<<<<<<<<<<<<
 *     """
 *     set_properties(self, props, mask)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.MutableFst.set_properties", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":2823
 *     return self
 * 
 *   cdef void _set_start(self, int64 state) except *:             # <<<<<<<<<<<<<<
 *     if not self._mfst.get().SetStart(state):
 *       raise FstIndexError("State index out of range")
 */

static void __pyx_f_6fstlib_4cext_9pywrapfst_10MutableFst__set_start(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, int64 __pyx_v_state) {
  __Pyx_RefNannyDeclarations
  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("_set_start", 0);

  /* "fstlib/cext/pywrapfst.pyx":2824
 * 
 *   cdef void _set_start(self, int64 state) except *:
 *     if not self._mfst.get().SetStart(state):             # <<<<<<<<<<<<<<
 *       raise FstIndexError("State index out of range")
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
    __PYX_ERR(0, 2824, __pyx_L1_error)
  }
  __pyx_t_1 = ((!(__pyx_v_self->_mfst.get()->SetStart(__pyx_v_state) != 0)) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "fstlib/cext/pywrapfst.pyx":2825
 *   cdef void _set_start(self, int64 state) except *:
 *     if not self._mfst.get().SetStart(state):
 *       raise FstIndexError("State index out of range")             # <<<<<<<<<<<<<<
 * 
 *   def set_start(self, int64 state):
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2825, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_kp_u_State_index_out_of_range) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_u_State_index_out_of_range);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2825, __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(0, 2825, __pyx_L1_error)

    /* "fstlib/cext/pywrapfst.pyx":2824
 * 
 *   cdef void _set_start(self, int64 state) except *:
 *     if not self._mfst.get().SetStart(state):             # <<<<<<<<<<<<<<
 *       raise FstIndexError("State index out of range")
 * 
 */
  }

  /* "fstlib/cext/pywrapfst.pyx":2823
 *     return self
 * 
 *   cdef void _set_start(self, int64 state) except *:             # <<<<<<<<<<<<<<
 *     if not self._mfst.get().SetStart(state):
 *       raise FstIndexError("State index out of range")
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.MutableFst._set_start", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "fstlib/cext/pywrapfst.pyx":2827
 *       raise FstIndexError("State index out of range")
 * 
 *   def set_start(self, int64 state):             # <<<<<<<<<<<<<<
 *     """
 *     set_start(self, state)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_61set_start(PyObject *__pyx_v_self, PyObject *__pyx_arg_state); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_10MutableFst_60set_start[] = "\n    set_start(self, state)\n\n    Sets a state to be the initial state state.\n\n    Args:\n      state: The integer index of a state.\n\n    Returns:\n      self.\n\n    Raises:\n      FstIndexError: State index out of range.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_61set_start(PyObject *__pyx_v_self, PyObject *__pyx_arg_state) {
  int64 __pyx_v_state;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_start (wrapper)", 0);
  assert(__pyx_arg_state); {
    __pyx_v_state = __Pyx_PyInt_As_int64_t(__pyx_arg_state); if (unlikely((__pyx_v_state == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2827, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.MutableFst.set_start", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_10MutableFst_60set_start(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *)__pyx_v_self), ((int64)__pyx_v_state));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_10MutableFst_60set_start(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, int64 __pyx_v_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_start", 0);

  /* "fstlib/cext/pywrapfst.pyx":2842
 *       FstIndexError: State index out of range.
 *     """
 *     self._set_start(state)             # <<<<<<<<<<<<<<
 *     return self
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_set_start");
    __PYX_ERR(0, 2842, __pyx_L1_error)
  }
  ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_set_start(__pyx_v_self, __pyx_v_state); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2842, __pyx_L1_error)

  /* "fstlib/cext/pywrapfst.pyx":2843
 *     """
 *     self._set_start(state)
 *     return self             # <<<<<<<<<<<<<<
 * 
 *   cdef void _topsort(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":2827
 *       raise FstIndexError("State index out of range")
 * 
 *   def set_start(self, int64 state):             # <<<<<<<<<<<<<<
 *     """
 *     set_start(self, state)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.MutableFst.set_start", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":2845
 *     return self
 * 
 *   cdef void _topsort(self):             # <<<<<<<<<<<<<<
 *     # TopSort returns False if the FST is cyclic, and thus can't be TopSorted.
 *     if not fst.TopSort(self._mfst.get()):
 */

static void __pyx_f_6fstlib_4cext_9pywrapfst_10MutableFst__topsort(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  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("_topsort", 0);

  /* "fstlib/cext/pywrapfst.pyx":2847
 *   cdef void _topsort(self):
 *     # TopSort returns False if the FST is cyclic, and thus can't be TopSorted.
 *     if not fst.TopSort(self._mfst.get()):             # <<<<<<<<<<<<<<
 *       logging.warning("Cannot topsort cyclic FST")
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
    __PYX_ERR(0, 2847, __pyx_L1_error)
  }
  __pyx_t_1 = ((!(fst::script::TopSort(__pyx_v_self->_mfst.get()) != 0)) != 0);
  if (__pyx_t_1) {

    /* "fstlib/cext/pywrapfst.pyx":2848
 *     # TopSort returns False if the FST is cyclic, and thus can't be TopSorted.
 *     if not fst.TopSort(self._mfst.get()):
 *       logging.warning("Cannot topsort cyclic FST")             # <<<<<<<<<<<<<<
 * 
 *   def topsort(self):
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_logging); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2848, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_warning); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2848, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, __pyx_kp_u_Cannot_topsort_cyclic_FST) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_kp_u_Cannot_topsort_cyclic_FST);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2848, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "fstlib/cext/pywrapfst.pyx":2847
 *   cdef void _topsort(self):
 *     # TopSort returns False if the FST is cyclic, and thus can't be TopSorted.
 *     if not fst.TopSort(self._mfst.get()):             # <<<<<<<<<<<<<<
 *       logging.warning("Cannot topsort cyclic FST")
 * 
 */
  }

  /* "fstlib/cext/pywrapfst.pyx":2845
 *     return self
 * 
 *   cdef void _topsort(self):             # <<<<<<<<<<<<<<
 *     # TopSort returns False if the FST is cyclic, and thus can't be TopSorted.
 *     if not fst.TopSort(self._mfst.get()):
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("fstlib.cext.pywrapfst.MutableFst._topsort", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "fstlib/cext/pywrapfst.pyx":2850
 *       logging.warning("Cannot topsort cyclic FST")
 * 
 *   def topsort(self):             # <<<<<<<<<<<<<<
 *     """
 *     topsort(self)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_63topsort(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_10MutableFst_62topsort[] = "\n    topsort(self)\n\n    Sorts transitions by state IDs.\n\n    This operation destructively topologically sorts the FST, if it is acyclic;\n    otherwise it remains unchanged. Once sorted, all transitions are from lower\n    state IDs to higher state IDs\n\n    Returns:\n       self.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_63topsort(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("topsort (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_10MutableFst_62topsort(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_10MutableFst_62topsort(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("topsort", 0);

  /* "fstlib/cext/pywrapfst.pyx":2863
 *        self.
 *     """
 *     self._topsort()             # <<<<<<<<<<<<<<
 *     return self
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_topsort");
    __PYX_ERR(0, 2863, __pyx_L1_error)
  }
  ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_topsort(__pyx_v_self);

  /* "fstlib/cext/pywrapfst.pyx":2864
 *     """
 *     self._topsort()
 *     return self             # <<<<<<<<<<<<<<
 * 
 *   def union(self, *fsts2):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":2850
 *       logging.warning("Cannot topsort cyclic FST")
 * 
 *   def topsort(self):             # <<<<<<<<<<<<<<
 *     """
 *     topsort(self)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.MutableFst.topsort", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":2866
 *     return self
 * 
 *   def union(self, *fsts2):             # <<<<<<<<<<<<<<
 *     """
 *     union(self, *fsts2)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_65union(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_10MutableFst_64union[] = "\n    union(self, *fsts2)\n\n    Computes the union (sum) of two or more FSTs.\n\n    This operation computes the union of two or more FSTs. If A transduces\n    string x to y with weight a and B transduces string w to v with weight b,\n    then their union transduces x to y with weight a and w to v with weight b.\n\n    Args:\n      *fsts2: One or more input FSTs.\n\n    Returns:\n      self.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_65union(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_fsts2 = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("union (wrapper)", 0);
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "union", 0))) return NULL;
  __Pyx_INCREF(__pyx_args);
  __pyx_v_fsts2 = __pyx_args;
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_10MutableFst_64union(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *)__pyx_v_self), __pyx_v_fsts2);

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_10MutableFst_64union(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_self, PyObject *__pyx_v_fsts2) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v__fst2 = 0;
  std::vector<__pyx_t_6fstlib_4cext_9pywrapfst_const_FstClass_ptr>  __pyx_v__fsts2;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  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("union", 0);

  /* "fstlib/cext/pywrapfst.pyx":2884
 *     cdef Fst _fst2
 *     cdef vector[const_FstClass_ptr] _fsts2
 *     for _fst2 in fsts2:             # <<<<<<<<<<<<<<
 *       _fsts2.push_back(_fst2._fst.get())
 *     fst.Union(self._mfst.get(), _fsts2)
 */
  __pyx_t_1 = __pyx_v_fsts2; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
  for (;;) {
    if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 2884, __pyx_L1_error)
    #else
    __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2884, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_6fstlib_4cext_9pywrapfst_Fst))))) __PYX_ERR(0, 2884, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v__fst2, ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "fstlib/cext/pywrapfst.pyx":2885
 *     cdef vector[const_FstClass_ptr] _fsts2
 *     for _fst2 in fsts2:
 *       _fsts2.push_back(_fst2._fst.get())             # <<<<<<<<<<<<<<
 *     fst.Union(self._mfst.get(), _fsts2)
 *     self._check_mutating_imethod()
 */
    if (unlikely(((PyObject *)__pyx_v__fst2) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
      __PYX_ERR(0, 2885, __pyx_L1_error)
    }
    try {
      __pyx_v__fsts2.push_back(__pyx_v__fst2->_fst.get());
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(0, 2885, __pyx_L1_error)
    }

    /* "fstlib/cext/pywrapfst.pyx":2884
 *     cdef Fst _fst2
 *     cdef vector[const_FstClass_ptr] _fsts2
 *     for _fst2 in fsts2:             # <<<<<<<<<<<<<<
 *       _fsts2.push_back(_fst2._fst.get())
 *     fst.Union(self._mfst.get(), _fsts2)
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "fstlib/cext/pywrapfst.pyx":2886
 *     for _fst2 in fsts2:
 *       _fsts2.push_back(_fst2._fst.get())
 *     fst.Union(self._mfst.get(), _fsts2)             # <<<<<<<<<<<<<<
 *     self._check_mutating_imethod()
 *     return self
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
    __PYX_ERR(0, 2886, __pyx_L1_error)
  }
  fst::script::Union(__pyx_v_self->_mfst.get(), __pyx_v__fsts2);

  /* "fstlib/cext/pywrapfst.pyx":2887
 *       _fsts2.push_back(_fst2._fst.get())
 *     fst.Union(self._mfst.get(), _fsts2)
 *     self._check_mutating_imethod()             # <<<<<<<<<<<<<<
 *     return self
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_check_mutating_imethod");
    __PYX_ERR(0, 2887, __pyx_L1_error)
  }
  ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2887, __pyx_L1_error)

  /* "fstlib/cext/pywrapfst.pyx":2888
 *     fst.Union(self._mfst.get(), _fsts2)
 *     self._check_mutating_imethod()
 *     return self             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":2866
 *     return self
 * 
 *   def union(self, *fsts2):             # <<<<<<<<<<<<<<
 *     """
 *     union(self, *fsts2)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.MutableFst.union", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v__fst2);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":2904
 *   """
 * 
 *   def __init__(self, arc_type="standard"):             # <<<<<<<<<<<<<<
 *     cdef unique_ptr[fst.MutableFstClass] _tfst
 *     _tfst.reset(new fst.VectorFstClass(tostring(arc_type)))
 */

/* Python wrapper */
static int __pyx_pw_6fstlib_4cext_9pywrapfst_9VectorFst_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_6fstlib_4cext_9pywrapfst_9VectorFst_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_arc_type = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_arc_type,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)__pyx_n_u_standard);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_arc_type);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 2904, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_arc_type = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2904, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.VectorFst.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_9VectorFst___init__(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_VectorFst *)__pyx_v_self), __pyx_v_arc_type);

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

static int __pyx_pf_6fstlib_4cext_9pywrapfst_9VectorFst___init__(struct __pyx_obj_6fstlib_4cext_9pywrapfst_VectorFst *__pyx_v_self, PyObject *__pyx_v_arc_type) {
  std::unique_ptr<fst::script::MutableFstClass>  __pyx_v__tfst;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "fstlib/cext/pywrapfst.pyx":2906
 *   def __init__(self, arc_type="standard"):
 *     cdef unique_ptr[fst.MutableFstClass] _tfst
 *     _tfst.reset(new fst.VectorFstClass(tostring(arc_type)))             # <<<<<<<<<<<<<<
 *     if _tfst.get().Properties(fst.kError, True) == fst.kError:
 *       raise FstOpError(f"Unknown arc type: {arc_type!r}")
 */
  __pyx_t_1 = __pyx_f_6fstlib_4cext_9pywrapfst_tostring(__pyx_v_arc_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2906, __pyx_L1_error)
  __pyx_v__tfst.reset(new fst::script::VectorFstClass(__pyx_t_1));

  /* "fstlib/cext/pywrapfst.pyx":2907
 *     cdef unique_ptr[fst.MutableFstClass] _tfst
 *     _tfst.reset(new fst.VectorFstClass(tostring(arc_type)))
 *     if _tfst.get().Properties(fst.kError, True) == fst.kError:             # <<<<<<<<<<<<<<
 *       raise FstOpError(f"Unknown arc type: {arc_type!r}")
 *     self._fst.reset(_tfst.release())
 */
  __pyx_t_2 = ((__pyx_v__tfst.get()->Properties(fst::kError, 1) == fst::kError) != 0);
  if (unlikely(__pyx_t_2)) {

    /* "fstlib/cext/pywrapfst.pyx":2908
 *     _tfst.reset(new fst.VectorFstClass(tostring(arc_type)))
 *     if _tfst.get().Properties(fst.kError, True) == fst.kError:
 *       raise FstOpError(f"Unknown arc type: {arc_type!r}")             # <<<<<<<<<<<<<<
 *     self._fst.reset(_tfst.release())
 *     self._mfst = static_pointer_cast[fst.MutableFstClass,
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FstOpError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2908, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_arc_type), __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2908, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Unknown_arc_type, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2908, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_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_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2908, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 2908, __pyx_L1_error)

    /* "fstlib/cext/pywrapfst.pyx":2907
 *     cdef unique_ptr[fst.MutableFstClass] _tfst
 *     _tfst.reset(new fst.VectorFstClass(tostring(arc_type)))
 *     if _tfst.get().Properties(fst.kError, True) == fst.kError:             # <<<<<<<<<<<<<<
 *       raise FstOpError(f"Unknown arc type: {arc_type!r}")
 *     self._fst.reset(_tfst.release())
 */
  }

  /* "fstlib/cext/pywrapfst.pyx":2909
 *     if _tfst.get().Properties(fst.kError, True) == fst.kError:
 *       raise FstOpError(f"Unknown arc type: {arc_type!r}")
 *     self._fst.reset(_tfst.release())             # <<<<<<<<<<<<<<
 *     self._mfst = static_pointer_cast[fst.MutableFstClass,
 *                                      fst.FstClass](self._fst)
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 2909, __pyx_L1_error)
  }
  __pyx_v_self->__pyx_base.__pyx_base._fst.reset(__pyx_v__tfst.release());

  /* "fstlib/cext/pywrapfst.pyx":2911
 *     self._fst.reset(_tfst.release())
 *     self._mfst = static_pointer_cast[fst.MutableFstClass,
 *                                      fst.FstClass](self._fst)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 2911, __pyx_L1_error)
  }

  /* "fstlib/cext/pywrapfst.pyx":2910
 *       raise FstOpError(f"Unknown arc type: {arc_type!r}")
 *     self._fst.reset(_tfst.release())
 *     self._mfst = static_pointer_cast[fst.MutableFstClass,             # <<<<<<<<<<<<<<
 *                                      fst.FstClass](self._fst)
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
    __PYX_ERR(0, 2910, __pyx_L1_error)
  }
  __pyx_v_self->__pyx_base._mfst = std::static_pointer_cast<fst::script::MutableFstClass,fst::script::FstClass>(__pyx_v_self->__pyx_base.__pyx_base._fst);

  /* "fstlib/cext/pywrapfst.pyx":2904
 *   """
 * 
 *   def __init__(self, arc_type="standard"):             # <<<<<<<<<<<<<<
 *     cdef unique_ptr[fst.MutableFstClass] _tfst
 *     _tfst.reset(new fst.VectorFstClass(tostring(arc_type)))
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.VectorFst.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":2930
 * 
 * 
 * cdef Fst _init_Fst(FstClass_ptr tfst):             # <<<<<<<<<<<<<<
 *   if tfst.Properties(fst.kError, True) == fst.kError:
 *     raise FstOpError("Operation failed")
 */

static struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_f_6fstlib_4cext_9pywrapfst__init_Fst(__pyx_t_6fstlib_4cext_9pywrapfst_FstClass_ptr __pyx_v_tfst) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v__ofst = 0;
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_init_Fst", 0);

  /* "fstlib/cext/pywrapfst.pyx":2931
 * 
 * cdef Fst _init_Fst(FstClass_ptr tfst):
 *   if tfst.Properties(fst.kError, True) == fst.kError:             # <<<<<<<<<<<<<<
 *     raise FstOpError("Operation failed")
 *   cdef Fst _ofst = Fst.__new__(Fst)
 */
  __pyx_t_1 = ((__pyx_v_tfst->Properties(fst::kError, 1) == fst::kError) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "fstlib/cext/pywrapfst.pyx":2932
 * cdef Fst _init_Fst(FstClass_ptr tfst):
 *   if tfst.Properties(fst.kError, True) == fst.kError:
 *     raise FstOpError("Operation failed")             # <<<<<<<<<<<<<<
 *   cdef Fst _ofst = Fst.__new__(Fst)
 *   _ofst._fst.reset(tfst)
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstOpError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2932, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_kp_u_Operation_failed) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_u_Operation_failed);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2932, __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(0, 2932, __pyx_L1_error)

    /* "fstlib/cext/pywrapfst.pyx":2931
 * 
 * cdef Fst _init_Fst(FstClass_ptr tfst):
 *   if tfst.Properties(fst.kError, True) == fst.kError:             # <<<<<<<<<<<<<<
 *     raise FstOpError("Operation failed")
 *   cdef Fst _ofst = Fst.__new__(Fst)
 */
  }

  /* "fstlib/cext/pywrapfst.pyx":2933
 *   if tfst.Properties(fst.kError, True) == fst.kError:
 *     raise FstOpError("Operation failed")
 *   cdef Fst _ofst = Fst.__new__(Fst)             # <<<<<<<<<<<<<<
 *   _ofst._fst.reset(tfst)
 *   return _ofst
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_6fstlib_4cext_9pywrapfst_Fst(((PyTypeObject *)__pyx_ptype_6fstlib_4cext_9pywrapfst_Fst), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2933, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_v__ofst = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "fstlib/cext/pywrapfst.pyx":2934
 *     raise FstOpError("Operation failed")
 *   cdef Fst _ofst = Fst.__new__(Fst)
 *   _ofst._fst.reset(tfst)             # <<<<<<<<<<<<<<
 *   return _ofst
 * 
 */
  if (unlikely(((PyObject *)__pyx_v__ofst) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 2934, __pyx_L1_error)
  }
  __pyx_v__ofst->_fst.reset(__pyx_v_tfst);

  /* "fstlib/cext/pywrapfst.pyx":2935
 *   cdef Fst _ofst = Fst.__new__(Fst)
 *   _ofst._fst.reset(tfst)
 *   return _ofst             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v__ofst));
  __pyx_r = __pyx_v__ofst;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":2930
 * 
 * 
 * cdef Fst _init_Fst(FstClass_ptr tfst):             # <<<<<<<<<<<<<<
 *   if tfst.Properties(fst.kError, True) == fst.kError:
 *     raise FstOpError("Operation failed")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst._init_Fst", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v__ofst);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":2938
 * 
 * 
 * cdef MutableFst _init_MutableFst(MutableFstClass_ptr tfst):             # <<<<<<<<<<<<<<
 *   if tfst.Properties(fst.kError, True) == fst.kError:
 *     raise FstOpError("Operation failed")
 */

static struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_f_6fstlib_4cext_9pywrapfst__init_MutableFst(__pyx_t_6fstlib_4cext_9pywrapfst_MutableFstClass_ptr __pyx_v_tfst) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v__ofst = 0;
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_init_MutableFst", 0);

  /* "fstlib/cext/pywrapfst.pyx":2939
 * 
 * cdef MutableFst _init_MutableFst(MutableFstClass_ptr tfst):
 *   if tfst.Properties(fst.kError, True) == fst.kError:             # <<<<<<<<<<<<<<
 *     raise FstOpError("Operation failed")
 *   cdef MutableFst _ofst = MutableFst.__new__(MutableFst)
 */
  __pyx_t_1 = ((__pyx_v_tfst->Properties(fst::kError, 1) == fst::kError) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "fstlib/cext/pywrapfst.pyx":2940
 * cdef MutableFst _init_MutableFst(MutableFstClass_ptr tfst):
 *   if tfst.Properties(fst.kError, True) == fst.kError:
 *     raise FstOpError("Operation failed")             # <<<<<<<<<<<<<<
 *   cdef MutableFst _ofst = MutableFst.__new__(MutableFst)
 *   _ofst._fst.reset(tfst)
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstOpError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2940, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_kp_u_Operation_failed) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_u_Operation_failed);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2940, __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(0, 2940, __pyx_L1_error)

    /* "fstlib/cext/pywrapfst.pyx":2939
 * 
 * cdef MutableFst _init_MutableFst(MutableFstClass_ptr tfst):
 *   if tfst.Properties(fst.kError, True) == fst.kError:             # <<<<<<<<<<<<<<
 *     raise FstOpError("Operation failed")
 *   cdef MutableFst _ofst = MutableFst.__new__(MutableFst)
 */
  }

  /* "fstlib/cext/pywrapfst.pyx":2941
 *   if tfst.Properties(fst.kError, True) == fst.kError:
 *     raise FstOpError("Operation failed")
 *   cdef MutableFst _ofst = MutableFst.__new__(MutableFst)             # <<<<<<<<<<<<<<
 *   _ofst._fst.reset(tfst)
 *   # Makes a copy of it as the derived type! Cool.
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_6fstlib_4cext_9pywrapfst_MutableFst(((PyTypeObject *)__pyx_ptype_6fstlib_4cext_9pywrapfst_MutableFst), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2941, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_v__ofst = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "fstlib/cext/pywrapfst.pyx":2942
 *     raise FstOpError("Operation failed")
 *   cdef MutableFst _ofst = MutableFst.__new__(MutableFst)
 *   _ofst._fst.reset(tfst)             # <<<<<<<<<<<<<<
 *   # Makes a copy of it as the derived type! Cool.
 *   _ofst._mfst = static_pointer_cast[fst.MutableFstClass,
 */
  if (unlikely(((PyObject *)__pyx_v__ofst) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 2942, __pyx_L1_error)
  }
  __pyx_v__ofst->__pyx_base._fst.reset(__pyx_v_tfst);

  /* "fstlib/cext/pywrapfst.pyx":2945
 *   # Makes a copy of it as the derived type! Cool.
 *   _ofst._mfst = static_pointer_cast[fst.MutableFstClass,
 *                                     fst.FstClass](_ofst._fst)             # <<<<<<<<<<<<<<
 *   return _ofst
 * 
 */
  if (unlikely(((PyObject *)__pyx_v__ofst) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 2945, __pyx_L1_error)
  }

  /* "fstlib/cext/pywrapfst.pyx":2944
 *   _ofst._fst.reset(tfst)
 *   # Makes a copy of it as the derived type! Cool.
 *   _ofst._mfst = static_pointer_cast[fst.MutableFstClass,             # <<<<<<<<<<<<<<
 *                                     fst.FstClass](_ofst._fst)
 *   return _ofst
 */
  if (unlikely(((PyObject *)__pyx_v__ofst) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
    __PYX_ERR(0, 2944, __pyx_L1_error)
  }
  __pyx_v__ofst->_mfst = std::static_pointer_cast<fst::script::MutableFstClass,fst::script::FstClass>(__pyx_v__ofst->__pyx_base._fst);

  /* "fstlib/cext/pywrapfst.pyx":2946
 *   _ofst._mfst = static_pointer_cast[fst.MutableFstClass,
 *                                     fst.FstClass](_ofst._fst)
 *   return _ofst             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v__ofst));
  __pyx_r = __pyx_v__ofst;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":2938
 * 
 * 
 * cdef MutableFst _init_MutableFst(MutableFstClass_ptr tfst):             # <<<<<<<<<<<<<<
 *   if tfst.Properties(fst.kError, True) == fst.kError:
 *     raise FstOpError("Operation failed")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst._init_MutableFst", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v__ofst);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":2949
 * 
 * 
 * cdef Fst _init_XFst(FstClass_ptr tfst):             # <<<<<<<<<<<<<<
 *   if tfst.Properties(fst.kMutable, True) == fst.kMutable:
 *     return _init_MutableFst(static_cast[MutableFstClass_ptr](tfst))
 */

static struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_f_6fstlib_4cext_9pywrapfst__init_XFst(__pyx_t_6fstlib_4cext_9pywrapfst_FstClass_ptr __pyx_v_tfst) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__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("_init_XFst", 0);

  /* "fstlib/cext/pywrapfst.pyx":2950
 * 
 * cdef Fst _init_XFst(FstClass_ptr tfst):
 *   if tfst.Properties(fst.kMutable, True) == fst.kMutable:             # <<<<<<<<<<<<<<
 *     return _init_MutableFst(static_cast[MutableFstClass_ptr](tfst))
 *   else:
 */
  __pyx_t_1 = ((__pyx_v_tfst->Properties(fst::kMutable, 1) == fst::kMutable) != 0);
  if (__pyx_t_1) {

    /* "fstlib/cext/pywrapfst.pyx":2951
 * cdef Fst _init_XFst(FstClass_ptr tfst):
 *   if tfst.Properties(fst.kMutable, True) == fst.kMutable:
 *     return _init_MutableFst(static_cast[MutableFstClass_ptr](tfst))             # <<<<<<<<<<<<<<
 *   else:
 *     return _init_Fst(tfst)
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_2 = ((PyObject *)__pyx_f_6fstlib_4cext_9pywrapfst__init_MutableFst(static_cast<__pyx_t_6fstlib_4cext_9pywrapfst_MutableFstClass_ptr>(__pyx_v_tfst))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2951, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *)__pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "fstlib/cext/pywrapfst.pyx":2950
 * 
 * cdef Fst _init_XFst(FstClass_ptr tfst):
 *   if tfst.Properties(fst.kMutable, True) == fst.kMutable:             # <<<<<<<<<<<<<<
 *     return _init_MutableFst(static_cast[MutableFstClass_ptr](tfst))
 *   else:
 */
  }

  /* "fstlib/cext/pywrapfst.pyx":2953
 *     return _init_MutableFst(static_cast[MutableFstClass_ptr](tfst))
 *   else:
 *     return _init_Fst(tfst)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_2 = ((PyObject *)__pyx_f_6fstlib_4cext_9pywrapfst__init_Fst(__pyx_v_tfst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2953, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *)__pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }

  /* "fstlib/cext/pywrapfst.pyx":2949
 * 
 * 
 * cdef Fst _init_XFst(FstClass_ptr tfst):             # <<<<<<<<<<<<<<
 *   if tfst.Properties(fst.kMutable, True) == fst.kMutable:
 *     return _init_MutableFst(static_cast[MutableFstClass_ptr](tfst))
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst._init_XFst", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":2956
 * 
 * 
 * cpdef Fst _read_Fst(source):             # <<<<<<<<<<<<<<
 *   cdef unique_ptr[fst.FstClass] _tfst
 *   _tfst.reset(fst.FstClass.Read(path_tostring(source)))
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_17_read_Fst(PyObject *__pyx_self, PyObject *__pyx_v_source); /*proto*/
static struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_f_6fstlib_4cext_9pywrapfst__read_Fst(PyObject *__pyx_v_source, CYTHON_UNUSED int __pyx_skip_dispatch) {
  std::unique_ptr<fst::script::FstClass>  __pyx_v__tfst;
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_read_Fst", 0);

  /* "fstlib/cext/pywrapfst.pyx":2958
 * cpdef Fst _read_Fst(source):
 *   cdef unique_ptr[fst.FstClass] _tfst
 *   _tfst.reset(fst.FstClass.Read(path_tostring(source)))             # <<<<<<<<<<<<<<
 *   if _tfst.get() == NULL:
 *     raise FstIOError(f"Read failed: {source!r}")
 */
  __pyx_t_1 = __pyx_f_6fstlib_4cext_9pywrapfst_path_tostring(__pyx_v_source); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2958, __pyx_L1_error)
  __pyx_v__tfst.reset(fst::script::FstClass::Read(__pyx_t_1));

  /* "fstlib/cext/pywrapfst.pyx":2959
 *   cdef unique_ptr[fst.FstClass] _tfst
 *   _tfst.reset(fst.FstClass.Read(path_tostring(source)))
 *   if _tfst.get() == NULL:             # <<<<<<<<<<<<<<
 *     raise FstIOError(f"Read failed: {source!r}")
 *   return _init_XFst(_tfst.release())
 */
  __pyx_t_2 = ((__pyx_v__tfst.get() == NULL) != 0);
  if (unlikely(__pyx_t_2)) {

    /* "fstlib/cext/pywrapfst.pyx":2960
 *   _tfst.reset(fst.FstClass.Read(path_tostring(source)))
 *   if _tfst.get() == NULL:
 *     raise FstIOError(f"Read failed: {source!r}")             # <<<<<<<<<<<<<<
 *   return _init_XFst(_tfst.release())
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FstIOError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2960, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_source), __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2960, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Read_failed, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2960, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_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_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2960, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 2960, __pyx_L1_error)

    /* "fstlib/cext/pywrapfst.pyx":2959
 *   cdef unique_ptr[fst.FstClass] _tfst
 *   _tfst.reset(fst.FstClass.Read(path_tostring(source)))
 *   if _tfst.get() == NULL:             # <<<<<<<<<<<<<<
 *     raise FstIOError(f"Read failed: {source!r}")
 *   return _init_XFst(_tfst.release())
 */
  }

  /* "fstlib/cext/pywrapfst.pyx":2961
 *   if _tfst.get() == NULL:
 *     raise FstIOError(f"Read failed: {source!r}")
 *   return _init_XFst(_tfst.release())             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_3 = ((PyObject *)__pyx_f_6fstlib_4cext_9pywrapfst__init_XFst(__pyx_v__tfst.release())); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2961, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":2956
 * 
 * 
 * cpdef Fst _read_Fst(source):             # <<<<<<<<<<<<<<
 *   cdef unique_ptr[fst.FstClass] _tfst
 *   _tfst.reset(fst.FstClass.Read(path_tostring(source)))
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst._read_Fst", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_17_read_Fst(PyObject *__pyx_self, PyObject *__pyx_v_source); /*proto*/
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_17_read_Fst(PyObject *__pyx_self, PyObject *__pyx_v_source) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_read_Fst (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_16_read_Fst(__pyx_self, ((PyObject *)__pyx_v_source));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_16_read_Fst(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_source) {
  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("_read_Fst", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_6fstlib_4cext_9pywrapfst__read_Fst(__pyx_v_source, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2956, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst._read_Fst", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":2964
 * 
 * 
 * cpdef Fst _read_Fst_from_string(string state):             # <<<<<<<<<<<<<<
 *   cdef stringstream _sstrm
 *   _sstrm << state
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_19_read_Fst_from_string(PyObject *__pyx_self, PyObject *__pyx_arg_state); /*proto*/
static struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_f_6fstlib_4cext_9pywrapfst__read_Fst_from_string(std::string __pyx_v_state, CYTHON_UNUSED int __pyx_skip_dispatch) {
  std::stringstream __pyx_v__sstrm;
  std::unique_ptr<fst::script::FstClass>  __pyx_v__tfst;
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_read_Fst_from_string", 0);

  /* "fstlib/cext/pywrapfst.pyx":2966
 * cpdef Fst _read_Fst_from_string(string state):
 *   cdef stringstream _sstrm
 *   _sstrm << state             # <<<<<<<<<<<<<<
 *   cdef unique_ptr[fst.FstClass] _tfst
 *   _tfst.reset(fst.FstClass.ReadStream(_sstrm, b"<pywrapfst>"))
 */
  (void)((__pyx_v__sstrm << __pyx_v_state));

  /* "fstlib/cext/pywrapfst.pyx":2968
 *   _sstrm << state
 *   cdef unique_ptr[fst.FstClass] _tfst
 *   _tfst.reset(fst.FstClass.ReadStream(_sstrm, b"<pywrapfst>"))             # <<<<<<<<<<<<<<
 *   if _tfst.get() == NULL:
 *     raise FstIOError("Read from string failed")
 */
  __pyx_v__tfst.reset(fst::script::FstClass::Read(__pyx_v__sstrm, __pyx_k_pywrapfst));

  /* "fstlib/cext/pywrapfst.pyx":2969
 *   cdef unique_ptr[fst.FstClass] _tfst
 *   _tfst.reset(fst.FstClass.ReadStream(_sstrm, b"<pywrapfst>"))
 *   if _tfst.get() == NULL:             # <<<<<<<<<<<<<<
 *     raise FstIOError("Read from string failed")
 *   return _init_XFst(_tfst.release())
 */
  __pyx_t_1 = ((__pyx_v__tfst.get() == NULL) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "fstlib/cext/pywrapfst.pyx":2970
 *   _tfst.reset(fst.FstClass.ReadStream(_sstrm, b"<pywrapfst>"))
 *   if _tfst.get() == NULL:
 *     raise FstIOError("Read from string failed")             # <<<<<<<<<<<<<<
 *   return _init_XFst(_tfst.release())
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstIOError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2970, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_kp_u_Read_from_string_failed) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_u_Read_from_string_failed);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2970, __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(0, 2970, __pyx_L1_error)

    /* "fstlib/cext/pywrapfst.pyx":2969
 *   cdef unique_ptr[fst.FstClass] _tfst
 *   _tfst.reset(fst.FstClass.ReadStream(_sstrm, b"<pywrapfst>"))
 *   if _tfst.get() == NULL:             # <<<<<<<<<<<<<<
 *     raise FstIOError("Read from string failed")
 *   return _init_XFst(_tfst.release())
 */
  }

  /* "fstlib/cext/pywrapfst.pyx":2971
 *   if _tfst.get() == NULL:
 *     raise FstIOError("Read from string failed")
 *   return _init_XFst(_tfst.release())             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_2 = ((PyObject *)__pyx_f_6fstlib_4cext_9pywrapfst__init_XFst(__pyx_v__tfst.release())); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2971, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":2964
 * 
 * 
 * cpdef Fst _read_Fst_from_string(string state):             # <<<<<<<<<<<<<<
 *   cdef stringstream _sstrm
 *   _sstrm << state
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst._read_Fst_from_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_19_read_Fst_from_string(PyObject *__pyx_self, PyObject *__pyx_arg_state); /*proto*/
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_19_read_Fst_from_string(PyObject *__pyx_self, PyObject *__pyx_arg_state) {
  std::string __pyx_v_state;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_read_Fst_from_string (wrapper)", 0);
  assert(__pyx_arg_state); {
    __pyx_v_state = __pyx_convert_string_from_py_std__in_string(__pyx_arg_state); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2964, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst._read_Fst_from_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_18_read_Fst_from_string(__pyx_self, ((std::string)__pyx_v_state));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_18_read_Fst_from_string(CYTHON_UNUSED PyObject *__pyx_self, std::string __pyx_v_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("_read_Fst_from_string", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_6fstlib_4cext_9pywrapfst__read_Fst_from_string(__pyx_v_state, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2964, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst._read_Fst_from_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":3090
 *   """
 * 
 *   def __repr__(self):             # <<<<<<<<<<<<<<
 *     return f"<Arc at 0x{id(self):x}>"
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_3Arc_1__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_3Arc_1__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_3Arc___repr__(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Arc *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_3Arc___repr__(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Arc *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  Py_UCS4 __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "fstlib/cext/pywrapfst.pyx":3091
 * 
 *   def __repr__(self):
 *     return f"<Arc at 0x{id(self):x}>"             # <<<<<<<<<<<<<<
 * 
 *   def __init__(self, int64 ilabel, int64 olabel, weight, int64 nextstate):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3091, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = 0;
  __pyx_t_3 = 127;
  __Pyx_INCREF(__pyx_kp_u_Arc_at_0x);
  __pyx_t_2 += 10;
  __Pyx_GIVEREF(__pyx_kp_u_Arc_at_0x);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_Arc_at_0x);
  __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3091, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_Format(__pyx_t_4, __pyx_n_u_x); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3091, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5);
  __pyx_t_5 = 0;
  __Pyx_INCREF(__pyx_kp_u__3);
  __pyx_t_2 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__3);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u__3);
  __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_1, 3, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3091, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":3090
 *   """
 * 
 *   def __repr__(self):             # <<<<<<<<<<<<<<
 *     return f"<Arc at 0x{id(self):x}>"
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.Arc.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":3093
 *     return f"<Arc at 0x{id(self):x}>"
 * 
 *   def __init__(self, int64 ilabel, int64 olabel, weight, int64 nextstate):             # <<<<<<<<<<<<<<
 *     cdef fst.WeightClass _weight = _get_WeightClass_or_one(b"tropical", weight)
 *     self._arc.reset(new fst.ArcClass(ilabel, olabel, _weight, nextstate))
 */

/* Python wrapper */
static int __pyx_pw_6fstlib_4cext_9pywrapfst_3Arc_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_6fstlib_4cext_9pywrapfst_3Arc_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int64 __pyx_v_ilabel;
  int64 __pyx_v_olabel;
  PyObject *__pyx_v_weight = 0;
  int64 __pyx_v_nextstate;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ilabel,&__pyx_n_s_olabel,&__pyx_n_s_weight,&__pyx_n_s_nextstate,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ilabel)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_olabel)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 1); __PYX_ERR(0, 3093, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_weight)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 2); __PYX_ERR(0, 3093, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nextstate)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 3); __PYX_ERR(0, 3093, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 3093, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
    }
    __pyx_v_ilabel = __Pyx_PyInt_As_int64_t(values[0]); if (unlikely((__pyx_v_ilabel == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3093, __pyx_L3_error)
    __pyx_v_olabel = __Pyx_PyInt_As_int64_t(values[1]); if (unlikely((__pyx_v_olabel == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3093, __pyx_L3_error)
    __pyx_v_weight = values[2];
    __pyx_v_nextstate = __Pyx_PyInt_As_int64_t(values[3]); if (unlikely((__pyx_v_nextstate == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3093, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3093, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.Arc.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_3Arc_2__init__(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Arc *)__pyx_v_self), __pyx_v_ilabel, __pyx_v_olabel, __pyx_v_weight, __pyx_v_nextstate);

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

static int __pyx_pf_6fstlib_4cext_9pywrapfst_3Arc_2__init__(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Arc *__pyx_v_self, int64 __pyx_v_ilabel, int64 __pyx_v_olabel, PyObject *__pyx_v_weight, int64 __pyx_v_nextstate) {
  fst::script::WeightClass __pyx_v__weight;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  fst::script::WeightClass __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "fstlib/cext/pywrapfst.pyx":3094
 * 
 *   def __init__(self, int64 ilabel, int64 olabel, weight, int64 nextstate):
 *     cdef fst.WeightClass _weight = _get_WeightClass_or_one(b"tropical", weight)             # <<<<<<<<<<<<<<
 *     self._arc.reset(new fst.ArcClass(ilabel, olabel, _weight, nextstate))
 * 
 */
  __pyx_t_1 = __pyx_f_6fstlib_4cext_9pywrapfst__get_WeightClass_or_one(__pyx_k_tropical, __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3094, __pyx_L1_error)
  __pyx_v__weight = __pyx_t_1;

  /* "fstlib/cext/pywrapfst.pyx":3095
 *   def __init__(self, int64 ilabel, int64 olabel, weight, int64 nextstate):
 *     cdef fst.WeightClass _weight = _get_WeightClass_or_one(b"tropical", weight)
 *     self._arc.reset(new fst.ArcClass(ilabel, olabel, _weight, nextstate))             # <<<<<<<<<<<<<<
 * 
 *   cpdef Arc copy(self):
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_arc");
    __PYX_ERR(0, 3095, __pyx_L1_error)
  }
  __pyx_v_self->_arc.reset(new fst::script::ArcClass(__pyx_v_ilabel, __pyx_v_olabel, __pyx_v__weight, __pyx_v_nextstate));

  /* "fstlib/cext/pywrapfst.pyx":3093
 *     return f"<Arc at 0x{id(self):x}>"
 * 
 *   def __init__(self, int64 ilabel, int64 olabel, weight, int64 nextstate):             # <<<<<<<<<<<<<<
 *     cdef fst.WeightClass _weight = _get_WeightClass_or_one(b"tropical", weight)
 *     self._arc.reset(new fst.ArcClass(ilabel, olabel, _weight, nextstate))
 */

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

/* "fstlib/cext/pywrapfst.pyx":3097
 *     self._arc.reset(new fst.ArcClass(ilabel, olabel, _weight, nextstate))
 * 
 *   cpdef Arc copy(self):             # <<<<<<<<<<<<<<
 *     return Arc(self.ilabel, self.olabel, self.weight, self.nextstate)
 * 
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_3Arc_5copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static struct __pyx_obj_6fstlib_4cext_9pywrapfst_Arc *__pyx_f_6fstlib_4cext_9pywrapfst_3Arc_copy(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Arc *__pyx_v_self, int __pyx_skip_dispatch) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_Arc *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("copy", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_copy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3097, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6fstlib_4cext_9pywrapfst_3Arc_5copy)) {
        __Pyx_XDECREF(((PyObject *)__pyx_r));
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3097, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_6fstlib_4cext_9pywrapfst_Arc))))) __PYX_ERR(0, 3097, __pyx_L1_error)
        __pyx_r = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Arc *)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "fstlib/cext/pywrapfst.pyx":3098
 * 
 *   cpdef Arc copy(self):
 *     return Arc(self.ilabel, self.olabel, self.weight, self.nextstate)             # <<<<<<<<<<<<<<
 * 
 *   property ilabel:
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_ilabel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3098, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_olabel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3098, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_weight); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3098, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_nextstate); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3098, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3098, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6fstlib_4cext_9pywrapfst_Arc), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3098, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_r = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Arc *)__pyx_t_4);
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":3097
 *     self._arc.reset(new fst.ArcClass(ilabel, olabel, _weight, nextstate))
 * 
 *   cpdef Arc copy(self):             # <<<<<<<<<<<<<<
 *     return Arc(self.ilabel, self.olabel, self.weight, self.nextstate)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.Arc.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_3Arc_5copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_3Arc_5copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("copy (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_3Arc_4copy(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Arc *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_3Arc_4copy(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Arc *__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("copy", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_6fstlib_4cext_9pywrapfst_3Arc_copy(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3097, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.Arc.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":3102
 *   property ilabel:
 * 
 *     def __get__(self):             # <<<<<<<<<<<<<<
 *       return deref(self._arc).ilabel
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_3Arc_6ilabel_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_3Arc_6ilabel_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_3Arc_6ilabel___get__(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Arc *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_3Arc_6ilabel___get__(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Arc *__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__", 0);

  /* "fstlib/cext/pywrapfst.pyx":3103
 * 
 *     def __get__(self):
 *       return deref(self._arc).ilabel             # <<<<<<<<<<<<<<
 * 
 *     def __set__(self, int64 value):
 */
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_arc");
    __PYX_ERR(0, 3103, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_PyInt_From_int64_t((*__pyx_v_self->_arc).ilabel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3103, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":3102
 *   property ilabel:
 * 
 *     def __get__(self):             # <<<<<<<<<<<<<<
 *       return deref(self._arc).ilabel
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.Arc.ilabel.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":3105
 *       return deref(self._arc).ilabel
 * 
 *     def __set__(self, int64 value):             # <<<<<<<<<<<<<<
 *       deref(self._arc).ilabel = value
 * 
 */

/* Python wrapper */
static int __pyx_pw_6fstlib_4cext_9pywrapfst_3Arc_6ilabel_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value); /*proto*/
static int __pyx_pw_6fstlib_4cext_9pywrapfst_3Arc_6ilabel_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value) {
  int64 __pyx_v_value;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  assert(__pyx_arg_value); {
    __pyx_v_value = __Pyx_PyInt_As_int64_t(__pyx_arg_value); if (unlikely((__pyx_v_value == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3105, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.Arc.ilabel.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_3Arc_6ilabel_2__set__(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Arc *)__pyx_v_self), ((int64)__pyx_v_value));

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

static int __pyx_pf_6fstlib_4cext_9pywrapfst_3Arc_6ilabel_2__set__(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Arc *__pyx_v_self, int64 __pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "fstlib/cext/pywrapfst.pyx":3106
 * 
 *     def __set__(self, int64 value):
 *       deref(self._arc).ilabel = value             # <<<<<<<<<<<<<<
 * 
 *   property olabel:
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_arc");
    __PYX_ERR(0, 3106, __pyx_L1_error)
  }
  (*__pyx_v_self->_arc).ilabel = __pyx_v_value;

  /* "fstlib/cext/pywrapfst.pyx":3105
 *       return deref(self._arc).ilabel
 * 
 *     def __set__(self, int64 value):             # <<<<<<<<<<<<<<
 *       deref(self._arc).ilabel = value
 * 
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.Arc.ilabel.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":3110
 *   property olabel:
 * 
 *     def __get__(self):             # <<<<<<<<<<<<<<
 *       return deref(self._arc).olabel
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_3Arc_6olabel_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_3Arc_6olabel_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_3Arc_6olabel___get__(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Arc *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_3Arc_6olabel___get__(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Arc *__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__", 0);

  /* "fstlib/cext/pywrapfst.pyx":3111
 * 
 *     def __get__(self):
 *       return deref(self._arc).olabel             # <<<<<<<<<<<<<<
 * 
 *     def __set__(self, int64 value):
 */
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_arc");
    __PYX_ERR(0, 3111, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_PyInt_From_int64_t((*__pyx_v_self->_arc).olabel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3111, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":3110
 *   property olabel:
 * 
 *     def __get__(self):             # <<<<<<<<<<<<<<
 *       return deref(self._arc).olabel
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.Arc.olabel.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":3113
 *       return deref(self._arc).olabel
 * 
 *     def __set__(self, int64 value):             # <<<<<<<<<<<<<<
 *       deref(self._arc).olabel = value
 * 
 */

/* Python wrapper */
static int __pyx_pw_6fstlib_4cext_9pywrapfst_3Arc_6olabel_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value); /*proto*/
static int __pyx_pw_6fstlib_4cext_9pywrapfst_3Arc_6olabel_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value) {
  int64 __pyx_v_value;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  assert(__pyx_arg_value); {
    __pyx_v_value = __Pyx_PyInt_As_int64_t(__pyx_arg_value); if (unlikely((__pyx_v_value == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3113, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.Arc.olabel.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_3Arc_6olabel_2__set__(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Arc *)__pyx_v_self), ((int64)__pyx_v_value));

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

static int __pyx_pf_6fstlib_4cext_9pywrapfst_3Arc_6olabel_2__set__(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Arc *__pyx_v_self, int64 __pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "fstlib/cext/pywrapfst.pyx":3114
 * 
 *     def __set__(self, int64 value):
 *       deref(self._arc).olabel = value             # <<<<<<<<<<<<<<
 * 
 *   property weight:
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_arc");
    __PYX_ERR(0, 3114, __pyx_L1_error)
  }
  (*__pyx_v_self->_arc).olabel = __pyx_v_value;

  /* "fstlib/cext/pywrapfst.pyx":3113
 *       return deref(self._arc).olabel
 * 
 *     def __set__(self, int64 value):             # <<<<<<<<<<<<<<
 *       deref(self._arc).olabel = value
 * 
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.Arc.olabel.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":3118
 *   property weight:
 * 
 *     def __get__(self):             # <<<<<<<<<<<<<<
 *       cdef Weight _weight = Weight.__new__(Weight)
 *       _weight._weight.reset(new fst.WeightClass(deref(self._arc).weight))
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_3Arc_6weight_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_3Arc_6weight_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_3Arc_6weight___get__(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Arc *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_3Arc_6weight___get__(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Arc *__pyx_v_self) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__pyx_v__weight = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "fstlib/cext/pywrapfst.pyx":3119
 * 
 *     def __get__(self):
 *       cdef Weight _weight = Weight.__new__(Weight)             # <<<<<<<<<<<<<<
 *       _weight._weight.reset(new fst.WeightClass(deref(self._arc).weight))
 *       return _weight
 */
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_6fstlib_4cext_9pywrapfst_Weight(((PyTypeObject *)__pyx_ptype_6fstlib_4cext_9pywrapfst_Weight), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3119, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v__weight = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "fstlib/cext/pywrapfst.pyx":3120
 *     def __get__(self):
 *       cdef Weight _weight = Weight.__new__(Weight)
 *       _weight._weight.reset(new fst.WeightClass(deref(self._arc).weight))             # <<<<<<<<<<<<<<
 *       return _weight
 * 
 */
  if (unlikely(((PyObject *)__pyx_v__weight) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_weight");
    __PYX_ERR(0, 3120, __pyx_L1_error)
  }
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_arc");
    __PYX_ERR(0, 3120, __pyx_L1_error)
  }
  __pyx_v__weight->_weight.reset(new fst::script::WeightClass((*__pyx_v_self->_arc).weight));

  /* "fstlib/cext/pywrapfst.pyx":3121
 *       cdef Weight _weight = Weight.__new__(Weight)
 *       _weight._weight.reset(new fst.WeightClass(deref(self._arc).weight))
 *       return _weight             # <<<<<<<<<<<<<<
 * 
 *     def __set__(self, weight):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v__weight));
  __pyx_r = ((PyObject *)__pyx_v__weight);
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":3118
 *   property weight:
 * 
 *     def __get__(self):             # <<<<<<<<<<<<<<
 *       cdef Weight _weight = Weight.__new__(Weight)
 *       _weight._weight.reset(new fst.WeightClass(deref(self._arc).weight))
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.Arc.weight.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v__weight);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":3123
 *       return _weight
 * 
 *     def __set__(self, weight):             # <<<<<<<<<<<<<<
 *       deref(self._arc).weight = _get_WeightClass_or_one(b"tropical", weight)
 * 
 */

/* Python wrapper */
static int __pyx_pw_6fstlib_4cext_9pywrapfst_3Arc_6weight_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_weight); /*proto*/
static int __pyx_pw_6fstlib_4cext_9pywrapfst_3Arc_6weight_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_weight) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_3Arc_6weight_2__set__(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Arc *)__pyx_v_self), ((PyObject *)__pyx_v_weight));

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

static int __pyx_pf_6fstlib_4cext_9pywrapfst_3Arc_6weight_2__set__(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Arc *__pyx_v_self, PyObject *__pyx_v_weight) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  fst::script::WeightClass __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "fstlib/cext/pywrapfst.pyx":3124
 * 
 *     def __set__(self, weight):
 *       deref(self._arc).weight = _get_WeightClass_or_one(b"tropical", weight)             # <<<<<<<<<<<<<<
 * 
 *   property nextstate:
 */
  __pyx_t_1 = __pyx_f_6fstlib_4cext_9pywrapfst__get_WeightClass_or_one(__pyx_k_tropical, __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3124, __pyx_L1_error)
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_arc");
    __PYX_ERR(0, 3124, __pyx_L1_error)
  }
  (*__pyx_v_self->_arc).weight = __pyx_t_1;

  /* "fstlib/cext/pywrapfst.pyx":3123
 *       return _weight
 * 
 *     def __set__(self, weight):             # <<<<<<<<<<<<<<
 *       deref(self._arc).weight = _get_WeightClass_or_one(b"tropical", weight)
 * 
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.Arc.weight.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":3128
 *   property nextstate:
 * 
 *     def __get__(self):             # <<<<<<<<<<<<<<
 *       return deref(self._arc).nextstate
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_3Arc_9nextstate_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_3Arc_9nextstate_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_3Arc_9nextstate___get__(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Arc *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_3Arc_9nextstate___get__(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Arc *__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__", 0);

  /* "fstlib/cext/pywrapfst.pyx":3129
 * 
 *     def __get__(self):
 *       return deref(self._arc).nextstate             # <<<<<<<<<<<<<<
 * 
 *     def __set__(self, int64 value):
 */
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_arc");
    __PYX_ERR(0, 3129, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_PyInt_From_int64_t((*__pyx_v_self->_arc).nextstate); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":3128
 *   property nextstate:
 * 
 *     def __get__(self):             # <<<<<<<<<<<<<<
 *       return deref(self._arc).nextstate
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.Arc.nextstate.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":3131
 *       return deref(self._arc).nextstate
 * 
 *     def __set__(self, int64 value):             # <<<<<<<<<<<<<<
 *       deref(self._arc).nextstate = value
 * 
 */

/* Python wrapper */
static int __pyx_pw_6fstlib_4cext_9pywrapfst_3Arc_9nextstate_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value); /*proto*/
static int __pyx_pw_6fstlib_4cext_9pywrapfst_3Arc_9nextstate_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value) {
  int64 __pyx_v_value;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  assert(__pyx_arg_value); {
    __pyx_v_value = __Pyx_PyInt_As_int64_t(__pyx_arg_value); if (unlikely((__pyx_v_value == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3131, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.Arc.nextstate.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_3Arc_9nextstate_2__set__(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Arc *)__pyx_v_self), ((int64)__pyx_v_value));

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

static int __pyx_pf_6fstlib_4cext_9pywrapfst_3Arc_9nextstate_2__set__(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Arc *__pyx_v_self, int64 __pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "fstlib/cext/pywrapfst.pyx":3132
 * 
 *     def __set__(self, int64 value):
 *       deref(self._arc).nextstate = value             # <<<<<<<<<<<<<<
 * 
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_arc");
    __PYX_ERR(0, 3132, __pyx_L1_error)
  }
  (*__pyx_v_self->_arc).nextstate = __pyx_v_value;

  /* "fstlib/cext/pywrapfst.pyx":3131
 *       return deref(self._arc).nextstate
 * 
 *     def __set__(self, int64 value):             # <<<<<<<<<<<<<<
 *       deref(self._arc).nextstate = value
 * 
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.Arc.nextstate.__set__", __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._arc cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_3Arc_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_3Arc_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_3Arc_6__reduce_cython__(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Arc *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_3Arc_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_6fstlib_4cext_9pywrapfst_Arc *__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("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self._arc cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self._arc cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __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(1, 2, __pyx_L1_error)

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.Arc.__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._arc cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self._arc cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_3Arc_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_3Arc_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_3Arc_8__setstate_cython__(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Arc *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_3Arc_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_6fstlib_4cext_9pywrapfst_Arc *__pyx_v_self, CYTHON_UNUSED 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__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self._arc cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self._arc cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __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(1, 4, __pyx_L1_error)

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.Arc.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":3135
 * 
 * 
 * cdef Arc _init_Arc(const fst.ArcClass &arc):             # <<<<<<<<<<<<<<
 *   cdef Weight _weight = Weight.__new__(Weight)
 *   _weight._weight.reset(new fst.WeightClass(arc.weight))
 */

static struct __pyx_obj_6fstlib_4cext_9pywrapfst_Arc *__pyx_f_6fstlib_4cext_9pywrapfst__init_Arc(fst::script::ArcClass const &__pyx_v_arc) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *__pyx_v__weight = 0;
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_Arc *__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("_init_Arc", 0);

  /* "fstlib/cext/pywrapfst.pyx":3136
 * 
 * cdef Arc _init_Arc(const fst.ArcClass &arc):
 *   cdef Weight _weight = Weight.__new__(Weight)             # <<<<<<<<<<<<<<
 *   _weight._weight.reset(new fst.WeightClass(arc.weight))
 *   return Arc(arc.ilabel, arc.olabel, _weight, arc.nextstate)
 */
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_6fstlib_4cext_9pywrapfst_Weight(((PyTypeObject *)__pyx_ptype_6fstlib_4cext_9pywrapfst_Weight), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3136, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v__weight = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "fstlib/cext/pywrapfst.pyx":3137
 * cdef Arc _init_Arc(const fst.ArcClass &arc):
 *   cdef Weight _weight = Weight.__new__(Weight)
 *   _weight._weight.reset(new fst.WeightClass(arc.weight))             # <<<<<<<<<<<<<<
 *   return Arc(arc.ilabel, arc.olabel, _weight, arc.nextstate)
 * 
 */
  if (unlikely(((PyObject *)__pyx_v__weight) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_weight");
    __PYX_ERR(0, 3137, __pyx_L1_error)
  }
  __pyx_v__weight->_weight.reset(new fst::script::WeightClass(__pyx_v_arc.weight));

  /* "fstlib/cext/pywrapfst.pyx":3138
 *   cdef Weight _weight = Weight.__new__(Weight)
 *   _weight._weight.reset(new fst.WeightClass(arc.weight))
 *   return Arc(arc.ilabel, arc.olabel, _weight, arc.nextstate)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_arc.ilabel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_arc.olabel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_v_arc.nextstate); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_v__weight));
  __Pyx_GIVEREF(((PyObject *)__pyx_v__weight));
  PyTuple_SET_ITEM(__pyx_t_4, 2, ((PyObject *)__pyx_v__weight));
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_3);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6fstlib_4cext_9pywrapfst_Arc), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_r = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Arc *)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":3135
 * 
 * 
 * cdef Arc _init_Arc(const fst.ArcClass &arc):             # <<<<<<<<<<<<<<
 *   cdef Weight _weight = Weight.__new__(Weight)
 *   _weight._weight.reset(new fst.WeightClass(arc.weight))
 */

  /* 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("fstlib.cext.pywrapfst._init_Arc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v__weight);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":3152
 *   """
 * 
 *   def __repr__(self):             # <<<<<<<<<<<<<<
 *     return f"<_ArcIterator at 0x{id(self):x}>"
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_12_ArcIterator_1__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_12_ArcIterator_1__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_12_ArcIterator___repr__(((struct __pyx_obj_6fstlib_4cext_9pywrapfst__ArcIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_12_ArcIterator___repr__(struct __pyx_obj_6fstlib_4cext_9pywrapfst__ArcIterator *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  Py_UCS4 __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "fstlib/cext/pywrapfst.pyx":3153
 * 
 *   def __repr__(self):
 *     return f"<_ArcIterator at 0x{id(self):x}>"             # <<<<<<<<<<<<<<
 * 
 *   def __init__(self, Fst ifst, int64 state):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3153, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = 0;
  __pyx_t_3 = 127;
  __Pyx_INCREF(__pyx_kp_u_ArcIterator_at_0x);
  __pyx_t_2 += 19;
  __Pyx_GIVEREF(__pyx_kp_u_ArcIterator_at_0x);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_ArcIterator_at_0x);
  __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3153, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_Format(__pyx_t_4, __pyx_n_u_x); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3153, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5);
  __pyx_t_5 = 0;
  __Pyx_INCREF(__pyx_kp_u__3);
  __pyx_t_2 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__3);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u__3);
  __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_1, 3, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3153, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":3152
 *   """
 * 
 *   def __repr__(self):             # <<<<<<<<<<<<<<
 *     return f"<_ArcIterator at 0x{id(self):x}>"
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst._ArcIterator.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":3155
 *     return f"<_ArcIterator at 0x{id(self):x}>"
 * 
 *   def __init__(self, Fst ifst, int64 state):             # <<<<<<<<<<<<<<
 *     if not ifst._fst.get().ValidStateId(state):
 *       raise FstIndexError("State index out of range")
 */

/* Python wrapper */
static int __pyx_pw_6fstlib_4cext_9pywrapfst_12_ArcIterator_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_6fstlib_4cext_9pywrapfst_12_ArcIterator_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst = 0;
  int64 __pyx_v_state;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ifst,&__pyx_n_s_state,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ifst)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_state)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 3155, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 3155, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_ifst = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *)values[0]);
    __pyx_v_state = __Pyx_PyInt_As_int64_t(values[1]); if (unlikely((__pyx_v_state == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3155, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3155, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst._ArcIterator.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_6fstlib_4cext_9pywrapfst_Fst, 1, "ifst", 0))) __PYX_ERR(0, 3155, __pyx_L1_error)
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_12_ArcIterator_2__init__(((struct __pyx_obj_6fstlib_4cext_9pywrapfst__ArcIterator *)__pyx_v_self), __pyx_v_ifst, __pyx_v_state);

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

static int __pyx_pf_6fstlib_4cext_9pywrapfst_12_ArcIterator_2__init__(struct __pyx_obj_6fstlib_4cext_9pywrapfst__ArcIterator *__pyx_v_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst, int64 __pyx_v_state) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  std::shared_ptr<fst::script::FstClass>  __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "fstlib/cext/pywrapfst.pyx":3156
 * 
 *   def __init__(self, Fst ifst, int64 state):
 *     if not ifst._fst.get().ValidStateId(state):             # <<<<<<<<<<<<<<
 *       raise FstIndexError("State index out of range")
 *     # Makes copy of the shared_ptr, potentially extending the FST's lifetime.
 */
  if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 3156, __pyx_L1_error)
  }
  __pyx_t_1 = ((!(__pyx_v_ifst->_fst.get()->ValidStateId(__pyx_v_state) != 0)) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "fstlib/cext/pywrapfst.pyx":3157
 *   def __init__(self, Fst ifst, int64 state):
 *     if not ifst._fst.get().ValidStateId(state):
 *       raise FstIndexError("State index out of range")             # <<<<<<<<<<<<<<
 *     # Makes copy of the shared_ptr, potentially extending the FST's lifetime.
 *     self._fst = ifst._fst
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3157, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_kp_u_State_index_out_of_range) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_u_State_index_out_of_range);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3157, __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(0, 3157, __pyx_L1_error)

    /* "fstlib/cext/pywrapfst.pyx":3156
 * 
 *   def __init__(self, Fst ifst, int64 state):
 *     if not ifst._fst.get().ValidStateId(state):             # <<<<<<<<<<<<<<
 *       raise FstIndexError("State index out of range")
 *     # Makes copy of the shared_ptr, potentially extending the FST's lifetime.
 */
  }

  /* "fstlib/cext/pywrapfst.pyx":3159
 *       raise FstIndexError("State index out of range")
 *     # Makes copy of the shared_ptr, potentially extending the FST's lifetime.
 *     self._fst = ifst._fst             # <<<<<<<<<<<<<<
 *     self._aiter.reset(new fst.ArcIteratorClass(deref(self._fst), state))
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 3159, __pyx_L1_error)
  }
  __pyx_t_5 = __pyx_v_ifst->_fst;
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 3159, __pyx_L1_error)
  }
  __pyx_v_self->_fst = __pyx_t_5;

  /* "fstlib/cext/pywrapfst.pyx":3160
 *     # Makes copy of the shared_ptr, potentially extending the FST's lifetime.
 *     self._fst = ifst._fst
 *     self._aiter.reset(new fst.ArcIteratorClass(deref(self._fst), state))             # <<<<<<<<<<<<<<
 * 
 *   # This just registers this class as a possible iterator.
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_aiter");
    __PYX_ERR(0, 3160, __pyx_L1_error)
  }
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 3160, __pyx_L1_error)
  }
  __pyx_v_self->_aiter.reset(new fst::script::ArcIteratorClass((*__pyx_v_self->_fst), __pyx_v_state));

  /* "fstlib/cext/pywrapfst.pyx":3155
 *     return f"<_ArcIterator at 0x{id(self):x}>"
 * 
 *   def __init__(self, Fst ifst, int64 state):             # <<<<<<<<<<<<<<
 *     if not ifst._fst.get().ValidStateId(state):
 *       raise FstIndexError("State index out of range")
 */

  /* 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_AddTraceback("fstlib.cext.pywrapfst._ArcIterator.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":3163
 * 
 *   # This just registers this class as a possible iterator.
 *   def __iter__(self):             # <<<<<<<<<<<<<<
 *     return self
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_12_ArcIterator_5__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_12_ArcIterator_5__iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_12_ArcIterator_4__iter__(((struct __pyx_obj_6fstlib_4cext_9pywrapfst__ArcIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_12_ArcIterator_4__iter__(struct __pyx_obj_6fstlib_4cext_9pywrapfst__ArcIterator *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);

  /* "fstlib/cext/pywrapfst.pyx":3164
 *   # This just registers this class as a possible iterator.
 *   def __iter__(self):
 *     return self             # <<<<<<<<<<<<<<
 * 
 *   # Magic method used to get a Pythonic API out of the C++ API.
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":3163
 * 
 *   # This just registers this class as a possible iterator.
 *   def __iter__(self):             # <<<<<<<<<<<<<<
 *     return self
 * 
 */

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

/* "fstlib/cext/pywrapfst.pyx":3167
 * 
 *   # Magic method used to get a Pythonic API out of the C++ API.
 *   def __next__(self):             # <<<<<<<<<<<<<<
 *     if self.done():
 *       raise StopIteration
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_12_ArcIterator_7__next__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_12_ArcIterator_7__next__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__next__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_12_ArcIterator_6__next__(((struct __pyx_obj_6fstlib_4cext_9pywrapfst__ArcIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_12_ArcIterator_6__next__(struct __pyx_obj_6fstlib_4cext_9pywrapfst__ArcIterator *__pyx_v_self) {
  PyObject *__pyx_v_result = 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("__next__", 0);

  /* "fstlib/cext/pywrapfst.pyx":3168
 *   # Magic method used to get a Pythonic API out of the C++ API.
 *   def __next__(self):
 *     if self.done():             # <<<<<<<<<<<<<<
 *       raise StopIteration
 *     result = self.value()
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "done");
    __PYX_ERR(0, 3168, __pyx_L1_error)
  }
  __pyx_t_1 = (((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst__ArcIterator *)__pyx_v_self->__pyx_vtab)->done(__pyx_v_self, 0) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "fstlib/cext/pywrapfst.pyx":3169
 *   def __next__(self):
 *     if self.done():
 *       raise StopIteration             # <<<<<<<<<<<<<<
 *     result = self.value()
 *     self.next()
 */
    __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
    __PYX_ERR(0, 3169, __pyx_L1_error)

    /* "fstlib/cext/pywrapfst.pyx":3168
 *   # Magic method used to get a Pythonic API out of the C++ API.
 *   def __next__(self):
 *     if self.done():             # <<<<<<<<<<<<<<
 *       raise StopIteration
 *     result = self.value()
 */
  }

  /* "fstlib/cext/pywrapfst.pyx":3170
 *     if self.done():
 *       raise StopIteration
 *     result = self.value()             # <<<<<<<<<<<<<<
 *     self.next()
 *     return result
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "value");
    __PYX_ERR(0, 3170, __pyx_L1_error)
  }
  __pyx_t_2 = ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst__ArcIterator *)__pyx_v_self->__pyx_vtab)->value(__pyx_v_self, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3170, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_result = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "fstlib/cext/pywrapfst.pyx":3171
 *       raise StopIteration
 *     result = self.value()
 *     self.next()             # <<<<<<<<<<<<<<
 *     return result
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "next");
    __PYX_ERR(0, 3171, __pyx_L1_error)
  }
  ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst__ArcIterator *)__pyx_v_self->__pyx_vtab)->next(__pyx_v_self, 0);

  /* "fstlib/cext/pywrapfst.pyx":3172
 *     result = self.value()
 *     self.next()
 *     return result             # <<<<<<<<<<<<<<
 * 
 *   cpdef bool done(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":3167
 * 
 *   # Magic method used to get a Pythonic API out of the C++ API.
 *   def __next__(self):             # <<<<<<<<<<<<<<
 *     if self.done():
 *       raise StopIteration
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst._ArcIterator.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":3174
 *     return result
 * 
 *   cpdef bool done(self):             # <<<<<<<<<<<<<<
 *     """
 *     done(self)
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_12_ArcIterator_9done(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static bool __pyx_f_6fstlib_4cext_9pywrapfst_12_ArcIterator_done(struct __pyx_obj_6fstlib_4cext_9pywrapfst__ArcIterator *__pyx_v_self, int __pyx_skip_dispatch) {
  bool __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  bool __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("done", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_done); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3174, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6fstlib_4cext_9pywrapfst_12_ArcIterator_9done)) {
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3174, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3174, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_5;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "fstlib/cext/pywrapfst.pyx":3183
 *       True if the iterator is exhausted, False otherwise.
 *     """
 *     return self._aiter.get().Done()             # <<<<<<<<<<<<<<
 * 
 *   cpdef uint8 flags(self):
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_aiter");
    __PYX_ERR(0, 3183, __pyx_L1_error)
  }
  __pyx_r = __pyx_v_self->_aiter.get()->Done();
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":3174
 *     return result
 * 
 *   cpdef bool done(self):             # <<<<<<<<<<<<<<
 *     """
 *     done(self)
 */

  /* 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_WriteUnraisable("fstlib.cext.pywrapfst._ArcIterator.done", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_12_ArcIterator_9done(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_12_ArcIterator_8done[] = "\n    done(self)\n\n    Indicates whether the iterator is exhausted or not.\n\n    Returns:\n      True if the iterator is exhausted, False otherwise.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_12_ArcIterator_9done(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("done (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_12_ArcIterator_8done(((struct __pyx_obj_6fstlib_4cext_9pywrapfst__ArcIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_12_ArcIterator_8done(struct __pyx_obj_6fstlib_4cext_9pywrapfst__ArcIterator *__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("done", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_6fstlib_4cext_9pywrapfst_12_ArcIterator_done(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3174, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst._ArcIterator.done", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":3185
 *     return self._aiter.get().Done()
 * 
 *   cpdef uint8 flags(self):             # <<<<<<<<<<<<<<
 *     """
 *     flags(self)
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_12_ArcIterator_11flags(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static uint8 __pyx_f_6fstlib_4cext_9pywrapfst_12_ArcIterator_flags(struct __pyx_obj_6fstlib_4cext_9pywrapfst__ArcIterator *__pyx_v_self, int __pyx_skip_dispatch) {
  uint8 __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  uint8 __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("flags", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3185, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6fstlib_4cext_9pywrapfst_12_ArcIterator_11flags)) {
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3185, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_5 = __Pyx_PyInt_As_uint8_t(__pyx_t_2); if (unlikely((__pyx_t_5 == ((uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3185, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_5;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "fstlib/cext/pywrapfst.pyx":3194
 *       The current iterator behavioral flags as an integer.
 *     """
 *     return self._aiter.get().Flags()             # <<<<<<<<<<<<<<
 * 
 *   cpdef void next(self):
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_aiter");
    __PYX_ERR(0, 3194, __pyx_L1_error)
  }
  __pyx_r = __pyx_v_self->_aiter.get()->Flags();
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":3185
 *     return self._aiter.get().Done()
 * 
 *   cpdef uint8 flags(self):             # <<<<<<<<<<<<<<
 *     """
 *     flags(self)
 */

  /* 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_WriteUnraisable("fstlib.cext.pywrapfst._ArcIterator.flags", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_12_ArcIterator_11flags(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_12_ArcIterator_10flags[] = "\n    flags(self)\n\n    Returns the current iterator behavioral flags.\n\n    Returns:\n      The current iterator behavioral flags as an integer.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_12_ArcIterator_11flags(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("flags (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_12_ArcIterator_10flags(((struct __pyx_obj_6fstlib_4cext_9pywrapfst__ArcIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_12_ArcIterator_10flags(struct __pyx_obj_6fstlib_4cext_9pywrapfst__ArcIterator *__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("flags", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_uint8_t(__pyx_f_6fstlib_4cext_9pywrapfst_12_ArcIterator_flags(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3185, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst._ArcIterator.flags", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":3196
 *     return self._aiter.get().Flags()
 * 
 *   cpdef void next(self):             # <<<<<<<<<<<<<<
 *     """
 *     next(self)
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_12_ArcIterator_13next(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static void __pyx_f_6fstlib_4cext_9pywrapfst_12_ArcIterator_next(struct __pyx_obj_6fstlib_4cext_9pywrapfst__ArcIterator *__pyx_v_self, int __pyx_skip_dispatch) {
  __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("next", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_next); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3196, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6fstlib_4cext_9pywrapfst_12_ArcIterator_13next)) {
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3196, __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;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "fstlib/cext/pywrapfst.pyx":3202
 *     Advances the iterator.
 *     """
 *     self._aiter.get().Next()             # <<<<<<<<<<<<<<
 * 
 *   cpdef size_t position(self):
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_aiter");
    __PYX_ERR(0, 3202, __pyx_L1_error)
  }
  __pyx_v_self->_aiter.get()->Next();

  /* "fstlib/cext/pywrapfst.pyx":3196
 *     return self._aiter.get().Flags()
 * 
 *   cpdef void next(self):             # <<<<<<<<<<<<<<
 *     """
 *     next(self)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("fstlib.cext.pywrapfst._ArcIterator.next", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_12_ArcIterator_13next(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_12_ArcIterator_12next[] = "\n    next(self)\n\n    Advances the iterator.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_12_ArcIterator_13next(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("next (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_12_ArcIterator_12next(((struct __pyx_obj_6fstlib_4cext_9pywrapfst__ArcIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_12_ArcIterator_12next(struct __pyx_obj_6fstlib_4cext_9pywrapfst__ArcIterator *__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("next", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_6fstlib_4cext_9pywrapfst_12_ArcIterator_next(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3196, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst._ArcIterator.next", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":3204
 *     self._aiter.get().Next()
 * 
 *   cpdef size_t position(self):             # <<<<<<<<<<<<<<
 *     """
 *     position(self)
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_12_ArcIterator_15position(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static size_t __pyx_f_6fstlib_4cext_9pywrapfst_12_ArcIterator_position(struct __pyx_obj_6fstlib_4cext_9pywrapfst__ArcIterator *__pyx_v_self, int __pyx_skip_dispatch) {
  size_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("position", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_position); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3204, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6fstlib_4cext_9pywrapfst_12_ArcIterator_15position)) {
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3204, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_5 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3204, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_5;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "fstlib/cext/pywrapfst.pyx":3213
 *       The iterator's position, expressed as an integer.
 *     """
 *     return self._aiter.get().Position()             # <<<<<<<<<<<<<<
 * 
 *   cpdef void reset(self):
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_aiter");
    __PYX_ERR(0, 3213, __pyx_L1_error)
  }
  __pyx_r = __pyx_v_self->_aiter.get()->Position();
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":3204
 *     self._aiter.get().Next()
 * 
 *   cpdef size_t position(self):             # <<<<<<<<<<<<<<
 *     """
 *     position(self)
 */

  /* 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_WriteUnraisable("fstlib.cext.pywrapfst._ArcIterator.position", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_12_ArcIterator_15position(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_12_ArcIterator_14position[] = "\n    position(self)\n\n    Returns the position of the iterator.\n\n    Returns:\n      The iterator's position, expressed as an integer.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_12_ArcIterator_15position(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("position (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_12_ArcIterator_14position(((struct __pyx_obj_6fstlib_4cext_9pywrapfst__ArcIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_12_ArcIterator_14position(struct __pyx_obj_6fstlib_4cext_9pywrapfst__ArcIterator *__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("position", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_f_6fstlib_4cext_9pywrapfst_12_ArcIterator_position(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3204, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst._ArcIterator.position", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":3215
 *     return self._aiter.get().Position()
 * 
 *   cpdef void reset(self):             # <<<<<<<<<<<<<<
 *     """
 *     reset(self)
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_12_ArcIterator_17reset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static void __pyx_f_6fstlib_4cext_9pywrapfst_12_ArcIterator_reset(struct __pyx_obj_6fstlib_4cext_9pywrapfst__ArcIterator *__pyx_v_self, int __pyx_skip_dispatch) {
  __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("reset", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3215, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6fstlib_4cext_9pywrapfst_12_ArcIterator_17reset)) {
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3215, __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;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "fstlib/cext/pywrapfst.pyx":3221
 *     Resets the iterator to the initial position.
 *     """
 *     self._aiter.get().Reset()             # <<<<<<<<<<<<<<
 * 
 *   cpdef void seek(self, size_t a):
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_aiter");
    __PYX_ERR(0, 3221, __pyx_L1_error)
  }
  __pyx_v_self->_aiter.get()->Reset();

  /* "fstlib/cext/pywrapfst.pyx":3215
 *     return self._aiter.get().Position()
 * 
 *   cpdef void reset(self):             # <<<<<<<<<<<<<<
 *     """
 *     reset(self)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("fstlib.cext.pywrapfst._ArcIterator.reset", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_12_ArcIterator_17reset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_12_ArcIterator_16reset[] = "\n    reset(self)\n\n    Resets the iterator to the initial position.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_12_ArcIterator_17reset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("reset (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_12_ArcIterator_16reset(((struct __pyx_obj_6fstlib_4cext_9pywrapfst__ArcIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_12_ArcIterator_16reset(struct __pyx_obj_6fstlib_4cext_9pywrapfst__ArcIterator *__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", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_6fstlib_4cext_9pywrapfst_12_ArcIterator_reset(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3215, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst._ArcIterator.reset", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":3223
 *     self._aiter.get().Reset()
 * 
 *   cpdef void seek(self, size_t a):             # <<<<<<<<<<<<<<
 *     """
 *     seek(self, a)
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_12_ArcIterator_19seek(PyObject *__pyx_v_self, PyObject *__pyx_arg_a); /*proto*/
static void __pyx_f_6fstlib_4cext_9pywrapfst_12_ArcIterator_seek(struct __pyx_obj_6fstlib_4cext_9pywrapfst__ArcIterator *__pyx_v_self, size_t __pyx_v_a, int __pyx_skip_dispatch) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("seek", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_seek); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3223, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6fstlib_4cext_9pywrapfst_12_ArcIterator_19seek)) {
        __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_v_a); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3223, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
          if (likely(__pyx_t_5)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
            __Pyx_INCREF(__pyx_t_5);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_4, function);
          }
        }
        __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3223, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "fstlib/cext/pywrapfst.pyx":3232
 *       a: The position to seek to.
 *     """
 *     self._aiter.get().Seek(a)             # <<<<<<<<<<<<<<
 * 
 *   cpdef void set_flags(self, uint8 flags, uint8 mask):
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_aiter");
    __PYX_ERR(0, 3232, __pyx_L1_error)
  }
  __pyx_v_self->_aiter.get()->Seek(__pyx_v_a);

  /* "fstlib/cext/pywrapfst.pyx":3223
 *     self._aiter.get().Reset()
 * 
 *   cpdef void seek(self, size_t a):             # <<<<<<<<<<<<<<
 *     """
 *     seek(self, a)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_WriteUnraisable("fstlib.cext.pywrapfst._ArcIterator.seek", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_12_ArcIterator_19seek(PyObject *__pyx_v_self, PyObject *__pyx_arg_a); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_12_ArcIterator_18seek[] = "\n    seek(self, a)\n\n    Advance the iterator to a new position.\n\n    Args:\n      a: The position to seek to.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_12_ArcIterator_19seek(PyObject *__pyx_v_self, PyObject *__pyx_arg_a) {
  size_t __pyx_v_a;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("seek (wrapper)", 0);
  assert(__pyx_arg_a); {
    __pyx_v_a = __Pyx_PyInt_As_size_t(__pyx_arg_a); if (unlikely((__pyx_v_a == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3223, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst._ArcIterator.seek", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_12_ArcIterator_18seek(((struct __pyx_obj_6fstlib_4cext_9pywrapfst__ArcIterator *)__pyx_v_self), ((size_t)__pyx_v_a));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_12_ArcIterator_18seek(struct __pyx_obj_6fstlib_4cext_9pywrapfst__ArcIterator *__pyx_v_self, size_t __pyx_v_a) {
  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("seek", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_6fstlib_4cext_9pywrapfst_12_ArcIterator_seek(__pyx_v_self, __pyx_v_a, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3223, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst._ArcIterator.seek", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":3234
 *     self._aiter.get().Seek(a)
 * 
 *   cpdef void set_flags(self, uint8 flags, uint8 mask):             # <<<<<<<<<<<<<<
 *     """
 *     set_flags(self, flags, mask)
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_12_ArcIterator_21set_flags(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static void __pyx_f_6fstlib_4cext_9pywrapfst_12_ArcIterator_set_flags(struct __pyx_obj_6fstlib_4cext_9pywrapfst__ArcIterator *__pyx_v_self, uint8 __pyx_v_flags, uint8 __pyx_v_mask, int __pyx_skip_dispatch) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_flags", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3234, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6fstlib_4cext_9pywrapfst_12_ArcIterator_21set_flags)) {
        __pyx_t_3 = __Pyx_PyInt_From_uint8_t(__pyx_v_flags); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3234, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_mask); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3234, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_5 = __pyx_t_1; __pyx_t_6 = NULL;
        __pyx_t_7 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
          __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
          if (likely(__pyx_t_6)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
            __Pyx_INCREF(__pyx_t_6);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_5, function);
            __pyx_t_7 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_5)) {
          PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_3, __pyx_t_4};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3234, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
          PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_3, __pyx_t_4};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3234, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        {
          __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3234, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          if (__pyx_t_6) {
            __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_3);
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_4);
          __pyx_t_3 = 0;
          __pyx_t_4 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3234, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        }
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "fstlib/cext/pywrapfst.pyx":3244
 *       mask: A mask to be applied to the `flags` argument before setting them.
 *     """
 *     self._aiter.get().SetFlags(flags, mask)             # <<<<<<<<<<<<<<
 * 
 *   cpdef object value(self):
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_aiter");
    __PYX_ERR(0, 3244, __pyx_L1_error)
  }
  __pyx_v_self->_aiter.get()->SetFlags(__pyx_v_flags, __pyx_v_mask);

  /* "fstlib/cext/pywrapfst.pyx":3234
 *     self._aiter.get().Seek(a)
 * 
 *   cpdef void set_flags(self, uint8 flags, uint8 mask):             # <<<<<<<<<<<<<<
 *     """
 *     set_flags(self, flags, mask)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_WriteUnraisable("fstlib.cext.pywrapfst._ArcIterator.set_flags", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_12_ArcIterator_21set_flags(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_12_ArcIterator_20set_flags[] = "\n    set_flags(self, flags, mask)\n\n    Sets the current iterator behavioral flags.\n\n    Args:\n      flags: The properties to be set.\n      mask: A mask to be applied to the `flags` argument before setting them.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_12_ArcIterator_21set_flags(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  uint8 __pyx_v_flags;
  uint8 __pyx_v_mask;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_flags (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flags,&__pyx_n_s_mask,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_flags", 1, 2, 2, 1); __PYX_ERR(0, 3234, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_flags") < 0)) __PYX_ERR(0, 3234, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_flags = __Pyx_PyInt_As_uint8_t(values[0]); if (unlikely((__pyx_v_flags == ((uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3234, __pyx_L3_error)
    __pyx_v_mask = __Pyx_PyInt_As_uint8_t(values[1]); if (unlikely((__pyx_v_mask == ((uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3234, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_flags", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3234, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst._ArcIterator.set_flags", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_12_ArcIterator_20set_flags(((struct __pyx_obj_6fstlib_4cext_9pywrapfst__ArcIterator *)__pyx_v_self), __pyx_v_flags, __pyx_v_mask);

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_12_ArcIterator_20set_flags(struct __pyx_obj_6fstlib_4cext_9pywrapfst__ArcIterator *__pyx_v_self, uint8 __pyx_v_flags, uint8 __pyx_v_mask) {
  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_flags", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_6fstlib_4cext_9pywrapfst_12_ArcIterator_set_flags(__pyx_v_self, __pyx_v_flags, __pyx_v_mask, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3234, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst._ArcIterator.set_flags", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":3246
 *     self._aiter.get().SetFlags(flags, mask)
 * 
 *   cpdef object value(self):             # <<<<<<<<<<<<<<
 *     """
 *     value(self)
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_12_ArcIterator_23value(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_6fstlib_4cext_9pywrapfst_12_ArcIterator_value(struct __pyx_obj_6fstlib_4cext_9pywrapfst__ArcIterator *__pyx_v_self, int __pyx_skip_dispatch) {
  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("value", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3246, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6fstlib_4cext_9pywrapfst_12_ArcIterator_23value)) {
        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3246, __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;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "fstlib/cext/pywrapfst.pyx":3252
 *     Returns the current arc.
 *     """
 *     return _init_Arc(self._aiter.get().Value())             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_aiter");
    __PYX_ERR(0, 3252, __pyx_L1_error)
  }
  __pyx_t_1 = ((PyObject *)__pyx_f_6fstlib_4cext_9pywrapfst__init_Arc(__pyx_v_self->_aiter.get()->Value())); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3252, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":3246
 *     self._aiter.get().SetFlags(flags, mask)
 * 
 *   cpdef object value(self):             # <<<<<<<<<<<<<<
 *     """
 *     value(self)
 */

  /* 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("fstlib.cext.pywrapfst._ArcIterator.value", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_12_ArcIterator_23value(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_12_ArcIterator_22value[] = "\n    value(self)\n\n    Returns the current arc.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_12_ArcIterator_23value(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("value (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_12_ArcIterator_22value(((struct __pyx_obj_6fstlib_4cext_9pywrapfst__ArcIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_12_ArcIterator_22value(struct __pyx_obj_6fstlib_4cext_9pywrapfst__ArcIterator *__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("value", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6fstlib_4cext_9pywrapfst_12_ArcIterator_value(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3246, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst._ArcIterator.value", __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._aiter,self._fst cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_12_ArcIterator_25__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_12_ArcIterator_25__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_12_ArcIterator_24__reduce_cython__(((struct __pyx_obj_6fstlib_4cext_9pywrapfst__ArcIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_12_ArcIterator_24__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_6fstlib_4cext_9pywrapfst__ArcIterator *__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("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self._aiter,self._fst cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self._aiter,self._fst cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __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(1, 2, __pyx_L1_error)

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst._ArcIterator.__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._aiter,self._fst cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self._aiter,self._fst cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_12_ArcIterator_27__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_12_ArcIterator_27__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_12_ArcIterator_26__setstate_cython__(((struct __pyx_obj_6fstlib_4cext_9pywrapfst__ArcIterator *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_12_ArcIterator_26__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_6fstlib_4cext_9pywrapfst__ArcIterator *__pyx_v_self, CYTHON_UNUSED 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__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self._aiter,self._fst cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self._aiter,self._fst cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __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(1, 4, __pyx_L1_error)

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst._ArcIterator.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":3264
 *   """
 * 
 *   def __repr__(self):             # <<<<<<<<<<<<<<
 *     return f"<_MutableArcIterator at 0x{id(self):x}>"
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_1__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_1__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_19_MutableArcIterator___repr__(((struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableArcIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_19_MutableArcIterator___repr__(struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableArcIterator *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  Py_UCS4 __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "fstlib/cext/pywrapfst.pyx":3265
 * 
 *   def __repr__(self):
 *     return f"<_MutableArcIterator at 0x{id(self):x}>"             # <<<<<<<<<<<<<<
 * 
 *   def __init__(self, MutableFst ifst, int64 state):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3265, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = 0;
  __pyx_t_3 = 127;
  __Pyx_INCREF(__pyx_kp_u_MutableArcIterator_at_0x);
  __pyx_t_2 += 26;
  __Pyx_GIVEREF(__pyx_kp_u_MutableArcIterator_at_0x);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_MutableArcIterator_at_0x);
  __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3265, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_Format(__pyx_t_4, __pyx_n_u_x); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3265, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5);
  __pyx_t_5 = 0;
  __Pyx_INCREF(__pyx_kp_u__3);
  __pyx_t_2 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__3);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u__3);
  __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_1, 3, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3265, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":3264
 *   """
 * 
 *   def __repr__(self):             # <<<<<<<<<<<<<<
 *     return f"<_MutableArcIterator at 0x{id(self):x}>"
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst._MutableArcIterator.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":3267
 *     return f"<_MutableArcIterator at 0x{id(self):x}>"
 * 
 *   def __init__(self, MutableFst ifst, int64 state):             # <<<<<<<<<<<<<<
 *     if not ifst._fst.get().ValidStateId(state):
 *       raise FstIndexError("State index out of range")
 */

/* Python wrapper */
static int __pyx_pw_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_ifst = 0;
  int64 __pyx_v_state;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ifst,&__pyx_n_s_state,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ifst)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_state)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 3267, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 3267, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_ifst = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *)values[0]);
    __pyx_v_state = __Pyx_PyInt_As_int64_t(values[1]); if (unlikely((__pyx_v_state == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3267, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3267, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst._MutableArcIterator.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_6fstlib_4cext_9pywrapfst_MutableFst, 1, "ifst", 0))) __PYX_ERR(0, 3267, __pyx_L1_error)
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_2__init__(((struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableArcIterator *)__pyx_v_self), __pyx_v_ifst, __pyx_v_state);

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

static int __pyx_pf_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_2__init__(struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableArcIterator *__pyx_v_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_v_ifst, int64 __pyx_v_state) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  std::shared_ptr<fst::script::MutableFstClass>  __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "fstlib/cext/pywrapfst.pyx":3268
 * 
 *   def __init__(self, MutableFst ifst, int64 state):
 *     if not ifst._fst.get().ValidStateId(state):             # <<<<<<<<<<<<<<
 *       raise FstIndexError("State index out of range")
 *     # Makes copy of the shared_ptr, potentially extending the FST's lifetime.
 */
  if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 3268, __pyx_L1_error)
  }
  __pyx_t_1 = ((!(__pyx_v_ifst->__pyx_base._fst.get()->ValidStateId(__pyx_v_state) != 0)) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "fstlib/cext/pywrapfst.pyx":3269
 *   def __init__(self, MutableFst ifst, int64 state):
 *     if not ifst._fst.get().ValidStateId(state):
 *       raise FstIndexError("State index out of range")             # <<<<<<<<<<<<<<
 *     # Makes copy of the shared_ptr, potentially extending the FST's lifetime.
 *     self._mfst = ifst._mfst
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3269, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_kp_u_State_index_out_of_range) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_u_State_index_out_of_range);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3269, __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(0, 3269, __pyx_L1_error)

    /* "fstlib/cext/pywrapfst.pyx":3268
 * 
 *   def __init__(self, MutableFst ifst, int64 state):
 *     if not ifst._fst.get().ValidStateId(state):             # <<<<<<<<<<<<<<
 *       raise FstIndexError("State index out of range")
 *     # Makes copy of the shared_ptr, potentially extending the FST's lifetime.
 */
  }

  /* "fstlib/cext/pywrapfst.pyx":3271
 *       raise FstIndexError("State index out of range")
 *     # Makes copy of the shared_ptr, potentially extending the FST's lifetime.
 *     self._mfst = ifst._mfst             # <<<<<<<<<<<<<<
 *     self._aiter.reset(new fst.MutableArcIteratorClass(ifst._mfst.get(), state))
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
    __PYX_ERR(0, 3271, __pyx_L1_error)
  }
  __pyx_t_5 = __pyx_v_ifst->_mfst;
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
    __PYX_ERR(0, 3271, __pyx_L1_error)
  }
  __pyx_v_self->_mfst = __pyx_t_5;

  /* "fstlib/cext/pywrapfst.pyx":3272
 *     # Makes copy of the shared_ptr, potentially extending the FST's lifetime.
 *     self._mfst = ifst._mfst
 *     self._aiter.reset(new fst.MutableArcIteratorClass(ifst._mfst.get(), state))             # <<<<<<<<<<<<<<
 * 
 *   # Magic method used to get a Pythonic Iterator API out of the C++ API.
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_aiter");
    __PYX_ERR(0, 3272, __pyx_L1_error)
  }
  if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
    __PYX_ERR(0, 3272, __pyx_L1_error)
  }
  __pyx_v_self->_aiter.reset(new fst::script::MutableArcIteratorClass(__pyx_v_ifst->_mfst.get(), __pyx_v_state));

  /* "fstlib/cext/pywrapfst.pyx":3267
 *     return f"<_MutableArcIterator at 0x{id(self):x}>"
 * 
 *   def __init__(self, MutableFst ifst, int64 state):             # <<<<<<<<<<<<<<
 *     if not ifst._fst.get().ValidStateId(state):
 *       raise FstIndexError("State index out of range")
 */

  /* 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_AddTraceback("fstlib.cext.pywrapfst._MutableArcIterator.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_6generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "fstlib/cext/pywrapfst.pyx":3275
 * 
 *   # Magic method used to get a Pythonic Iterator API out of the C++ API.
 *   def __iter__(self):             # <<<<<<<<<<<<<<
 *     while not self.done():
 *       yield self.value()
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_5__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_5__iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_4__iter__(((struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableArcIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_4__iter__(struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableArcIterator *__pyx_v_self) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst___pyx_scope_struct____iter__ *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__iter__", 0);
  __pyx_cur_scope = (struct __pyx_obj_6fstlib_4cext_9pywrapfst___pyx_scope_struct____iter__ *)__pyx_tp_new_6fstlib_4cext_9pywrapfst___pyx_scope_struct____iter__(__pyx_ptype_6fstlib_4cext_9pywrapfst___pyx_scope_struct____iter__, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst___pyx_scope_struct____iter__ *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 3275, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_6generator, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_iter, __pyx_n_s_MutableArcIterator___iter, __pyx_n_s_fstlib_cext_pywrapfst); if (unlikely(!gen)) __PYX_ERR(0, 3275, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst._MutableArcIterator.__iter__", __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_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_6generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_6fstlib_4cext_9pywrapfst___pyx_scope_struct____iter__ *__pyx_cur_scope = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst___pyx_scope_struct____iter__ *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 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, 3275, __pyx_L1_error)

  /* "fstlib/cext/pywrapfst.pyx":3276
 *   # Magic method used to get a Pythonic Iterator API out of the C++ API.
 *   def __iter__(self):
 *     while not self.done():             # <<<<<<<<<<<<<<
 *       yield self.value()
 *       self.next()
 */
  while (1) {
    if (unlikely(((PyObject *)__pyx_cur_scope->__pyx_v_self) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "done");
      __PYX_ERR(0, 3276, __pyx_L1_error)
    }
    __pyx_t_1 = ((!(((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst__MutableArcIterator *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->done(__pyx_cur_scope->__pyx_v_self, 0) != 0)) != 0);
    if (!__pyx_t_1) break;

    /* "fstlib/cext/pywrapfst.pyx":3277
 *   def __iter__(self):
 *     while not self.done():
 *       yield self.value()             # <<<<<<<<<<<<<<
 *       self.next()
 * 
 */
    if (unlikely(((PyObject *)__pyx_cur_scope->__pyx_v_self) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "value");
      __PYX_ERR(0, 3277, __pyx_L1_error)
    }
    __pyx_t_2 = ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst__MutableArcIterator *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->value(__pyx_cur_scope->__pyx_v_self, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3277, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 3277, __pyx_L1_error)

    /* "fstlib/cext/pywrapfst.pyx":3278
 *     while not self.done():
 *       yield self.value()
 *       self.next()             # <<<<<<<<<<<<<<
 * 
 *   # Magic method used to get a Pythonic API out of the C++ API.
 */
    if (unlikely(((PyObject *)__pyx_cur_scope->__pyx_v_self) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "next");
      __PYX_ERR(0, 3278, __pyx_L1_error)
    }
    ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst__MutableArcIterator *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->next(__pyx_cur_scope->__pyx_v_self, 0);
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "fstlib/cext/pywrapfst.pyx":3275
 * 
 *   # Magic method used to get a Pythonic Iterator API out of the C++ API.
 *   def __iter__(self):             # <<<<<<<<<<<<<<
 *     while not self.done():
 *       yield self.value()
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("__iter__", __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;
}

/* "fstlib/cext/pywrapfst.pyx":3281
 * 
 *   # Magic method used to get a Pythonic API out of the C++ API.
 *   def __next__(self):             # <<<<<<<<<<<<<<
 *     if self.done():
 *       raise StopIteration
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_8__next__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_8__next__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__next__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_7__next__(((struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableArcIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_7__next__(struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableArcIterator *__pyx_v_self) {
  PyObject *__pyx_v_result = 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("__next__", 0);

  /* "fstlib/cext/pywrapfst.pyx":3282
 *   # Magic method used to get a Pythonic API out of the C++ API.
 *   def __next__(self):
 *     if self.done():             # <<<<<<<<<<<<<<
 *       raise StopIteration
 *     result = self.value()
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "done");
    __PYX_ERR(0, 3282, __pyx_L1_error)
  }
  __pyx_t_1 = (((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst__MutableArcIterator *)__pyx_v_self->__pyx_vtab)->done(__pyx_v_self, 0) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "fstlib/cext/pywrapfst.pyx":3283
 *   def __next__(self):
 *     if self.done():
 *       raise StopIteration             # <<<<<<<<<<<<<<
 *     result = self.value()
 *     self.next()
 */
    __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
    __PYX_ERR(0, 3283, __pyx_L1_error)

    /* "fstlib/cext/pywrapfst.pyx":3282
 *   # Magic method used to get a Pythonic API out of the C++ API.
 *   def __next__(self):
 *     if self.done():             # <<<<<<<<<<<<<<
 *       raise StopIteration
 *     result = self.value()
 */
  }

  /* "fstlib/cext/pywrapfst.pyx":3284
 *     if self.done():
 *       raise StopIteration
 *     result = self.value()             # <<<<<<<<<<<<<<
 *     self.next()
 *     return result
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "value");
    __PYX_ERR(0, 3284, __pyx_L1_error)
  }
  __pyx_t_2 = ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst__MutableArcIterator *)__pyx_v_self->__pyx_vtab)->value(__pyx_v_self, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3284, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_result = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "fstlib/cext/pywrapfst.pyx":3285
 *       raise StopIteration
 *     result = self.value()
 *     self.next()             # <<<<<<<<<<<<<<
 *     return result
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "next");
    __PYX_ERR(0, 3285, __pyx_L1_error)
  }
  ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst__MutableArcIterator *)__pyx_v_self->__pyx_vtab)->next(__pyx_v_self, 0);

  /* "fstlib/cext/pywrapfst.pyx":3286
 *     result = self.value()
 *     self.next()
 *     return result             # <<<<<<<<<<<<<<
 * 
 *   cpdef bool done(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":3281
 * 
 *   # Magic method used to get a Pythonic API out of the C++ API.
 *   def __next__(self):             # <<<<<<<<<<<<<<
 *     if self.done():
 *       raise StopIteration
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst._MutableArcIterator.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":3288
 *     return result
 * 
 *   cpdef bool done(self):             # <<<<<<<<<<<<<<
 *     """
 *     done(self)
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_10done(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static bool __pyx_f_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_done(struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableArcIterator *__pyx_v_self, int __pyx_skip_dispatch) {
  bool __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  bool __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("done", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_done); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3288, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_10done)) {
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3288, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3288, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_5;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "fstlib/cext/pywrapfst.pyx":3297
 *       True if the iterator is exhausted, False otherwise.
 *     """
 *     return self._aiter.get().Done()             # <<<<<<<<<<<<<<
 * 
 *   cpdef uint8 flags(self):
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_aiter");
    __PYX_ERR(0, 3297, __pyx_L1_error)
  }
  __pyx_r = __pyx_v_self->_aiter.get()->Done();
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":3288
 *     return result
 * 
 *   cpdef bool done(self):             # <<<<<<<<<<<<<<
 *     """
 *     done(self)
 */

  /* 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_WriteUnraisable("fstlib.cext.pywrapfst._MutableArcIterator.done", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_10done(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_9done[] = "\n    done(self)\n\n    Indicates whether the iterator is exhausted or not.\n\n    Returns:\n      True if the iterator is exhausted, False otherwise.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_10done(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("done (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_9done(((struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableArcIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_9done(struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableArcIterator *__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("done", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_done(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3288, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst._MutableArcIterator.done", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":3299
 *     return self._aiter.get().Done()
 * 
 *   cpdef uint8 flags(self):             # <<<<<<<<<<<<<<
 *     """
 *     flags(self)
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_12flags(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static uint8 __pyx_f_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_flags(struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableArcIterator *__pyx_v_self, int __pyx_skip_dispatch) {
  uint8 __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  uint8 __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("flags", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3299, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_12flags)) {
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3299, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_5 = __Pyx_PyInt_As_uint8_t(__pyx_t_2); if (unlikely((__pyx_t_5 == ((uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3299, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_5;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "fstlib/cext/pywrapfst.pyx":3308
 *       The current iterator behavioral flags as an integer.
 *     """
 *     return self._aiter.get().Flags()             # <<<<<<<<<<<<<<
 * 
 *   cpdef void next(self):
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_aiter");
    __PYX_ERR(0, 3308, __pyx_L1_error)
  }
  __pyx_r = __pyx_v_self->_aiter.get()->Flags();
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":3299
 *     return self._aiter.get().Done()
 * 
 *   cpdef uint8 flags(self):             # <<<<<<<<<<<<<<
 *     """
 *     flags(self)
 */

  /* 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_WriteUnraisable("fstlib.cext.pywrapfst._MutableArcIterator.flags", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_12flags(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_11flags[] = "\n    flags(self)\n\n    Returns the current iterator behavioral flags.\n\n    Returns:\n      The current iterator behavioral flags as an integer.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_12flags(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("flags (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_11flags(((struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableArcIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_11flags(struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableArcIterator *__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("flags", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_uint8_t(__pyx_f_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_flags(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3299, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst._MutableArcIterator.flags", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":3310
 *     return self._aiter.get().Flags()
 * 
 *   cpdef void next(self):             # <<<<<<<<<<<<<<
 *     """
 *     next(self)
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_14next(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static void __pyx_f_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_next(struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableArcIterator *__pyx_v_self, int __pyx_skip_dispatch) {
  __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("next", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_next); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3310, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_14next)) {
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3310, __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;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "fstlib/cext/pywrapfst.pyx":3316
 *     Advances the iterator.
 *     """
 *     self._aiter.get().Next()             # <<<<<<<<<<<<<<
 * 
 *   cpdef size_t position(self):
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_aiter");
    __PYX_ERR(0, 3316, __pyx_L1_error)
  }
  __pyx_v_self->_aiter.get()->Next();

  /* "fstlib/cext/pywrapfst.pyx":3310
 *     return self._aiter.get().Flags()
 * 
 *   cpdef void next(self):             # <<<<<<<<<<<<<<
 *     """
 *     next(self)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("fstlib.cext.pywrapfst._MutableArcIterator.next", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_14next(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_13next[] = "\n    next(self)\n\n    Advances the iterator.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_14next(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("next (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_13next(((struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableArcIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_13next(struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableArcIterator *__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("next", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_next(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3310, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst._MutableArcIterator.next", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":3318
 *     self._aiter.get().Next()
 * 
 *   cpdef size_t position(self):             # <<<<<<<<<<<<<<
 *     """
 *     position(self)
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_16position(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static size_t __pyx_f_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_position(struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableArcIterator *__pyx_v_self, int __pyx_skip_dispatch) {
  size_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("position", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_position); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3318, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_16position)) {
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3318, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_5 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3318, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_5;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "fstlib/cext/pywrapfst.pyx":3327
 *       The iterator's position, expressed as an integer.
 *     """
 *     return self._aiter.get().Position()             # <<<<<<<<<<<<<<
 * 
 *   cpdef void reset(self):
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_aiter");
    __PYX_ERR(0, 3327, __pyx_L1_error)
  }
  __pyx_r = __pyx_v_self->_aiter.get()->Position();
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":3318
 *     self._aiter.get().Next()
 * 
 *   cpdef size_t position(self):             # <<<<<<<<<<<<<<
 *     """
 *     position(self)
 */

  /* 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_WriteUnraisable("fstlib.cext.pywrapfst._MutableArcIterator.position", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_16position(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_15position[] = "\n    position(self)\n\n    Returns the position of the iterator.\n\n    Returns:\n      The iterator's position, expressed as an integer.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_16position(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("position (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_15position(((struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableArcIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_15position(struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableArcIterator *__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("position", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_f_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_position(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3318, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst._MutableArcIterator.position", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":3329
 *     return self._aiter.get().Position()
 * 
 *   cpdef void reset(self):             # <<<<<<<<<<<<<<
 *     """
 *     reset(self)
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_18reset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static void __pyx_f_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_reset(struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableArcIterator *__pyx_v_self, int __pyx_skip_dispatch) {
  __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("reset", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3329, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_18reset)) {
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3329, __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;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "fstlib/cext/pywrapfst.pyx":3335
 *     Resets the iterator to the initial position.
 *     """
 *     self._aiter.get().Reset()             # <<<<<<<<<<<<<<
 * 
 *   cpdef void seek(self, size_t a):
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_aiter");
    __PYX_ERR(0, 3335, __pyx_L1_error)
  }
  __pyx_v_self->_aiter.get()->Reset();

  /* "fstlib/cext/pywrapfst.pyx":3329
 *     return self._aiter.get().Position()
 * 
 *   cpdef void reset(self):             # <<<<<<<<<<<<<<
 *     """
 *     reset(self)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("fstlib.cext.pywrapfst._MutableArcIterator.reset", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_18reset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_17reset[] = "\n    reset(self)\n\n    Resets the iterator to the initial position.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_18reset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("reset (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_17reset(((struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableArcIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_17reset(struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableArcIterator *__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", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_reset(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3329, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst._MutableArcIterator.reset", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":3337
 *     self._aiter.get().Reset()
 * 
 *   cpdef void seek(self, size_t a):             # <<<<<<<<<<<<<<
 *     """
 *     seek(self, a)
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_20seek(PyObject *__pyx_v_self, PyObject *__pyx_arg_a); /*proto*/
static void __pyx_f_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_seek(struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableArcIterator *__pyx_v_self, size_t __pyx_v_a, int __pyx_skip_dispatch) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("seek", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_seek); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3337, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_20seek)) {
        __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_v_a); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3337, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
          if (likely(__pyx_t_5)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
            __Pyx_INCREF(__pyx_t_5);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_4, function);
          }
        }
        __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3337, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "fstlib/cext/pywrapfst.pyx":3346
 *       a: The position to seek to.
 *     """
 *     self._aiter.get().Seek(a)             # <<<<<<<<<<<<<<
 * 
 *   cpdef void set_flags(self, uint8 flags, uint8 mask):
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_aiter");
    __PYX_ERR(0, 3346, __pyx_L1_error)
  }
  __pyx_v_self->_aiter.get()->Seek(__pyx_v_a);

  /* "fstlib/cext/pywrapfst.pyx":3337
 *     self._aiter.get().Reset()
 * 
 *   cpdef void seek(self, size_t a):             # <<<<<<<<<<<<<<
 *     """
 *     seek(self, a)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_WriteUnraisable("fstlib.cext.pywrapfst._MutableArcIterator.seek", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_20seek(PyObject *__pyx_v_self, PyObject *__pyx_arg_a); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_19seek[] = "\n    seek(self, a)\n\n    Advance the iterator to a new position.\n\n    Args:\n      a: The position to seek to.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_20seek(PyObject *__pyx_v_self, PyObject *__pyx_arg_a) {
  size_t __pyx_v_a;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("seek (wrapper)", 0);
  assert(__pyx_arg_a); {
    __pyx_v_a = __Pyx_PyInt_As_size_t(__pyx_arg_a); if (unlikely((__pyx_v_a == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3337, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst._MutableArcIterator.seek", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_19seek(((struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableArcIterator *)__pyx_v_self), ((size_t)__pyx_v_a));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_19seek(struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableArcIterator *__pyx_v_self, size_t __pyx_v_a) {
  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("seek", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_seek(__pyx_v_self, __pyx_v_a, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3337, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst._MutableArcIterator.seek", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":3348
 *     self._aiter.get().Seek(a)
 * 
 *   cpdef void set_flags(self, uint8 flags, uint8 mask):             # <<<<<<<<<<<<<<
 *     """
 *     set_flags(self, flags, mask)
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_22set_flags(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static void __pyx_f_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_set_flags(struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableArcIterator *__pyx_v_self, uint8 __pyx_v_flags, uint8 __pyx_v_mask, int __pyx_skip_dispatch) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_flags", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3348, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_22set_flags)) {
        __pyx_t_3 = __Pyx_PyInt_From_uint8_t(__pyx_v_flags); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3348, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_mask); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3348, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_5 = __pyx_t_1; __pyx_t_6 = NULL;
        __pyx_t_7 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
          __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
          if (likely(__pyx_t_6)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
            __Pyx_INCREF(__pyx_t_6);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_5, function);
            __pyx_t_7 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_5)) {
          PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_3, __pyx_t_4};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3348, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
          PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_3, __pyx_t_4};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3348, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        {
          __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3348, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          if (__pyx_t_6) {
            __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_3);
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_4);
          __pyx_t_3 = 0;
          __pyx_t_4 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3348, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        }
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "fstlib/cext/pywrapfst.pyx":3358
 *       mask: A mask to be applied to the `flags` argument before setting them.
 *     """
 *     self._aiter.get().SetFlags(flags, mask)             # <<<<<<<<<<<<<<
 * 
 *   cpdef void set_value(self, Arc arc):
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_aiter");
    __PYX_ERR(0, 3358, __pyx_L1_error)
  }
  __pyx_v_self->_aiter.get()->SetFlags(__pyx_v_flags, __pyx_v_mask);

  /* "fstlib/cext/pywrapfst.pyx":3348
 *     self._aiter.get().Seek(a)
 * 
 *   cpdef void set_flags(self, uint8 flags, uint8 mask):             # <<<<<<<<<<<<<<
 *     """
 *     set_flags(self, flags, mask)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_WriteUnraisable("fstlib.cext.pywrapfst._MutableArcIterator.set_flags", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_22set_flags(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_21set_flags[] = "\n    set_flags(self, flags, mask)\n\n    Sets the current iterator behavioral flags.\n\n    Args:\n      flags: The properties to be set.\n      mask: A mask to be applied to the `flags` argument before setting them.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_22set_flags(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  uint8 __pyx_v_flags;
  uint8 __pyx_v_mask;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_flags (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flags,&__pyx_n_s_mask,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_flags", 1, 2, 2, 1); __PYX_ERR(0, 3348, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_flags") < 0)) __PYX_ERR(0, 3348, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_flags = __Pyx_PyInt_As_uint8_t(values[0]); if (unlikely((__pyx_v_flags == ((uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3348, __pyx_L3_error)
    __pyx_v_mask = __Pyx_PyInt_As_uint8_t(values[1]); if (unlikely((__pyx_v_mask == ((uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3348, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_flags", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3348, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst._MutableArcIterator.set_flags", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_21set_flags(((struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableArcIterator *)__pyx_v_self), __pyx_v_flags, __pyx_v_mask);

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_21set_flags(struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableArcIterator *__pyx_v_self, uint8 __pyx_v_flags, uint8 __pyx_v_mask) {
  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_flags", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_set_flags(__pyx_v_self, __pyx_v_flags, __pyx_v_mask, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3348, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst._MutableArcIterator.set_flags", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":3360
 *     self._aiter.get().SetFlags(flags, mask)
 * 
 *   cpdef void set_value(self, Arc arc):             # <<<<<<<<<<<<<<
 *     """
 *     set_value(self, arc)
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_24set_value(PyObject *__pyx_v_self, PyObject *__pyx_v_arc); /*proto*/
static void __pyx_f_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_set_value(struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableArcIterator *__pyx_v_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Arc *__pyx_v_arc, int __pyx_skip_dispatch) {
  __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_value", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3360, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_24set_value)) {
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, ((PyObject *)__pyx_v_arc)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_arc));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3360, __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;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "fstlib/cext/pywrapfst.pyx":3369
 *       arc: The arc to replace the current arc with.
 *     """
 *     self._aiter.get().SetValue(deref(arc._arc))             # <<<<<<<<<<<<<<
 * 
 *   cpdef object value(self):
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_aiter");
    __PYX_ERR(0, 3369, __pyx_L1_error)
  }
  if (unlikely(((PyObject *)__pyx_v_arc) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_arc");
    __PYX_ERR(0, 3369, __pyx_L1_error)
  }
  __pyx_v_self->_aiter.get()->SetValue((*__pyx_v_arc->_arc));

  /* "fstlib/cext/pywrapfst.pyx":3360
 *     self._aiter.get().SetFlags(flags, mask)
 * 
 *   cpdef void set_value(self, Arc arc):             # <<<<<<<<<<<<<<
 *     """
 *     set_value(self, arc)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("fstlib.cext.pywrapfst._MutableArcIterator.set_value", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_24set_value(PyObject *__pyx_v_self, PyObject *__pyx_v_arc); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_23set_value[] = "\n    set_value(self, arc)\n\n    Replace the current arc with a new arc.\n\n    Args:\n      arc: The arc to replace the current arc with.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_24set_value(PyObject *__pyx_v_self, PyObject *__pyx_v_arc) {
  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 (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arc), __pyx_ptype_6fstlib_4cext_9pywrapfst_Arc, 1, "arc", 0))) __PYX_ERR(0, 3360, __pyx_L1_error)
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_23set_value(((struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableArcIterator *)__pyx_v_self), ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Arc *)__pyx_v_arc));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_23set_value(struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableArcIterator *__pyx_v_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Arc *__pyx_v_arc) {
  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_value", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_set_value(__pyx_v_self, __pyx_v_arc, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3360, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst._MutableArcIterator.set_value", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":3371
 *     self._aiter.get().SetValue(deref(arc._arc))
 * 
 *   cpdef object value(self):             # <<<<<<<<<<<<<<
 *     """
 *     value(self)
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_26value(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_value(struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableArcIterator *__pyx_v_self, int __pyx_skip_dispatch) {
  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("value", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3371, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_26value)) {
        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3371, __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;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "fstlib/cext/pywrapfst.pyx":3377
 *     Returns the current arc.
 *     """
 *     return _init_Arc(self._aiter.get().Value())             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_aiter");
    __PYX_ERR(0, 3377, __pyx_L1_error)
  }
  __pyx_t_1 = ((PyObject *)__pyx_f_6fstlib_4cext_9pywrapfst__init_Arc(__pyx_v_self->_aiter.get()->Value())); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3377, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":3371
 *     self._aiter.get().SetValue(deref(arc._arc))
 * 
 *   cpdef object value(self):             # <<<<<<<<<<<<<<
 *     """
 *     value(self)
 */

  /* 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("fstlib.cext.pywrapfst._MutableArcIterator.value", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_26value(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_25value[] = "\n    value(self)\n\n    Returns the current arc.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_26value(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("value (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_25value(((struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableArcIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_25value(struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableArcIterator *__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("value", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_value(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3371, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst._MutableArcIterator.value", __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._aiter,self._mfst cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_28__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_28__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_27__reduce_cython__(((struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableArcIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_27__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableArcIterator *__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("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self._aiter,self._mfst cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self._aiter,self._mfst cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __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(1, 2, __pyx_L1_error)

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst._MutableArcIterator.__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._aiter,self._mfst cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self._aiter,self._mfst cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_30__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_30__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_29__setstate_cython__(((struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableArcIterator *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_29__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableArcIterator *__pyx_v_self, CYTHON_UNUSED 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__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self._aiter,self._mfst cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self._aiter,self._mfst cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __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(1, 4, __pyx_L1_error)

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst._MutableArcIterator.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":3391
 *   """
 * 
 *   def __repr__(self):             # <<<<<<<<<<<<<<
 *     return f"<_StateIterator at 0x{id(self):x}>"
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_14_StateIterator_1__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_14_StateIterator_1__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_14_StateIterator___repr__(((struct __pyx_obj_6fstlib_4cext_9pywrapfst__StateIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_14_StateIterator___repr__(struct __pyx_obj_6fstlib_4cext_9pywrapfst__StateIterator *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  Py_UCS4 __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "fstlib/cext/pywrapfst.pyx":3392
 * 
 *   def __repr__(self):
 *     return f"<_StateIterator at 0x{id(self):x}>"             # <<<<<<<<<<<<<<
 * 
 *   def __init__(self, Fst ifst):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3392, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = 0;
  __pyx_t_3 = 127;
  __Pyx_INCREF(__pyx_kp_u_StateIterator_at_0x);
  __pyx_t_2 += 21;
  __Pyx_GIVEREF(__pyx_kp_u_StateIterator_at_0x);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_StateIterator_at_0x);
  __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3392, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_Format(__pyx_t_4, __pyx_n_u_x); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3392, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5);
  __pyx_t_5 = 0;
  __Pyx_INCREF(__pyx_kp_u__3);
  __pyx_t_2 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__3);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u__3);
  __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_1, 3, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3392, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":3391
 *   """
 * 
 *   def __repr__(self):             # <<<<<<<<<<<<<<
 *     return f"<_StateIterator at 0x{id(self):x}>"
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst._StateIterator.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":3394
 *     return f"<_StateIterator at 0x{id(self):x}>"
 * 
 *   def __init__(self, Fst ifst):             # <<<<<<<<<<<<<<
 *     # Makes copy of the shared_ptr, potentially extending the FST's lifetime.
 *     self._fst = ifst._fst
 */

/* Python wrapper */
static int __pyx_pw_6fstlib_4cext_9pywrapfst_14_StateIterator_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_6fstlib_4cext_9pywrapfst_14_StateIterator_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ifst,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ifst)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 3394, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_ifst = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3394, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst._StateIterator.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_6fstlib_4cext_9pywrapfst_Fst, 1, "ifst", 0))) __PYX_ERR(0, 3394, __pyx_L1_error)
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_14_StateIterator_2__init__(((struct __pyx_obj_6fstlib_4cext_9pywrapfst__StateIterator *)__pyx_v_self), __pyx_v_ifst);

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

static int __pyx_pf_6fstlib_4cext_9pywrapfst_14_StateIterator_2__init__(struct __pyx_obj_6fstlib_4cext_9pywrapfst__StateIterator *__pyx_v_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  std::shared_ptr<fst::script::FstClass>  __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "fstlib/cext/pywrapfst.pyx":3396
 *   def __init__(self, Fst ifst):
 *     # Makes copy of the shared_ptr, potentially extending the FST's lifetime.
 *     self._fst = ifst._fst             # <<<<<<<<<<<<<<
 *     self._siter.reset(new fst.StateIteratorClass(deref(self._fst)))
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 3396, __pyx_L1_error)
  }
  __pyx_t_1 = __pyx_v_ifst->_fst;
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 3396, __pyx_L1_error)
  }
  __pyx_v_self->_fst = __pyx_t_1;

  /* "fstlib/cext/pywrapfst.pyx":3397
 *     # Makes copy of the shared_ptr, potentially extending the FST's lifetime.
 *     self._fst = ifst._fst
 *     self._siter.reset(new fst.StateIteratorClass(deref(self._fst)))             # <<<<<<<<<<<<<<
 * 
 *   # This just registers this class as a possible iterator.
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_siter");
    __PYX_ERR(0, 3397, __pyx_L1_error)
  }
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 3397, __pyx_L1_error)
  }
  __pyx_v_self->_siter.reset(new fst::script::StateIteratorClass((*__pyx_v_self->_fst)));

  /* "fstlib/cext/pywrapfst.pyx":3394
 *     return f"<_StateIterator at 0x{id(self):x}>"
 * 
 *   def __init__(self, Fst ifst):             # <<<<<<<<<<<<<<
 *     # Makes copy of the shared_ptr, potentially extending the FST's lifetime.
 *     self._fst = ifst._fst
 */

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

/* "fstlib/cext/pywrapfst.pyx":3400
 * 
 *   # This just registers this class as a possible iterator.
 *   def __iter__(self):             # <<<<<<<<<<<<<<
 *     return self
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_14_StateIterator_5__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_14_StateIterator_5__iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_14_StateIterator_4__iter__(((struct __pyx_obj_6fstlib_4cext_9pywrapfst__StateIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_14_StateIterator_4__iter__(struct __pyx_obj_6fstlib_4cext_9pywrapfst__StateIterator *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);

  /* "fstlib/cext/pywrapfst.pyx":3401
 *   # This just registers this class as a possible iterator.
 *   def __iter__(self):
 *     return self             # <<<<<<<<<<<<<<
 * 
 *   # Magic method used to get a Pythonic API out of the C++ API.
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":3400
 * 
 *   # This just registers this class as a possible iterator.
 *   def __iter__(self):             # <<<<<<<<<<<<<<
 *     return self
 * 
 */

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

/* "fstlib/cext/pywrapfst.pyx":3404
 * 
 *   # Magic method used to get a Pythonic API out of the C++ API.
 *   def __next__(self):             # <<<<<<<<<<<<<<
 *     if self.done():
 *       raise StopIteration
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_14_StateIterator_7__next__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_14_StateIterator_7__next__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__next__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_14_StateIterator_6__next__(((struct __pyx_obj_6fstlib_4cext_9pywrapfst__StateIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_14_StateIterator_6__next__(struct __pyx_obj_6fstlib_4cext_9pywrapfst__StateIterator *__pyx_v_self) {
  int64 __pyx_v_result;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__next__", 0);

  /* "fstlib/cext/pywrapfst.pyx":3405
 *   # Magic method used to get a Pythonic API out of the C++ API.
 *   def __next__(self):
 *     if self.done():             # <<<<<<<<<<<<<<
 *       raise StopIteration
 *     cdef int64 result = self.value()
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "done");
    __PYX_ERR(0, 3405, __pyx_L1_error)
  }
  __pyx_t_1 = (((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst__StateIterator *)__pyx_v_self->__pyx_vtab)->done(__pyx_v_self, 0) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "fstlib/cext/pywrapfst.pyx":3406
 *   def __next__(self):
 *     if self.done():
 *       raise StopIteration             # <<<<<<<<<<<<<<
 *     cdef int64 result = self.value()
 *     self.next()
 */
    __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
    __PYX_ERR(0, 3406, __pyx_L1_error)

    /* "fstlib/cext/pywrapfst.pyx":3405
 *   # Magic method used to get a Pythonic API out of the C++ API.
 *   def __next__(self):
 *     if self.done():             # <<<<<<<<<<<<<<
 *       raise StopIteration
 *     cdef int64 result = self.value()
 */
  }

  /* "fstlib/cext/pywrapfst.pyx":3407
 *     if self.done():
 *       raise StopIteration
 *     cdef int64 result = self.value()             # <<<<<<<<<<<<<<
 *     self.next()
 *     return result
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "value");
    __PYX_ERR(0, 3407, __pyx_L1_error)
  }
  __pyx_v_result = ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst__StateIterator *)__pyx_v_self->__pyx_vtab)->value(__pyx_v_self, 0);

  /* "fstlib/cext/pywrapfst.pyx":3408
 *       raise StopIteration
 *     cdef int64 result = self.value()
 *     self.next()             # <<<<<<<<<<<<<<
 *     return result
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "next");
    __PYX_ERR(0, 3408, __pyx_L1_error)
  }
  ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst__StateIterator *)__pyx_v_self->__pyx_vtab)->next(__pyx_v_self, 0);

  /* "fstlib/cext/pywrapfst.pyx":3409
 *     cdef int64 result = self.value()
 *     self.next()
 *     return result             # <<<<<<<<<<<<<<
 * 
 *   cpdef bool done(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_result); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3409, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":3404
 * 
 *   # Magic method used to get a Pythonic API out of the C++ API.
 *   def __next__(self):             # <<<<<<<<<<<<<<
 *     if self.done():
 *       raise StopIteration
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst._StateIterator.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":3411
 *     return result
 * 
 *   cpdef bool done(self):             # <<<<<<<<<<<<<<
 *     """
 *     done(self)
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_14_StateIterator_9done(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static bool __pyx_f_6fstlib_4cext_9pywrapfst_14_StateIterator_done(struct __pyx_obj_6fstlib_4cext_9pywrapfst__StateIterator *__pyx_v_self, int __pyx_skip_dispatch) {
  bool __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  bool __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("done", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_done); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3411, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6fstlib_4cext_9pywrapfst_14_StateIterator_9done)) {
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3411, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3411, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_5;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "fstlib/cext/pywrapfst.pyx":3420
 *       True if the iterator is exhausted, False otherwise.
 *     """
 *     return self._siter.get().Done()             # <<<<<<<<<<<<<<
 * 
 *   cpdef void next(self):
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_siter");
    __PYX_ERR(0, 3420, __pyx_L1_error)
  }
  __pyx_r = __pyx_v_self->_siter.get()->Done();
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":3411
 *     return result
 * 
 *   cpdef bool done(self):             # <<<<<<<<<<<<<<
 *     """
 *     done(self)
 */

  /* 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_WriteUnraisable("fstlib.cext.pywrapfst._StateIterator.done", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_14_StateIterator_9done(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_14_StateIterator_8done[] = "\n    done(self)\n\n    Indicates whether the iterator is exhausted or not.\n\n    Returns:\n      True if the iterator is exhausted, False otherwise.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_14_StateIterator_9done(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("done (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_14_StateIterator_8done(((struct __pyx_obj_6fstlib_4cext_9pywrapfst__StateIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_14_StateIterator_8done(struct __pyx_obj_6fstlib_4cext_9pywrapfst__StateIterator *__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("done", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_6fstlib_4cext_9pywrapfst_14_StateIterator_done(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3411, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst._StateIterator.done", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":3422
 *     return self._siter.get().Done()
 * 
 *   cpdef void next(self):             # <<<<<<<<<<<<<<
 *     """
 *     next(self)
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_14_StateIterator_11next(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static void __pyx_f_6fstlib_4cext_9pywrapfst_14_StateIterator_next(struct __pyx_obj_6fstlib_4cext_9pywrapfst__StateIterator *__pyx_v_self, int __pyx_skip_dispatch) {
  __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("next", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_next); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3422, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6fstlib_4cext_9pywrapfst_14_StateIterator_11next)) {
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3422, __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;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "fstlib/cext/pywrapfst.pyx":3428
 *     Advances the iterator.
 *     """
 *     self._siter.get().Next()             # <<<<<<<<<<<<<<
 * 
 *   cpdef void reset(self):
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_siter");
    __PYX_ERR(0, 3428, __pyx_L1_error)
  }
  __pyx_v_self->_siter.get()->Next();

  /* "fstlib/cext/pywrapfst.pyx":3422
 *     return self._siter.get().Done()
 * 
 *   cpdef void next(self):             # <<<<<<<<<<<<<<
 *     """
 *     next(self)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("fstlib.cext.pywrapfst._StateIterator.next", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_14_StateIterator_11next(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_14_StateIterator_10next[] = "\n    next(self)\n\n    Advances the iterator.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_14_StateIterator_11next(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("next (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_14_StateIterator_10next(((struct __pyx_obj_6fstlib_4cext_9pywrapfst__StateIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_14_StateIterator_10next(struct __pyx_obj_6fstlib_4cext_9pywrapfst__StateIterator *__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("next", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_6fstlib_4cext_9pywrapfst_14_StateIterator_next(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3422, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst._StateIterator.next", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":3430
 *     self._siter.get().Next()
 * 
 *   cpdef void reset(self):             # <<<<<<<<<<<<<<
 *     """
 *     reset(self)
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_14_StateIterator_13reset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static void __pyx_f_6fstlib_4cext_9pywrapfst_14_StateIterator_reset(struct __pyx_obj_6fstlib_4cext_9pywrapfst__StateIterator *__pyx_v_self, int __pyx_skip_dispatch) {
  __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("reset", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3430, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6fstlib_4cext_9pywrapfst_14_StateIterator_13reset)) {
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3430, __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;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "fstlib/cext/pywrapfst.pyx":3436
 *     Resets the iterator to the initial position.
 *     """
 *     self._siter.get().Reset()             # <<<<<<<<<<<<<<
 * 
 *   cpdef int64 value(self):
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_siter");
    __PYX_ERR(0, 3436, __pyx_L1_error)
  }
  __pyx_v_self->_siter.get()->Reset();

  /* "fstlib/cext/pywrapfst.pyx":3430
 *     self._siter.get().Next()
 * 
 *   cpdef void reset(self):             # <<<<<<<<<<<<<<
 *     """
 *     reset(self)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("fstlib.cext.pywrapfst._StateIterator.reset", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_14_StateIterator_13reset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_14_StateIterator_12reset[] = "\n    reset(self)\n\n    Resets the iterator to the initial position.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_14_StateIterator_13reset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("reset (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_14_StateIterator_12reset(((struct __pyx_obj_6fstlib_4cext_9pywrapfst__StateIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_14_StateIterator_12reset(struct __pyx_obj_6fstlib_4cext_9pywrapfst__StateIterator *__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", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_6fstlib_4cext_9pywrapfst_14_StateIterator_reset(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3430, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst._StateIterator.reset", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":3438
 *     self._siter.get().Reset()
 * 
 *   cpdef int64 value(self):             # <<<<<<<<<<<<<<
 *     """
 *     value(self)
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_14_StateIterator_15value(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static int64 __pyx_f_6fstlib_4cext_9pywrapfst_14_StateIterator_value(struct __pyx_obj_6fstlib_4cext_9pywrapfst__StateIterator *__pyx_v_self, int __pyx_skip_dispatch) {
  int64 __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int64 __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("value", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3438, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6fstlib_4cext_9pywrapfst_14_StateIterator_15value)) {
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3438, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_5 = __Pyx_PyInt_As_int64_t(__pyx_t_2); if (unlikely((__pyx_t_5 == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3438, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_5;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "fstlib/cext/pywrapfst.pyx":3444
 *     Returns the current state index.
 *     """
 *     return self._siter.get().Value()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_siter");
    __PYX_ERR(0, 3444, __pyx_L1_error)
  }
  __pyx_r = __pyx_v_self->_siter.get()->Value();
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":3438
 *     self._siter.get().Reset()
 * 
 *   cpdef int64 value(self):             # <<<<<<<<<<<<<<
 *     """
 *     value(self)
 */

  /* 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_WriteUnraisable("fstlib.cext.pywrapfst._StateIterator.value", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_14_StateIterator_15value(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_14_StateIterator_14value[] = "\n    value(self)\n\n    Returns the current state index.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_14_StateIterator_15value(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("value (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_14_StateIterator_14value(((struct __pyx_obj_6fstlib_4cext_9pywrapfst__StateIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_14_StateIterator_14value(struct __pyx_obj_6fstlib_4cext_9pywrapfst__StateIterator *__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("value", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_f_6fstlib_4cext_9pywrapfst_14_StateIterator_value(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3438, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst._StateIterator.value", __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._fst,self._siter cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_14_StateIterator_17__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_14_StateIterator_17__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_14_StateIterator_16__reduce_cython__(((struct __pyx_obj_6fstlib_4cext_9pywrapfst__StateIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_14_StateIterator_16__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_6fstlib_4cext_9pywrapfst__StateIterator *__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("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self._fst,self._siter cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self._fst,self._siter cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __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(1, 2, __pyx_L1_error)

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst._StateIterator.__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._fst,self._siter cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self._fst,self._siter cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_14_StateIterator_19__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_14_StateIterator_19__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_14_StateIterator_18__setstate_cython__(((struct __pyx_obj_6fstlib_4cext_9pywrapfst__StateIterator *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_14_StateIterator_18__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_6fstlib_4cext_9pywrapfst__StateIterator *__pyx_v_self, CYTHON_UNUSED 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__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self._fst,self._siter cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self._fst,self._siter cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __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(1, 4, __pyx_L1_error)

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst._StateIterator.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":3450
 * 
 * 
 * cdef Fst _map(Fst ifst,             # <<<<<<<<<<<<<<
 *                float delta=fst.kDelta,
 *                map_type="identity",
 */

static struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_f_6fstlib_4cext_9pywrapfst__map(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst__map *__pyx_optional_args) {
  float __pyx_v_delta = __pyx_k__32;
  PyObject *__pyx_v_map_type = ((PyObject *)__pyx_n_u_identity);
  double __pyx_v_power = ((double)1.);

  /* "fstlib/cext/pywrapfst.pyx":3454
 *                map_type="identity",
 *                double power=1.,
 *                weight=None):             # <<<<<<<<<<<<<<
 *   cdef fst.MapType _map_type
 *   if not fst.GetMapType(tostring(map_type), addr(_map_type)):
 */
  PyObject *__pyx_v_weight = ((PyObject *)Py_None);
  fst::script::MapType __pyx_v__map_type;
  fst::script::WeightClass __pyx_v__weight;
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  fst::script::WeightClass __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_map", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_delta = __pyx_optional_args->delta;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_map_type = __pyx_optional_args->map_type;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_power = __pyx_optional_args->power;
          if (__pyx_optional_args->__pyx_n > 3) {
            __pyx_v_weight = __pyx_optional_args->weight;
          }
        }
      }
    }
  }

  /* "fstlib/cext/pywrapfst.pyx":3456
 *                weight=None):
 *   cdef fst.MapType _map_type
 *   if not fst.GetMapType(tostring(map_type), addr(_map_type)):             # <<<<<<<<<<<<<<
 *     raise FstArgError(f"Unknown map type: {map_type!r}")
 *   cdef fst.WeightClass _weight
 */
  __pyx_t_1 = __pyx_f_6fstlib_4cext_9pywrapfst_tostring(__pyx_v_map_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3456, __pyx_L1_error)
  __pyx_t_2 = ((!(fst::script::GetMapType(__pyx_t_1, (&__pyx_v__map_type)) != 0)) != 0);
  if (unlikely(__pyx_t_2)) {

    /* "fstlib/cext/pywrapfst.pyx":3457
 *   cdef fst.MapType _map_type
 *   if not fst.GetMapType(tostring(map_type), addr(_map_type)):
 *     raise FstArgError(f"Unknown map type: {map_type!r}")             # <<<<<<<<<<<<<<
 *   cdef fst.WeightClass _weight
 *   if _map_type == fst.MapType.TIMES_MAPPER:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FstArgError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3457, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_map_type), __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3457, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Unknown_map_type, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3457, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_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_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3457, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 3457, __pyx_L1_error)

    /* "fstlib/cext/pywrapfst.pyx":3456
 *                weight=None):
 *   cdef fst.MapType _map_type
 *   if not fst.GetMapType(tostring(map_type), addr(_map_type)):             # <<<<<<<<<<<<<<
 *     raise FstArgError(f"Unknown map type: {map_type!r}")
 *   cdef fst.WeightClass _weight
 */
  }

  /* "fstlib/cext/pywrapfst.pyx":3459
 *     raise FstArgError(f"Unknown map type: {map_type!r}")
 *   cdef fst.WeightClass _weight
 *   if _map_type == fst.MapType.TIMES_MAPPER:             # <<<<<<<<<<<<<<
 *       _weight = _get_WeightClass_or_one(ifst.weight_type(), weight)
 *   else:
 */
  __pyx_t_2 = ((__pyx_v__map_type == fst::script::MapType::TIMES) != 0);
  if (__pyx_t_2) {

    /* "fstlib/cext/pywrapfst.pyx":3460
 *   cdef fst.WeightClass _weight
 *   if _map_type == fst.MapType.TIMES_MAPPER:
 *       _weight = _get_WeightClass_or_one(ifst.weight_type(), weight)             # <<<<<<<<<<<<<<
 *   else:
 *       _weight = _get_WeightClass_or_zero(ifst.weight_type(), weight)
 */
    if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "weight_type");
      __PYX_ERR(0, 3460, __pyx_L1_error)
    }
    __pyx_t_7 = __pyx_f_6fstlib_4cext_9pywrapfst__get_WeightClass_or_one(((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_Fst *)__pyx_v_ifst->__pyx_vtab)->weight_type(__pyx_v_ifst, 0), __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3460, __pyx_L1_error)
    __pyx_v__weight = __pyx_t_7;

    /* "fstlib/cext/pywrapfst.pyx":3459
 *     raise FstArgError(f"Unknown map type: {map_type!r}")
 *   cdef fst.WeightClass _weight
 *   if _map_type == fst.MapType.TIMES_MAPPER:             # <<<<<<<<<<<<<<
 *       _weight = _get_WeightClass_or_one(ifst.weight_type(), weight)
 *   else:
 */
    goto __pyx_L4;
  }

  /* "fstlib/cext/pywrapfst.pyx":3462
 *       _weight = _get_WeightClass_or_one(ifst.weight_type(), weight)
 *   else:
 *       _weight = _get_WeightClass_or_zero(ifst.weight_type(), weight)             # <<<<<<<<<<<<<<
 *   return _init_XFst(
 *     fst.Map(deref(ifst._fst), _map_type, delta, power, _weight).release())
 */
  /*else*/ {
    if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "weight_type");
      __PYX_ERR(0, 3462, __pyx_L1_error)
    }
    __pyx_t_7 = __pyx_f_6fstlib_4cext_9pywrapfst__get_WeightClass_or_zero(((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_Fst *)__pyx_v_ifst->__pyx_vtab)->weight_type(__pyx_v_ifst, 0), __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3462, __pyx_L1_error)
    __pyx_v__weight = __pyx_t_7;
  }
  __pyx_L4:;

  /* "fstlib/cext/pywrapfst.pyx":3463
 *   else:
 *       _weight = _get_WeightClass_or_zero(ifst.weight_type(), weight)
 *   return _init_XFst(             # <<<<<<<<<<<<<<
 *     fst.Map(deref(ifst._fst), _map_type, delta, power, _weight).release())
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));

  /* "fstlib/cext/pywrapfst.pyx":3464
 *       _weight = _get_WeightClass_or_zero(ifst.weight_type(), weight)
 *   return _init_XFst(
 *     fst.Map(deref(ifst._fst), _map_type, delta, power, _weight).release())             # <<<<<<<<<<<<<<
 * 
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 3464, __pyx_L1_error)
  }

  /* "fstlib/cext/pywrapfst.pyx":3463
 *   else:
 *       _weight = _get_WeightClass_or_zero(ifst.weight_type(), weight)
 *   return _init_XFst(             # <<<<<<<<<<<<<<
 *     fst.Map(deref(ifst._fst), _map_type, delta, power, _weight).release())
 * 
 */
  __pyx_t_3 = ((PyObject *)__pyx_f_6fstlib_4cext_9pywrapfst__init_XFst(fst::script::Map((*__pyx_v_ifst->_fst), __pyx_v__map_type, __pyx_v_delta, __pyx_v_power, __pyx_v__weight).release())); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3463, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":3450
 * 
 * 
 * cdef Fst _map(Fst ifst,             # <<<<<<<<<<<<<<
 *                float delta=fst.kDelta,
 *                map_type="identity",
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst._map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":3467
 * 
 * 
 * cpdef Fst arcmap(Fst ifst,             # <<<<<<<<<<<<<<
 *                  float delta=fst.kDelta,
 *                  map_type="identity",
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_21arcmap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_f_6fstlib_4cext_9pywrapfst_arcmap(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_arcmap *__pyx_optional_args) {
  float __pyx_v_delta = __pyx_k__33;
  PyObject *__pyx_v_map_type = ((PyObject *)__pyx_n_u_identity);
  double __pyx_v_power = ((double)1.);

  /* "fstlib/cext/pywrapfst.pyx":3471
 *                  map_type="identity",
 *                  double power=1.,
 *                  weight=None):             # <<<<<<<<<<<<<<
 *   """
 *   arcmap(ifst, delta=0.0009765625, map_type="identity", power=1., weight=None)
 */
  PyObject *__pyx_v_weight = ((PyObject *)Py_None);
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_6fstlib_4cext_9pywrapfst__map __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("arcmap", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_delta = __pyx_optional_args->delta;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_map_type = __pyx_optional_args->map_type;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_power = __pyx_optional_args->power;
          if (__pyx_optional_args->__pyx_n > 3) {
            __pyx_v_weight = __pyx_optional_args->weight;
          }
        }
      }
    }
  }

  /* "fstlib/cext/pywrapfst.pyx":3511
 *     FstArgError: Unknown map type.
 *   """
 *   return _map(ifst, delta, map_type, power, weight)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_2.__pyx_n = 4;
  __pyx_t_2.delta = __pyx_v_delta;
  __pyx_t_2.map_type = __pyx_v_map_type;
  __pyx_t_2.power = __pyx_v_power;
  __pyx_t_2.weight = __pyx_v_weight;
  __pyx_t_1 = ((PyObject *)__pyx_f_6fstlib_4cext_9pywrapfst__map(__pyx_v_ifst, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3511, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":3467
 * 
 * 
 * cpdef Fst arcmap(Fst ifst,             # <<<<<<<<<<<<<<
 *                  float delta=fst.kDelta,
 *                  map_type="identity",
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.arcmap", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_21arcmap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_20arcmap[] = "\n  arcmap(ifst, delta=0.0009765625, map_type=\"identity\", power=1., weight=None)\n\n  Constructively applies a transform to all arcs and final states.\n\n  This operation transforms each arc and final state in the input FST using\n  one of the following:\n\n    * identity: maps to self.\n    * input_epsilon: replaces all input labels with epsilon.\n    * invert: reciprocates all non-Zero weights.\n    * output_epsilon: replaces all output labels with epsilon.\n    * quantize: quantizes weights.\n    * plus: adds a constant to all weights.\n    * power: raises all weights to a power.\n    * rmweight: replaces all non-Zero weights with 1.\n    * superfinal: redirects final states to a new superfinal state.\n    * times: right-multiplies a constant by all weights.\n    * to_log: converts weights to the log semiring.\n    * to_log64: converts weights to the log64 semiring.\n    * to_std: converts weights to the tropical semiring.\n\n  Args:\n    ifst: The input FST.\n    delta: Comparison/quantization delta (ignored unless `map_type` is\n        `quantize`).\n    map_type: A string matching a known mapping operation (see above).\n    power: A positive scalar or integer power; ignored unless `map_type` is\n        `power` (in which case it defaults to 1).\n    weight: A Weight or weight string passed to the arc-mapper; ignored unless\n        `map_type` is `plus` (in which case it defaults to semiring Zero) or\n        `times` (in which case it defaults to semiring One).\n\n  Returns:\n    An FST with arcs and final states remapped.\n\n  Raises:\n    FstArgError: Unknown map type.\n  ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_21arcmap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst = 0;
  float __pyx_v_delta;
  PyObject *__pyx_v_map_type = 0;
  double __pyx_v_power;
  PyObject *__pyx_v_weight = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("arcmap (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ifst,&__pyx_n_s_delta,&__pyx_n_s_map_type,&__pyx_n_s_power,&__pyx_n_s_weight,0};
    PyObject* values[5] = {0,0,0,0,0};
    values[2] = ((PyObject *)__pyx_n_u_identity);

    /* "fstlib/cext/pywrapfst.pyx":3471
 *                  map_type="identity",
 *                  double power=1.,
 *                  weight=None):             # <<<<<<<<<<<<<<
 *   """
 *   arcmap(ifst, delta=0.0009765625, map_type="identity", power=1., weight=None)
 */
    values[4] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ifst)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_delta);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_map_type);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_power);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_weight);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "arcmap") < 0)) __PYX_ERR(0, 3467, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_ifst = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *)values[0]);
    if (values[1]) {
      __pyx_v_delta = __pyx_PyFloat_AsFloat(values[1]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 3468, __pyx_L3_error)
    } else {
      __pyx_v_delta = __pyx_k__33;
    }
    __pyx_v_map_type = values[2];
    if (values[3]) {
      __pyx_v_power = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_power == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3470, __pyx_L3_error)
    } else {
      __pyx_v_power = ((double)1.);
    }
    __pyx_v_weight = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("arcmap", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3467, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.arcmap", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_6fstlib_4cext_9pywrapfst_Fst, 1, "ifst", 0))) __PYX_ERR(0, 3467, __pyx_L1_error)
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_20arcmap(__pyx_self, __pyx_v_ifst, __pyx_v_delta, __pyx_v_map_type, __pyx_v_power, __pyx_v_weight);

  /* "fstlib/cext/pywrapfst.pyx":3467
 * 
 * 
 * cpdef Fst arcmap(Fst ifst,             # <<<<<<<<<<<<<<
 *                  float delta=fst.kDelta,
 *                  map_type="identity",
 */

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_20arcmap(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst, float __pyx_v_delta, PyObject *__pyx_v_map_type, double __pyx_v_power, PyObject *__pyx_v_weight) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_arcmap __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("arcmap", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 4;
  __pyx_t_2.delta = __pyx_v_delta;
  __pyx_t_2.map_type = __pyx_v_map_type;
  __pyx_t_2.power = __pyx_v_power;
  __pyx_t_2.weight = __pyx_v_weight;
  __pyx_t_1 = ((PyObject *)__pyx_f_6fstlib_4cext_9pywrapfst_arcmap(__pyx_v_ifst, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3467, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.arcmap", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":3514
 * 
 * 
 * cpdef MutableFst compose(Fst ifst1,             # <<<<<<<<<<<<<<
 *                          Fst ifst2,
 *                          compose_filter="auto",
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_23compose(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_f_6fstlib_4cext_9pywrapfst_compose(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst1, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst2, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_compose *__pyx_optional_args) {
  PyObject *__pyx_v_compose_filter = ((PyObject *)__pyx_n_u_auto);

  /* "fstlib/cext/pywrapfst.pyx":3517
 *                          Fst ifst2,
 *                          compose_filter="auto",
 *                          bool connect=True):             # <<<<<<<<<<<<<<
 *   """
 *   compose(ifst1, ifst2, compose_filter="auto", connect=True)
 */
  bool __pyx_v_connect = ((bool)1);
  std::unique_ptr<fst::script::VectorFstClass>  __pyx_v__tfst;
  std::unique_ptr<fst::ComposeOptions>  __pyx_v__opts;
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  enum fst::ComposeFilter __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("compose", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_compose_filter = __pyx_optional_args->compose_filter;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_connect = __pyx_optional_args->connect;
      }
    }
  }

  /* "fstlib/cext/pywrapfst.pyx":3541
 *   """
 *   cdef unique_ptr[fst.VectorFstClass] _tfst
 *   _tfst.reset(new fst.VectorFstClass(ifst1.arc_type()))             # <<<<<<<<<<<<<<
 *   cdef unique_ptr[fst.ComposeOptions] _opts
 *   _opts.reset(
 */
  if (unlikely(((PyObject *)__pyx_v_ifst1) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "arc_type");
    __PYX_ERR(0, 3541, __pyx_L1_error)
  }
  __pyx_v__tfst.reset(new fst::script::VectorFstClass(((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_Fst *)__pyx_v_ifst1->__pyx_vtab)->arc_type(__pyx_v_ifst1, 0)));

  /* "fstlib/cext/pywrapfst.pyx":3545
 *   _opts.reset(
 *       new fst.ComposeOptions(connect,
 *                              _get_compose_filter(tostring(compose_filter))))             # <<<<<<<<<<<<<<
 *   fst.Compose(deref(ifst1._fst), deref(ifst2._fst), _tfst.get(), deref(_opts))
 *   return _init_MutableFst(_tfst.release())
 */
  __pyx_t_1 = __pyx_f_6fstlib_4cext_9pywrapfst_tostring(__pyx_v_compose_filter); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3545, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_6fstlib_4cext_9pywrapfst__get_compose_filter(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3545, __pyx_L1_error)

  /* "fstlib/cext/pywrapfst.pyx":3543
 *   _tfst.reset(new fst.VectorFstClass(ifst1.arc_type()))
 *   cdef unique_ptr[fst.ComposeOptions] _opts
 *   _opts.reset(             # <<<<<<<<<<<<<<
 *       new fst.ComposeOptions(connect,
 *                              _get_compose_filter(tostring(compose_filter))))
 */
  __pyx_v__opts.reset(new fst::ComposeOptions(__pyx_v_connect, __pyx_t_2));

  /* "fstlib/cext/pywrapfst.pyx":3546
 *       new fst.ComposeOptions(connect,
 *                              _get_compose_filter(tostring(compose_filter))))
 *   fst.Compose(deref(ifst1._fst), deref(ifst2._fst), _tfst.get(), deref(_opts))             # <<<<<<<<<<<<<<
 *   return _init_MutableFst(_tfst.release())
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_ifst1) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 3546, __pyx_L1_error)
  }
  if (unlikely(((PyObject *)__pyx_v_ifst2) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 3546, __pyx_L1_error)
  }
  fst::script::Compose((*__pyx_v_ifst1->_fst), (*__pyx_v_ifst2->_fst), __pyx_v__tfst.get(), (*__pyx_v__opts));

  /* "fstlib/cext/pywrapfst.pyx":3547
 *                              _get_compose_filter(tostring(compose_filter))))
 *   fst.Compose(deref(ifst1._fst), deref(ifst2._fst), _tfst.get(), deref(_opts))
 *   return _init_MutableFst(_tfst.release())             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_3 = ((PyObject *)__pyx_f_6fstlib_4cext_9pywrapfst__init_MutableFst(__pyx_v__tfst.release())); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3547, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":3514
 * 
 * 
 * cpdef MutableFst compose(Fst ifst1,             # <<<<<<<<<<<<<<
 *                          Fst ifst2,
 *                          compose_filter="auto",
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.compose", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_23compose(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_22compose[] = "\n  compose(ifst1, ifst2, compose_filter=\"auto\", connect=True)\n\n  Constructively composes two FSTs.\n\n  This operation computes the composition of two FSTs. If A transduces string\n  x to y with weight a and B transduces y to z with weight b, then their\n  composition transduces string x to z with weight a \\otimes b. The output\n  labels of the first transducer or the input labels of the second transducer\n  must be sorted (or otherwise support appropriate matchers).\n\n  Args:\n    ifst1: The first input FST.\n    ifst2: The second input FST.\n    compose_filter: A string matching a known composition filter; one of:\n        \"alt_sequence\", \"auto\", \"match\", \"no_match\", \"null\", \"sequence\",\n        \"trivial\".\n    connect: Should output be trimmed?\n\n  Returns:\n    An FST.\n  ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_23compose(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst1 = 0;
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst2 = 0;
  PyObject *__pyx_v_compose_filter = 0;
  bool __pyx_v_connect;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("compose (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ifst1,&__pyx_n_s_ifst2,&__pyx_n_s_compose_filter,&__pyx_n_s_connect,0};
    PyObject* values[4] = {0,0,0,0};
    values[2] = ((PyObject *)__pyx_n_u_auto);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ifst1)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ifst2)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("compose", 0, 2, 4, 1); __PYX_ERR(0, 3514, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_compose_filter);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_connect);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "compose") < 0)) __PYX_ERR(0, 3514, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_ifst1 = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *)values[0]);
    __pyx_v_ifst2 = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *)values[1]);
    __pyx_v_compose_filter = values[2];
    if (values[3]) {
      __pyx_v_connect = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_connect == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3517, __pyx_L3_error)
    } else {

      /* "fstlib/cext/pywrapfst.pyx":3517
 *                          Fst ifst2,
 *                          compose_filter="auto",
 *                          bool connect=True):             # <<<<<<<<<<<<<<
 *   """
 *   compose(ifst1, ifst2, compose_filter="auto", connect=True)
 */
      __pyx_v_connect = ((bool)1);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("compose", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3514, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.compose", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst1), __pyx_ptype_6fstlib_4cext_9pywrapfst_Fst, 1, "ifst1", 0))) __PYX_ERR(0, 3514, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst2), __pyx_ptype_6fstlib_4cext_9pywrapfst_Fst, 1, "ifst2", 0))) __PYX_ERR(0, 3515, __pyx_L1_error)
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_22compose(__pyx_self, __pyx_v_ifst1, __pyx_v_ifst2, __pyx_v_compose_filter, __pyx_v_connect);

  /* "fstlib/cext/pywrapfst.pyx":3514
 * 
 * 
 * cpdef MutableFst compose(Fst ifst1,             # <<<<<<<<<<<<<<
 *                          Fst ifst2,
 *                          compose_filter="auto",
 */

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_22compose(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst1, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst2, PyObject *__pyx_v_compose_filter, bool __pyx_v_connect) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_compose __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("compose", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.compose_filter = __pyx_v_compose_filter;
  __pyx_t_2.connect = __pyx_v_connect;
  __pyx_t_1 = ((PyObject *)__pyx_f_6fstlib_4cext_9pywrapfst_compose(__pyx_v_ifst1, __pyx_v_ifst2, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3514, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.compose", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":3550
 * 
 * 
 * cpdef Fst convert(Fst ifst, fst_type=""):             # <<<<<<<<<<<<<<
 *   """
 *   convert(ifst, fst_type="")
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_25convert(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_f_6fstlib_4cext_9pywrapfst_convert(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_convert *__pyx_optional_args) {
  PyObject *__pyx_v_fst_type = ((PyObject *)__pyx_kp_u__11);
  std::string __pyx_v__fst_type;
  std::unique_ptr<fst::script::FstClass>  __pyx_v__tfst;
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  Py_UCS4 __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("convert", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_fst_type = __pyx_optional_args->fst_type;
    }
  }

  /* "fstlib/cext/pywrapfst.pyx":3567
 *     FstOpError: Conversion failed.
 *   """
 *   cdef string _fst_type = tostring(fst_type)             # <<<<<<<<<<<<<<
 *   cdef unique_ptr[fst.FstClass] _tfst
 *   _tfst = fst.Convert(deref(ifst._fst), _fst_type)
 */
  __pyx_t_1 = __pyx_f_6fstlib_4cext_9pywrapfst_tostring(__pyx_v_fst_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3567, __pyx_L1_error)
  __pyx_v__fst_type = __pyx_t_1;

  /* "fstlib/cext/pywrapfst.pyx":3569
 *   cdef string _fst_type = tostring(fst_type)
 *   cdef unique_ptr[fst.FstClass] _tfst
 *   _tfst = fst.Convert(deref(ifst._fst), _fst_type)             # <<<<<<<<<<<<<<
 *   # Script-land Convert returns a null pointer to signal failure.
 *   if _tfst.get() == NULL:
 */
  if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 3569, __pyx_L1_error)
  }
  __pyx_v__tfst = fst::script::Convert((*__pyx_v_ifst->_fst), __pyx_v__fst_type);

  /* "fstlib/cext/pywrapfst.pyx":3571
 *   _tfst = fst.Convert(deref(ifst._fst), _fst_type)
 *   # Script-land Convert returns a null pointer to signal failure.
 *   if _tfst.get() == NULL:             # <<<<<<<<<<<<<<
 *     raise FstOpError(f"Conversion to {fst_type!r} failed")
 *   return _init_XFst(_tfst.release())
 */
  __pyx_t_2 = ((__pyx_v__tfst.get() == NULL) != 0);
  if (unlikely(__pyx_t_2)) {

    /* "fstlib/cext/pywrapfst.pyx":3572
 *   # Script-land Convert returns a null pointer to signal failure.
 *   if _tfst.get() == NULL:
 *     raise FstOpError(f"Conversion to {fst_type!r} failed")             # <<<<<<<<<<<<<<
 *   return _init_XFst(_tfst.release())
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FstOpError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3572, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3572, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = 0;
    __pyx_t_7 = 127;
    __Pyx_INCREF(__pyx_kp_u_Conversion_to);
    __pyx_t_6 += 14;
    __Pyx_GIVEREF(__pyx_kp_u_Conversion_to);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_u_Conversion_to);
    __pyx_t_8 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_fst_type), __pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3572, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) : __pyx_t_7;
    __pyx_t_6 += __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_failed);
    __pyx_t_6 += 7;
    __Pyx_GIVEREF(__pyx_kp_u_failed);
    PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_kp_u_failed);
    __pyx_t_8 = __Pyx_PyUnicode_Join(__pyx_t_5, 3, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3572, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_8);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3572, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 3572, __pyx_L1_error)

    /* "fstlib/cext/pywrapfst.pyx":3571
 *   _tfst = fst.Convert(deref(ifst._fst), _fst_type)
 *   # Script-land Convert returns a null pointer to signal failure.
 *   if _tfst.get() == NULL:             # <<<<<<<<<<<<<<
 *     raise FstOpError(f"Conversion to {fst_type!r} failed")
 *   return _init_XFst(_tfst.release())
 */
  }

  /* "fstlib/cext/pywrapfst.pyx":3573
 *   if _tfst.get() == NULL:
 *     raise FstOpError(f"Conversion to {fst_type!r} failed")
 *   return _init_XFst(_tfst.release())             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_3 = ((PyObject *)__pyx_f_6fstlib_4cext_9pywrapfst__init_XFst(__pyx_v__tfst.release())); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3573, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":3550
 * 
 * 
 * cpdef Fst convert(Fst ifst, fst_type=""):             # <<<<<<<<<<<<<<
 *   """
 *   convert(ifst, fst_type="")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.convert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_25convert(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_24convert[] = "\n  convert(ifst, fst_type=\"\")\n\n  Constructively converts an FST to a new internal representation.\n\n  Args:\n    ifst: The input FST.\n    fst_type: A string indicating the FST type to convert to, or an empty string\n        if no conversion is desired.\n\n  Returns:\n    The input FST converted to the desired FST type.\n\n  Raises:\n    FstOpError: Conversion failed.\n  ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_25convert(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst = 0;
  PyObject *__pyx_v_fst_type = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("convert (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ifst,&__pyx_n_s_fst_type,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)__pyx_kp_u__11);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ifst)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fst_type);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "convert") < 0)) __PYX_ERR(0, 3550, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_ifst = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *)values[0]);
    __pyx_v_fst_type = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("convert", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3550, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.convert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_6fstlib_4cext_9pywrapfst_Fst, 1, "ifst", 0))) __PYX_ERR(0, 3550, __pyx_L1_error)
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_24convert(__pyx_self, __pyx_v_ifst, __pyx_v_fst_type);

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_24convert(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst, PyObject *__pyx_v_fst_type) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_convert __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("convert", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.fst_type = __pyx_v_fst_type;
  __pyx_t_1 = ((PyObject *)__pyx_f_6fstlib_4cext_9pywrapfst_convert(__pyx_v_ifst, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3550, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.convert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":3576
 * 
 * 
 * cpdef MutableFst determinize(Fst ifst,             # <<<<<<<<<<<<<<
 *                              float delta=fst.kShortestDelta,
 *                              det_type="functional",
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_27determinize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_f_6fstlib_4cext_9pywrapfst_determinize(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_determinize *__pyx_optional_args) {
  float __pyx_v_delta = __pyx_k__34;
  PyObject *__pyx_v_det_type = ((PyObject *)__pyx_n_u_functional);
  int64 __pyx_v_nstate = __pyx_k__35;
  int64 __pyx_v_subsequential_label = ((int64)0);

  /* "fstlib/cext/pywrapfst.pyx":3581
 *                              int64 nstate=fst.kNoStateId,
 *                              int64 subsequential_label=0,
 *                              weight=None,             # <<<<<<<<<<<<<<
 *                              bool increment_subsequential_label=False):
 *   """
 */
  PyObject *__pyx_v_weight = ((PyObject *)Py_None);

  /* "fstlib/cext/pywrapfst.pyx":3582
 *                              int64 subsequential_label=0,
 *                              weight=None,
 *                              bool increment_subsequential_label=False):             # <<<<<<<<<<<<<<
 *   """
 *   determinize(ifst, delta=1e-6, det_type="functional",
 */
  bool __pyx_v_increment_subsequential_label = ((bool)0);
  std::unique_ptr<fst::script::VectorFstClass>  __pyx_v__tfst;
  fst::script::WeightClass __pyx_v__weight;
  enum fst::DeterminizeType __pyx_v__det_type;
  std::unique_ptr<fst::script::DeterminizeOptions>  __pyx_v__opts;
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  fst::script::WeightClass __pyx_t_1;
  std::string __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("determinize", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_delta = __pyx_optional_args->delta;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_det_type = __pyx_optional_args->det_type;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_nstate = __pyx_optional_args->nstate;
          if (__pyx_optional_args->__pyx_n > 3) {
            __pyx_v_subsequential_label = __pyx_optional_args->subsequential_label;
            if (__pyx_optional_args->__pyx_n > 4) {
              __pyx_v_weight = __pyx_optional_args->weight;
              if (__pyx_optional_args->__pyx_n > 5) {
                __pyx_v_increment_subsequential_label = __pyx_optional_args->increment_subsequential_label;
              }
            }
          }
        }
      }
    }
  }

  /* "fstlib/cext/pywrapfst.pyx":3616
 *   """
 *   cdef unique_ptr[fst.VectorFstClass] _tfst
 *   _tfst.reset(new fst.VectorFstClass(ifst.arc_type()))             # <<<<<<<<<<<<<<
 *   # Threshold is set to semiring Zero (no pruning) if weight unspecified.
 *   cdef fst.WeightClass _weight = _get_WeightClass_or_zero(ifst.weight_type(),
 */
  if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "arc_type");
    __PYX_ERR(0, 3616, __pyx_L1_error)
  }
  __pyx_v__tfst.reset(new fst::script::VectorFstClass(((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_Fst *)__pyx_v_ifst->__pyx_vtab)->arc_type(__pyx_v_ifst, 0)));

  /* "fstlib/cext/pywrapfst.pyx":3618
 *   _tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
 *   # Threshold is set to semiring Zero (no pruning) if weight unspecified.
 *   cdef fst.WeightClass _weight = _get_WeightClass_or_zero(ifst.weight_type(),             # <<<<<<<<<<<<<<
 *                                                           weight)
 *   cdef fst.DeterminizeType _det_type
 */
  if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "weight_type");
    __PYX_ERR(0, 3618, __pyx_L1_error)
  }

  /* "fstlib/cext/pywrapfst.pyx":3619
 *   # Threshold is set to semiring Zero (no pruning) if weight unspecified.
 *   cdef fst.WeightClass _weight = _get_WeightClass_or_zero(ifst.weight_type(),
 *                                                           weight)             # <<<<<<<<<<<<<<
 *   cdef fst.DeterminizeType _det_type
 *   if not fst.GetDeterminizeType(tostring(det_type), addr(_det_type)):
 */
  __pyx_t_1 = __pyx_f_6fstlib_4cext_9pywrapfst__get_WeightClass_or_zero(((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_Fst *)__pyx_v_ifst->__pyx_vtab)->weight_type(__pyx_v_ifst, 0), __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3618, __pyx_L1_error)
  __pyx_v__weight = __pyx_t_1;

  /* "fstlib/cext/pywrapfst.pyx":3621
 *                                                           weight)
 *   cdef fst.DeterminizeType _det_type
 *   if not fst.GetDeterminizeType(tostring(det_type), addr(_det_type)):             # <<<<<<<<<<<<<<
 *     raise FstArgError(f"Unknown determinization type: {det_type!r}")
 *   cdef unique_ptr[fst.DeterminizeOptions] _opts
 */
  __pyx_t_2 = __pyx_f_6fstlib_4cext_9pywrapfst_tostring(__pyx_v_det_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3621, __pyx_L1_error)
  __pyx_t_3 = ((!(fst::script::GetDeterminizeType(__pyx_t_2, (&__pyx_v__det_type)) != 0)) != 0);
  if (unlikely(__pyx_t_3)) {

    /* "fstlib/cext/pywrapfst.pyx":3622
 *   cdef fst.DeterminizeType _det_type
 *   if not fst.GetDeterminizeType(tostring(det_type), addr(_det_type)):
 *     raise FstArgError(f"Unknown determinization type: {det_type!r}")             # <<<<<<<<<<<<<<
 *   cdef unique_ptr[fst.DeterminizeOptions] _opts
 *   _opts.reset(
 */
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_FstArgError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3622, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_det_type), __pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3622, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Unknown_determinization_type, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3622, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_7);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3622, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(0, 3622, __pyx_L1_error)

    /* "fstlib/cext/pywrapfst.pyx":3621
 *                                                           weight)
 *   cdef fst.DeterminizeType _det_type
 *   if not fst.GetDeterminizeType(tostring(det_type), addr(_det_type)):             # <<<<<<<<<<<<<<
 *     raise FstArgError(f"Unknown determinization type: {det_type!r}")
 *   cdef unique_ptr[fst.DeterminizeOptions] _opts
 */
  }

  /* "fstlib/cext/pywrapfst.pyx":3624
 *     raise FstArgError(f"Unknown determinization type: {det_type!r}")
 *   cdef unique_ptr[fst.DeterminizeOptions] _opts
 *   _opts.reset(             # <<<<<<<<<<<<<<
 *       new fst.DeterminizeOptions(delta,
 *                                  _weight,
 */
  __pyx_v__opts.reset(new fst::script::DeterminizeOptions(__pyx_v_delta, __pyx_v__weight, __pyx_v_nstate, __pyx_v_subsequential_label, __pyx_v__det_type, __pyx_v_increment_subsequential_label));

  /* "fstlib/cext/pywrapfst.pyx":3631
 *                                  _det_type,
 *                                  increment_subsequential_label))
 *   fst.Determinize(deref(ifst._fst), _tfst.get(), deref(_opts))             # <<<<<<<<<<<<<<
 *   return _init_MutableFst(_tfst.release())
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 3631, __pyx_L1_error)
  }
  fst::script::Determinize((*__pyx_v_ifst->_fst), __pyx_v__tfst.get(), (*__pyx_v__opts));

  /* "fstlib/cext/pywrapfst.pyx":3632
 *                                  increment_subsequential_label))
 *   fst.Determinize(deref(ifst._fst), _tfst.get(), deref(_opts))
 *   return _init_MutableFst(_tfst.release())             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_4 = ((PyObject *)__pyx_f_6fstlib_4cext_9pywrapfst__init_MutableFst(__pyx_v__tfst.release())); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3632, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_r = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *)__pyx_t_4);
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":3576
 * 
 * 
 * cpdef MutableFst determinize(Fst ifst,             # <<<<<<<<<<<<<<
 *                              float delta=fst.kShortestDelta,
 *                              det_type="functional",
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.determinize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_27determinize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_26determinize[] = "\n  determinize(ifst, delta=1e-6, det_type=\"functional\",\n              nstate=NO_STATE_ID, subsequential_label=0, weight=None,\n              incremental_subsequential_label=False)\n\n  Constructively determinizes a weighted FST.\n\n  This operations creates an equivalent FST that has the property that no\n  state has two transitions with the same input label. For this algorithm,\n  epsilon transitions are treated as regular symbols (cf. `rmepsilon`).\n\n  Args:\n    ifst: The input FST.\n    delta: Comparison/quantization delta.\n    det_type: Type of determinization; one of: \"functional\" (input transducer is\n        functional), \"nonfunctional\" (input transducer is not functional) and\n        disambiguate\" (input transducer is not functional but only keep the min\n        of ambiguous outputs).\n    nstate: State number threshold.\n    subsequential_label: Input label of arc corresponding to residual final\n        output when producing a subsequential transducer.\n    weight: A Weight or weight string indicating the desired weight threshold\n        below which paths are pruned; if omitted, no paths are pruned.\n    increment_subsequential_label: Increment subsequential when creating\n        several arcs for the residual final output at a given state.\n\n  Returns:\n    An equivalent deterministic FST.\n\n  Raises:\n    FstArgError: Unknown determinization type.\n  ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_27determinize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst = 0;
  float __pyx_v_delta;
  PyObject *__pyx_v_det_type = 0;
  int64 __pyx_v_nstate;
  int64 __pyx_v_subsequential_label;
  PyObject *__pyx_v_weight = 0;
  bool __pyx_v_increment_subsequential_label;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("determinize (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ifst,&__pyx_n_s_delta,&__pyx_n_s_det_type,&__pyx_n_s_nstate,&__pyx_n_s_subsequential_label,&__pyx_n_s_weight,&__pyx_n_s_increment_subsequential_label,0};
    PyObject* values[7] = {0,0,0,0,0,0,0};
    values[2] = ((PyObject *)__pyx_n_u_functional);

    /* "fstlib/cext/pywrapfst.pyx":3581
 *                              int64 nstate=fst.kNoStateId,
 *                              int64 subsequential_label=0,
 *                              weight=None,             # <<<<<<<<<<<<<<
 *                              bool increment_subsequential_label=False):
 *   """
 */
    values[5] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ifst)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_delta);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_det_type);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nstate);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subsequential_label);
          if (value) { values[4] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_weight);
          if (value) { values[5] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_increment_subsequential_label);
          if (value) { values[6] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "determinize") < 0)) __PYX_ERR(0, 3576, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_ifst = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *)values[0]);
    if (values[1]) {
      __pyx_v_delta = __pyx_PyFloat_AsFloat(values[1]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 3577, __pyx_L3_error)
    } else {
      __pyx_v_delta = __pyx_k__34;
    }
    __pyx_v_det_type = values[2];
    if (values[3]) {
      __pyx_v_nstate = __Pyx_PyInt_As_int64_t(values[3]); if (unlikely((__pyx_v_nstate == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3579, __pyx_L3_error)
    } else {
      __pyx_v_nstate = __pyx_k__35;
    }
    if (values[4]) {
      __pyx_v_subsequential_label = __Pyx_PyInt_As_int64_t(values[4]); if (unlikely((__pyx_v_subsequential_label == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3580, __pyx_L3_error)
    } else {
      __pyx_v_subsequential_label = ((int64)0);
    }
    __pyx_v_weight = values[5];
    if (values[6]) {
      __pyx_v_increment_subsequential_label = __Pyx_PyObject_IsTrue(values[6]); if (unlikely((__pyx_v_increment_subsequential_label == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3582, __pyx_L3_error)
    } else {

      /* "fstlib/cext/pywrapfst.pyx":3582
 *                              int64 subsequential_label=0,
 *                              weight=None,
 *                              bool increment_subsequential_label=False):             # <<<<<<<<<<<<<<
 *   """
 *   determinize(ifst, delta=1e-6, det_type="functional",
 */
      __pyx_v_increment_subsequential_label = ((bool)0);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("determinize", 0, 1, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3576, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.determinize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_6fstlib_4cext_9pywrapfst_Fst, 1, "ifst", 0))) __PYX_ERR(0, 3576, __pyx_L1_error)
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_26determinize(__pyx_self, __pyx_v_ifst, __pyx_v_delta, __pyx_v_det_type, __pyx_v_nstate, __pyx_v_subsequential_label, __pyx_v_weight, __pyx_v_increment_subsequential_label);

  /* "fstlib/cext/pywrapfst.pyx":3576
 * 
 * 
 * cpdef MutableFst determinize(Fst ifst,             # <<<<<<<<<<<<<<
 *                              float delta=fst.kShortestDelta,
 *                              det_type="functional",
 */

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_26determinize(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst, float __pyx_v_delta, PyObject *__pyx_v_det_type, int64 __pyx_v_nstate, int64 __pyx_v_subsequential_label, PyObject *__pyx_v_weight, bool __pyx_v_increment_subsequential_label) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_determinize __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("determinize", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 6;
  __pyx_t_2.delta = __pyx_v_delta;
  __pyx_t_2.det_type = __pyx_v_det_type;
  __pyx_t_2.nstate = __pyx_v_nstate;
  __pyx_t_2.subsequential_label = __pyx_v_subsequential_label;
  __pyx_t_2.weight = __pyx_v_weight;
  __pyx_t_2.increment_subsequential_label = __pyx_v_increment_subsequential_label;
  __pyx_t_1 = ((PyObject *)__pyx_f_6fstlib_4cext_9pywrapfst_determinize(__pyx_v_ifst, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3576, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.determinize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":3635
 * 
 * 
 * cpdef MutableFst difference(Fst ifst1,             # <<<<<<<<<<<<<<
 *                             Fst ifst2,
 *                             compose_filter="auto",
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_29difference(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_f_6fstlib_4cext_9pywrapfst_difference(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst1, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst2, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_difference *__pyx_optional_args) {
  PyObject *__pyx_v_compose_filter = ((PyObject *)__pyx_n_u_auto);

  /* "fstlib/cext/pywrapfst.pyx":3638
 *                             Fst ifst2,
 *                             compose_filter="auto",
 *                             bool connect=True):             # <<<<<<<<<<<<<<
 *   """
 *   difference(ifst1, ifst2, compose_filter="auto", connect=True)
 */
  bool __pyx_v_connect = ((bool)1);
  std::unique_ptr<fst::script::VectorFstClass>  __pyx_v__tfst;
  std::unique_ptr<fst::ComposeOptions>  __pyx_v__opts;
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  enum fst::ComposeFilter __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("difference", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_compose_filter = __pyx_optional_args->compose_filter;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_connect = __pyx_optional_args->connect;
      }
    }
  }

  /* "fstlib/cext/pywrapfst.pyx":3663
 *   """
 *   cdef unique_ptr[fst.VectorFstClass] _tfst
 *   _tfst.reset(new fst.VectorFstClass(ifst1.arc_type()))             # <<<<<<<<<<<<<<
 *   cdef unique_ptr[fst.ComposeOptions] _opts
 *   _opts.reset(
 */
  if (unlikely(((PyObject *)__pyx_v_ifst1) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "arc_type");
    __PYX_ERR(0, 3663, __pyx_L1_error)
  }
  __pyx_v__tfst.reset(new fst::script::VectorFstClass(((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_Fst *)__pyx_v_ifst1->__pyx_vtab)->arc_type(__pyx_v_ifst1, 0)));

  /* "fstlib/cext/pywrapfst.pyx":3667
 *   _opts.reset(
 *       new fst.ComposeOptions(connect,
 *                             _get_compose_filter(tostring(compose_filter))))             # <<<<<<<<<<<<<<
 *   fst.Difference(deref(ifst1._fst),
 *                  deref(ifst2._fst),
 */
  __pyx_t_1 = __pyx_f_6fstlib_4cext_9pywrapfst_tostring(__pyx_v_compose_filter); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3667, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_6fstlib_4cext_9pywrapfst__get_compose_filter(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3667, __pyx_L1_error)

  /* "fstlib/cext/pywrapfst.pyx":3665
 *   _tfst.reset(new fst.VectorFstClass(ifst1.arc_type()))
 *   cdef unique_ptr[fst.ComposeOptions] _opts
 *   _opts.reset(             # <<<<<<<<<<<<<<
 *       new fst.ComposeOptions(connect,
 *                             _get_compose_filter(tostring(compose_filter))))
 */
  __pyx_v__opts.reset(new fst::ComposeOptions(__pyx_v_connect, __pyx_t_2));

  /* "fstlib/cext/pywrapfst.pyx":3668
 *       new fst.ComposeOptions(connect,
 *                             _get_compose_filter(tostring(compose_filter))))
 *   fst.Difference(deref(ifst1._fst),             # <<<<<<<<<<<<<<
 *                  deref(ifst2._fst),
 *                  _tfst.get(),
 */
  if (unlikely(((PyObject *)__pyx_v_ifst1) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 3668, __pyx_L1_error)
  }

  /* "fstlib/cext/pywrapfst.pyx":3669
 *                             _get_compose_filter(tostring(compose_filter))))
 *   fst.Difference(deref(ifst1._fst),
 *                  deref(ifst2._fst),             # <<<<<<<<<<<<<<
 *                  _tfst.get(),
 *                  deref(_opts))
 */
  if (unlikely(((PyObject *)__pyx_v_ifst2) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 3669, __pyx_L1_error)
  }

  /* "fstlib/cext/pywrapfst.pyx":3668
 *       new fst.ComposeOptions(connect,
 *                             _get_compose_filter(tostring(compose_filter))))
 *   fst.Difference(deref(ifst1._fst),             # <<<<<<<<<<<<<<
 *                  deref(ifst2._fst),
 *                  _tfst.get(),
 */
  fst::script::Difference((*__pyx_v_ifst1->_fst), (*__pyx_v_ifst2->_fst), __pyx_v__tfst.get(), (*__pyx_v__opts));

  /* "fstlib/cext/pywrapfst.pyx":3672
 *                  _tfst.get(),
 *                  deref(_opts))
 *   return _init_MutableFst(_tfst.release())             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_3 = ((PyObject *)__pyx_f_6fstlib_4cext_9pywrapfst__init_MutableFst(__pyx_v__tfst.release())); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3672, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":3635
 * 
 * 
 * cpdef MutableFst difference(Fst ifst1,             # <<<<<<<<<<<<<<
 *                             Fst ifst2,
 *                             compose_filter="auto",
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.difference", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_29difference(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_28difference[] = "\n  difference(ifst1, ifst2, compose_filter=\"auto\", connect=True)\n\n  Constructively computes the difference of two FSTs.\n\n  This operation computes the difference between two FSAs. Only strings that are\n  in the first automaton but not in second are retained in the result. The first\n  argument must be an acceptor; the second argument must be an unweighted,\n  epsilon-free, deterministic acceptor. The output labels of the first\n  transducer or the input labels of the second transducer must be sorted (or\n  otherwise support appropriate matchers).\n\n  Args:\n    ifst1: The first input FST.\n    ifst2: The second input FST.\n    compose_filter: A string matching a known composition filter; one of:\n        \"alt_sequence\", \"auto\", \"match\", \"no_match\", \"null\", \"sequence\",\n        \"trivial\".\n    connect: Should the output FST be trimmed?\n\n  Returns:\n    An FST representing the difference of the FSTs.\n  ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_29difference(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst1 = 0;
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst2 = 0;
  PyObject *__pyx_v_compose_filter = 0;
  bool __pyx_v_connect;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("difference (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ifst1,&__pyx_n_s_ifst2,&__pyx_n_s_compose_filter,&__pyx_n_s_connect,0};
    PyObject* values[4] = {0,0,0,0};
    values[2] = ((PyObject *)__pyx_n_u_auto);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ifst1)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ifst2)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("difference", 0, 2, 4, 1); __PYX_ERR(0, 3635, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_compose_filter);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_connect);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "difference") < 0)) __PYX_ERR(0, 3635, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_ifst1 = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *)values[0]);
    __pyx_v_ifst2 = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *)values[1]);
    __pyx_v_compose_filter = values[2];
    if (values[3]) {
      __pyx_v_connect = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_connect == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3638, __pyx_L3_error)
    } else {

      /* "fstlib/cext/pywrapfst.pyx":3638
 *                             Fst ifst2,
 *                             compose_filter="auto",
 *                             bool connect=True):             # <<<<<<<<<<<<<<
 *   """
 *   difference(ifst1, ifst2, compose_filter="auto", connect=True)
 */
      __pyx_v_connect = ((bool)1);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("difference", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3635, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.difference", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst1), __pyx_ptype_6fstlib_4cext_9pywrapfst_Fst, 1, "ifst1", 0))) __PYX_ERR(0, 3635, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst2), __pyx_ptype_6fstlib_4cext_9pywrapfst_Fst, 1, "ifst2", 0))) __PYX_ERR(0, 3636, __pyx_L1_error)
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_28difference(__pyx_self, __pyx_v_ifst1, __pyx_v_ifst2, __pyx_v_compose_filter, __pyx_v_connect);

  /* "fstlib/cext/pywrapfst.pyx":3635
 * 
 * 
 * cpdef MutableFst difference(Fst ifst1,             # <<<<<<<<<<<<<<
 *                             Fst ifst2,
 *                             compose_filter="auto",
 */

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_28difference(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst1, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst2, PyObject *__pyx_v_compose_filter, bool __pyx_v_connect) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_difference __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("difference", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.compose_filter = __pyx_v_compose_filter;
  __pyx_t_2.connect = __pyx_v_connect;
  __pyx_t_1 = ((PyObject *)__pyx_f_6fstlib_4cext_9pywrapfst_difference(__pyx_v_ifst1, __pyx_v_ifst2, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3635, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.difference", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":3675
 * 
 * 
 * cpdef MutableFst disambiguate(Fst ifst,             # <<<<<<<<<<<<<<
 *                               float delta=fst.kDelta,
 *                               int64 nstate=fst.kNoStateId,
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_31disambiguate(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_f_6fstlib_4cext_9pywrapfst_disambiguate(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_disambiguate *__pyx_optional_args) {
  float __pyx_v_delta = __pyx_k__36;
  int64 __pyx_v_nstate = __pyx_k__37;
  int64 __pyx_v_subsequential_label = ((int64)0);

  /* "fstlib/cext/pywrapfst.pyx":3679
 *                               int64 nstate=fst.kNoStateId,
 *                               int64 subsequential_label=0,
 *                               weight=None):             # <<<<<<<<<<<<<<
 *   """
 *   disambiguate(ifst, delta=0.0009765625, nstate=NO_STATE_ID,
 */
  PyObject *__pyx_v_weight = ((PyObject *)Py_None);
  std::unique_ptr<fst::script::VectorFstClass>  __pyx_v__tfst;
  fst::script::WeightClass __pyx_v__weight;
  std::unique_ptr<fst::script::DisambiguateOptions>  __pyx_v__opts;
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  fst::script::WeightClass __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("disambiguate", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_delta = __pyx_optional_args->delta;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_nstate = __pyx_optional_args->nstate;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_subsequential_label = __pyx_optional_args->subsequential_label;
          if (__pyx_optional_args->__pyx_n > 3) {
            __pyx_v_weight = __pyx_optional_args->weight;
          }
        }
      }
    }
  }

  /* "fstlib/cext/pywrapfst.pyx":3704
 *   """
 *   cdef unique_ptr[fst.VectorFstClass] _tfst
 *   _tfst.reset(new fst.VectorFstClass(ifst.arc_type()))             # <<<<<<<<<<<<<<
 *   # Threshold is set to semiring Zero (no pruning) if no weight is specified.
 *   cdef fst.WeightClass _weight = _get_WeightClass_or_zero(ifst.weight_type(),
 */
  if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "arc_type");
    __PYX_ERR(0, 3704, __pyx_L1_error)
  }
  __pyx_v__tfst.reset(new fst::script::VectorFstClass(((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_Fst *)__pyx_v_ifst->__pyx_vtab)->arc_type(__pyx_v_ifst, 0)));

  /* "fstlib/cext/pywrapfst.pyx":3706
 *   _tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
 *   # Threshold is set to semiring Zero (no pruning) if no weight is specified.
 *   cdef fst.WeightClass _weight = _get_WeightClass_or_zero(ifst.weight_type(),             # <<<<<<<<<<<<<<
 *                                                      weight)
 *   cdef unique_ptr[fst.DisambiguateOptions] _opts
 */
  if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "weight_type");
    __PYX_ERR(0, 3706, __pyx_L1_error)
  }

  /* "fstlib/cext/pywrapfst.pyx":3707
 *   # Threshold is set to semiring Zero (no pruning) if no weight is specified.
 *   cdef fst.WeightClass _weight = _get_WeightClass_or_zero(ifst.weight_type(),
 *                                                      weight)             # <<<<<<<<<<<<<<
 *   cdef unique_ptr[fst.DisambiguateOptions] _opts
 *   _opts.reset(
 */
  __pyx_t_1 = __pyx_f_6fstlib_4cext_9pywrapfst__get_WeightClass_or_zero(((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_Fst *)__pyx_v_ifst->__pyx_vtab)->weight_type(__pyx_v_ifst, 0), __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3706, __pyx_L1_error)
  __pyx_v__weight = __pyx_t_1;

  /* "fstlib/cext/pywrapfst.pyx":3709
 *                                                      weight)
 *   cdef unique_ptr[fst.DisambiguateOptions] _opts
 *   _opts.reset(             # <<<<<<<<<<<<<<
 *       new fst.DisambiguateOptions(delta,
 *                                   _weight,
 */
  __pyx_v__opts.reset(new fst::script::DisambiguateOptions(__pyx_v_delta, __pyx_v__weight, __pyx_v_nstate, __pyx_v_subsequential_label));

  /* "fstlib/cext/pywrapfst.pyx":3714
 *                                   nstate,
 *                                   subsequential_label))
 *   fst.Disambiguate(deref(ifst._fst), _tfst.get(), deref(_opts))             # <<<<<<<<<<<<<<
 *   return _init_MutableFst(_tfst.release())
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 3714, __pyx_L1_error)
  }
  fst::script::Disambiguate((*__pyx_v_ifst->_fst), __pyx_v__tfst.get(), (*__pyx_v__opts));

  /* "fstlib/cext/pywrapfst.pyx":3715
 *                                   subsequential_label))
 *   fst.Disambiguate(deref(ifst._fst), _tfst.get(), deref(_opts))
 *   return _init_MutableFst(_tfst.release())             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_2 = ((PyObject *)__pyx_f_6fstlib_4cext_9pywrapfst__init_MutableFst(__pyx_v__tfst.release())); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3715, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":3675
 * 
 * 
 * cpdef MutableFst disambiguate(Fst ifst,             # <<<<<<<<<<<<<<
 *                               float delta=fst.kDelta,
 *                               int64 nstate=fst.kNoStateId,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.disambiguate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_31disambiguate(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_30disambiguate[] = "\n  disambiguate(ifst, delta=0.0009765625, nstate=NO_STATE_ID,\n               subsequential_label=0, weight=None):\n\n  Constructively disambiguates a weighted transducer.\n\n  This operation disambiguates a weighted transducer. The result will be an\n  equivalent FST that has the property that no two successful paths have the\n  same input labeling. For this algorithm, epsilon transitions are treated as\n  regular symbols (cf. `rmepsilon`).\n\n  Args:\n    ifst: The input FST.\n    delta: Comparison/quantization delta.\n    nstate: State number threshold.\n    subsequential_label: Input label of arc corresponding to residual final\n        output when producing a subsequential transducer.\n    weight: A Weight or weight string indicating the desired weight threshold\n        below which paths are pruned; if omitted, no paths are pruned.\n\n  Returns:\n    An equivalent disambiguated FST.\n  ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_31disambiguate(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst = 0;
  float __pyx_v_delta;
  int64 __pyx_v_nstate;
  int64 __pyx_v_subsequential_label;
  PyObject *__pyx_v_weight = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("disambiguate (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ifst,&__pyx_n_s_delta,&__pyx_n_s_nstate,&__pyx_n_s_subsequential_label,&__pyx_n_s_weight,0};
    PyObject* values[5] = {0,0,0,0,0};

    /* "fstlib/cext/pywrapfst.pyx":3679
 *                               int64 nstate=fst.kNoStateId,
 *                               int64 subsequential_label=0,
 *                               weight=None):             # <<<<<<<<<<<<<<
 *   """
 *   disambiguate(ifst, delta=0.0009765625, nstate=NO_STATE_ID,
 */
    values[4] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ifst)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_delta);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nstate);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subsequential_label);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_weight);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "disambiguate") < 0)) __PYX_ERR(0, 3675, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_ifst = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *)values[0]);
    if (values[1]) {
      __pyx_v_delta = __pyx_PyFloat_AsFloat(values[1]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 3676, __pyx_L3_error)
    } else {
      __pyx_v_delta = __pyx_k__36;
    }
    if (values[2]) {
      __pyx_v_nstate = __Pyx_PyInt_As_int64_t(values[2]); if (unlikely((__pyx_v_nstate == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3677, __pyx_L3_error)
    } else {
      __pyx_v_nstate = __pyx_k__37;
    }
    if (values[3]) {
      __pyx_v_subsequential_label = __Pyx_PyInt_As_int64_t(values[3]); if (unlikely((__pyx_v_subsequential_label == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3678, __pyx_L3_error)
    } else {
      __pyx_v_subsequential_label = ((int64)0);
    }
    __pyx_v_weight = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("disambiguate", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3675, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.disambiguate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_6fstlib_4cext_9pywrapfst_Fst, 1, "ifst", 0))) __PYX_ERR(0, 3675, __pyx_L1_error)
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_30disambiguate(__pyx_self, __pyx_v_ifst, __pyx_v_delta, __pyx_v_nstate, __pyx_v_subsequential_label, __pyx_v_weight);

  /* "fstlib/cext/pywrapfst.pyx":3675
 * 
 * 
 * cpdef MutableFst disambiguate(Fst ifst,             # <<<<<<<<<<<<<<
 *                               float delta=fst.kDelta,
 *                               int64 nstate=fst.kNoStateId,
 */

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_30disambiguate(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst, float __pyx_v_delta, int64 __pyx_v_nstate, int64 __pyx_v_subsequential_label, PyObject *__pyx_v_weight) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_disambiguate __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("disambiguate", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 4;
  __pyx_t_2.delta = __pyx_v_delta;
  __pyx_t_2.nstate = __pyx_v_nstate;
  __pyx_t_2.subsequential_label = __pyx_v_subsequential_label;
  __pyx_t_2.weight = __pyx_v_weight;
  __pyx_t_1 = ((PyObject *)__pyx_f_6fstlib_4cext_9pywrapfst_disambiguate(__pyx_v_ifst, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3675, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.disambiguate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":3718
 * 
 * 
 * cpdef MutableFst epsnormalize(Fst ifst, bool eps_norm_output=False):             # <<<<<<<<<<<<<<
 *   """
 *   epsnormalize(ifst, eps_norm_output=False)
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_33epsnormalize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_f_6fstlib_4cext_9pywrapfst_epsnormalize(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_epsnormalize *__pyx_optional_args) {
  bool __pyx_v_eps_norm_output = ((bool)0);
  std::unique_ptr<fst::script::VectorFstClass>  __pyx_v__tfst;
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  enum fst::EpsNormalizeType __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("epsnormalize", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_eps_norm_output = __pyx_optional_args->eps_norm_output;
    }
  }

  /* "fstlib/cext/pywrapfst.pyx":3739
 *   """
 *   cdef unique_ptr[fst.VectorFstClass] _tfst
 *   _tfst.reset(new fst.VectorFstClass(ifst.arc_type()))             # <<<<<<<<<<<<<<
 *   fst.EpsNormalize(
 *       deref(ifst._fst),
 */
  if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "arc_type");
    __PYX_ERR(0, 3739, __pyx_L1_error)
  }
  __pyx_v__tfst.reset(new fst::script::VectorFstClass(((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_Fst *)__pyx_v_ifst->__pyx_vtab)->arc_type(__pyx_v_ifst, 0)));

  /* "fstlib/cext/pywrapfst.pyx":3741
 *   _tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
 *   fst.EpsNormalize(
 *       deref(ifst._fst),             # <<<<<<<<<<<<<<
 *       _tfst.get(),
 *       fst.EPS_NORM_OUTPUT if eps_norm_output else fst.EPS_NORM_INPUT)
 */
  if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 3741, __pyx_L1_error)
  }

  /* "fstlib/cext/pywrapfst.pyx":3743
 *       deref(ifst._fst),
 *       _tfst.get(),
 *       fst.EPS_NORM_OUTPUT if eps_norm_output else fst.EPS_NORM_INPUT)             # <<<<<<<<<<<<<<
 *   return _init_MutableFst(_tfst.release())
 * 
 */
  if ((__pyx_v_eps_norm_output != 0)) {
    __pyx_t_1 = fst::EPS_NORM_OUTPUT;
  } else {
    __pyx_t_1 = fst::EPS_NORM_INPUT;
  }

  /* "fstlib/cext/pywrapfst.pyx":3740
 *   cdef unique_ptr[fst.VectorFstClass] _tfst
 *   _tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
 *   fst.EpsNormalize(             # <<<<<<<<<<<<<<
 *       deref(ifst._fst),
 *       _tfst.get(),
 */
  fst::script::EpsNormalize((*__pyx_v_ifst->_fst), __pyx_v__tfst.get(), __pyx_t_1);

  /* "fstlib/cext/pywrapfst.pyx":3744
 *       _tfst.get(),
 *       fst.EPS_NORM_OUTPUT if eps_norm_output else fst.EPS_NORM_INPUT)
 *   return _init_MutableFst(_tfst.release())             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_2 = ((PyObject *)__pyx_f_6fstlib_4cext_9pywrapfst__init_MutableFst(__pyx_v__tfst.release())); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3744, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":3718
 * 
 * 
 * cpdef MutableFst epsnormalize(Fst ifst, bool eps_norm_output=False):             # <<<<<<<<<<<<<<
 *   """
 *   epsnormalize(ifst, eps_norm_output=False)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.epsnormalize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_33epsnormalize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_32epsnormalize[] = "\n  epsnormalize(ifst, eps_norm_output=False)\n\n  Constructively epsilon-normalizes an FST.\n\n  This operation creates an equivalent FST that is epsilon-normalized. An\n  acceptor is epsilon-normalized if it it is epsilon-removed (cf. `rmepsilon`).\n  A transducer is input epsilon-normalized if, in addition, along any path, all\n  arcs with epsilon input labels follow all arcs with non-epsilon input labels.\n  Output epsilon-normalized is defined similarly. The input FST must be\n  functional.\n\n  Args:\n    ifst: The input FST.\n    eps_norm_output: Should the FST be output epsilon-normalized?\n\n  Returns:\n    An equivalent epsilon-normalized FST.\n  ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_33epsnormalize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst = 0;
  bool __pyx_v_eps_norm_output;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("epsnormalize (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ifst,&__pyx_n_s_eps_norm_output,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ifst)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_eps_norm_output);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "epsnormalize") < 0)) __PYX_ERR(0, 3718, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_ifst = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *)values[0]);
    if (values[1]) {
      __pyx_v_eps_norm_output = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_eps_norm_output == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3718, __pyx_L3_error)
    } else {
      __pyx_v_eps_norm_output = ((bool)0);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("epsnormalize", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3718, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.epsnormalize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_6fstlib_4cext_9pywrapfst_Fst, 1, "ifst", 0))) __PYX_ERR(0, 3718, __pyx_L1_error)
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_32epsnormalize(__pyx_self, __pyx_v_ifst, __pyx_v_eps_norm_output);

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_32epsnormalize(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst, bool __pyx_v_eps_norm_output) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_epsnormalize __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("epsnormalize", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.eps_norm_output = __pyx_v_eps_norm_output;
  __pyx_t_1 = ((PyObject *)__pyx_f_6fstlib_4cext_9pywrapfst_epsnormalize(__pyx_v_ifst, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3718, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.epsnormalize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":3747
 * 
 * 
 * cpdef bool equal(Fst ifst1, Fst ifst2, float delta=fst.kDelta):             # <<<<<<<<<<<<<<
 *   """
 *   equal(ifst1, ifst2, delta=0.0009765625)
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_35equal(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static bool __pyx_f_6fstlib_4cext_9pywrapfst_equal(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst1, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst2, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_equal *__pyx_optional_args) {
  float __pyx_v_delta = __pyx_k__38;
  bool __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("equal", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_delta = __pyx_optional_args->delta;
    }
  }

  /* "fstlib/cext/pywrapfst.pyx":3765
 *     True if the FSTs satisfy the above condition, else False.
 *   """
 *   return fst.Equal(deref(ifst1._fst), deref(ifst2._fst), delta)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_ifst1) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 3765, __pyx_L1_error)
  }
  if (unlikely(((PyObject *)__pyx_v_ifst2) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 3765, __pyx_L1_error)
  }
  __pyx_r = fst::script::Equal((*__pyx_v_ifst1->_fst), (*__pyx_v_ifst2->_fst), __pyx_v_delta);
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":3747
 * 
 * 
 * cpdef bool equal(Fst ifst1, Fst ifst2, float delta=fst.kDelta):             # <<<<<<<<<<<<<<
 *   """
 *   equal(ifst1, ifst2, delta=0.0009765625)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("fstlib.cext.pywrapfst.equal", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_35equal(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_34equal[] = "\n  equal(ifst1, ifst2, delta=0.0009765625)\n\n  Are two FSTs equal?\n\n  This function tests whether two FSTs have the same states with the same\n  numbering and the same transitions with the same labels and weights in the\n  same order.\n\n  Args:\n    ifst1: The first input FST.\n    ifst2: The second input FST.\n    delta: Comparison/quantization delta.\n\n  Returns:\n    True if the FSTs satisfy the above condition, else False.\n  ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_35equal(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst1 = 0;
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst2 = 0;
  float __pyx_v_delta;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("equal (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ifst1,&__pyx_n_s_ifst2,&__pyx_n_s_delta,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ifst1)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ifst2)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("equal", 0, 2, 3, 1); __PYX_ERR(0, 3747, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_delta);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "equal") < 0)) __PYX_ERR(0, 3747, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_ifst1 = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *)values[0]);
    __pyx_v_ifst2 = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *)values[1]);
    if (values[2]) {
      __pyx_v_delta = __pyx_PyFloat_AsFloat(values[2]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 3747, __pyx_L3_error)
    } else {
      __pyx_v_delta = __pyx_k__38;
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("equal", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3747, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.equal", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst1), __pyx_ptype_6fstlib_4cext_9pywrapfst_Fst, 1, "ifst1", 0))) __PYX_ERR(0, 3747, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst2), __pyx_ptype_6fstlib_4cext_9pywrapfst_Fst, 1, "ifst2", 0))) __PYX_ERR(0, 3747, __pyx_L1_error)
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_34equal(__pyx_self, __pyx_v_ifst1, __pyx_v_ifst2, __pyx_v_delta);

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_34equal(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst1, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst2, float __pyx_v_delta) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  bool __pyx_t_1;
  struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_equal __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("equal", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.delta = __pyx_v_delta;
  __pyx_t_1 = __pyx_f_6fstlib_4cext_9pywrapfst_equal(__pyx_v_ifst1, __pyx_v_ifst2, 0, &__pyx_t_2); 
  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3747, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.equal", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":3768
 * 
 * 
 * cpdef bool equivalent(Fst ifst1, Fst ifst2, float delta=fst.kDelta):             # <<<<<<<<<<<<<<
 *   """
 *   equivalent(ifst1, ifst2, delta=0.0009765625)
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_37equivalent(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static bool __pyx_f_6fstlib_4cext_9pywrapfst_equivalent(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst1, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst2, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_equivalent *__pyx_optional_args) {
  float __pyx_v_delta = __pyx_k__39;
  bool __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("equivalent", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_delta = __pyx_optional_args->delta;
    }
  }

  /* "fstlib/cext/pywrapfst.pyx":3786
 *     True if the FSTs satisfy the above condition, else False.
 *   """
 *   return fst.Equivalent(deref(ifst1._fst), deref(ifst2._fst), delta)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_ifst1) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 3786, __pyx_L1_error)
  }
  if (unlikely(((PyObject *)__pyx_v_ifst2) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 3786, __pyx_L1_error)
  }
  __pyx_r = fst::script::Equivalent((*__pyx_v_ifst1->_fst), (*__pyx_v_ifst2->_fst), __pyx_v_delta);
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":3768
 * 
 * 
 * cpdef bool equivalent(Fst ifst1, Fst ifst2, float delta=fst.kDelta):             # <<<<<<<<<<<<<<
 *   """
 *   equivalent(ifst1, ifst2, delta=0.0009765625)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("fstlib.cext.pywrapfst.equivalent", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_37equivalent(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_36equivalent[] = "\n  equivalent(ifst1, ifst2, delta=0.0009765625)\n\n  Are the two acceptors equivalent?\n\n  This operation tests whether two epsilon-free deterministic weighted\n  acceptors are equivalent, that is if they accept the same strings with the\n  same weights.\n\n  Args:\n    ifst1: The first input FST.\n    ifst2: The second input FST.\n    delta: Comparison/quantization delta.\n\n  Returns:\n    True if the FSTs satisfy the above condition, else False.\n  ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_37equivalent(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst1 = 0;
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst2 = 0;
  float __pyx_v_delta;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("equivalent (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ifst1,&__pyx_n_s_ifst2,&__pyx_n_s_delta,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ifst1)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ifst2)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("equivalent", 0, 2, 3, 1); __PYX_ERR(0, 3768, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_delta);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "equivalent") < 0)) __PYX_ERR(0, 3768, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_ifst1 = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *)values[0]);
    __pyx_v_ifst2 = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *)values[1]);
    if (values[2]) {
      __pyx_v_delta = __pyx_PyFloat_AsFloat(values[2]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 3768, __pyx_L3_error)
    } else {
      __pyx_v_delta = __pyx_k__39;
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("equivalent", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3768, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.equivalent", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst1), __pyx_ptype_6fstlib_4cext_9pywrapfst_Fst, 1, "ifst1", 0))) __PYX_ERR(0, 3768, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst2), __pyx_ptype_6fstlib_4cext_9pywrapfst_Fst, 1, "ifst2", 0))) __PYX_ERR(0, 3768, __pyx_L1_error)
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_36equivalent(__pyx_self, __pyx_v_ifst1, __pyx_v_ifst2, __pyx_v_delta);

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_36equivalent(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst1, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst2, float __pyx_v_delta) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  bool __pyx_t_1;
  struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_equivalent __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("equivalent", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.delta = __pyx_v_delta;
  __pyx_t_1 = __pyx_f_6fstlib_4cext_9pywrapfst_equivalent(__pyx_v_ifst1, __pyx_v_ifst2, 0, &__pyx_t_2); 
  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3768, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.equivalent", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":3789
 * 
 * 
 * cpdef MutableFst intersect(Fst ifst1,             # <<<<<<<<<<<<<<
 *                            Fst ifst2,
 *                            compose_filter="auto",
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_39intersect(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_f_6fstlib_4cext_9pywrapfst_intersect(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst1, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst2, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_intersect *__pyx_optional_args) {
  PyObject *__pyx_v_compose_filter = ((PyObject *)__pyx_n_u_auto);

  /* "fstlib/cext/pywrapfst.pyx":3792
 *                            Fst ifst2,
 *                            compose_filter="auto",
 *                            bool connect=True):             # <<<<<<<<<<<<<<
 *   """
 *   intersect(ifst1, ifst2, compose_filter="auto", connect=True)
 */
  bool __pyx_v_connect = ((bool)1);
  std::unique_ptr<fst::script::VectorFstClass>  __pyx_v__tfst;
  std::unique_ptr<fst::ComposeOptions>  __pyx_v__opts;
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  enum fst::ComposeFilter __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("intersect", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_compose_filter = __pyx_optional_args->compose_filter;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_connect = __pyx_optional_args->connect;
      }
    }
  }

  /* "fstlib/cext/pywrapfst.pyx":3815
 *   """
 *   cdef unique_ptr[fst.VectorFstClass] _tfst
 *   _tfst.reset(new fst.VectorFstClass(ifst1.arc_type()))             # <<<<<<<<<<<<<<
 *   cdef unique_ptr[fst.ComposeOptions] _opts
 *   _opts.reset(
 */
  if (unlikely(((PyObject *)__pyx_v_ifst1) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "arc_type");
    __PYX_ERR(0, 3815, __pyx_L1_error)
  }
  __pyx_v__tfst.reset(new fst::script::VectorFstClass(((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_Fst *)__pyx_v_ifst1->__pyx_vtab)->arc_type(__pyx_v_ifst1, 0)));

  /* "fstlib/cext/pywrapfst.pyx":3819
 *   _opts.reset(
 *       new fst.ComposeOptions(connect,
 *                             _get_compose_filter(tostring(compose_filter))))             # <<<<<<<<<<<<<<
 *   fst.Intersect(deref(ifst1._fst), deref(ifst2._fst), _tfst.get(), deref(_opts))
 *   return _init_MutableFst(_tfst.release())
 */
  __pyx_t_1 = __pyx_f_6fstlib_4cext_9pywrapfst_tostring(__pyx_v_compose_filter); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3819, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_6fstlib_4cext_9pywrapfst__get_compose_filter(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3819, __pyx_L1_error)

  /* "fstlib/cext/pywrapfst.pyx":3817
 *   _tfst.reset(new fst.VectorFstClass(ifst1.arc_type()))
 *   cdef unique_ptr[fst.ComposeOptions] _opts
 *   _opts.reset(             # <<<<<<<<<<<<<<
 *       new fst.ComposeOptions(connect,
 *                             _get_compose_filter(tostring(compose_filter))))
 */
  __pyx_v__opts.reset(new fst::ComposeOptions(__pyx_v_connect, __pyx_t_2));

  /* "fstlib/cext/pywrapfst.pyx":3820
 *       new fst.ComposeOptions(connect,
 *                             _get_compose_filter(tostring(compose_filter))))
 *   fst.Intersect(deref(ifst1._fst), deref(ifst2._fst), _tfst.get(), deref(_opts))             # <<<<<<<<<<<<<<
 *   return _init_MutableFst(_tfst.release())
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_ifst1) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 3820, __pyx_L1_error)
  }
  if (unlikely(((PyObject *)__pyx_v_ifst2) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 3820, __pyx_L1_error)
  }
  fst::script::Intersect((*__pyx_v_ifst1->_fst), (*__pyx_v_ifst2->_fst), __pyx_v__tfst.get(), (*__pyx_v__opts));

  /* "fstlib/cext/pywrapfst.pyx":3821
 *                             _get_compose_filter(tostring(compose_filter))))
 *   fst.Intersect(deref(ifst1._fst), deref(ifst2._fst), _tfst.get(), deref(_opts))
 *   return _init_MutableFst(_tfst.release())             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_3 = ((PyObject *)__pyx_f_6fstlib_4cext_9pywrapfst__init_MutableFst(__pyx_v__tfst.release())); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3821, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":3789
 * 
 * 
 * cpdef MutableFst intersect(Fst ifst1,             # <<<<<<<<<<<<<<
 *                            Fst ifst2,
 *                            compose_filter="auto",
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.intersect", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_39intersect(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_38intersect[] = "\n  intersect(ifst1, ifst2, compose_filter=\"auto\", connect=True)\n\n  Constructively intersects two FSTs.\n\n  This operation computes the intersection (Hadamard product) of two FSTs.\n  Only strings that are in both automata are retained in the result. The two\n  arguments must be acceptors. One of the arguments must be label-sorted (or\n  otherwise support appropriate matchers).\n\n  Args:\n    ifst1: The first input FST.\n    ifst2: The second input FST.\n    compose_filter: A string matching a known composition filter; one of:\n        \"alt_sequence\", \"auto\", \"match\", \"no_match\", \"null\", \"sequence\",\n        \"trivial\".\n    connect: Should output be trimmed?\n\n  Returns:\n    An intersected FST.\n  ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_39intersect(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst1 = 0;
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst2 = 0;
  PyObject *__pyx_v_compose_filter = 0;
  bool __pyx_v_connect;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("intersect (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ifst1,&__pyx_n_s_ifst2,&__pyx_n_s_compose_filter,&__pyx_n_s_connect,0};
    PyObject* values[4] = {0,0,0,0};
    values[2] = ((PyObject *)__pyx_n_u_auto);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ifst1)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ifst2)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("intersect", 0, 2, 4, 1); __PYX_ERR(0, 3789, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_compose_filter);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_connect);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "intersect") < 0)) __PYX_ERR(0, 3789, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_ifst1 = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *)values[0]);
    __pyx_v_ifst2 = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *)values[1]);
    __pyx_v_compose_filter = values[2];
    if (values[3]) {
      __pyx_v_connect = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_connect == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3792, __pyx_L3_error)
    } else {

      /* "fstlib/cext/pywrapfst.pyx":3792
 *                            Fst ifst2,
 *                            compose_filter="auto",
 *                            bool connect=True):             # <<<<<<<<<<<<<<
 *   """
 *   intersect(ifst1, ifst2, compose_filter="auto", connect=True)
 */
      __pyx_v_connect = ((bool)1);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("intersect", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3789, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.intersect", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst1), __pyx_ptype_6fstlib_4cext_9pywrapfst_Fst, 1, "ifst1", 0))) __PYX_ERR(0, 3789, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst2), __pyx_ptype_6fstlib_4cext_9pywrapfst_Fst, 1, "ifst2", 0))) __PYX_ERR(0, 3790, __pyx_L1_error)
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_38intersect(__pyx_self, __pyx_v_ifst1, __pyx_v_ifst2, __pyx_v_compose_filter, __pyx_v_connect);

  /* "fstlib/cext/pywrapfst.pyx":3789
 * 
 * 
 * cpdef MutableFst intersect(Fst ifst1,             # <<<<<<<<<<<<<<
 *                            Fst ifst2,
 *                            compose_filter="auto",
 */

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_38intersect(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst1, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst2, PyObject *__pyx_v_compose_filter, bool __pyx_v_connect) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_intersect __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("intersect", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.compose_filter = __pyx_v_compose_filter;
  __pyx_t_2.connect = __pyx_v_connect;
  __pyx_t_1 = ((PyObject *)__pyx_f_6fstlib_4cext_9pywrapfst_intersect(__pyx_v_ifst1, __pyx_v_ifst2, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3789, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.intersect", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":3824
 * 
 * 
 * cpdef bool isomorphic(Fst ifst1, Fst ifst2, float delta=fst.kDelta):             # <<<<<<<<<<<<<<
 *   """
 *   isomorphic(ifst1, ifst2, delta=0.0009765625)
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_41isomorphic(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static bool __pyx_f_6fstlib_4cext_9pywrapfst_isomorphic(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst1, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst2, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_isomorphic *__pyx_optional_args) {
  float __pyx_v_delta = __pyx_k__40;
  bool __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("isomorphic", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_delta = __pyx_optional_args->delta;
    }
  }

  /* "fstlib/cext/pywrapfst.pyx":3845
 *     True if the two transducers satisfy the above condition, else False.
 *   """
 *   return fst.Isomorphic(deref(ifst1._fst), deref(ifst2._fst), delta)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_ifst1) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 3845, __pyx_L1_error)
  }
  if (unlikely(((PyObject *)__pyx_v_ifst2) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 3845, __pyx_L1_error)
  }
  __pyx_r = fst::script::Isomorphic((*__pyx_v_ifst1->_fst), (*__pyx_v_ifst2->_fst), __pyx_v_delta);
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":3824
 * 
 * 
 * cpdef bool isomorphic(Fst ifst1, Fst ifst2, float delta=fst.kDelta):             # <<<<<<<<<<<<<<
 *   """
 *   isomorphic(ifst1, ifst2, delta=0.0009765625)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("fstlib.cext.pywrapfst.isomorphic", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_41isomorphic(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_40isomorphic[] = "\n  isomorphic(ifst1, ifst2, delta=0.0009765625)\n\n  Are the two acceptors isomorphic?\n\n  This operation determines if two transducers with a certain required\n  determinism have the same states, irrespective of numbering, and the same\n  transitions with the same labels and weights, irrespective of ordering. In\n  other words, FSTs A, B are isomorphic if and only if the states of A can be\n  renumbered and the transitions leaving each state reordered so the two are\n  equal (according to the definition given in `equal`).\n\n  Args:\n    ifst1: The first input FST.\n    ifst2: The second input FST.\n    delta: Comparison/quantization delta.\n\n  Returns:\n    True if the two transducers satisfy the above condition, else False.\n  ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_41isomorphic(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst1 = 0;
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst2 = 0;
  float __pyx_v_delta;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("isomorphic (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ifst1,&__pyx_n_s_ifst2,&__pyx_n_s_delta,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ifst1)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ifst2)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("isomorphic", 0, 2, 3, 1); __PYX_ERR(0, 3824, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_delta);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "isomorphic") < 0)) __PYX_ERR(0, 3824, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_ifst1 = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *)values[0]);
    __pyx_v_ifst2 = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *)values[1]);
    if (values[2]) {
      __pyx_v_delta = __pyx_PyFloat_AsFloat(values[2]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 3824, __pyx_L3_error)
    } else {
      __pyx_v_delta = __pyx_k__40;
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("isomorphic", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3824, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.isomorphic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst1), __pyx_ptype_6fstlib_4cext_9pywrapfst_Fst, 1, "ifst1", 0))) __PYX_ERR(0, 3824, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst2), __pyx_ptype_6fstlib_4cext_9pywrapfst_Fst, 1, "ifst2", 0))) __PYX_ERR(0, 3824, __pyx_L1_error)
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_40isomorphic(__pyx_self, __pyx_v_ifst1, __pyx_v_ifst2, __pyx_v_delta);

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_40isomorphic(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst1, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst2, float __pyx_v_delta) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  bool __pyx_t_1;
  struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_isomorphic __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("isomorphic", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.delta = __pyx_v_delta;
  __pyx_t_1 = __pyx_f_6fstlib_4cext_9pywrapfst_isomorphic(__pyx_v_ifst1, __pyx_v_ifst2, 0, &__pyx_t_2); 
  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3824, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.isomorphic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":3848
 * 
 * 
 * cpdef MutableFst prune(Fst ifst,             # <<<<<<<<<<<<<<
 *                        float delta=fst.kDelta,
 *                        int64 nstate=fst.kNoStateId,
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_43prune(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_f_6fstlib_4cext_9pywrapfst_prune(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_prune *__pyx_optional_args) {
  float __pyx_v_delta = __pyx_k__41;
  int64 __pyx_v_nstate = __pyx_k__42;

  /* "fstlib/cext/pywrapfst.pyx":3851
 *                        float delta=fst.kDelta,
 *                        int64 nstate=fst.kNoStateId,
 *                        weight=None):             # <<<<<<<<<<<<<<
 *   """
 *   prune(ifst, delta=0.0009765625, nstate=NO_STATE_ID, weight=None)
 */
  PyObject *__pyx_v_weight = ((PyObject *)Py_None);
  std::unique_ptr<fst::script::VectorFstClass>  __pyx_v__tfst;
  fst::script::WeightClass __pyx_v__weight;
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  fst::script::WeightClass __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("prune", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_delta = __pyx_optional_args->delta;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_nstate = __pyx_optional_args->nstate;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_weight = __pyx_optional_args->weight;
        }
      }
    }
  }

  /* "fstlib/cext/pywrapfst.pyx":3873
 *   """
 *   cdef unique_ptr[fst.VectorFstClass] _tfst
 *   _tfst.reset(new fst.VectorFstClass(ifst.arc_type()))             # <<<<<<<<<<<<<<
 *   cdef fst.WeightClass _weight = _get_WeightClass_or_zero(ifst.weight_type(),
 *                                                           weight)
 */
  if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "arc_type");
    __PYX_ERR(0, 3873, __pyx_L1_error)
  }
  __pyx_v__tfst.reset(new fst::script::VectorFstClass(((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_Fst *)__pyx_v_ifst->__pyx_vtab)->arc_type(__pyx_v_ifst, 0)));

  /* "fstlib/cext/pywrapfst.pyx":3874
 *   cdef unique_ptr[fst.VectorFstClass] _tfst
 *   _tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
 *   cdef fst.WeightClass _weight = _get_WeightClass_or_zero(ifst.weight_type(),             # <<<<<<<<<<<<<<
 *                                                           weight)
 *   fst.Prune(deref(ifst._fst), _tfst.get(), _weight, nstate, delta)
 */
  if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "weight_type");
    __PYX_ERR(0, 3874, __pyx_L1_error)
  }

  /* "fstlib/cext/pywrapfst.pyx":3875
 *   _tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
 *   cdef fst.WeightClass _weight = _get_WeightClass_or_zero(ifst.weight_type(),
 *                                                           weight)             # <<<<<<<<<<<<<<
 *   fst.Prune(deref(ifst._fst), _tfst.get(), _weight, nstate, delta)
 *   return _init_MutableFst(_tfst.release())
 */
  __pyx_t_1 = __pyx_f_6fstlib_4cext_9pywrapfst__get_WeightClass_or_zero(((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_Fst *)__pyx_v_ifst->__pyx_vtab)->weight_type(__pyx_v_ifst, 0), __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3874, __pyx_L1_error)
  __pyx_v__weight = __pyx_t_1;

  /* "fstlib/cext/pywrapfst.pyx":3876
 *   cdef fst.WeightClass _weight = _get_WeightClass_or_zero(ifst.weight_type(),
 *                                                           weight)
 *   fst.Prune(deref(ifst._fst), _tfst.get(), _weight, nstate, delta)             # <<<<<<<<<<<<<<
 *   return _init_MutableFst(_tfst.release())
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 3876, __pyx_L1_error)
  }
  fst::script::Prune((*__pyx_v_ifst->_fst), __pyx_v__tfst.get(), __pyx_v__weight, __pyx_v_nstate, __pyx_v_delta);

  /* "fstlib/cext/pywrapfst.pyx":3877
 *                                                           weight)
 *   fst.Prune(deref(ifst._fst), _tfst.get(), _weight, nstate, delta)
 *   return _init_MutableFst(_tfst.release())             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_2 = ((PyObject *)__pyx_f_6fstlib_4cext_9pywrapfst__init_MutableFst(__pyx_v__tfst.release())); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3877, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":3848
 * 
 * 
 * cpdef MutableFst prune(Fst ifst,             # <<<<<<<<<<<<<<
 *                        float delta=fst.kDelta,
 *                        int64 nstate=fst.kNoStateId,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.prune", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_43prune(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_42prune[] = "\n  prune(ifst, delta=0.0009765625, nstate=NO_STATE_ID, weight=None)\n\n  Constructively removes paths with weights below a certain threshold.\n\n  This operation deletes states and arcs in the input FST that do not belong\n  to a successful path whose weight is no more (w.r.t the natural semiring\n  order) than the threshold t \\otimes-times the weight of the shortest path in\n  the input FST. Weights must be commutative and have the path property.\n\n  Args:\n    ifst: The input FST.\n    delta: Comparison/quantization delta.\n    nstate: State number threshold.\n    weight: A Weight or weight string indicating the desired weight threshold\n        below which paths are pruned; if omitted, no paths are pruned.\n\n  Returns:\n    A pruned FST.\n  ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_43prune(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst = 0;
  float __pyx_v_delta;
  int64 __pyx_v_nstate;
  PyObject *__pyx_v_weight = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("prune (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ifst,&__pyx_n_s_delta,&__pyx_n_s_nstate,&__pyx_n_s_weight,0};
    PyObject* values[4] = {0,0,0,0};

    /* "fstlib/cext/pywrapfst.pyx":3851
 *                        float delta=fst.kDelta,
 *                        int64 nstate=fst.kNoStateId,
 *                        weight=None):             # <<<<<<<<<<<<<<
 *   """
 *   prune(ifst, delta=0.0009765625, nstate=NO_STATE_ID, weight=None)
 */
    values[3] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ifst)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_delta);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nstate);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_weight);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "prune") < 0)) __PYX_ERR(0, 3848, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_ifst = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *)values[0]);
    if (values[1]) {
      __pyx_v_delta = __pyx_PyFloat_AsFloat(values[1]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 3849, __pyx_L3_error)
    } else {
      __pyx_v_delta = __pyx_k__41;
    }
    if (values[2]) {
      __pyx_v_nstate = __Pyx_PyInt_As_int64_t(values[2]); if (unlikely((__pyx_v_nstate == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3850, __pyx_L3_error)
    } else {
      __pyx_v_nstate = __pyx_k__42;
    }
    __pyx_v_weight = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("prune", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3848, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.prune", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_6fstlib_4cext_9pywrapfst_Fst, 1, "ifst", 0))) __PYX_ERR(0, 3848, __pyx_L1_error)
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_42prune(__pyx_self, __pyx_v_ifst, __pyx_v_delta, __pyx_v_nstate, __pyx_v_weight);

  /* "fstlib/cext/pywrapfst.pyx":3848
 * 
 * 
 * cpdef MutableFst prune(Fst ifst,             # <<<<<<<<<<<<<<
 *                        float delta=fst.kDelta,
 *                        int64 nstate=fst.kNoStateId,
 */

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_42prune(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst, float __pyx_v_delta, int64 __pyx_v_nstate, PyObject *__pyx_v_weight) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_prune __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("prune", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 3;
  __pyx_t_2.delta = __pyx_v_delta;
  __pyx_t_2.nstate = __pyx_v_nstate;
  __pyx_t_2.weight = __pyx_v_weight;
  __pyx_t_1 = ((PyObject *)__pyx_f_6fstlib_4cext_9pywrapfst_prune(__pyx_v_ifst, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3848, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.prune", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":3880
 * 
 * 
 * cpdef MutableFst push(Fst ifst,             # <<<<<<<<<<<<<<
 *                       float delta=fst.kDelta,
 *                       bool push_weights=False,
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_45push(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_f_6fstlib_4cext_9pywrapfst_push(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_push *__pyx_optional_args) {
  float __pyx_v_delta = __pyx_k__43;

  /* "fstlib/cext/pywrapfst.pyx":3882
 * cpdef MutableFst push(Fst ifst,
 *                       float delta=fst.kDelta,
 *                       bool push_weights=False,             # <<<<<<<<<<<<<<
 *                       bool push_labels=False,
 *                       bool remove_common_affix=False,
 */
  bool __pyx_v_push_weights = ((bool)0);

  /* "fstlib/cext/pywrapfst.pyx":3883
 *                       float delta=fst.kDelta,
 *                       bool push_weights=False,
 *                       bool push_labels=False,             # <<<<<<<<<<<<<<
 *                       bool remove_common_affix=False,
 *                       bool remove_total_weight=False,
 */
  bool __pyx_v_push_labels = ((bool)0);

  /* "fstlib/cext/pywrapfst.pyx":3884
 *                       bool push_weights=False,
 *                       bool push_labels=False,
 *                       bool remove_common_affix=False,             # <<<<<<<<<<<<<<
 *                       bool remove_total_weight=False,
 *                       bool to_final=False):
 */
  bool __pyx_v_remove_common_affix = ((bool)0);

  /* "fstlib/cext/pywrapfst.pyx":3885
 *                       bool push_labels=False,
 *                       bool remove_common_affix=False,
 *                       bool remove_total_weight=False,             # <<<<<<<<<<<<<<
 *                       bool to_final=False):
 *   """
 */
  bool __pyx_v_remove_total_weight = ((bool)0);

  /* "fstlib/cext/pywrapfst.pyx":3886
 *                       bool remove_common_affix=False,
 *                       bool remove_total_weight=False,
 *                       bool to_final=False):             # <<<<<<<<<<<<<<
 *   """
 *   push(ifst, delta=0.0009765625, push_weights=False, push_labels=False,
 */
  bool __pyx_v_to_final = ((bool)0);
  std::unique_ptr<fst::script::VectorFstClass>  __pyx_v__tfst;
  uint8 __pyx_v_flags;
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__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("push", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_delta = __pyx_optional_args->delta;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_push_weights = __pyx_optional_args->push_weights;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_push_labels = __pyx_optional_args->push_labels;
          if (__pyx_optional_args->__pyx_n > 3) {
            __pyx_v_remove_common_affix = __pyx_optional_args->remove_common_affix;
            if (__pyx_optional_args->__pyx_n > 4) {
              __pyx_v_remove_total_weight = __pyx_optional_args->remove_total_weight;
              if (__pyx_optional_args->__pyx_n > 5) {
                __pyx_v_to_final = __pyx_optional_args->to_final;
              }
            }
          }
        }
      }
    }
  }

  /* "fstlib/cext/pywrapfst.pyx":3923
 *   """
 *   cdef unique_ptr[fst.VectorFstClass] _tfst
 *   _tfst.reset(new fst.VectorFstClass(ifst.arc_type()))             # <<<<<<<<<<<<<<
 *   cdef uint8 flags = fst.GetPushFlags(push_weights,
 *                                       push_labels,
 */
  if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "arc_type");
    __PYX_ERR(0, 3923, __pyx_L1_error)
  }
  __pyx_v__tfst.reset(new fst::script::VectorFstClass(((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_Fst *)__pyx_v_ifst->__pyx_vtab)->arc_type(__pyx_v_ifst, 0)));

  /* "fstlib/cext/pywrapfst.pyx":3924
 *   cdef unique_ptr[fst.VectorFstClass] _tfst
 *   _tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
 *   cdef uint8 flags = fst.GetPushFlags(push_weights,             # <<<<<<<<<<<<<<
 *                                       push_labels,
 *                                       remove_common_affix,
 */
  __pyx_v_flags = fst::script::GetPushFlags(__pyx_v_push_weights, __pyx_v_push_labels, __pyx_v_remove_common_affix, __pyx_v_remove_total_weight);

  /* "fstlib/cext/pywrapfst.pyx":3928
 *                                       remove_common_affix,
 *                                       remove_total_weight)
 *   fst.Push(deref(ifst._fst),             # <<<<<<<<<<<<<<
 *            _tfst.get(),
 *            flags,
 */
  if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 3928, __pyx_L1_error)
  }

  /* "fstlib/cext/pywrapfst.pyx":3932
 *            flags,
 *            fst.GetReweightType(to_final),
 *            delta)             # <<<<<<<<<<<<<<
 *   return _init_MutableFst(_tfst.release())
 * 
 */
  fst::script::Push((*__pyx_v_ifst->_fst), __pyx_v__tfst.get(), __pyx_v_flags, fst::script::GetReweightType(__pyx_v_to_final), __pyx_v_delta);

  /* "fstlib/cext/pywrapfst.pyx":3933
 *            fst.GetReweightType(to_final),
 *            delta)
 *   return _init_MutableFst(_tfst.release())             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)__pyx_f_6fstlib_4cext_9pywrapfst__init_MutableFst(__pyx_v__tfst.release())); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3933, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":3880
 * 
 * 
 * cpdef MutableFst push(Fst ifst,             # <<<<<<<<<<<<<<
 *                       float delta=fst.kDelta,
 *                       bool push_weights=False,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.push", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_45push(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_44push[] = "\n  push(ifst, delta=0.0009765625, push_weights=False, push_labels=False,\n       remove_common_affix=False, remove_total_weight=False, to_final=False)\n\n  Constructively pushes weights/labels towards initial or final states.\n\n  This operation produces an equivalent transducer by pushing the weights\n  and/or the labels towards the initial state or toward the final states.\n\n  When pushing weights towards the initial state, the sum of the weight of the\n  outgoing transitions and final weight at any non-initial state is equal to 1\n  in the resulting machine. When pushing weights towards the final states, the\n  sum of the weight of the incoming transitions at any state is equal to 1.\n  Weights need to be left distributive when pushing towards the initial state\n  and right distributive when pushing towards the final states.\n\n  Pushing labels towards the initial state consists in minimizing at every\n  state the length of the longest common prefix of the output labels of the\n  outgoing paths. Pushing labels towards the final states consists in\n  minimizing at every state the length of the longest common suffix of the\n  output labels of the incoming paths.\n\n  Args:\n    ifst: The input FST.\n    delta: Comparison/quantization delta.\n    push_weights: Should weights be pushed?\n    push_labels: Should labels be pushed?\n    remove_common_affix: If pushing labels, should common prefix/suffix be\n        removed?\n    remove_total_weight: If pushing weights, should total weight be removed?\n    to_final: Push towards final states?\n\n  Returns:\n    An equivalent pushed FST.\n  ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_45push(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst = 0;
  float __pyx_v_delta;
  bool __pyx_v_push_weights;
  bool __pyx_v_push_labels;
  bool __pyx_v_remove_common_affix;
  bool __pyx_v_remove_total_weight;
  bool __pyx_v_to_final;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("push (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ifst,&__pyx_n_s_delta,&__pyx_n_s_push_weights,&__pyx_n_s_push_labels,&__pyx_n_s_remove_common_affix,&__pyx_n_s_remove_total_weight,&__pyx_n_s_to_final,0};
    PyObject* values[7] = {0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ifst)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_delta);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_push_weights);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_push_labels);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_remove_common_affix);
          if (value) { values[4] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_remove_total_weight);
          if (value) { values[5] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_to_final);
          if (value) { values[6] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "push") < 0)) __PYX_ERR(0, 3880, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_ifst = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *)values[0]);
    if (values[1]) {
      __pyx_v_delta = __pyx_PyFloat_AsFloat(values[1]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 3881, __pyx_L3_error)
    } else {
      __pyx_v_delta = __pyx_k__43;
    }
    if (values[2]) {
      __pyx_v_push_weights = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_push_weights == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3882, __pyx_L3_error)
    } else {

      /* "fstlib/cext/pywrapfst.pyx":3882
 * cpdef MutableFst push(Fst ifst,
 *                       float delta=fst.kDelta,
 *                       bool push_weights=False,             # <<<<<<<<<<<<<<
 *                       bool push_labels=False,
 *                       bool remove_common_affix=False,
 */
      __pyx_v_push_weights = ((bool)0);
    }
    if (values[3]) {
      __pyx_v_push_labels = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_push_labels == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3883, __pyx_L3_error)
    } else {

      /* "fstlib/cext/pywrapfst.pyx":3883
 *                       float delta=fst.kDelta,
 *                       bool push_weights=False,
 *                       bool push_labels=False,             # <<<<<<<<<<<<<<
 *                       bool remove_common_affix=False,
 *                       bool remove_total_weight=False,
 */
      __pyx_v_push_labels = ((bool)0);
    }
    if (values[4]) {
      __pyx_v_remove_common_affix = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_remove_common_affix == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3884, __pyx_L3_error)
    } else {

      /* "fstlib/cext/pywrapfst.pyx":3884
 *                       bool push_weights=False,
 *                       bool push_labels=False,
 *                       bool remove_common_affix=False,             # <<<<<<<<<<<<<<
 *                       bool remove_total_weight=False,
 *                       bool to_final=False):
 */
      __pyx_v_remove_common_affix = ((bool)0);
    }
    if (values[5]) {
      __pyx_v_remove_total_weight = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_remove_total_weight == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3885, __pyx_L3_error)
    } else {

      /* "fstlib/cext/pywrapfst.pyx":3885
 *                       bool push_labels=False,
 *                       bool remove_common_affix=False,
 *                       bool remove_total_weight=False,             # <<<<<<<<<<<<<<
 *                       bool to_final=False):
 *   """
 */
      __pyx_v_remove_total_weight = ((bool)0);
    }
    if (values[6]) {
      __pyx_v_to_final = __Pyx_PyObject_IsTrue(values[6]); if (unlikely((__pyx_v_to_final == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3886, __pyx_L3_error)
    } else {

      /* "fstlib/cext/pywrapfst.pyx":3886
 *                       bool remove_common_affix=False,
 *                       bool remove_total_weight=False,
 *                       bool to_final=False):             # <<<<<<<<<<<<<<
 *   """
 *   push(ifst, delta=0.0009765625, push_weights=False, push_labels=False,
 */
      __pyx_v_to_final = ((bool)0);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("push", 0, 1, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3880, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.push", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_6fstlib_4cext_9pywrapfst_Fst, 1, "ifst", 0))) __PYX_ERR(0, 3880, __pyx_L1_error)
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_44push(__pyx_self, __pyx_v_ifst, __pyx_v_delta, __pyx_v_push_weights, __pyx_v_push_labels, __pyx_v_remove_common_affix, __pyx_v_remove_total_weight, __pyx_v_to_final);

  /* "fstlib/cext/pywrapfst.pyx":3880
 * 
 * 
 * cpdef MutableFst push(Fst ifst,             # <<<<<<<<<<<<<<
 *                       float delta=fst.kDelta,
 *                       bool push_weights=False,
 */

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_44push(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst, float __pyx_v_delta, bool __pyx_v_push_weights, bool __pyx_v_push_labels, bool __pyx_v_remove_common_affix, bool __pyx_v_remove_total_weight, bool __pyx_v_to_final) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_push __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("push", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 6;
  __pyx_t_2.delta = __pyx_v_delta;
  __pyx_t_2.push_weights = __pyx_v_push_weights;
  __pyx_t_2.push_labels = __pyx_v_push_labels;
  __pyx_t_2.remove_common_affix = __pyx_v_remove_common_affix;
  __pyx_t_2.remove_total_weight = __pyx_v_remove_total_weight;
  __pyx_t_2.to_final = __pyx_v_to_final;
  __pyx_t_1 = ((PyObject *)__pyx_f_6fstlib_4cext_9pywrapfst_push(__pyx_v_ifst, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3880, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.push", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":3936
 * 
 * 
 * cpdef bool randequivalent(Fst ifst1,             # <<<<<<<<<<<<<<
 *                           Fst ifst2,
 *                           int32 npath=1,
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_47randequivalent(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static bool __pyx_f_6fstlib_4cext_9pywrapfst_randequivalent(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst1, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst2, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_randequivalent *__pyx_optional_args) {
  int32 __pyx_v_npath = ((int32)1);
  float __pyx_v_delta = __pyx_k__44;
  PyObject *__pyx_v_select = ((PyObject *)__pyx_n_u_uniform);
  int32 __pyx_v_max_length = __pyx_k__45;
  uint64 __pyx_v_seed = ((uint64)0);
  fst::script::RandArcSelection __pyx_v__select;
  std::unique_ptr<fst::RandGenOptions<fst::script::RandArcSelection> >  __pyx_v__opts;
  bool __pyx_r;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  fst::script::RandArcSelection __pyx_t_2;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("randequivalent", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_npath = __pyx_optional_args->npath;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_delta = __pyx_optional_args->delta;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_select = __pyx_optional_args->select;
          if (__pyx_optional_args->__pyx_n > 3) {
            __pyx_v_max_length = __pyx_optional_args->max_length;
            if (__pyx_optional_args->__pyx_n > 4) {
              __pyx_v_seed = __pyx_optional_args->seed;
            }
          }
        }
      }
    }
  }

  /* "fstlib/cext/pywrapfst.pyx":3969
 *     True if the two transducers satisfy the above condition, else False.
 *   """
 *   cdef fst.RandArcSelection _select = _get_rand_arc_selection(tostring(select))             # <<<<<<<<<<<<<<
 *   cdef unique_ptr[fst.RandGenOptions[fst.RandArcSelection]] _opts
 *   # The three trailing options will be ignored by RandEquivalent.
 */
  __pyx_t_1 = __pyx_f_6fstlib_4cext_9pywrapfst_tostring(__pyx_v_select); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3969, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_6fstlib_4cext_9pywrapfst__get_rand_arc_selection(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3969, __pyx_L1_error)
  __pyx_v__select = __pyx_t_2;

  /* "fstlib/cext/pywrapfst.pyx":3972
 *   cdef unique_ptr[fst.RandGenOptions[fst.RandArcSelection]] _opts
 *   # The three trailing options will be ignored by RandEquivalent.
 *   _opts.reset(             # <<<<<<<<<<<<<<
 *        new fst.RandGenOptions[fst.RandArcSelection](_select,
 *                                                     max_length,
 */
  __pyx_v__opts.reset(new fst::RandGenOptions<fst::script::RandArcSelection> (__pyx_v__select, __pyx_v_max_length, 1, 0, 0));

  /* "fstlib/cext/pywrapfst.pyx":3978
 *                                                     False,
 *                                                     False))
 *   if seed == 0:             # <<<<<<<<<<<<<<
 *     seed = time(NULL)
 *   return fst.RandEquivalent(deref(ifst1._fst),
 */
  __pyx_t_3 = ((__pyx_v_seed == 0) != 0);
  if (__pyx_t_3) {

    /* "fstlib/cext/pywrapfst.pyx":3979
 *                                                     False))
 *   if seed == 0:
 *     seed = time(NULL)             # <<<<<<<<<<<<<<
 *   return fst.RandEquivalent(deref(ifst1._fst),
 *                             deref(ifst2._fst),
 */
    __pyx_v_seed = time(NULL);

    /* "fstlib/cext/pywrapfst.pyx":3978
 *                                                     False,
 *                                                     False))
 *   if seed == 0:             # <<<<<<<<<<<<<<
 *     seed = time(NULL)
 *   return fst.RandEquivalent(deref(ifst1._fst),
 */
  }

  /* "fstlib/cext/pywrapfst.pyx":3980
 *   if seed == 0:
 *     seed = time(NULL)
 *   return fst.RandEquivalent(deref(ifst1._fst),             # <<<<<<<<<<<<<<
 *                             deref(ifst2._fst),
 *                             npath,
 */
  if (unlikely(((PyObject *)__pyx_v_ifst1) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 3980, __pyx_L1_error)
  }

  /* "fstlib/cext/pywrapfst.pyx":3981
 *     seed = time(NULL)
 *   return fst.RandEquivalent(deref(ifst1._fst),
 *                             deref(ifst2._fst),             # <<<<<<<<<<<<<<
 *                             npath,
 *                             deref(_opts),
 */
  if (unlikely(((PyObject *)__pyx_v_ifst2) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 3981, __pyx_L1_error)
  }

  /* "fstlib/cext/pywrapfst.pyx":3980
 *   if seed == 0:
 *     seed = time(NULL)
 *   return fst.RandEquivalent(deref(ifst1._fst),             # <<<<<<<<<<<<<<
 *                             deref(ifst2._fst),
 *                             npath,
 */
  __pyx_r = fst::script::RandEquivalent((*__pyx_v_ifst1->_fst), (*__pyx_v_ifst2->_fst), __pyx_v_npath, (*__pyx_v__opts), __pyx_v_delta, __pyx_v_seed);
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":3936
 * 
 * 
 * cpdef bool randequivalent(Fst ifst1,             # <<<<<<<<<<<<<<
 *                           Fst ifst2,
 *                           int32 npath=1,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.randequivalent", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_47randequivalent(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_46randequivalent[] = "\n  randequivalent(ifst1, ifst2, npath=1, delta=0.0009765625, select=\"uniform\",\n                 max_length=2147483647, seed=0)\n\n  Are two acceptors stochastically equivalent?\n\n  This operation tests whether two FSTs are equivalent by randomly generating\n  paths alternatively in each of the two FSTs. For each randomly generated path,\n  the algorithm computes for each of the two FSTs the sum of the weights of all\n  the successful paths sharing the same input and output labels as the randomly\n  generated path and checks that these two values are within `delta`.\n\n  Args:\n    ifst1: The first input FST.\n    ifst2: The second input FST.\n    npath: The number of random paths to generate.\n    delta: Comparison/quantization delta.\n    seed: An optional seed value for random path generation; if zero, the\n        current time and process ID is used.\n    select: A string matching a known random arc selection type; one of:\n        \"uniform\", \"log_prob\", \"fast_log_prob\".\n    max_length: The maximum length of each random path.\n\n  Returns:\n    True if the two transducers satisfy the above condition, else False.\n  ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_47randequivalent(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst1 = 0;
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst2 = 0;
  int32 __pyx_v_npath;
  float __pyx_v_delta;
  PyObject *__pyx_v_select = 0;
  int32 __pyx_v_max_length;
  uint64 __pyx_v_seed;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("randequivalent (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ifst1,&__pyx_n_s_ifst2,&__pyx_n_s_npath,&__pyx_n_s_delta,&__pyx_n_s_select,&__pyx_n_s_max_length,&__pyx_n_s_seed,0};
    PyObject* values[7] = {0,0,0,0,0,0,0};
    values[4] = ((PyObject *)__pyx_n_u_uniform);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ifst1)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ifst2)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("randequivalent", 0, 2, 7, 1); __PYX_ERR(0, 3936, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_npath);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_delta);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_select);
          if (value) { values[4] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_length);
          if (value) { values[5] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_seed);
          if (value) { values[6] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "randequivalent") < 0)) __PYX_ERR(0, 3936, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_ifst1 = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *)values[0]);
    __pyx_v_ifst2 = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *)values[1]);
    if (values[2]) {
      __pyx_v_npath = __Pyx_PyInt_As_int32_t(values[2]); if (unlikely((__pyx_v_npath == ((int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3938, __pyx_L3_error)
    } else {
      __pyx_v_npath = ((int32)1);
    }
    if (values[3]) {
      __pyx_v_delta = __pyx_PyFloat_AsFloat(values[3]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 3939, __pyx_L3_error)
    } else {
      __pyx_v_delta = __pyx_k__44;
    }
    __pyx_v_select = values[4];
    if (values[5]) {
      __pyx_v_max_length = __Pyx_PyInt_As_int32_t(values[5]); if (unlikely((__pyx_v_max_length == ((int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3941, __pyx_L3_error)
    } else {
      __pyx_v_max_length = __pyx_k__45;
    }
    if (values[6]) {
      __pyx_v_seed = __Pyx_PyInt_As_uint64_t(values[6]); if (unlikely((__pyx_v_seed == ((uint64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3942, __pyx_L3_error)
    } else {
      __pyx_v_seed = ((uint64)0);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("randequivalent", 0, 2, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3936, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.randequivalent", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst1), __pyx_ptype_6fstlib_4cext_9pywrapfst_Fst, 1, "ifst1", 0))) __PYX_ERR(0, 3936, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst2), __pyx_ptype_6fstlib_4cext_9pywrapfst_Fst, 1, "ifst2", 0))) __PYX_ERR(0, 3937, __pyx_L1_error)
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_46randequivalent(__pyx_self, __pyx_v_ifst1, __pyx_v_ifst2, __pyx_v_npath, __pyx_v_delta, __pyx_v_select, __pyx_v_max_length, __pyx_v_seed);

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_46randequivalent(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst1, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst2, int32 __pyx_v_npath, float __pyx_v_delta, PyObject *__pyx_v_select, int32 __pyx_v_max_length, uint64 __pyx_v_seed) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  bool __pyx_t_1;
  struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_randequivalent __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("randequivalent", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 5;
  __pyx_t_2.npath = __pyx_v_npath;
  __pyx_t_2.delta = __pyx_v_delta;
  __pyx_t_2.select = __pyx_v_select;
  __pyx_t_2.max_length = __pyx_v_max_length;
  __pyx_t_2.seed = __pyx_v_seed;
  __pyx_t_1 = __pyx_f_6fstlib_4cext_9pywrapfst_randequivalent(__pyx_v_ifst1, __pyx_v_ifst2, 0, &__pyx_t_2); if (unlikely(__pyx_t_1 == ((bool)-1) && PyErr_Occurred())) __PYX_ERR(0, 3936, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3936, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.randequivalent", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":3988
 * 
 * 
 * cpdef MutableFst randgen(Fst ifst,             # <<<<<<<<<<<<<<
 *                          int32 npath=1,
 *                          select="uniform",
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_49randgen(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_f_6fstlib_4cext_9pywrapfst_randgen(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_randgen *__pyx_optional_args) {
  int32 __pyx_v_npath = ((int32)1);
  PyObject *__pyx_v_select = ((PyObject *)__pyx_n_u_uniform);
  int32 __pyx_v_max_length = __pyx_k__46;

  /* "fstlib/cext/pywrapfst.pyx":3992
 *                          select="uniform",
 *                          int32 max_length=INT32_MAX,
 *                          bool weighted=False,             # <<<<<<<<<<<<<<
 *                          bool remove_total_weight=False,
 *                          uint64 seed=0):
 */
  bool __pyx_v_weighted = ((bool)0);

  /* "fstlib/cext/pywrapfst.pyx":3993
 *                          int32 max_length=INT32_MAX,
 *                          bool weighted=False,
 *                          bool remove_total_weight=False,             # <<<<<<<<<<<<<<
 *                          uint64 seed=0):
 *   """
 */
  bool __pyx_v_remove_total_weight = ((bool)0);
  uint64 __pyx_v_seed = ((uint64)0);
  fst::script::RandArcSelection __pyx_v__select;
  std::unique_ptr<fst::RandGenOptions<fst::script::RandArcSelection> >  __pyx_v__opts;
  std::unique_ptr<fst::script::VectorFstClass>  __pyx_v__tfst;
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  fst::script::RandArcSelection __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("randgen", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_npath = __pyx_optional_args->npath;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_select = __pyx_optional_args->select;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_max_length = __pyx_optional_args->max_length;
          if (__pyx_optional_args->__pyx_n > 3) {
            __pyx_v_weighted = __pyx_optional_args->weighted;
            if (__pyx_optional_args->__pyx_n > 4) {
              __pyx_v_remove_total_weight = __pyx_optional_args->remove_total_weight;
              if (__pyx_optional_args->__pyx_n > 5) {
                __pyx_v_seed = __pyx_optional_args->seed;
              }
            }
          }
        }
      }
    }
  }

  /* "fstlib/cext/pywrapfst.pyx":4024
 *     An FST containing one or more random paths.
 *   """
 *   cdef fst.RandArcSelection _select = _get_rand_arc_selection(tostring(select))             # <<<<<<<<<<<<<<
 *   cdef unique_ptr[fst.RandGenOptions[fst.RandArcSelection]] _opts
 *   _opts.reset(
 */
  __pyx_t_1 = __pyx_f_6fstlib_4cext_9pywrapfst_tostring(__pyx_v_select); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4024, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_6fstlib_4cext_9pywrapfst__get_rand_arc_selection(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4024, __pyx_L1_error)
  __pyx_v__select = __pyx_t_2;

  /* "fstlib/cext/pywrapfst.pyx":4026
 *   cdef fst.RandArcSelection _select = _get_rand_arc_selection(tostring(select))
 *   cdef unique_ptr[fst.RandGenOptions[fst.RandArcSelection]] _opts
 *   _opts.reset(             # <<<<<<<<<<<<<<
 *       new fst.RandGenOptions[fst.RandArcSelection](_select,
 *                                                    max_length,
 */
  __pyx_v__opts.reset(new fst::RandGenOptions<fst::script::RandArcSelection> (__pyx_v__select, __pyx_v_max_length, __pyx_v_npath, __pyx_v_weighted, __pyx_v_remove_total_weight));

  /* "fstlib/cext/pywrapfst.pyx":4033
 *                                                    remove_total_weight))
 *   cdef unique_ptr[fst.VectorFstClass] _tfst
 *   _tfst.reset(new fst.VectorFstClass(ifst.arc_type()))             # <<<<<<<<<<<<<<
 *   if seed == 0:
 *     seed = time(NULL)
 */
  if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "arc_type");
    __PYX_ERR(0, 4033, __pyx_L1_error)
  }
  __pyx_v__tfst.reset(new fst::script::VectorFstClass(((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_Fst *)__pyx_v_ifst->__pyx_vtab)->arc_type(__pyx_v_ifst, 0)));

  /* "fstlib/cext/pywrapfst.pyx":4034
 *   cdef unique_ptr[fst.VectorFstClass] _tfst
 *   _tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
 *   if seed == 0:             # <<<<<<<<<<<<<<
 *     seed = time(NULL)
 *   fst.RandGen(deref(ifst._fst), _tfst.get(), deref(_opts), seed)
 */
  __pyx_t_3 = ((__pyx_v_seed == 0) != 0);
  if (__pyx_t_3) {

    /* "fstlib/cext/pywrapfst.pyx":4035
 *   _tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
 *   if seed == 0:
 *     seed = time(NULL)             # <<<<<<<<<<<<<<
 *   fst.RandGen(deref(ifst._fst), _tfst.get(), deref(_opts), seed)
 *   return _init_MutableFst(_tfst.release())
 */
    __pyx_v_seed = time(NULL);

    /* "fstlib/cext/pywrapfst.pyx":4034
 *   cdef unique_ptr[fst.VectorFstClass] _tfst
 *   _tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
 *   if seed == 0:             # <<<<<<<<<<<<<<
 *     seed = time(NULL)
 *   fst.RandGen(deref(ifst._fst), _tfst.get(), deref(_opts), seed)
 */
  }

  /* "fstlib/cext/pywrapfst.pyx":4036
 *   if seed == 0:
 *     seed = time(NULL)
 *   fst.RandGen(deref(ifst._fst), _tfst.get(), deref(_opts), seed)             # <<<<<<<<<<<<<<
 *   return _init_MutableFst(_tfst.release())
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 4036, __pyx_L1_error)
  }
  fst::script::RandGen((*__pyx_v_ifst->_fst), __pyx_v__tfst.get(), (*__pyx_v__opts), __pyx_v_seed);

  /* "fstlib/cext/pywrapfst.pyx":4037
 *     seed = time(NULL)
 *   fst.RandGen(deref(ifst._fst), _tfst.get(), deref(_opts), seed)
 *   return _init_MutableFst(_tfst.release())             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_4 = ((PyObject *)__pyx_f_6fstlib_4cext_9pywrapfst__init_MutableFst(__pyx_v__tfst.release())); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4037, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_r = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *)__pyx_t_4);
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":3988
 * 
 * 
 * cpdef MutableFst randgen(Fst ifst,             # <<<<<<<<<<<<<<
 *                          int32 npath=1,
 *                          select="uniform",
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.randgen", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_49randgen(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_48randgen[] = "\n  randgen(ifst, npath=1, seed=0, select=\"uniform\", max_length=2147483647,\n          weighted=False, remove_total_weight=False)\n\n  Randomly generate successful paths in an FST.\n\n  This operation randomly generates a set of successful paths in the input FST.\n  This relies on a mechanism for selecting arcs, specified using the `select`\n  argument. The default selector, \"uniform\", randomly selects a transition\n  using a uniform distribution. The \"log_prob\" selector randomly selects a\n  transition w.r.t. the weights treated as negative log probabilities after\n  normalizing for the total weight leaving the state. In all cases, finality is\n  treated as a transition to a super-final state.\n\n  Args:\n    ifst: The input FST.\n    npath: The number of random paths to generate.\n    seed: An optional seed value for random path generation; if zero, the\n        current time and process ID is used.\n    select: A string matching a known random arc selection type; one of:\n        \"uniform\", \"log_prob\", \"fast_log_prob\".\n    max_length: The maximum length of each random path.\n    weighted: Should the output be weighted by path count?\n    remove_total_weight: Should the total weight be removed (ignored when\n        `weighted` is False)?\n\n  Returns:\n    An FST containing one or more random paths.\n  ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_49randgen(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst = 0;
  int32 __pyx_v_npath;
  PyObject *__pyx_v_select = 0;
  int32 __pyx_v_max_length;
  bool __pyx_v_weighted;
  bool __pyx_v_remove_total_weight;
  uint64 __pyx_v_seed;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("randgen (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ifst,&__pyx_n_s_npath,&__pyx_n_s_select,&__pyx_n_s_max_length,&__pyx_n_s_weighted,&__pyx_n_s_remove_total_weight,&__pyx_n_s_seed,0};
    PyObject* values[7] = {0,0,0,0,0,0,0};
    values[2] = ((PyObject *)__pyx_n_u_uniform);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ifst)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_npath);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_select);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_length);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_weighted);
          if (value) { values[4] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_remove_total_weight);
          if (value) { values[5] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_seed);
          if (value) { values[6] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "randgen") < 0)) __PYX_ERR(0, 3988, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_ifst = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *)values[0]);
    if (values[1]) {
      __pyx_v_npath = __Pyx_PyInt_As_int32_t(values[1]); if (unlikely((__pyx_v_npath == ((int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3989, __pyx_L3_error)
    } else {
      __pyx_v_npath = ((int32)1);
    }
    __pyx_v_select = values[2];
    if (values[3]) {
      __pyx_v_max_length = __Pyx_PyInt_As_int32_t(values[3]); if (unlikely((__pyx_v_max_length == ((int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3991, __pyx_L3_error)
    } else {
      __pyx_v_max_length = __pyx_k__46;
    }
    if (values[4]) {
      __pyx_v_weighted = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_weighted == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3992, __pyx_L3_error)
    } else {

      /* "fstlib/cext/pywrapfst.pyx":3992
 *                          select="uniform",
 *                          int32 max_length=INT32_MAX,
 *                          bool weighted=False,             # <<<<<<<<<<<<<<
 *                          bool remove_total_weight=False,
 *                          uint64 seed=0):
 */
      __pyx_v_weighted = ((bool)0);
    }
    if (values[5]) {
      __pyx_v_remove_total_weight = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_remove_total_weight == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3993, __pyx_L3_error)
    } else {

      /* "fstlib/cext/pywrapfst.pyx":3993
 *                          int32 max_length=INT32_MAX,
 *                          bool weighted=False,
 *                          bool remove_total_weight=False,             # <<<<<<<<<<<<<<
 *                          uint64 seed=0):
 *   """
 */
      __pyx_v_remove_total_weight = ((bool)0);
    }
    if (values[6]) {
      __pyx_v_seed = __Pyx_PyInt_As_uint64_t(values[6]); if (unlikely((__pyx_v_seed == ((uint64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3994, __pyx_L3_error)
    } else {
      __pyx_v_seed = ((uint64)0);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("randgen", 0, 1, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3988, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.randgen", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_6fstlib_4cext_9pywrapfst_Fst, 1, "ifst", 0))) __PYX_ERR(0, 3988, __pyx_L1_error)
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_48randgen(__pyx_self, __pyx_v_ifst, __pyx_v_npath, __pyx_v_select, __pyx_v_max_length, __pyx_v_weighted, __pyx_v_remove_total_weight, __pyx_v_seed);

  /* "fstlib/cext/pywrapfst.pyx":3988
 * 
 * 
 * cpdef MutableFst randgen(Fst ifst,             # <<<<<<<<<<<<<<
 *                          int32 npath=1,
 *                          select="uniform",
 */

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_48randgen(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst, int32 __pyx_v_npath, PyObject *__pyx_v_select, int32 __pyx_v_max_length, bool __pyx_v_weighted, bool __pyx_v_remove_total_weight, uint64 __pyx_v_seed) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_randgen __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("randgen", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 6;
  __pyx_t_2.npath = __pyx_v_npath;
  __pyx_t_2.select = __pyx_v_select;
  __pyx_t_2.max_length = __pyx_v_max_length;
  __pyx_t_2.remove_total_weight = __pyx_v_weighted;
  __pyx_t_2.weighted = __pyx_v_remove_total_weight;
  __pyx_t_2.seed = __pyx_v_seed;
  __pyx_t_1 = ((PyObject *)__pyx_f_6fstlib_4cext_9pywrapfst_randgen(__pyx_v_ifst, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3988, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.randgen", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":4040
 * 
 * 
 * cpdef MutableFst replace(pairs,             # <<<<<<<<<<<<<<
 *                          call_arc_labeling="input",
 *                          return_arc_labeling="neither",
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_51replace(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_f_6fstlib_4cext_9pywrapfst_replace(PyObject *__pyx_v_pairs, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_replace *__pyx_optional_args) {
  PyObject *__pyx_v_call_arc_labeling = ((PyObject *)__pyx_n_u_input);
  PyObject *__pyx_v_return_arc_labeling = ((PyObject *)__pyx_n_u_neither);

  /* "fstlib/cext/pywrapfst.pyx":4043
 *                          call_arc_labeling="input",
 *                          return_arc_labeling="neither",
 *                          bool epsilon_on_replace=False,             # <<<<<<<<<<<<<<
 *                          int64 return_label=0):
 *   """
 */
  bool __pyx_v_epsilon_on_replace = ((bool)0);
  int64 __pyx_v_return_label = ((int64)0);
  int64 __pyx_v__label;
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v__pfst = 0;
  std::vector<__pyx_t_10cpywrapfst_LabelFstClassPair>  __pyx_v__pairs;
  std::unique_ptr<fst::script::VectorFstClass>  __pyx_v__tfst;
  enum fst::ReplaceLabelType __pyx_v__cal;
  enum fst::ReplaceLabelType __pyx_v__ral;
  std::unique_ptr<fst::script::ReplaceOptions>  __pyx_v__opts;
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__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 *);
  int64 __pyx_t_9;
  __pyx_t_10cpywrapfst_LabelFstClassPair __pyx_t_10;
  std::string __pyx_t_11;
  enum fst::ReplaceLabelType __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("replace", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_call_arc_labeling = __pyx_optional_args->call_arc_labeling;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_return_arc_labeling = __pyx_optional_args->return_arc_labeling;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_epsilon_on_replace = __pyx_optional_args->epsilon_on_replace;
          if (__pyx_optional_args->__pyx_n > 3) {
            __pyx_v_return_label = __pyx_optional_args->return_label;
          }
        }
      }
    }
  }

  /* "fstlib/cext/pywrapfst.pyx":4084
 *   cdef Fst _pfst
 *   cdef vector[fst.LabelFstClassPair] _pairs
 *   for (_label, _pfst) in pairs:             # <<<<<<<<<<<<<<
 *       _pairs.push_back(fst.LabelFstClassPair(_label, _pfst._fst.get()))
 *   cdef unique_ptr[fst.VectorFstClass] _tfst
 */
  if (likely(PyList_CheckExact(__pyx_v_pairs)) || PyTuple_CheckExact(__pyx_v_pairs)) {
    __pyx_t_1 = __pyx_v_pairs; __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_pairs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4084, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4084, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 4084, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4084, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 4084, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4084, __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, 4084, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
      PyObject* sequence = __pyx_t_4;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 4084, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_5 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_6 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      #else
      __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4084, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4084, __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(0, 4084, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
      index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_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(0, 4084, __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(0, 4084, __pyx_L1_error)
      __pyx_L6_unpacking_done:;
    }
    __pyx_t_9 = __Pyx_PyInt_As_int64_t(__pyx_t_5); if (unlikely((__pyx_t_9 == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4084, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_6fstlib_4cext_9pywrapfst_Fst))))) __PYX_ERR(0, 4084, __pyx_L1_error)
    __pyx_v__label = __pyx_t_9;
    __Pyx_XDECREF_SET(__pyx_v__pfst, ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *)__pyx_t_6));
    __pyx_t_6 = 0;

    /* "fstlib/cext/pywrapfst.pyx":4085
 *   cdef vector[fst.LabelFstClassPair] _pairs
 *   for (_label, _pfst) in pairs:
 *       _pairs.push_back(fst.LabelFstClassPair(_label, _pfst._fst.get()))             # <<<<<<<<<<<<<<
 *   cdef unique_ptr[fst.VectorFstClass] _tfst
 *   _tfst.reset(new fst.VectorFstClass(_pairs[0].second.ArcType()))
 */
    if (unlikely(((PyObject *)__pyx_v__pfst) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
      __PYX_ERR(0, 4085, __pyx_L1_error)
    }
    try {
      __pyx_t_10 = __pyx_t_10cpywrapfst_LabelFstClassPair(__pyx_v__label, __pyx_v__pfst->_fst.get());
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(0, 4085, __pyx_L1_error)
    }
    try {
      __pyx_v__pairs.push_back(__pyx_t_10);
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(0, 4085, __pyx_L1_error)
    }

    /* "fstlib/cext/pywrapfst.pyx":4084
 *   cdef Fst _pfst
 *   cdef vector[fst.LabelFstClassPair] _pairs
 *   for (_label, _pfst) in pairs:             # <<<<<<<<<<<<<<
 *       _pairs.push_back(fst.LabelFstClassPair(_label, _pfst._fst.get()))
 *   cdef unique_ptr[fst.VectorFstClass] _tfst
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "fstlib/cext/pywrapfst.pyx":4087
 *       _pairs.push_back(fst.LabelFstClassPair(_label, _pfst._fst.get()))
 *   cdef unique_ptr[fst.VectorFstClass] _tfst
 *   _tfst.reset(new fst.VectorFstClass(_pairs[0].second.ArcType()))             # <<<<<<<<<<<<<<
 *   cdef fst.ReplaceLabelType _cal = _get_replace_label_type(
 *       tostring(call_arc_labeling),
 */
  __pyx_v__tfst.reset(new fst::script::VectorFstClass((__pyx_v__pairs[0]).second->ArcType()));

  /* "fstlib/cext/pywrapfst.pyx":4089
 *   _tfst.reset(new fst.VectorFstClass(_pairs[0].second.ArcType()))
 *   cdef fst.ReplaceLabelType _cal = _get_replace_label_type(
 *       tostring(call_arc_labeling),             # <<<<<<<<<<<<<<
 *       epsilon_on_replace)
 *   cdef fst.ReplaceLabelType _ral = _get_replace_label_type(
 */
  __pyx_t_11 = __pyx_f_6fstlib_4cext_9pywrapfst_tostring(__pyx_v_call_arc_labeling); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4089, __pyx_L1_error)

  /* "fstlib/cext/pywrapfst.pyx":4088
 *   cdef unique_ptr[fst.VectorFstClass] _tfst
 *   _tfst.reset(new fst.VectorFstClass(_pairs[0].second.ArcType()))
 *   cdef fst.ReplaceLabelType _cal = _get_replace_label_type(             # <<<<<<<<<<<<<<
 *       tostring(call_arc_labeling),
 *       epsilon_on_replace)
 */
  __pyx_t_12 = __pyx_f_6fstlib_4cext_9pywrapfst__get_replace_label_type(__pyx_t_11, __pyx_v_epsilon_on_replace); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4088, __pyx_L1_error)
  __pyx_v__cal = __pyx_t_12;

  /* "fstlib/cext/pywrapfst.pyx":4092
 *       epsilon_on_replace)
 *   cdef fst.ReplaceLabelType _ral = _get_replace_label_type(
 *       tostring(return_arc_labeling),             # <<<<<<<<<<<<<<
 *       epsilon_on_replace)
 *   cdef unique_ptr[fst.ReplaceOptions] _opts
 */
  __pyx_t_11 = __pyx_f_6fstlib_4cext_9pywrapfst_tostring(__pyx_v_return_arc_labeling); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4092, __pyx_L1_error)

  /* "fstlib/cext/pywrapfst.pyx":4091
 *       tostring(call_arc_labeling),
 *       epsilon_on_replace)
 *   cdef fst.ReplaceLabelType _ral = _get_replace_label_type(             # <<<<<<<<<<<<<<
 *       tostring(return_arc_labeling),
 *       epsilon_on_replace)
 */
  __pyx_t_12 = __pyx_f_6fstlib_4cext_9pywrapfst__get_replace_label_type(__pyx_t_11, __pyx_v_epsilon_on_replace); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4091, __pyx_L1_error)
  __pyx_v__ral = __pyx_t_12;

  /* "fstlib/cext/pywrapfst.pyx":4095
 *       epsilon_on_replace)
 *   cdef unique_ptr[fst.ReplaceOptions] _opts
 *   _opts.reset(new fst.ReplaceOptions(_pairs[0].first, _cal, _ral, return_label))             # <<<<<<<<<<<<<<
 *   fst.Replace(_pairs, _tfst.get(), deref(_opts))
 *   return _init_MutableFst(_tfst.release())
 */
  __pyx_v__opts.reset(new fst::script::ReplaceOptions((__pyx_v__pairs[0]).first, __pyx_v__cal, __pyx_v__ral, __pyx_v_return_label));

  /* "fstlib/cext/pywrapfst.pyx":4096
 *   cdef unique_ptr[fst.ReplaceOptions] _opts
 *   _opts.reset(new fst.ReplaceOptions(_pairs[0].first, _cal, _ral, return_label))
 *   fst.Replace(_pairs, _tfst.get(), deref(_opts))             # <<<<<<<<<<<<<<
 *   return _init_MutableFst(_tfst.release())
 * 
 */
  fst::script::Replace(__pyx_v__pairs, __pyx_v__tfst.get(), (*__pyx_v__opts));

  /* "fstlib/cext/pywrapfst.pyx":4097
 *   _opts.reset(new fst.ReplaceOptions(_pairs[0].first, _cal, _ral, return_label))
 *   fst.Replace(_pairs, _tfst.get(), deref(_opts))
 *   return _init_MutableFst(_tfst.release())             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)__pyx_f_6fstlib_4cext_9pywrapfst__init_MutableFst(__pyx_v__tfst.release())); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4097, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":4040
 * 
 * 
 * cpdef MutableFst replace(pairs,             # <<<<<<<<<<<<<<
 *                          call_arc_labeling="input",
 *                          return_arc_labeling="neither",
 */

  /* 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_AddTraceback("fstlib.cext.pywrapfst.replace", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v__pfst);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_51replace(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_50replace[] = "\n  replace(pairs, call_arc_labeling=\"input\", return_arc_labeling=\"neither\",\n          epsilon_on_replace=False, return_label=0)\n\n  Recursively replaces arcs in the FST with other FST(s).\n\n  This operation performs the dynamic replacement of arcs in one FST with\n  another FST, allowing the definition of FSTs analogous to RTNs. It takes as\n  input a set of pairs of a set of pairs formed by a non-terminal label and\n  its corresponding FST, and a label identifying the root FST in that set.\n  The resulting FST is obtained by taking the root FST and recursively replacing\n  each arc having a nonterminal as output label by its corresponding FST. More\n  precisely, an arc from state s to state d with (nonterminal) output label n in\n  this FST is replaced by redirecting this \"call\" arc to the initial state of a\n  copy F of the FST for n, and adding \"return\" arcs from each final state of F\n  to d. Optional arguments control how the call and return arcs are labeled; by\n  default, the only non-epsilon label is placed on the call arc.\n\n  Args:\n\n    pairs: An iterable of (nonterminal label, FST) pairs, where the former is an\n        unsigned integer and the latter is an Fst instance.\n    call_arc_labeling: A string indicating which call arc labels should be\n        non-epsilon. One of: \"input\" (default), \"output\", \"both\", \"neither\".\n        This value is set to \"neither\" if epsilon_on_replace is True.\n    return_arc_labeling: A string indicating which return arc labels should be\n        non-epsilon. One of: \"input\", \"output\", \"both\", \"neither\" (default).\n        This value is set to \"neither\" if epsilon_on_replace is True.\n    epsilon_on_replace: Should call and return arcs be epsilon arcs? If True,\n        this effectively overrides call_arc_labeling and return_arc_labeling,\n        setting both to \"neither\".\n    return_label: The integer label for return arcs.\n\n  Returns:\n    An FST resulting from expanding the input"" RTN.\n  ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_51replace(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_pairs = 0;
  PyObject *__pyx_v_call_arc_labeling = 0;
  PyObject *__pyx_v_return_arc_labeling = 0;
  bool __pyx_v_epsilon_on_replace;
  int64 __pyx_v_return_label;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("replace (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pairs,&__pyx_n_s_call_arc_labeling,&__pyx_n_s_return_arc_labeling,&__pyx_n_s_epsilon_on_replace,&__pyx_n_s_return_label,0};
    PyObject* values[5] = {0,0,0,0,0};
    values[1] = ((PyObject *)__pyx_n_u_input);
    values[2] = ((PyObject *)__pyx_n_u_neither);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pairs)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_call_arc_labeling);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_return_arc_labeling);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_epsilon_on_replace);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_return_label);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "replace") < 0)) __PYX_ERR(0, 4040, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_pairs = values[0];
    __pyx_v_call_arc_labeling = values[1];
    __pyx_v_return_arc_labeling = values[2];
    if (values[3]) {
      __pyx_v_epsilon_on_replace = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_epsilon_on_replace == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4043, __pyx_L3_error)
    } else {

      /* "fstlib/cext/pywrapfst.pyx":4043
 *                          call_arc_labeling="input",
 *                          return_arc_labeling="neither",
 *                          bool epsilon_on_replace=False,             # <<<<<<<<<<<<<<
 *                          int64 return_label=0):
 *   """
 */
      __pyx_v_epsilon_on_replace = ((bool)0);
    }
    if (values[4]) {
      __pyx_v_return_label = __Pyx_PyInt_As_int64_t(values[4]); if (unlikely((__pyx_v_return_label == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4044, __pyx_L3_error)
    } else {
      __pyx_v_return_label = ((int64)0);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("replace", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4040, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.replace", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_50replace(__pyx_self, __pyx_v_pairs, __pyx_v_call_arc_labeling, __pyx_v_return_arc_labeling, __pyx_v_epsilon_on_replace, __pyx_v_return_label);

  /* "fstlib/cext/pywrapfst.pyx":4040
 * 
 * 
 * cpdef MutableFst replace(pairs,             # <<<<<<<<<<<<<<
 *                          call_arc_labeling="input",
 *                          return_arc_labeling="neither",
 */

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_50replace(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_pairs, PyObject *__pyx_v_call_arc_labeling, PyObject *__pyx_v_return_arc_labeling, bool __pyx_v_epsilon_on_replace, int64 __pyx_v_return_label) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_replace __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("replace", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 4;
  __pyx_t_2.call_arc_labeling = __pyx_v_call_arc_labeling;
  __pyx_t_2.return_arc_labeling = __pyx_v_return_arc_labeling;
  __pyx_t_2.epsilon_on_replace = __pyx_v_epsilon_on_replace;
  __pyx_t_2.return_label = __pyx_v_return_label;
  __pyx_t_1 = ((PyObject *)__pyx_f_6fstlib_4cext_9pywrapfst_replace(__pyx_v_pairs, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4040, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.replace", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":4100
 * 
 * 
 * cpdef MutableFst reverse(Fst ifst, bool require_superinitial=True):             # <<<<<<<<<<<<<<
 *   """
 *   reverse(ifst, require_superinitial=True)
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_53reverse(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_f_6fstlib_4cext_9pywrapfst_reverse(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_reverse *__pyx_optional_args) {
  bool __pyx_v_require_superinitial = ((bool)1);
  std::unique_ptr<fst::script::VectorFstClass>  __pyx_v__tfst;
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__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("reverse", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_require_superinitial = __pyx_optional_args->require_superinitial;
    }
  }

  /* "fstlib/cext/pywrapfst.pyx":4120
 *   """
 *   cdef unique_ptr[fst.VectorFstClass] _tfst
 *   _tfst.reset(new fst.VectorFstClass(ifst.arc_type()))             # <<<<<<<<<<<<<<
 *   fst.Reverse(deref(ifst._fst), _tfst.get(), require_superinitial)
 *   return _init_MutableFst(_tfst.release())
 */
  if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "arc_type");
    __PYX_ERR(0, 4120, __pyx_L1_error)
  }
  __pyx_v__tfst.reset(new fst::script::VectorFstClass(((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_Fst *)__pyx_v_ifst->__pyx_vtab)->arc_type(__pyx_v_ifst, 0)));

  /* "fstlib/cext/pywrapfst.pyx":4121
 *   cdef unique_ptr[fst.VectorFstClass] _tfst
 *   _tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
 *   fst.Reverse(deref(ifst._fst), _tfst.get(), require_superinitial)             # <<<<<<<<<<<<<<
 *   return _init_MutableFst(_tfst.release())
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 4121, __pyx_L1_error)
  }
  fst::script::Reverse((*__pyx_v_ifst->_fst), __pyx_v__tfst.get(), __pyx_v_require_superinitial);

  /* "fstlib/cext/pywrapfst.pyx":4122
 *   _tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
 *   fst.Reverse(deref(ifst._fst), _tfst.get(), require_superinitial)
 *   return _init_MutableFst(_tfst.release())             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)__pyx_f_6fstlib_4cext_9pywrapfst__init_MutableFst(__pyx_v__tfst.release())); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4122, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":4100
 * 
 * 
 * cpdef MutableFst reverse(Fst ifst, bool require_superinitial=True):             # <<<<<<<<<<<<<<
 *   """
 *   reverse(ifst, require_superinitial=True)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.reverse", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_53reverse(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_52reverse[] = "\n  reverse(ifst, require_superinitial=True)\n\n  Constructively reverses an FST's transduction.\n\n  This operation reverses an FST. If A transduces string x to y with weight a,\n  then the reverse of A transduces the reverse of x to the reverse of y with\n  weight a.Reverse(). (Typically, a = a.Reverse() and Arc = RevArc, e.g.,\n  TropicalWeight and LogWeight.) In general, e.g., when the weights only form a\n  left or right semiring, the output arc type must match the input arc type.\n\n  Args:\n    ifst: The input FST.\n    require_superinitial: Should a superinitial state be created?\n\n  Returns:\n    A reversed FST.\n  ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_53reverse(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst = 0;
  bool __pyx_v_require_superinitial;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("reverse (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ifst,&__pyx_n_s_require_superinitial,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ifst)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_require_superinitial);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "reverse") < 0)) __PYX_ERR(0, 4100, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_ifst = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *)values[0]);
    if (values[1]) {
      __pyx_v_require_superinitial = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_require_superinitial == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4100, __pyx_L3_error)
    } else {
      __pyx_v_require_superinitial = ((bool)1);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("reverse", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4100, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.reverse", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_6fstlib_4cext_9pywrapfst_Fst, 1, "ifst", 0))) __PYX_ERR(0, 4100, __pyx_L1_error)
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_52reverse(__pyx_self, __pyx_v_ifst, __pyx_v_require_superinitial);

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_52reverse(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst, bool __pyx_v_require_superinitial) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_reverse __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("reverse", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.require_superinitial = __pyx_v_require_superinitial;
  __pyx_t_1 = ((PyObject *)__pyx_f_6fstlib_4cext_9pywrapfst_reverse(__pyx_v_ifst, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4100, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.reverse", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":4128
 * 
 * 
 * cdef void _shortestdistance(Fst ifst,             # <<<<<<<<<<<<<<
 *                             vector[fst.WeightClass] *distance,
 *                             float delta=fst.kShortestDelta,
 */

static void __pyx_f_6fstlib_4cext_9pywrapfst__shortestdistance(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst, std::vector<fst::script::WeightClass>  *__pyx_v_distance, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst__shortestdistance *__pyx_optional_args) {
  float __pyx_v_delta = __pyx_k__47;
  int64 __pyx_v_nstate = __pyx_k__48;
  PyObject *__pyx_v_queue_type = ((PyObject *)__pyx_n_u_auto);

  /* "fstlib/cext/pywrapfst.pyx":4133
 *                             int64 nstate=fst.kNoStateId,
 *                             queue_type="auto",
 *                             bool reverse=False) except *:             # <<<<<<<<<<<<<<
 *   cdef unique_ptr[fst.ShortestDistanceOptions] _opts
 *   if reverse:
 */
  bool __pyx_v_reverse = ((bool)0);
  std::unique_ptr<fst::script::ShortestDistanceOptions>  __pyx_v__opts;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  std::string __pyx_t_2;
  enum fst::QueueType __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_shortestdistance", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_delta = __pyx_optional_args->delta;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_nstate = __pyx_optional_args->nstate;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_queue_type = __pyx_optional_args->queue_type;
          if (__pyx_optional_args->__pyx_n > 3) {
            __pyx_v_reverse = __pyx_optional_args->reverse;
          }
        }
      }
    }
  }

  /* "fstlib/cext/pywrapfst.pyx":4135
 *                             bool reverse=False) except *:
 *   cdef unique_ptr[fst.ShortestDistanceOptions] _opts
 *   if reverse:             # <<<<<<<<<<<<<<
 *     # Only the simpler signature supports shortest distance to final states;
 *     # `nstate` and `queue_type` arguments are ignored.
 */
  __pyx_t_1 = (__pyx_v_reverse != 0);
  if (__pyx_t_1) {

    /* "fstlib/cext/pywrapfst.pyx":4138
 *     # Only the simpler signature supports shortest distance to final states;
 *     # `nstate` and `queue_type` arguments are ignored.
 *     fst.ShortestDistance(deref(ifst._fst), distance, True, delta)             # <<<<<<<<<<<<<<
 *   else:
 *     _opts.reset(
 */
    if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
      __PYX_ERR(0, 4138, __pyx_L1_error)
    }
    fst::script::ShortestDistance((*__pyx_v_ifst->_fst), __pyx_v_distance, 1, __pyx_v_delta);

    /* "fstlib/cext/pywrapfst.pyx":4135
 *                             bool reverse=False) except *:
 *   cdef unique_ptr[fst.ShortestDistanceOptions] _opts
 *   if reverse:             # <<<<<<<<<<<<<<
 *     # Only the simpler signature supports shortest distance to final states;
 *     # `nstate` and `queue_type` arguments are ignored.
 */
    goto __pyx_L3;
  }

  /* "fstlib/cext/pywrapfst.pyx":4140
 *     fst.ShortestDistance(deref(ifst._fst), distance, True, delta)
 *   else:
 *     _opts.reset(             # <<<<<<<<<<<<<<
 *         new fst.ShortestDistanceOptions(_get_queue_type(tostring(queue_type)),
 *                                         fst.ArcFilterType.ANY_ARC_FILTER,
 */
  /*else*/ {

    /* "fstlib/cext/pywrapfst.pyx":4141
 *   else:
 *     _opts.reset(
 *         new fst.ShortestDistanceOptions(_get_queue_type(tostring(queue_type)),             # <<<<<<<<<<<<<<
 *                                         fst.ArcFilterType.ANY_ARC_FILTER,
 *                                         nstate,
 */
    __pyx_t_2 = __pyx_f_6fstlib_4cext_9pywrapfst_tostring(__pyx_v_queue_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4141, __pyx_L1_error)
    __pyx_t_3 = __pyx_f_6fstlib_4cext_9pywrapfst__get_queue_type(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4141, __pyx_L1_error)

    /* "fstlib/cext/pywrapfst.pyx":4140
 *     fst.ShortestDistance(deref(ifst._fst), distance, True, delta)
 *   else:
 *     _opts.reset(             # <<<<<<<<<<<<<<
 *         new fst.ShortestDistanceOptions(_get_queue_type(tostring(queue_type)),
 *                                         fst.ArcFilterType.ANY_ARC_FILTER,
 */
    __pyx_v__opts.reset(new fst::script::ShortestDistanceOptions(__pyx_t_3, fst::script::ArcFilterType::ANY, __pyx_v_nstate, __pyx_v_delta));

    /* "fstlib/cext/pywrapfst.pyx":4145
 *                                         nstate,
 *                                         delta))
 *     fst.ShortestDistance(deref(ifst._fst), distance, deref(_opts))             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
      __PYX_ERR(0, 4145, __pyx_L1_error)
    }
    fst::script::ShortestDistance((*__pyx_v_ifst->_fst), __pyx_v_distance, (*__pyx_v__opts));
  }
  __pyx_L3:;

  /* "fstlib/cext/pywrapfst.pyx":4128
 * 
 * 
 * cdef void _shortestdistance(Fst ifst,             # <<<<<<<<<<<<<<
 *                             vector[fst.WeightClass] *distance,
 *                             float delta=fst.kShortestDelta,
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst._shortestdistance", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "fstlib/cext/pywrapfst.pyx":4148
 * 
 * 
 * def shortestdistance(Fst ifst,             # <<<<<<<<<<<<<<
 *                      float delta=fst.kShortestDelta,
 *                      int64 nstate=fst.kNoStateId,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_55shortestdistance(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_54shortestdistance[] = "\n  shortestdistance(ifst, delta=1e-6, nstate=NO_STATE_ID,\n                   queue_type=\"auto\", reverse=False)\n\n  Compute the shortest distance from the initial or final state.\n\n  This operation computes the shortest distance from the initial state (when\n  `reverse` is False) or from every state to the final state (when `reverse` is\n  True). The shortest distance from p to q is the \\otimes-sum of the weights of\n  all the paths between p and q. The weights must be right (if `reverse` is\n  False) or left (if `reverse` is True) distributive, and k-closed (i.e., 1\n  \\otimes x \\otimes x^2 \\otimes ... \\otimes x^{k + 1} = 1 \\otimes x \\otimes x^2\n  \\otimes ... \\otimes x^k; e.g., TropicalWeight).\n\n  Args:\n    ifst: The input FST.\n    delta: Comparison/quantization delta.\n    nstate: State number threshold (ignored if `reverse` is True).\n    queue_type: A string matching a known queue type; one of: \"auto\", \"fifo\",\n        \"lifo\", \"shortest\", \"state\", \"top\" (ignored if `reverse` is True).\n    reverse: Should the reverse distance (from each state to the final state)\n        be computed?\n\n  Returns:\n    A list of Weight objects representing the shortest distance for each state.\n  ";
static PyMethodDef __pyx_mdef_6fstlib_4cext_9pywrapfst_55shortestdistance = {"shortestdistance", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6fstlib_4cext_9pywrapfst_55shortestdistance, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6fstlib_4cext_9pywrapfst_54shortestdistance};
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_55shortestdistance(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst = 0;
  float __pyx_v_delta;
  int64 __pyx_v_nstate;
  PyObject *__pyx_v_queue_type = 0;
  bool __pyx_v_reverse;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("shortestdistance (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ifst,&__pyx_n_s_delta,&__pyx_n_s_nstate,&__pyx_n_s_queue_type,&__pyx_n_s_reverse,0};
    PyObject* values[5] = {0,0,0,0,0};
    values[3] = ((PyObject *)__pyx_n_u_auto);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ifst)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_delta);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nstate);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_queue_type);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_reverse);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "shortestdistance") < 0)) __PYX_ERR(0, 4148, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_ifst = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *)values[0]);
    if (values[1]) {
      __pyx_v_delta = __pyx_PyFloat_AsFloat(values[1]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 4149, __pyx_L3_error)
    } else {
      __pyx_v_delta = __pyx_k__49;
    }
    if (values[2]) {
      __pyx_v_nstate = __Pyx_PyInt_As_int64_t(values[2]); if (unlikely((__pyx_v_nstate == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4150, __pyx_L3_error)
    } else {
      __pyx_v_nstate = __pyx_k__50;
    }
    __pyx_v_queue_type = values[3];
    if (values[4]) {
      __pyx_v_reverse = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_reverse == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4152, __pyx_L3_error)
    } else {

      /* "fstlib/cext/pywrapfst.pyx":4152
 *                      int64 nstate=fst.kNoStateId,
 *                      queue_type="auto",
 *                      bool reverse=False):             # <<<<<<<<<<<<<<
 *   """
 *   shortestdistance(ifst, delta=1e-6, nstate=NO_STATE_ID,
 */
      __pyx_v_reverse = ((bool)0);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("shortestdistance", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4148, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.shortestdistance", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_6fstlib_4cext_9pywrapfst_Fst, 1, "ifst", 0))) __PYX_ERR(0, 4148, __pyx_L1_error)
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_54shortestdistance(__pyx_self, __pyx_v_ifst, __pyx_v_delta, __pyx_v_nstate, __pyx_v_queue_type, __pyx_v_reverse);

  /* "fstlib/cext/pywrapfst.pyx":4148
 * 
 * 
 * def shortestdistance(Fst ifst,             # <<<<<<<<<<<<<<
 *                      float delta=fst.kShortestDelta,
 *                      int64 nstate=fst.kNoStateId,
 */

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_54shortestdistance(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst, float __pyx_v_delta, int64 __pyx_v_nstate, PyObject *__pyx_v_queue_type, bool __pyx_v_reverse) {
  std::vector<fst::script::WeightClass>  __pyx_v__distance;
  fst::script::WeightClass __pyx_7genexpr__pyx_v_weight;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  struct __pyx_opt_args_6fstlib_4cext_9pywrapfst__shortestdistance __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  std::vector<fst::script::WeightClass> ::iterator __pyx_t_3;
  fst::script::WeightClass __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("shortestdistance", 0);

  /* "fstlib/cext/pywrapfst.pyx":4180
 *   """
 *   cdef vector[fst.WeightClass] _distance
 *   _shortestdistance(ifst, addr(_distance), delta, nstate, queue_type, reverse)             # <<<<<<<<<<<<<<
 *   return [Weight(ifst._fst.get().WeightType(), weight.ToString())
 *           for weight in _distance]
 */
  __pyx_t_1.__pyx_n = 4;
  __pyx_t_1.delta = __pyx_v_delta;
  __pyx_t_1.nstate = __pyx_v_nstate;
  __pyx_t_1.queue_type = __pyx_v_queue_type;
  __pyx_t_1.reverse = __pyx_v_reverse;
  __pyx_f_6fstlib_4cext_9pywrapfst__shortestdistance(__pyx_v_ifst, (&__pyx_v__distance), &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4180, __pyx_L1_error)

  /* "fstlib/cext/pywrapfst.pyx":4181
 *   cdef vector[fst.WeightClass] _distance
 *   _shortestdistance(ifst, addr(_distance), delta, nstate, queue_type, reverse)
 *   return [Weight(ifst._fst.get().WeightType(), weight.ToString())             # <<<<<<<<<<<<<<
 *           for weight in _distance]
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  { /* enter inner scope */
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4181, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "fstlib/cext/pywrapfst.pyx":4182
 *   _shortestdistance(ifst, addr(_distance), delta, nstate, queue_type, reverse)
 *   return [Weight(ifst._fst.get().WeightType(), weight.ToString())
 *           for weight in _distance]             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_3 = __pyx_v__distance.begin();
    for (;;) {
      if (!(__pyx_t_3 != __pyx_v__distance.end())) break;
      __pyx_t_4 = *__pyx_t_3;
      ++__pyx_t_3;
      __pyx_7genexpr__pyx_v_weight = __pyx_t_4;

      /* "fstlib/cext/pywrapfst.pyx":4181
 *   cdef vector[fst.WeightClass] _distance
 *   _shortestdistance(ifst, addr(_distance), delta, nstate, queue_type, reverse)
 *   return [Weight(ifst._fst.get().WeightType(), weight.ToString())             # <<<<<<<<<<<<<<
 *           for weight in _distance]
 * 
 */
      if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
        __PYX_ERR(0, 4181, __pyx_L1_error)
      }
      __pyx_t_5 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_v_ifst->_fst.get()->WeightType()); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4181, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_7genexpr__pyx_v_weight.ToString()); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4181, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4181, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6);
      __pyx_t_5 = 0;
      __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6fstlib_4cext_9pywrapfst_Weight), __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4181, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 4181, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "fstlib/cext/pywrapfst.pyx":4182
 *   _shortestdistance(ifst, addr(_distance), delta, nstate, queue_type, reverse)
 *   return [Weight(ifst._fst.get().WeightType(), weight.ToString())
 *           for weight in _distance]             # <<<<<<<<<<<<<<
 * 
 * 
 */
    }
  } /* exit inner scope */
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":4148
 * 
 * 
 * def shortestdistance(Fst ifst,             # <<<<<<<<<<<<<<
 *                      float delta=fst.kShortestDelta,
 *                      int64 nstate=fst.kNoStateId,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.shortestdistance", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":4185
 * 
 * 
 * cpdef MutableFst shortestpath(Fst ifst,             # <<<<<<<<<<<<<<
 *                               float delta=fst.kShortestDelta,
 *                               int32 nshortest=1,
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_57shortestpath(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_f_6fstlib_4cext_9pywrapfst_shortestpath(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_shortestpath *__pyx_optional_args) {
  float __pyx_v_delta = __pyx_k__51;
  int32 __pyx_v_nshortest = ((int32)1);
  int64 __pyx_v_nstate = __pyx_k__52;
  PyObject *__pyx_v_queue_type = ((PyObject *)__pyx_n_u_auto);

  /* "fstlib/cext/pywrapfst.pyx":4190
 *                               int64 nstate=fst.kNoStateId,
 *                               queue_type="auto",
 *                               bool unique=False,             # <<<<<<<<<<<<<<
 *                               weight=None):
 *   """
 */
  bool __pyx_v_unique = ((bool)0);

  /* "fstlib/cext/pywrapfst.pyx":4191
 *                               queue_type="auto",
 *                               bool unique=False,
 *                               weight=None):             # <<<<<<<<<<<<<<
 *   """
 *   shortestpath(ifst, delta=1e-6, nshortest=1, nstate=NO_STATE_ID,
 */
  PyObject *__pyx_v_weight = ((PyObject *)Py_None);
  std::unique_ptr<fst::script::VectorFstClass>  __pyx_v__tfst;
  fst::script::WeightClass __pyx_v__weight;
  std::unique_ptr<fst::script::ShortestPathOptions>  __pyx_v__opts;
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  fst::script::WeightClass __pyx_t_1;
  std::string __pyx_t_2;
  enum fst::QueueType __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("shortestpath", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_delta = __pyx_optional_args->delta;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_nshortest = __pyx_optional_args->nshortest;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_nstate = __pyx_optional_args->nstate;
          if (__pyx_optional_args->__pyx_n > 3) {
            __pyx_v_queue_type = __pyx_optional_args->queue_type;
            if (__pyx_optional_args->__pyx_n > 4) {
              __pyx_v_unique = __pyx_optional_args->unique;
              if (__pyx_optional_args->__pyx_n > 5) {
                __pyx_v_weight = __pyx_optional_args->weight;
              }
            }
          }
        }
      }
    }
  }

  /* "fstlib/cext/pywrapfst.pyx":4223
 *   """
 *   cdef unique_ptr[fst.VectorFstClass] _tfst
 *   _tfst.reset(new fst.VectorFstClass(ifst.arc_type()))             # <<<<<<<<<<<<<<
 *   # Threshold is set to semiring Zero (no pruning) if no weight is specified.
 *   cdef fst.WeightClass _weight = _get_WeightClass_or_zero(ifst.weight_type(),
 */
  if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "arc_type");
    __PYX_ERR(0, 4223, __pyx_L1_error)
  }
  __pyx_v__tfst.reset(new fst::script::VectorFstClass(((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_Fst *)__pyx_v_ifst->__pyx_vtab)->arc_type(__pyx_v_ifst, 0)));

  /* "fstlib/cext/pywrapfst.pyx":4225
 *   _tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
 *   # Threshold is set to semiring Zero (no pruning) if no weight is specified.
 *   cdef fst.WeightClass _weight = _get_WeightClass_or_zero(ifst.weight_type(),             # <<<<<<<<<<<<<<
 *                                                           weight)
 *   cdef unique_ptr[fst.ShortestPathOptions] _opts
 */
  if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "weight_type");
    __PYX_ERR(0, 4225, __pyx_L1_error)
  }

  /* "fstlib/cext/pywrapfst.pyx":4226
 *   # Threshold is set to semiring Zero (no pruning) if no weight is specified.
 *   cdef fst.WeightClass _weight = _get_WeightClass_or_zero(ifst.weight_type(),
 *                                                           weight)             # <<<<<<<<<<<<<<
 *   cdef unique_ptr[fst.ShortestPathOptions] _opts
 *   _opts.reset(
 */
  __pyx_t_1 = __pyx_f_6fstlib_4cext_9pywrapfst__get_WeightClass_or_zero(((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_Fst *)__pyx_v_ifst->__pyx_vtab)->weight_type(__pyx_v_ifst, 0), __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4225, __pyx_L1_error)
  __pyx_v__weight = __pyx_t_1;

  /* "fstlib/cext/pywrapfst.pyx":4229
 *   cdef unique_ptr[fst.ShortestPathOptions] _opts
 *   _opts.reset(
 *       new fst.ShortestPathOptions(_get_queue_type(tostring(queue_type)),             # <<<<<<<<<<<<<<
 *                                   nshortest,
 *                                   unique,
 */
  __pyx_t_2 = __pyx_f_6fstlib_4cext_9pywrapfst_tostring(__pyx_v_queue_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4229, __pyx_L1_error)
  __pyx_t_3 = __pyx_f_6fstlib_4cext_9pywrapfst__get_queue_type(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4229, __pyx_L1_error)

  /* "fstlib/cext/pywrapfst.pyx":4228
 *                                                           weight)
 *   cdef unique_ptr[fst.ShortestPathOptions] _opts
 *   _opts.reset(             # <<<<<<<<<<<<<<
 *       new fst.ShortestPathOptions(_get_queue_type(tostring(queue_type)),
 *                                   nshortest,
 */
  __pyx_v__opts.reset(new fst::script::ShortestPathOptions(__pyx_t_3, __pyx_v_nshortest, __pyx_v_unique, __pyx_v_delta, __pyx_v__weight, __pyx_v_nstate));

  /* "fstlib/cext/pywrapfst.pyx":4235
 *                                   _weight,
 *                                   nstate))
 *   fst.ShortestPath(deref(ifst._fst), _tfst.get(), deref(_opts))             # <<<<<<<<<<<<<<
 *   return _init_MutableFst(_tfst.release())
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 4235, __pyx_L1_error)
  }
  fst::script::ShortestPath((*__pyx_v_ifst->_fst), __pyx_v__tfst.get(), (*__pyx_v__opts));

  /* "fstlib/cext/pywrapfst.pyx":4236
 *                                   nstate))
 *   fst.ShortestPath(deref(ifst._fst), _tfst.get(), deref(_opts))
 *   return _init_MutableFst(_tfst.release())             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_4 = ((PyObject *)__pyx_f_6fstlib_4cext_9pywrapfst__init_MutableFst(__pyx_v__tfst.release())); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4236, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_r = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *)__pyx_t_4);
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":4185
 * 
 * 
 * cpdef MutableFst shortestpath(Fst ifst,             # <<<<<<<<<<<<<<
 *                               float delta=fst.kShortestDelta,
 *                               int32 nshortest=1,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.shortestpath", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_57shortestpath(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_56shortestpath[] = "\n  shortestpath(ifst, delta=1e-6, nshortest=1, nstate=NO_STATE_ID,\n               queue_type=\"auto\", unique=False, weight=None)\n\n  Construct an FST containing the shortest path(s) in the input FST.\n\n  This operation produces an FST containing the n-shortest paths in the input\n  FST. The n-shortest paths are the n-lowest weight paths w.r.t. the natural\n  semiring order. The single path that can be read from the ith of at most n\n  transitions leaving the initial state of the resulting FST is the ith\n  shortest path. The weights need to be right distributive and have the path\n  property. They also need to be left distributive as well for n-shortest with\n  n > 1 (e.g., TropicalWeight).\n\n  Args:\n    ifst: The input FST.\n    delta: Comparison/quantization delta.\n    nshortest: The number of paths to return.\n    nstate: State number threshold.\n    queue_type: A string matching a known queue type; one of: \"auto\", \"fifo\",\n        \"lifo\", \"shortest\", \"state\", \"top\".\n    unique: Should the resulting FST only contain distinct paths? (Requires\n        the input FST to be an acceptor; epsilons are treated as if they are\n        regular symbols.)\n    weight: A Weight or weight string indicating the desired weight threshold\n        below which paths are pruned; if omitted, no paths are pruned.\n\n  Returns:\n    An FST containing the n-shortest paths.\n  ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_57shortestpath(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst = 0;
  float __pyx_v_delta;
  int32 __pyx_v_nshortest;
  int64 __pyx_v_nstate;
  PyObject *__pyx_v_queue_type = 0;
  bool __pyx_v_unique;
  PyObject *__pyx_v_weight = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("shortestpath (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ifst,&__pyx_n_s_delta,&__pyx_n_s_nshortest,&__pyx_n_s_nstate,&__pyx_n_s_queue_type,&__pyx_n_s_unique,&__pyx_n_s_weight,0};
    PyObject* values[7] = {0,0,0,0,0,0,0};
    values[4] = ((PyObject *)__pyx_n_u_auto);

    /* "fstlib/cext/pywrapfst.pyx":4191
 *                               queue_type="auto",
 *                               bool unique=False,
 *                               weight=None):             # <<<<<<<<<<<<<<
 *   """
 *   shortestpath(ifst, delta=1e-6, nshortest=1, nstate=NO_STATE_ID,
 */
    values[6] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ifst)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_delta);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nshortest);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nstate);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_queue_type);
          if (value) { values[4] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_unique);
          if (value) { values[5] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_weight);
          if (value) { values[6] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "shortestpath") < 0)) __PYX_ERR(0, 4185, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_ifst = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *)values[0]);
    if (values[1]) {
      __pyx_v_delta = __pyx_PyFloat_AsFloat(values[1]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 4186, __pyx_L3_error)
    } else {
      __pyx_v_delta = __pyx_k__51;
    }
    if (values[2]) {
      __pyx_v_nshortest = __Pyx_PyInt_As_int32_t(values[2]); if (unlikely((__pyx_v_nshortest == ((int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4187, __pyx_L3_error)
    } else {
      __pyx_v_nshortest = ((int32)1);
    }
    if (values[3]) {
      __pyx_v_nstate = __Pyx_PyInt_As_int64_t(values[3]); if (unlikely((__pyx_v_nstate == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4188, __pyx_L3_error)
    } else {
      __pyx_v_nstate = __pyx_k__52;
    }
    __pyx_v_queue_type = values[4];
    if (values[5]) {
      __pyx_v_unique = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_unique == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4190, __pyx_L3_error)
    } else {

      /* "fstlib/cext/pywrapfst.pyx":4190
 *                               int64 nstate=fst.kNoStateId,
 *                               queue_type="auto",
 *                               bool unique=False,             # <<<<<<<<<<<<<<
 *                               weight=None):
 *   """
 */
      __pyx_v_unique = ((bool)0);
    }
    __pyx_v_weight = values[6];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("shortestpath", 0, 1, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4185, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.shortestpath", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_6fstlib_4cext_9pywrapfst_Fst, 1, "ifst", 0))) __PYX_ERR(0, 4185, __pyx_L1_error)
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_56shortestpath(__pyx_self, __pyx_v_ifst, __pyx_v_delta, __pyx_v_nshortest, __pyx_v_nstate, __pyx_v_queue_type, __pyx_v_unique, __pyx_v_weight);

  /* "fstlib/cext/pywrapfst.pyx":4185
 * 
 * 
 * cpdef MutableFst shortestpath(Fst ifst,             # <<<<<<<<<<<<<<
 *                               float delta=fst.kShortestDelta,
 *                               int32 nshortest=1,
 */

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_56shortestpath(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst, float __pyx_v_delta, int32 __pyx_v_nshortest, int64 __pyx_v_nstate, PyObject *__pyx_v_queue_type, bool __pyx_v_unique, PyObject *__pyx_v_weight) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_shortestpath __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("shortestpath", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 6;
  __pyx_t_2.delta = __pyx_v_delta;
  __pyx_t_2.nshortest = __pyx_v_nshortest;
  __pyx_t_2.nstate = __pyx_v_nstate;
  __pyx_t_2.queue_type = __pyx_v_queue_type;
  __pyx_t_2.unique = __pyx_v_unique;
  __pyx_t_2.weight = __pyx_v_weight;
  __pyx_t_1 = ((PyObject *)__pyx_f_6fstlib_4cext_9pywrapfst_shortestpath(__pyx_v_ifst, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4185, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.shortestpath", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":4239
 * 
 * 
 * cpdef Fst statemap(Fst ifst, map_type):             # <<<<<<<<<<<<<<
 *   """
 *   state_map(ifst, map_type)
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_59statemap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_f_6fstlib_4cext_9pywrapfst_statemap(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst, PyObject *__pyx_v_map_type, CYTHON_UNUSED int __pyx_skip_dispatch) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_6fstlib_4cext_9pywrapfst__map __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("statemap", 0);

  /* "fstlib/cext/pywrapfst.pyx":4262
 *     FstArgError: Unknown map type.
 *   """
 *   return _map(ifst, fst.kDelta, map_type, 1., None)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_2.__pyx_n = 4;
  __pyx_t_2.delta = fst::kDelta;
  __pyx_t_2.map_type = __pyx_v_map_type;
  __pyx_t_2.power = 1.;
  __pyx_t_2.weight = Py_None;
  __pyx_t_1 = ((PyObject *)__pyx_f_6fstlib_4cext_9pywrapfst__map(__pyx_v_ifst, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4262, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":4239
 * 
 * 
 * cpdef Fst statemap(Fst ifst, map_type):             # <<<<<<<<<<<<<<
 *   """
 *   state_map(ifst, map_type)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.statemap", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_59statemap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_58statemap[] = "\n  state_map(ifst, map_type)\n\n  Constructively applies a transform to all states.\n\n  This operation transforms each state using one of the following:\n\n    * arc_sum: sums weights of identically-labeled multi-arcs.\n    * arc_unique: deletes non-unique identically-labeled multi-arcs.\n    * identity: maps to self.\n\n  Args:\n    ifst: The input FST.\n    map_type: A string matching a known mapping operation; one of: \"arc_sum\",\n        \"arc_unique\", \"identity\".\n\n  Returns:\n    An FST with states remapped.\n\n  Raises:\n    FstArgError: Unknown map type.\n  ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_59statemap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst = 0;
  PyObject *__pyx_v_map_type = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("statemap (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ifst,&__pyx_n_s_map_type,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ifst)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_map_type)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("statemap", 1, 2, 2, 1); __PYX_ERR(0, 4239, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "statemap") < 0)) __PYX_ERR(0, 4239, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_ifst = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *)values[0]);
    __pyx_v_map_type = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("statemap", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4239, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.statemap", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_6fstlib_4cext_9pywrapfst_Fst, 1, "ifst", 0))) __PYX_ERR(0, 4239, __pyx_L1_error)
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_58statemap(__pyx_self, __pyx_v_ifst, __pyx_v_map_type);

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_58statemap(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst, PyObject *__pyx_v_map_type) {
  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("statemap", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_6fstlib_4cext_9pywrapfst_statemap(__pyx_v_ifst, __pyx_v_map_type, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4239, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.statemap", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":4265
 * 
 * 
 * cpdef MutableFst synchronize(Fst ifst):             # <<<<<<<<<<<<<<
 *   """
 *   synchronize(ifst)
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_61synchronize(PyObject *__pyx_self, PyObject *__pyx_v_ifst); /*proto*/
static struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__pyx_f_6fstlib_4cext_9pywrapfst_synchronize(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst, CYTHON_UNUSED int __pyx_skip_dispatch) {
  std::unique_ptr<fst::script::VectorFstClass>  __pyx_v__tfst;
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *__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("synchronize", 0);

  /* "fstlib/cext/pywrapfst.pyx":4285
 *   """
 *   cdef unique_ptr[fst.VectorFstClass] _tfst
 *   _tfst.reset(new fst.VectorFstClass(ifst.arc_type()))             # <<<<<<<<<<<<<<
 *   fst.Synchronize(deref(ifst._fst), _tfst.get())
 *   return _init_MutableFst(_tfst.release())
 */
  if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "arc_type");
    __PYX_ERR(0, 4285, __pyx_L1_error)
  }
  __pyx_v__tfst.reset(new fst::script::VectorFstClass(((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_Fst *)__pyx_v_ifst->__pyx_vtab)->arc_type(__pyx_v_ifst, 0)));

  /* "fstlib/cext/pywrapfst.pyx":4286
 *   cdef unique_ptr[fst.VectorFstClass] _tfst
 *   _tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
 *   fst.Synchronize(deref(ifst._fst), _tfst.get())             # <<<<<<<<<<<<<<
 *   return _init_MutableFst(_tfst.release())
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 4286, __pyx_L1_error)
  }
  fst::script::Synchronize((*__pyx_v_ifst->_fst), __pyx_v__tfst.get());

  /* "fstlib/cext/pywrapfst.pyx":4287
 *   _tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
 *   fst.Synchronize(deref(ifst._fst), _tfst.get())
 *   return _init_MutableFst(_tfst.release())             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)__pyx_f_6fstlib_4cext_9pywrapfst__init_MutableFst(__pyx_v__tfst.release())); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4287, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":4265
 * 
 * 
 * cpdef MutableFst synchronize(Fst ifst):             # <<<<<<<<<<<<<<
 *   """
 *   synchronize(ifst)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.synchronize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_61synchronize(PyObject *__pyx_self, PyObject *__pyx_v_ifst); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_60synchronize[] = "\n  synchronize(ifst)\n\n  Constructively synchronizes an FST.\n\n  This operation synchronizes a transducer. The result will be an equivalent\n  FST that has the property that during the traversal of a path, the delay is\n  either zero or strictly increasing, where the delay is the difference between\n  the number of non-epsilon output labels and input labels along the path. For\n  the algorithm to terminate, the input transducer must have bounded delay,\n  i.e., the delay of every cycle must be zero.\n\n  Args:\n    ifst: The input FST.\n\n  Returns:\n    An equivalent synchronized FST.\n  ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_61synchronize(PyObject *__pyx_self, PyObject *__pyx_v_ifst) {
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("synchronize (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_6fstlib_4cext_9pywrapfst_Fst, 1, "ifst", 0))) __PYX_ERR(0, 4265, __pyx_L1_error)
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_60synchronize(__pyx_self, ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *)__pyx_v_ifst));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_60synchronize(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst) {
  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("synchronize", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_6fstlib_4cext_9pywrapfst_synchronize(__pyx_v_ifst, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4265, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.synchronize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":4344
 *   """
 * 
 *   def __cinit__(self,             # <<<<<<<<<<<<<<
 *                 str fst_type="vector",
 *                 str arc_type="standard",
 */

/* Python wrapper */
static int __pyx_pw_6fstlib_4cext_9pywrapfst_8Compiler_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_6fstlib_4cext_9pywrapfst_8Compiler_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_fst_type = 0;
  PyObject *__pyx_v_arc_type = 0;
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTable *__pyx_v_isymbols = 0;
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTable *__pyx_v_osymbols = 0;
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTable *__pyx_v_ssymbols = 0;
  bool __pyx_v_acceptor;
  bool __pyx_v_keep_isymbols;
  bool __pyx_v_keep_osymbols;
  bool __pyx_v_keep_state_numbering;
  bool __pyx_v_allow_negative_labels;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fst_type,&__pyx_n_s_arc_type,&__pyx_n_s_isymbols,&__pyx_n_s_osymbols,&__pyx_n_s_ssymbols,&__pyx_n_s_acceptor,&__pyx_n_s_keep_isymbols,&__pyx_n_s_keep_osymbols,&__pyx_n_s_keep_state_numbering,&__pyx_n_s_allow_negative_labels,0};
    PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
    values[0] = ((PyObject*)__pyx_n_u_vector);
    values[1] = ((PyObject*)__pyx_n_u_standard);

    /* "fstlib/cext/pywrapfst.pyx":4347
 *                 str fst_type="vector",
 *                 str arc_type="standard",
 *                 SymbolTable isymbols=None,             # <<<<<<<<<<<<<<
 *                 SymbolTable osymbols=None,
 *                 SymbolTable ssymbols=None,
 */
    values[2] = (PyObject *)((struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTable *)Py_None);

    /* "fstlib/cext/pywrapfst.pyx":4348
 *                 str arc_type="standard",
 *                 SymbolTable isymbols=None,
 *                 SymbolTable osymbols=None,             # <<<<<<<<<<<<<<
 *                 SymbolTable ssymbols=None,
 *                 bool acceptor=False,
 */
    values[3] = (PyObject *)((struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTable *)Py_None);

    /* "fstlib/cext/pywrapfst.pyx":4349
 *                 SymbolTable isymbols=None,
 *                 SymbolTable osymbols=None,
 *                 SymbolTable ssymbols=None,             # <<<<<<<<<<<<<<
 *                 bool acceptor=False,
 *                 bool keep_isymbols=False,
 */
    values[4] = (PyObject *)((struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTable *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fst_type);
          if (value) { values[0] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_arc_type);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_isymbols);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_osymbols);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ssymbols);
          if (value) { values[4] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_acceptor);
          if (value) { values[5] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_keep_isymbols);
          if (value) { values[6] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_keep_osymbols);
          if (value) { values[7] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_keep_state_numbering);
          if (value) { values[8] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_allow_negative_labels);
          if (value) { values[9] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 4344, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_fst_type = ((PyObject*)values[0]);
    __pyx_v_arc_type = ((PyObject*)values[1]);
    __pyx_v_isymbols = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTable *)values[2]);
    __pyx_v_osymbols = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTable *)values[3]);
    __pyx_v_ssymbols = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTable *)values[4]);
    if (values[5]) {
      __pyx_v_acceptor = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_acceptor == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4350, __pyx_L3_error)
    } else {

      /* "fstlib/cext/pywrapfst.pyx":4350
 *                 SymbolTable osymbols=None,
 *                 SymbolTable ssymbols=None,
 *                 bool acceptor=False,             # <<<<<<<<<<<<<<
 *                 bool keep_isymbols=False,
 *                 bool keep_osymbols=False,
 */
      __pyx_v_acceptor = ((bool)0);
    }
    if (values[6]) {
      __pyx_v_keep_isymbols = __Pyx_PyObject_IsTrue(values[6]); if (unlikely((__pyx_v_keep_isymbols == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4351, __pyx_L3_error)
    } else {

      /* "fstlib/cext/pywrapfst.pyx":4351
 *                 SymbolTable ssymbols=None,
 *                 bool acceptor=False,
 *                 bool keep_isymbols=False,             # <<<<<<<<<<<<<<
 *                 bool keep_osymbols=False,
 *                 bool keep_state_numbering=False,
 */
      __pyx_v_keep_isymbols = ((bool)0);
    }
    if (values[7]) {
      __pyx_v_keep_osymbols = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_keep_osymbols == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4352, __pyx_L3_error)
    } else {

      /* "fstlib/cext/pywrapfst.pyx":4352
 *                 bool acceptor=False,
 *                 bool keep_isymbols=False,
 *                 bool keep_osymbols=False,             # <<<<<<<<<<<<<<
 *                 bool keep_state_numbering=False,
 *                 bool allow_negative_labels=False):
 */
      __pyx_v_keep_osymbols = ((bool)0);
    }
    if (values[8]) {
      __pyx_v_keep_state_numbering = __Pyx_PyObject_IsTrue(values[8]); if (unlikely((__pyx_v_keep_state_numbering == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4353, __pyx_L3_error)
    } else {

      /* "fstlib/cext/pywrapfst.pyx":4353
 *                 bool keep_isymbols=False,
 *                 bool keep_osymbols=False,
 *                 bool keep_state_numbering=False,             # <<<<<<<<<<<<<<
 *                 bool allow_negative_labels=False):
 *     self._sstrm.reset(new stringstream())
 */
      __pyx_v_keep_state_numbering = ((bool)0);
    }
    if (values[9]) {
      __pyx_v_allow_negative_labels = __Pyx_PyObject_IsTrue(values[9]); if (unlikely((__pyx_v_allow_negative_labels == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4354, __pyx_L3_error)
    } else {

      /* "fstlib/cext/pywrapfst.pyx":4354
 *                 bool keep_osymbols=False,
 *                 bool keep_state_numbering=False,
 *                 bool allow_negative_labels=False):             # <<<<<<<<<<<<<<
 *     self._sstrm.reset(new stringstream())
 *     self._fst_type = tostring(fst_type)
 */
      __pyx_v_allow_negative_labels = ((bool)0);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 10, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4344, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.Compiler.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fst_type), (&PyUnicode_Type), 1, "fst_type", 1))) __PYX_ERR(0, 4345, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arc_type), (&PyUnicode_Type), 1, "arc_type", 1))) __PYX_ERR(0, 4346, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_isymbols), __pyx_ptype_6fstlib_4cext_9pywrapfst_SymbolTable, 1, "isymbols", 0))) __PYX_ERR(0, 4347, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_osymbols), __pyx_ptype_6fstlib_4cext_9pywrapfst_SymbolTable, 1, "osymbols", 0))) __PYX_ERR(0, 4348, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ssymbols), __pyx_ptype_6fstlib_4cext_9pywrapfst_SymbolTable, 1, "ssymbols", 0))) __PYX_ERR(0, 4349, __pyx_L1_error)
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_8Compiler___cinit__(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Compiler *)__pyx_v_self), __pyx_v_fst_type, __pyx_v_arc_type, __pyx_v_isymbols, __pyx_v_osymbols, __pyx_v_ssymbols, __pyx_v_acceptor, __pyx_v_keep_isymbols, __pyx_v_keep_osymbols, __pyx_v_keep_state_numbering, __pyx_v_allow_negative_labels);

  /* "fstlib/cext/pywrapfst.pyx":4344
 *   """
 * 
 *   def __cinit__(self,             # <<<<<<<<<<<<<<
 *                 str fst_type="vector",
 *                 str arc_type="standard",
 */

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

static int __pyx_pf_6fstlib_4cext_9pywrapfst_8Compiler___cinit__(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Compiler *__pyx_v_self, PyObject *__pyx_v_fst_type, PyObject *__pyx_v_arc_type, struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTable *__pyx_v_isymbols, struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTable *__pyx_v_osymbols, struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTable *__pyx_v_ssymbols, bool __pyx_v_acceptor, bool __pyx_v_keep_isymbols, bool __pyx_v_keep_osymbols, bool __pyx_v_keep_state_numbering, bool __pyx_v_allow_negative_labels) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  fst::SymbolTable const *__pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "fstlib/cext/pywrapfst.pyx":4355
 *                 bool keep_state_numbering=False,
 *                 bool allow_negative_labels=False):
 *     self._sstrm.reset(new stringstream())             # <<<<<<<<<<<<<<
 *     self._fst_type = tostring(fst_type)
 *     self._arc_type = tostring(arc_type)
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_sstrm");
    __PYX_ERR(0, 4355, __pyx_L1_error)
  }
  __pyx_v_self->_sstrm.reset(new std::stringstream());

  /* "fstlib/cext/pywrapfst.pyx":4356
 *                 bool allow_negative_labels=False):
 *     self._sstrm.reset(new stringstream())
 *     self._fst_type = tostring(fst_type)             # <<<<<<<<<<<<<<
 *     self._arc_type = tostring(arc_type)
 *     self._isymbols = NULL
 */
  __pyx_t_1 = __pyx_f_6fstlib_4cext_9pywrapfst_tostring(__pyx_v_fst_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4356, __pyx_L1_error)
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst_type");
    __PYX_ERR(0, 4356, __pyx_L1_error)
  }
  __pyx_v_self->_fst_type = __pyx_t_1;

  /* "fstlib/cext/pywrapfst.pyx":4357
 *     self._sstrm.reset(new stringstream())
 *     self._fst_type = tostring(fst_type)
 *     self._arc_type = tostring(arc_type)             # <<<<<<<<<<<<<<
 *     self._isymbols = NULL
 *     if isymbols is not None:
 */
  __pyx_t_1 = __pyx_f_6fstlib_4cext_9pywrapfst_tostring(__pyx_v_arc_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4357, __pyx_L1_error)
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_arc_type");
    __PYX_ERR(0, 4357, __pyx_L1_error)
  }
  __pyx_v_self->_arc_type = __pyx_t_1;

  /* "fstlib/cext/pywrapfst.pyx":4358
 *     self._fst_type = tostring(fst_type)
 *     self._arc_type = tostring(arc_type)
 *     self._isymbols = NULL             # <<<<<<<<<<<<<<
 *     if isymbols is not None:
 *       self._isymbols = isymbols._raw_ptr_or_raise()
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_isymbols");
    __PYX_ERR(0, 4358, __pyx_L1_error)
  }
  __pyx_v_self->_isymbols = NULL;

  /* "fstlib/cext/pywrapfst.pyx":4359
 *     self._arc_type = tostring(arc_type)
 *     self._isymbols = NULL
 *     if isymbols is not None:             # <<<<<<<<<<<<<<
 *       self._isymbols = isymbols._raw_ptr_or_raise()
 *     self._osymbols = NULL
 */
  __pyx_t_2 = (((PyObject *)__pyx_v_isymbols) != Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "fstlib/cext/pywrapfst.pyx":4360
 *     self._isymbols = NULL
 *     if isymbols is not None:
 *       self._isymbols = isymbols._raw_ptr_or_raise()             # <<<<<<<<<<<<<<
 *     self._osymbols = NULL
 *     if osymbols is not None:
 */
    if (unlikely(((PyObject *)__pyx_v_isymbols) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raw_ptr_or_raise");
      __PYX_ERR(0, 4360, __pyx_L1_error)
    }
    __pyx_t_4 = ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_SymbolTable *)__pyx_v_isymbols->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._raw_ptr_or_raise(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *)__pyx_v_isymbols)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4360, __pyx_L1_error)
    if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_isymbols");
      __PYX_ERR(0, 4360, __pyx_L1_error)
    }
    __pyx_v_self->_isymbols = __pyx_t_4;

    /* "fstlib/cext/pywrapfst.pyx":4359
 *     self._arc_type = tostring(arc_type)
 *     self._isymbols = NULL
 *     if isymbols is not None:             # <<<<<<<<<<<<<<
 *       self._isymbols = isymbols._raw_ptr_or_raise()
 *     self._osymbols = NULL
 */
  }

  /* "fstlib/cext/pywrapfst.pyx":4361
 *     if isymbols is not None:
 *       self._isymbols = isymbols._raw_ptr_or_raise()
 *     self._osymbols = NULL             # <<<<<<<<<<<<<<
 *     if osymbols is not None:
 *       self._osymbols = osymbols._raw_ptr_or_raise()
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_osymbols");
    __PYX_ERR(0, 4361, __pyx_L1_error)
  }
  __pyx_v_self->_osymbols = NULL;

  /* "fstlib/cext/pywrapfst.pyx":4362
 *       self._isymbols = isymbols._raw_ptr_or_raise()
 *     self._osymbols = NULL
 *     if osymbols is not None:             # <<<<<<<<<<<<<<
 *       self._osymbols = osymbols._raw_ptr_or_raise()
 *     self._ssymbols = NULL
 */
  __pyx_t_3 = (((PyObject *)__pyx_v_osymbols) != Py_None);
  __pyx_t_2 = (__pyx_t_3 != 0);
  if (__pyx_t_2) {

    /* "fstlib/cext/pywrapfst.pyx":4363
 *     self._osymbols = NULL
 *     if osymbols is not None:
 *       self._osymbols = osymbols._raw_ptr_or_raise()             # <<<<<<<<<<<<<<
 *     self._ssymbols = NULL
 *     if ssymbols is not None:
 */
    if (unlikely(((PyObject *)__pyx_v_osymbols) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raw_ptr_or_raise");
      __PYX_ERR(0, 4363, __pyx_L1_error)
    }
    __pyx_t_4 = ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_SymbolTable *)__pyx_v_osymbols->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._raw_ptr_or_raise(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *)__pyx_v_osymbols)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4363, __pyx_L1_error)
    if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_osymbols");
      __PYX_ERR(0, 4363, __pyx_L1_error)
    }
    __pyx_v_self->_osymbols = __pyx_t_4;

    /* "fstlib/cext/pywrapfst.pyx":4362
 *       self._isymbols = isymbols._raw_ptr_or_raise()
 *     self._osymbols = NULL
 *     if osymbols is not None:             # <<<<<<<<<<<<<<
 *       self._osymbols = osymbols._raw_ptr_or_raise()
 *     self._ssymbols = NULL
 */
  }

  /* "fstlib/cext/pywrapfst.pyx":4364
 *     if osymbols is not None:
 *       self._osymbols = osymbols._raw_ptr_or_raise()
 *     self._ssymbols = NULL             # <<<<<<<<<<<<<<
 *     if ssymbols is not None:
 *       self._ssymbols = ssymbols._raw_ptr_or_raise()
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_ssymbols");
    __PYX_ERR(0, 4364, __pyx_L1_error)
  }
  __pyx_v_self->_ssymbols = NULL;

  /* "fstlib/cext/pywrapfst.pyx":4365
 *       self._osymbols = osymbols._raw_ptr_or_raise()
 *     self._ssymbols = NULL
 *     if ssymbols is not None:             # <<<<<<<<<<<<<<
 *       self._ssymbols = ssymbols._raw_ptr_or_raise()
 *     self._acceptor = acceptor
 */
  __pyx_t_2 = (((PyObject *)__pyx_v_ssymbols) != Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "fstlib/cext/pywrapfst.pyx":4366
 *     self._ssymbols = NULL
 *     if ssymbols is not None:
 *       self._ssymbols = ssymbols._raw_ptr_or_raise()             # <<<<<<<<<<<<<<
 *     self._acceptor = acceptor
 *     self._keep_isymbols = keep_isymbols
 */
    if (unlikely(((PyObject *)__pyx_v_ssymbols) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raw_ptr_or_raise");
      __PYX_ERR(0, 4366, __pyx_L1_error)
    }
    __pyx_t_4 = ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_SymbolTable *)__pyx_v_ssymbols->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._raw_ptr_or_raise(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *)__pyx_v_ssymbols)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4366, __pyx_L1_error)
    if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_ssymbols");
      __PYX_ERR(0, 4366, __pyx_L1_error)
    }
    __pyx_v_self->_ssymbols = __pyx_t_4;

    /* "fstlib/cext/pywrapfst.pyx":4365
 *       self._osymbols = osymbols._raw_ptr_or_raise()
 *     self._ssymbols = NULL
 *     if ssymbols is not None:             # <<<<<<<<<<<<<<
 *       self._ssymbols = ssymbols._raw_ptr_or_raise()
 *     self._acceptor = acceptor
 */
  }

  /* "fstlib/cext/pywrapfst.pyx":4367
 *     if ssymbols is not None:
 *       self._ssymbols = ssymbols._raw_ptr_or_raise()
 *     self._acceptor = acceptor             # <<<<<<<<<<<<<<
 *     self._keep_isymbols = keep_isymbols
 *     self._keep_osymbols = keep_osymbols
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_acceptor");
    __PYX_ERR(0, 4367, __pyx_L1_error)
  }
  __pyx_v_self->_acceptor = __pyx_v_acceptor;

  /* "fstlib/cext/pywrapfst.pyx":4368
 *       self._ssymbols = ssymbols._raw_ptr_or_raise()
 *     self._acceptor = acceptor
 *     self._keep_isymbols = keep_isymbols             # <<<<<<<<<<<<<<
 *     self._keep_osymbols = keep_osymbols
 *     self._keep_state_numbering = keep_state_numbering
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_keep_isymbols");
    __PYX_ERR(0, 4368, __pyx_L1_error)
  }
  __pyx_v_self->_keep_isymbols = __pyx_v_keep_isymbols;

  /* "fstlib/cext/pywrapfst.pyx":4369
 *     self._acceptor = acceptor
 *     self._keep_isymbols = keep_isymbols
 *     self._keep_osymbols = keep_osymbols             # <<<<<<<<<<<<<<
 *     self._keep_state_numbering = keep_state_numbering
 *     self._allow_negative_labels = allow_negative_labels
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_keep_osymbols");
    __PYX_ERR(0, 4369, __pyx_L1_error)
  }
  __pyx_v_self->_keep_osymbols = __pyx_v_keep_osymbols;

  /* "fstlib/cext/pywrapfst.pyx":4370
 *     self._keep_isymbols = keep_isymbols
 *     self._keep_osymbols = keep_osymbols
 *     self._keep_state_numbering = keep_state_numbering             # <<<<<<<<<<<<<<
 *     self._allow_negative_labels = allow_negative_labels
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_keep_state_numbering");
    __PYX_ERR(0, 4370, __pyx_L1_error)
  }
  __pyx_v_self->_keep_state_numbering = __pyx_v_keep_state_numbering;

  /* "fstlib/cext/pywrapfst.pyx":4371
 *     self._keep_osymbols = keep_osymbols
 *     self._keep_state_numbering = keep_state_numbering
 *     self._allow_negative_labels = allow_negative_labels             # <<<<<<<<<<<<<<
 * 
 *   cpdef Fst compile(self):
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_allow_negative_labels");
    __PYX_ERR(0, 4371, __pyx_L1_error)
  }
  __pyx_v_self->_allow_negative_labels = __pyx_v_allow_negative_labels;

  /* "fstlib/cext/pywrapfst.pyx":4344
 *   """
 * 
 *   def __cinit__(self,             # <<<<<<<<<<<<<<
 *                 str fst_type="vector",
 *                 str arc_type="standard",
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.Compiler.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":4373
 *     self._allow_negative_labels = allow_negative_labels
 * 
 *   cpdef Fst compile(self):             # <<<<<<<<<<<<<<
 *     """
 *     compile()
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_8Compiler_3compile(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_f_6fstlib_4cext_9pywrapfst_8Compiler_compile(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Compiler *__pyx_v_self, int __pyx_skip_dispatch) {
  std::unique_ptr<fst::script::FstClass>  __pyx_v__tfst;
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("compile", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_compile); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4373, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6fstlib_4cext_9pywrapfst_8Compiler_3compile)) {
        __Pyx_XDECREF(((PyObject *)__pyx_r));
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4373, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_6fstlib_4cext_9pywrapfst_Fst))))) __PYX_ERR(0, 4373, __pyx_L1_error)
        __pyx_r = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "fstlib/cext/pywrapfst.pyx":4388
 *     """
 *     cdef unique_ptr[fst.FstClass] _tfst
 *     _tfst = fst.CompileFstInternal(deref(self._sstrm),             # <<<<<<<<<<<<<<
 *                                    b"<pywrapfst>",
 *                                    self._fst_type,
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_sstrm");
    __PYX_ERR(0, 4388, __pyx_L1_error)
  }

  /* "fstlib/cext/pywrapfst.pyx":4390
 *     _tfst = fst.CompileFstInternal(deref(self._sstrm),
 *                                    b"<pywrapfst>",
 *                                    self._fst_type,             # <<<<<<<<<<<<<<
 *                                    self._arc_type,
 *                                    self._isymbols,
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst_type");
    __PYX_ERR(0, 4390, __pyx_L1_error)
  }

  /* "fstlib/cext/pywrapfst.pyx":4391
 *                                    b"<pywrapfst>",
 *                                    self._fst_type,
 *                                    self._arc_type,             # <<<<<<<<<<<<<<
 *                                    self._isymbols,
 *                                    self._osymbols,
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_arc_type");
    __PYX_ERR(0, 4391, __pyx_L1_error)
  }

  /* "fstlib/cext/pywrapfst.pyx":4392
 *                                    self._fst_type,
 *                                    self._arc_type,
 *                                    self._isymbols,             # <<<<<<<<<<<<<<
 *                                    self._osymbols,
 *                                    self._ssymbols,
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_isymbols");
    __PYX_ERR(0, 4392, __pyx_L1_error)
  }

  /* "fstlib/cext/pywrapfst.pyx":4393
 *                                    self._arc_type,
 *                                    self._isymbols,
 *                                    self._osymbols,             # <<<<<<<<<<<<<<
 *                                    self._ssymbols,
 *                                    self._acceptor,
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_osymbols");
    __PYX_ERR(0, 4393, __pyx_L1_error)
  }

  /* "fstlib/cext/pywrapfst.pyx":4394
 *                                    self._isymbols,
 *                                    self._osymbols,
 *                                    self._ssymbols,             # <<<<<<<<<<<<<<
 *                                    self._acceptor,
 *                                    self._keep_isymbols,
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_ssymbols");
    __PYX_ERR(0, 4394, __pyx_L1_error)
  }

  /* "fstlib/cext/pywrapfst.pyx":4395
 *                                    self._osymbols,
 *                                    self._ssymbols,
 *                                    self._acceptor,             # <<<<<<<<<<<<<<
 *                                    self._keep_isymbols,
 *                                    self._keep_osymbols,
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_acceptor");
    __PYX_ERR(0, 4395, __pyx_L1_error)
  }

  /* "fstlib/cext/pywrapfst.pyx":4396
 *                                    self._ssymbols,
 *                                    self._acceptor,
 *                                    self._keep_isymbols,             # <<<<<<<<<<<<<<
 *                                    self._keep_osymbols,
 *                                    self._keep_state_numbering,
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_keep_isymbols");
    __PYX_ERR(0, 4396, __pyx_L1_error)
  }

  /* "fstlib/cext/pywrapfst.pyx":4397
 *                                    self._acceptor,
 *                                    self._keep_isymbols,
 *                                    self._keep_osymbols,             # <<<<<<<<<<<<<<
 *                                    self._keep_state_numbering,
 *                                    self._allow_negative_labels)
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_keep_osymbols");
    __PYX_ERR(0, 4397, __pyx_L1_error)
  }

  /* "fstlib/cext/pywrapfst.pyx":4398
 *                                    self._keep_isymbols,
 *                                    self._keep_osymbols,
 *                                    self._keep_state_numbering,             # <<<<<<<<<<<<<<
 *                                    self._allow_negative_labels)
 *     self._sstrm.reset(new stringstream())
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_keep_state_numbering");
    __PYX_ERR(0, 4398, __pyx_L1_error)
  }

  /* "fstlib/cext/pywrapfst.pyx":4399
 *                                    self._keep_osymbols,
 *                                    self._keep_state_numbering,
 *                                    self._allow_negative_labels)             # <<<<<<<<<<<<<<
 *     self._sstrm.reset(new stringstream())
 *     if _tfst.get() == NULL:
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_allow_negative_labels");
    __PYX_ERR(0, 4399, __pyx_L1_error)
  }

  /* "fstlib/cext/pywrapfst.pyx":4388
 *     """
 *     cdef unique_ptr[fst.FstClass] _tfst
 *     _tfst = fst.CompileFstInternal(deref(self._sstrm),             # <<<<<<<<<<<<<<
 *                                    b"<pywrapfst>",
 *                                    self._fst_type,
 */
  __pyx_v__tfst = fst::script::CompileFstInternal((*__pyx_v_self->_sstrm), __pyx_k_pywrapfst, __pyx_v_self->_fst_type, __pyx_v_self->_arc_type, __pyx_v_self->_isymbols, __pyx_v_self->_osymbols, __pyx_v_self->_ssymbols, __pyx_v_self->_acceptor, __pyx_v_self->_keep_isymbols, __pyx_v_self->_keep_osymbols, __pyx_v_self->_keep_state_numbering, __pyx_v_self->_allow_negative_labels);

  /* "fstlib/cext/pywrapfst.pyx":4400
 *                                    self._keep_state_numbering,
 *                                    self._allow_negative_labels)
 *     self._sstrm.reset(new stringstream())             # <<<<<<<<<<<<<<
 *     if _tfst.get() == NULL:
 *       raise FstOpError("Compilation failed")
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_sstrm");
    __PYX_ERR(0, 4400, __pyx_L1_error)
  }
  __pyx_v_self->_sstrm.reset(new std::stringstream());

  /* "fstlib/cext/pywrapfst.pyx":4401
 *                                    self._allow_negative_labels)
 *     self._sstrm.reset(new stringstream())
 *     if _tfst.get() == NULL:             # <<<<<<<<<<<<<<
 *       raise FstOpError("Compilation failed")
 *     return _init_XFst(_tfst.release())
 */
  __pyx_t_5 = ((__pyx_v__tfst.get() == NULL) != 0);
  if (unlikely(__pyx_t_5)) {

    /* "fstlib/cext/pywrapfst.pyx":4402
 *     self._sstrm.reset(new stringstream())
 *     if _tfst.get() == NULL:
 *       raise FstOpError("Compilation failed")             # <<<<<<<<<<<<<<
 *     return _init_XFst(_tfst.release())
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FstOpError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4402, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_kp_u_Compilation_failed) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_u_Compilation_failed);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4402, __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(0, 4402, __pyx_L1_error)

    /* "fstlib/cext/pywrapfst.pyx":4401
 *                                    self._allow_negative_labels)
 *     self._sstrm.reset(new stringstream())
 *     if _tfst.get() == NULL:             # <<<<<<<<<<<<<<
 *       raise FstOpError("Compilation failed")
 *     return _init_XFst(_tfst.release())
 */
  }

  /* "fstlib/cext/pywrapfst.pyx":4403
 *     if _tfst.get() == NULL:
 *       raise FstOpError("Compilation failed")
 *     return _init_XFst(_tfst.release())             # <<<<<<<<<<<<<<
 * 
 *   cpdef void write(self, expression):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)__pyx_f_6fstlib_4cext_9pywrapfst__init_XFst(__pyx_v__tfst.release())); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4403, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":4373
 *     self._allow_negative_labels = allow_negative_labels
 * 
 *   cpdef Fst compile(self):             # <<<<<<<<<<<<<<
 *     """
 *     compile()
 */

  /* 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("fstlib.cext.pywrapfst.Compiler.compile", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_8Compiler_3compile(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_8Compiler_2compile[] = "\n    compile()\n\n    Compiles the FST in the compiler string buffer.\n\n    This method compiles the FST and returns the resulting machine.\n\n    Returns:\n      The FST described by the compiler string buffer.\n\n    Raises:\n      FstOpError: Compilation failed.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_8Compiler_3compile(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("compile (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_8Compiler_2compile(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Compiler *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_8Compiler_2compile(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Compiler *__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("compile", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_6fstlib_4cext_9pywrapfst_8Compiler_compile(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4373, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.Compiler.compile", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":4405
 *     return _init_XFst(_tfst.release())
 * 
 *   cpdef void write(self, expression):             # <<<<<<<<<<<<<<
 *     """
 *     write(expression)
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_8Compiler_5write(PyObject *__pyx_v_self, PyObject *__pyx_v_expression); /*proto*/
static void __pyx_f_6fstlib_4cext_9pywrapfst_8Compiler_write(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Compiler *__pyx_v_self, PyObject *__pyx_v_expression, int __pyx_skip_dispatch) {
  std::string __pyx_v__line;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  std::string __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("write", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_write); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4405, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6fstlib_4cext_9pywrapfst_8Compiler_5write)) {
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_expression) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_expression);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4405, __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;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "fstlib/cext/pywrapfst.pyx":4421
 *       expression: A string expression to add to compiler string buffer.
 *     """
 *     cdef string _line = tostring(expression)             # <<<<<<<<<<<<<<
 *     if not _line.empty() and _line.back() != b'\n':
 *       _line.append(b'\n')
 */
  __pyx_t_5 = __pyx_f_6fstlib_4cext_9pywrapfst_tostring(__pyx_v_expression); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4421, __pyx_L1_error)
  __pyx_v__line = __pyx_t_5;

  /* "fstlib/cext/pywrapfst.pyx":4422
 *     """
 *     cdef string _line = tostring(expression)
 *     if not _line.empty() and _line.back() != b'\n':             # <<<<<<<<<<<<<<
 *       _line.append(b'\n')
 *     deref(self._sstrm) << _line
 */
  __pyx_t_7 = ((!(__pyx_v__line.empty() != 0)) != 0);
  if (__pyx_t_7) {
  } else {
    __pyx_t_6 = __pyx_t_7;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_7 = ((__pyx_v__line.back() != '\n') != 0);
  __pyx_t_6 = __pyx_t_7;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_6) {

    /* "fstlib/cext/pywrapfst.pyx":4423
 *     cdef string _line = tostring(expression)
 *     if not _line.empty() and _line.back() != b'\n':
 *       _line.append(b'\n')             # <<<<<<<<<<<<<<
 *     deref(self._sstrm) << _line
 * 
 */
    try {
      __pyx_v__line.append(((char const *)"\n"));
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(0, 4423, __pyx_L1_error)
    }

    /* "fstlib/cext/pywrapfst.pyx":4422
 *     """
 *     cdef string _line = tostring(expression)
 *     if not _line.empty() and _line.back() != b'\n':             # <<<<<<<<<<<<<<
 *       _line.append(b'\n')
 *     deref(self._sstrm) << _line
 */
  }

  /* "fstlib/cext/pywrapfst.pyx":4424
 *     if not _line.empty() and _line.back() != b'\n':
 *       _line.append(b'\n')
 *     deref(self._sstrm) << _line             # <<<<<<<<<<<<<<
 * 
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_sstrm");
    __PYX_ERR(0, 4424, __pyx_L1_error)
  }
  (void)(((*__pyx_v_self->_sstrm) << __pyx_v__line));

  /* "fstlib/cext/pywrapfst.pyx":4405
 *     return _init_XFst(_tfst.release())
 * 
 *   cpdef void write(self, expression):             # <<<<<<<<<<<<<<
 *     """
 *     write(expression)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("fstlib.cext.pywrapfst.Compiler.write", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_8Compiler_5write(PyObject *__pyx_v_self, PyObject *__pyx_v_expression); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_8Compiler_4write[] = "\n    write(expression)\n\n    Writes a string into the compiler string buffer.\n\n    This method adds a line to the compiler string buffer. It is normally\n    invoked using the right shift operator, like so:\n\n        compiler = fst.Compiler()\n        compiler.write(\"0 0 49 49\")\n        compiler.write(\"0\")\n\n    Args:\n      expression: A string expression to add to compiler string buffer.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_8Compiler_5write(PyObject *__pyx_v_self, PyObject *__pyx_v_expression) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("write (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_8Compiler_4write(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Compiler *)__pyx_v_self), ((PyObject *)__pyx_v_expression));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_8Compiler_4write(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Compiler *__pyx_v_self, PyObject *__pyx_v_expression) {
  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("write", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_6fstlib_4cext_9pywrapfst_8Compiler_write(__pyx_v_self, __pyx_v_expression, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4405, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.Compiler.write", __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_6fstlib_4cext_9pywrapfst_8Compiler_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_8Compiler_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_8Compiler_6__reduce_cython__(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Compiler *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_8Compiler_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_6fstlib_4cext_9pywrapfst_Compiler *__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("__reduce_cython__", 0);

  /* "(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_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__53, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __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(1, 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_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.Compiler.__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_6fstlib_4cext_9pywrapfst_8Compiler_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_8Compiler_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_8Compiler_8__setstate_cython__(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Compiler *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_8Compiler_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_6fstlib_4cext_9pywrapfst_Compiler *__pyx_v_self, CYTHON_UNUSED 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__", 0);

  /* "(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_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__54, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __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(1, 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_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.Compiler.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":4446
 *   """
 * 
 *   def __init__(self):             # <<<<<<<<<<<<<<
 *     raise NotImplementedError(f"Cannot construct {self.__class__.__name__}")
 * 
 */

/* Python wrapper */
static int __pyx_pw_6fstlib_4cext_9pywrapfst_9FarReader_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_6fstlib_4cext_9pywrapfst_9FarReader_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_9FarReader___init__(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarReader *)__pyx_v_self));

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

static int __pyx_pf_6fstlib_4cext_9pywrapfst_9FarReader___init__(struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarReader *__pyx_v_self) {
  int __pyx_r;
  __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("__init__", 0);

  /* "fstlib/cext/pywrapfst.pyx":4447
 * 
 *   def __init__(self):
 *     raise NotImplementedError(f"Cannot construct {self.__class__.__name__}")             # <<<<<<<<<<<<<<
 * 
 *   def __repr__(self):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4447, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4447, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_t_2, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4447, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Cannot_construct, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4447, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_NotImplementedError, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4447, __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(0, 4447, __pyx_L1_error)

  /* "fstlib/cext/pywrapfst.pyx":4446
 *   """
 * 
 *   def __init__(self):             # <<<<<<<<<<<<<<
 *     raise NotImplementedError(f"Cannot construct {self.__class__.__name__}")
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.FarReader.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":4449
 *     raise NotImplementedError(f"Cannot construct {self.__class__.__name__}")
 * 
 *   def __repr__(self):             # <<<<<<<<<<<<<<
 *     return f"<{self.far_type()} FarReader at 0x{id(self):x}>"
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_9FarReader_3__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_9FarReader_3__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_9FarReader_2__repr__(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarReader *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_9FarReader_2__repr__(struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarReader *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  Py_UCS4 __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "fstlib/cext/pywrapfst.pyx":4450
 * 
 *   def __repr__(self):
 *     return f"<{self.far_type()} FarReader at 0x{id(self):x}>"             # <<<<<<<<<<<<<<
 * 
 *   @classmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4450, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = 0;
  __pyx_t_3 = 127;
  __Pyx_INCREF(__pyx_kp_u__2);
  __pyx_t_2 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__2);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u__2);
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "far_type");
    __PYX_ERR(0, 4450, __pyx_L1_error)
  }
  __pyx_t_4 = __pyx_convert_PyUnicode_string_to_py_std__in_string(((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_FarReader *)__pyx_v_self->__pyx_vtab)->far_type(__pyx_v_self, 0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4450, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4);
  __pyx_t_4 = 0;
  __Pyx_INCREF(__pyx_kp_u_FarReader_at_0x);
  __pyx_t_2 += 16;
  __Pyx_GIVEREF(__pyx_kp_u_FarReader_at_0x);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_FarReader_at_0x);
  __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4450, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_Format(__pyx_t_4, __pyx_n_u_x); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4450, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_5);
  __pyx_t_5 = 0;
  __Pyx_INCREF(__pyx_kp_u__3);
  __pyx_t_2 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__3);
  PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u__3);
  __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_1, 5, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4450, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":4449
 *     raise NotImplementedError(f"Cannot construct {self.__class__.__name__}")
 * 
 *   def __repr__(self):             # <<<<<<<<<<<<<<
 *     return f"<{self.far_type()} FarReader at 0x{id(self):x}>"
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.FarReader.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":4453
 * 
 *   @classmethod
 *   def open(cls, *sources):             # <<<<<<<<<<<<<<
 *     """
 *     FarReader.open(*sources)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_9FarReader_5open(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_9FarReader_4open[] = "\n    FarReader.open(*sources)\n\n    Creates a FarReader object.\n\n    This class method creates a FarReader given the string location of one or\n    more FAR files on disk.\n\n    Args:\n      *sources: The string location of one or more input FAR files.\n\n    Returns:\n      A new FarReader instance.\n\n    Raises:\n      FstIOError: Read failed.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_9FarReader_5open(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_sources = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("open (wrapper)", 0);
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "open", 0))) return NULL;
  __Pyx_INCREF(__pyx_args);
  __pyx_v_sources = __pyx_args;
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_9FarReader_4open(((PyTypeObject*)__pyx_v_cls), __pyx_v_sources);

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_9FarReader_4open(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_sources) {
  std::vector<std::string>  __pyx_v__sources;
  std::unique_ptr<fst::script::FarReaderClass>  __pyx_v__tfar;
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarReader *__pyx_v_reader = 0;
  PyObject *__pyx_8genexpr1__pyx_v_source = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  std::string __pyx_t_5;
  std::vector<std::string>  __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("open", 0);

  /* "fstlib/cext/pywrapfst.pyx":4471
 *       FstIOError: Read failed.
 *     """
 *     cdef vector[string] _sources = [path_tostring(source) for source in sources]             # <<<<<<<<<<<<<<
 *     cdef unique_ptr[fst.FarReaderClass] _tfar
 *     _tfar = fst.FarReaderClass.Open(_sources)
 */
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4471, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __pyx_v_sources; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    for (;;) {
      if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 4471, __pyx_L5_error)
      #else
      __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4471, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_4);
      #endif
      __Pyx_XDECREF_SET(__pyx_8genexpr1__pyx_v_source, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_5 = __pyx_f_6fstlib_4cext_9pywrapfst_path_tostring(__pyx_8genexpr1__pyx_v_source); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4471, __pyx_L5_error)
      __pyx_t_4 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4471, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 4471, __pyx_L5_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_source); __pyx_8genexpr1__pyx_v_source = 0;
    goto __pyx_L8_exit_scope;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_source); __pyx_8genexpr1__pyx_v_source = 0;
    goto __pyx_L1_error;
    __pyx_L8_exit_scope:;
  } /* exit inner scope */
  __pyx_t_6 = __pyx_convert_vector_from_py_std_3a__3a_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4471, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v__sources = __pyx_t_6;

  /* "fstlib/cext/pywrapfst.pyx":4473
 *     cdef vector[string] _sources = [path_tostring(source) for source in sources]
 *     cdef unique_ptr[fst.FarReaderClass] _tfar
 *     _tfar = fst.FarReaderClass.Open(_sources)             # <<<<<<<<<<<<<<
 *     if _tfar.get() == NULL:
 *       raise FstIOError(f"Read failed: {sources!r}")
 */
  __pyx_v__tfar = fst::script::FarReaderClass::Open(__pyx_v__sources);

  /* "fstlib/cext/pywrapfst.pyx":4474
 *     cdef unique_ptr[fst.FarReaderClass] _tfar
 *     _tfar = fst.FarReaderClass.Open(_sources)
 *     if _tfar.get() == NULL:             # <<<<<<<<<<<<<<
 *       raise FstIOError(f"Read failed: {sources!r}")
 *     cdef FarReader reader = FarReader.__new__(FarReader)
 */
  __pyx_t_7 = ((__pyx_v__tfar.get() == NULL) != 0);
  if (unlikely(__pyx_t_7)) {

    /* "fstlib/cext/pywrapfst.pyx":4475
 *     _tfar = fst.FarReaderClass.Open(_sources)
 *     if _tfar.get() == NULL:
 *       raise FstIOError(f"Read failed: {sources!r}")             # <<<<<<<<<<<<<<
 *     cdef FarReader reader = FarReader.__new__(FarReader)
 *     reader._reader = move(_tfar)
 */
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FstIOError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4475, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_sources), __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4475, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_8 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Read_failed, __pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4475, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_8);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4475, __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(0, 4475, __pyx_L1_error)

    /* "fstlib/cext/pywrapfst.pyx":4474
 *     cdef unique_ptr[fst.FarReaderClass] _tfar
 *     _tfar = fst.FarReaderClass.Open(_sources)
 *     if _tfar.get() == NULL:             # <<<<<<<<<<<<<<
 *       raise FstIOError(f"Read failed: {sources!r}")
 *     cdef FarReader reader = FarReader.__new__(FarReader)
 */
  }

  /* "fstlib/cext/pywrapfst.pyx":4476
 *     if _tfar.get() == NULL:
 *       raise FstIOError(f"Read failed: {sources!r}")
 *     cdef FarReader reader = FarReader.__new__(FarReader)             # <<<<<<<<<<<<<<
 *     reader._reader = move(_tfar)
 *     return reader
 */
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_6fstlib_4cext_9pywrapfst_FarReader(((PyTypeObject *)__pyx_ptype_6fstlib_4cext_9pywrapfst_FarReader), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4476, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v_reader = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarReader *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "fstlib/cext/pywrapfst.pyx":4477
 *       raise FstIOError(f"Read failed: {sources!r}")
 *     cdef FarReader reader = FarReader.__new__(FarReader)
 *     reader._reader = move(_tfar)             # <<<<<<<<<<<<<<
 *     return reader
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_reader) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_reader");
    __PYX_ERR(0, 4477, __pyx_L1_error)
  }
  __pyx_v_reader->_reader = fst::move<std::unique_ptr<fst::script::FarReaderClass> >(__pyx_v__tfar);

  /* "fstlib/cext/pywrapfst.pyx":4478
 *     cdef FarReader reader = FarReader.__new__(FarReader)
 *     reader._reader = move(_tfar)
 *     return reader             # <<<<<<<<<<<<<<
 * 
 *   cpdef string arc_type(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_reader));
  __pyx_r = ((PyObject *)__pyx_v_reader);
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":4453
 * 
 *   @classmethod
 *   def open(cls, *sources):             # <<<<<<<<<<<<<<
 *     """
 *     FarReader.open(*sources)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.FarReader.open", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_reader);
  __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_source);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":4480
 *     return reader
 * 
 *   cpdef string arc_type(self):             # <<<<<<<<<<<<<<
 *     """
 *     arc_type(self)
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_9FarReader_7arc_type(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static std::string __pyx_f_6fstlib_4cext_9pywrapfst_9FarReader_arc_type(struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarReader *__pyx_v_self, int __pyx_skip_dispatch) {
  std::string __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  std::string __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("arc_type", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_arc_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4480, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6fstlib_4cext_9pywrapfst_9FarReader_7arc_type)) {
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4480, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4480, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_5;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "fstlib/cext/pywrapfst.pyx":4486
 *     Returns a string indicating the arc type.
 *     """
 *     return self._reader.get().ArcType()             # <<<<<<<<<<<<<<
 * 
 *   cpdef bool done(self):
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_reader");
    __PYX_ERR(0, 4486, __pyx_L1_error)
  }
  __pyx_r = __pyx_v_self->_reader.get()->ArcType();
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":4480
 *     return reader
 * 
 *   cpdef string arc_type(self):             # <<<<<<<<<<<<<<
 *     """
 *     arc_type(self)
 */

  /* 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_WriteUnraisable("fstlib.cext.pywrapfst.FarReader.arc_type", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_9FarReader_7arc_type(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_9FarReader_6arc_type[] = "\n    arc_type(self)\n\n    Returns a string indicating the arc type.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_9FarReader_7arc_type(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("arc_type (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_9FarReader_6arc_type(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarReader *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_9FarReader_6arc_type(struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarReader *__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("arc_type", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_f_6fstlib_4cext_9pywrapfst_9FarReader_arc_type(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4480, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.FarReader.arc_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":4488
 *     return self._reader.get().ArcType()
 * 
 *   cpdef bool done(self):             # <<<<<<<<<<<<<<
 *     """
 *     done(self)
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_9FarReader_9done(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static bool __pyx_f_6fstlib_4cext_9pywrapfst_9FarReader_done(struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarReader *__pyx_v_self, int __pyx_skip_dispatch) {
  bool __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  bool __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("done", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_done); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4488, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6fstlib_4cext_9pywrapfst_9FarReader_9done)) {
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4488, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4488, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_5;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "fstlib/cext/pywrapfst.pyx":4497
 *       True if the iterator is exhausted, False otherwise.
 *     """
 *     return self._reader.get().Done()             # <<<<<<<<<<<<<<
 * 
 *   cpdef bool error(self):
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_reader");
    __PYX_ERR(0, 4497, __pyx_L1_error)
  }
  __pyx_r = __pyx_v_self->_reader.get()->Done();
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":4488
 *     return self._reader.get().ArcType()
 * 
 *   cpdef bool done(self):             # <<<<<<<<<<<<<<
 *     """
 *     done(self)
 */

  /* 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_WriteUnraisable("fstlib.cext.pywrapfst.FarReader.done", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_9FarReader_9done(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_9FarReader_8done[] = "\n    done(self)\n\n    Indicates whether the iterator is exhausted or not.\n\n    Returns:\n      True if the iterator is exhausted, False otherwise.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_9FarReader_9done(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("done (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_9FarReader_8done(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarReader *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_9FarReader_8done(struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarReader *__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("done", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_6fstlib_4cext_9pywrapfst_9FarReader_done(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4488, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.FarReader.done", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":4499
 *     return self._reader.get().Done()
 * 
 *   cpdef bool error(self):             # <<<<<<<<<<<<<<
 *     """
 *     error(self)
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_9FarReader_11error(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static bool __pyx_f_6fstlib_4cext_9pywrapfst_9FarReader_error(struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarReader *__pyx_v_self, int __pyx_skip_dispatch) {
  bool __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  bool __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("error", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4499, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6fstlib_4cext_9pywrapfst_9FarReader_11error)) {
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4499, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4499, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_5;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "fstlib/cext/pywrapfst.pyx":4508
 *       True if the FarReader is in an errorful state, False otherwise.
 *     """
 *     return self._reader.get().Error()             # <<<<<<<<<<<<<<
 * 
 *   cpdef string far_type(self):
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_reader");
    __PYX_ERR(0, 4508, __pyx_L1_error)
  }
  __pyx_r = __pyx_v_self->_reader.get()->Error();
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":4499
 *     return self._reader.get().Done()
 * 
 *   cpdef bool error(self):             # <<<<<<<<<<<<<<
 *     """
 *     error(self)
 */

  /* 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_WriteUnraisable("fstlib.cext.pywrapfst.FarReader.error", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_9FarReader_11error(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_9FarReader_10error[] = "\n    error(self)\n\n    Indicates whether the FarReader has encountered an error.\n\n    Returns:\n      True if the FarReader is in an errorful state, False otherwise.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_9FarReader_11error(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("error (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_9FarReader_10error(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarReader *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_9FarReader_10error(struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarReader *__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("error", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_6fstlib_4cext_9pywrapfst_9FarReader_error(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4499, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.FarReader.error", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":4510
 *     return self._reader.get().Error()
 * 
 *   cpdef string far_type(self):             # <<<<<<<<<<<<<<
 *     return fst.GetFarTypeString(self._reader.get().Type())
 * 
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_9FarReader_13far_type(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static std::string __pyx_f_6fstlib_4cext_9pywrapfst_9FarReader_far_type(struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarReader *__pyx_v_self, int __pyx_skip_dispatch) {
  std::string __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  std::string __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("far_type", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_far_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4510, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6fstlib_4cext_9pywrapfst_9FarReader_13far_type)) {
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4510, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4510, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_5;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "fstlib/cext/pywrapfst.pyx":4511
 * 
 *   cpdef string far_type(self):
 *     return fst.GetFarTypeString(self._reader.get().Type())             # <<<<<<<<<<<<<<
 * 
 *   cpdef bool find(self, key):
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_reader");
    __PYX_ERR(0, 4511, __pyx_L1_error)
  }
  __pyx_r = fst::GetFarTypeString(__pyx_v_self->_reader.get()->Type());
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":4510
 *     return self._reader.get().Error()
 * 
 *   cpdef string far_type(self):             # <<<<<<<<<<<<<<
 *     return fst.GetFarTypeString(self._reader.get().Type())
 * 
 */

  /* 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_WriteUnraisable("fstlib.cext.pywrapfst.FarReader.far_type", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_9FarReader_13far_type(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_9FarReader_13far_type(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("far_type (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_9FarReader_12far_type(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarReader *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_9FarReader_12far_type(struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarReader *__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("far_type", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_f_6fstlib_4cext_9pywrapfst_9FarReader_far_type(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4510, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.FarReader.far_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":4513
 *     return fst.GetFarTypeString(self._reader.get().Type())
 * 
 *   cpdef bool find(self, key):             # <<<<<<<<<<<<<<
 *     """
 *     find(self, key)
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_9FarReader_15find(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static bool __pyx_f_6fstlib_4cext_9pywrapfst_9FarReader_find(struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarReader *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch) {
  bool __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  bool __pyx_t_5;
  std::string __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("find", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_find); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4513, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6fstlib_4cext_9pywrapfst_9FarReader_15find)) {
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_key) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_key);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4513, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4513, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_5;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "fstlib/cext/pywrapfst.pyx":4526
 *       True if the key was found, False otherwise.
 *     """
 *     return self._reader.get().Find(tostring(key))             # <<<<<<<<<<<<<<
 * 
 *   cpdef Fst get_fst(self):
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_reader");
    __PYX_ERR(0, 4526, __pyx_L1_error)
  }
  __pyx_t_6 = __pyx_f_6fstlib_4cext_9pywrapfst_tostring(__pyx_v_key); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4526, __pyx_L1_error)
  __pyx_r = __pyx_v_self->_reader.get()->Find(__pyx_t_6);
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":4513
 *     return fst.GetFarTypeString(self._reader.get().Type())
 * 
 *   cpdef bool find(self, key):             # <<<<<<<<<<<<<<
 *     """
 *     find(self, key)
 */

  /* 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_WriteUnraisable("fstlib.cext.pywrapfst.FarReader.find", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_9FarReader_15find(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_9FarReader_14find[] = "\n    find(self, key)\n\n    Sets the current position to the first entry greater than or equal to the\n    key (a string) and indicates whether or not a match was found.\n\n    Args:\n      key: A string key.\n\n    Returns:\n      True if the key was found, False otherwise.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_9FarReader_15find(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("find (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_9FarReader_14find(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarReader *)__pyx_v_self), ((PyObject *)__pyx_v_key));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_9FarReader_14find(struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarReader *__pyx_v_self, PyObject *__pyx_v_key) {
  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("find", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_6fstlib_4cext_9pywrapfst_9FarReader_find(__pyx_v_self, __pyx_v_key, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4513, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.FarReader.find", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":4528
 *     return self._reader.get().Find(tostring(key))
 * 
 *   cpdef Fst get_fst(self):             # <<<<<<<<<<<<<<
 *     """
 *     get_fst(self)
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_9FarReader_17get_fst(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_f_6fstlib_4cext_9pywrapfst_9FarReader_get_fst(struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarReader *__pyx_v_self, int __pyx_skip_dispatch) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__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("get_fst", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_fst); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4528, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6fstlib_4cext_9pywrapfst_9FarReader_17get_fst)) {
        __Pyx_XDECREF(((PyObject *)__pyx_r));
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4528, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_6fstlib_4cext_9pywrapfst_Fst))))) __PYX_ERR(0, 4528, __pyx_L1_error)
        __pyx_r = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "fstlib/cext/pywrapfst.pyx":4537
 *       A copy of the FST at the current position.
 *     """
 *     return _init_XFst(new fst.FstClass(deref(self._reader.get().GetFstClass())))             # <<<<<<<<<<<<<<
 * 
 *   cpdef string get_key(self):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_reader");
    __PYX_ERR(0, 4537, __pyx_L1_error)
  }
  __pyx_t_1 = ((PyObject *)__pyx_f_6fstlib_4cext_9pywrapfst__init_XFst(new fst::script::FstClass((*__pyx_v_self->_reader.get()->GetFstClass())))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4537, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":4528
 *     return self._reader.get().Find(tostring(key))
 * 
 *   cpdef Fst get_fst(self):             # <<<<<<<<<<<<<<
 *     """
 *     get_fst(self)
 */

  /* 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("fstlib.cext.pywrapfst.FarReader.get_fst", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_9FarReader_17get_fst(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_9FarReader_16get_fst[] = "\n    get_fst(self)\n\n    Returns the FST at the current position.\n\n    Returns:\n      A copy of the FST at the current position.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_9FarReader_17get_fst(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_fst (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_9FarReader_16get_fst(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarReader *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_9FarReader_16get_fst(struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarReader *__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_fst", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_6fstlib_4cext_9pywrapfst_9FarReader_get_fst(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4528, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.FarReader.get_fst", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":4539
 *     return _init_XFst(new fst.FstClass(deref(self._reader.get().GetFstClass())))
 * 
 *   cpdef string get_key(self):             # <<<<<<<<<<<<<<
 *     """
 *     get_key(self)
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_9FarReader_19get_key(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static std::string __pyx_f_6fstlib_4cext_9pywrapfst_9FarReader_get_key(struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarReader *__pyx_v_self, int __pyx_skip_dispatch) {
  std::string __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  std::string __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_key", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4539, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6fstlib_4cext_9pywrapfst_9FarReader_19get_key)) {
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4539, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4539, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_5;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "fstlib/cext/pywrapfst.pyx":4548
 *       The string key at the current position.
 *     """
 *     return self._reader.get().GetKey()             # <<<<<<<<<<<<<<
 * 
 *   cpdef void next(self):
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_reader");
    __PYX_ERR(0, 4548, __pyx_L1_error)
  }
  __pyx_r = __pyx_v_self->_reader.get()->GetKey();
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":4539
 *     return _init_XFst(new fst.FstClass(deref(self._reader.get().GetFstClass())))
 * 
 *   cpdef string get_key(self):             # <<<<<<<<<<<<<<
 *     """
 *     get_key(self)
 */

  /* 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_WriteUnraisable("fstlib.cext.pywrapfst.FarReader.get_key", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_9FarReader_19get_key(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_9FarReader_18get_key[] = "\n    get_key(self)\n\n    Returns the string key at the current position.\n\n    Returns:\n      The string key at the current position.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_9FarReader_19get_key(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_key (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_9FarReader_18get_key(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarReader *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_9FarReader_18get_key(struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarReader *__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_key", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_f_6fstlib_4cext_9pywrapfst_9FarReader_get_key(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4539, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.FarReader.get_key", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":4550
 *     return self._reader.get().GetKey()
 * 
 *   cpdef void next(self):             # <<<<<<<<<<<<<<
 *     """
 *     next(self)
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_9FarReader_21next(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static void __pyx_f_6fstlib_4cext_9pywrapfst_9FarReader_next(struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarReader *__pyx_v_self, int __pyx_skip_dispatch) {
  __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("next", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_next); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4550, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6fstlib_4cext_9pywrapfst_9FarReader_21next)) {
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4550, __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;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "fstlib/cext/pywrapfst.pyx":4556
 *     Advances the iterator.
 *     """
 *     self._reader.get().Next()             # <<<<<<<<<<<<<<
 * 
 *   cpdef void reset(self):
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_reader");
    __PYX_ERR(0, 4556, __pyx_L1_error)
  }
  __pyx_v_self->_reader.get()->Next();

  /* "fstlib/cext/pywrapfst.pyx":4550
 *     return self._reader.get().GetKey()
 * 
 *   cpdef void next(self):             # <<<<<<<<<<<<<<
 *     """
 *     next(self)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("fstlib.cext.pywrapfst.FarReader.next", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_9FarReader_21next(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_9FarReader_20next[] = "\n    next(self)\n\n    Advances the iterator.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_9FarReader_21next(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("next (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_9FarReader_20next(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarReader *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_9FarReader_20next(struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarReader *__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("next", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_6fstlib_4cext_9pywrapfst_9FarReader_next(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4550, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.FarReader.next", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":4558
 *     self._reader.get().Next()
 * 
 *   cpdef void reset(self):             # <<<<<<<<<<<<<<
 *     """
 *     reset(self)
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_9FarReader_23reset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static void __pyx_f_6fstlib_4cext_9pywrapfst_9FarReader_reset(struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarReader *__pyx_v_self, int __pyx_skip_dispatch) {
  __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("reset", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4558, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6fstlib_4cext_9pywrapfst_9FarReader_23reset)) {
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4558, __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;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "fstlib/cext/pywrapfst.pyx":4564
 *     Resets the iterator to the initial position.
 *     """
 *     self._reader.get().Reset()             # <<<<<<<<<<<<<<
 * 
 *   def __getitem__(self, key):
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_reader");
    __PYX_ERR(0, 4564, __pyx_L1_error)
  }
  __pyx_v_self->_reader.get()->Reset();

  /* "fstlib/cext/pywrapfst.pyx":4558
 *     self._reader.get().Next()
 * 
 *   cpdef void reset(self):             # <<<<<<<<<<<<<<
 *     """
 *     reset(self)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("fstlib.cext.pywrapfst.FarReader.reset", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_9FarReader_23reset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_9FarReader_22reset[] = "\n    reset(self)\n\n    Resets the iterator to the initial position.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_9FarReader_23reset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("reset (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_9FarReader_22reset(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarReader *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_9FarReader_22reset(struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarReader *__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", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_6fstlib_4cext_9pywrapfst_9FarReader_reset(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4558, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.FarReader.reset", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":4566
 *     self._reader.get().Reset()
 * 
 *   def __getitem__(self, key):             # <<<<<<<<<<<<<<
 *     if self._reader.get().Find(tostring(key)):
 *       return self.get_fst()
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_9FarReader_25__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_9FarReader_25__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_9FarReader_24__getitem__(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarReader *)__pyx_v_self), ((PyObject *)__pyx_v_key));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_9FarReader_24__getitem__(struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarReader *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::string __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("__getitem__", 0);

  /* "fstlib/cext/pywrapfst.pyx":4567
 * 
 *   def __getitem__(self, key):
 *     if self._reader.get().Find(tostring(key)):             # <<<<<<<<<<<<<<
 *       return self.get_fst()
 *     else:
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_reader");
    __PYX_ERR(0, 4567, __pyx_L1_error)
  }
  __pyx_t_1 = __pyx_f_6fstlib_4cext_9pywrapfst_tostring(__pyx_v_key); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4567, __pyx_L1_error)
  __pyx_t_2 = (__pyx_v_self->_reader.get()->Find(__pyx_t_1) != 0);
  if (likely(__pyx_t_2)) {

    /* "fstlib/cext/pywrapfst.pyx":4568
 *   def __getitem__(self, key):
 *     if self._reader.get().Find(tostring(key)):
 *       return self.get_fst()             # <<<<<<<<<<<<<<
 *     else:
 *       raise KeyError(key)
 */
    __Pyx_XDECREF(__pyx_r);
    if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get_fst");
      __PYX_ERR(0, 4568, __pyx_L1_error)
    }
    __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_FarReader *)__pyx_v_self->__pyx_vtab)->get_fst(__pyx_v_self, 0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4568, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "fstlib/cext/pywrapfst.pyx":4567
 * 
 *   def __getitem__(self, key):
 *     if self._reader.get().Find(tostring(key)):             # <<<<<<<<<<<<<<
 *       return self.get_fst()
 *     else:
 */
  }

  /* "fstlib/cext/pywrapfst.pyx":4570
 *       return self.get_fst()
 *     else:
 *       raise KeyError(key)             # <<<<<<<<<<<<<<
 * 
 *   def __next__(self):
 */
  /*else*/ {
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_v_key); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4570, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 4570, __pyx_L1_error)
  }

  /* "fstlib/cext/pywrapfst.pyx":4566
 *     self._reader.get().Reset()
 * 
 *   def __getitem__(self, key):             # <<<<<<<<<<<<<<
 *     if self._reader.get().Find(tostring(key)):
 *       return self.get_fst()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.FarReader.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":4572
 *       raise KeyError(key)
 * 
 *   def __next__(self):             # <<<<<<<<<<<<<<
 *     if self.done():
 *       raise StopIteration
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_9FarReader_27__next__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_9FarReader_27__next__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__next__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_9FarReader_26__next__(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarReader *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_9FarReader_26__next__(struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarReader *__pyx_v_self) {
  std::string __pyx_v__key;
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v__fst = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  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("__next__", 0);

  /* "fstlib/cext/pywrapfst.pyx":4573
 * 
 *   def __next__(self):
 *     if self.done():             # <<<<<<<<<<<<<<
 *       raise StopIteration
 *     cdef string _key = self.get_key()
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "done");
    __PYX_ERR(0, 4573, __pyx_L1_error)
  }
  __pyx_t_1 = (((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_FarReader *)__pyx_v_self->__pyx_vtab)->done(__pyx_v_self, 0) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "fstlib/cext/pywrapfst.pyx":4574
 *   def __next__(self):
 *     if self.done():
 *       raise StopIteration             # <<<<<<<<<<<<<<
 *     cdef string _key = self.get_key()
 *     cdef Fst _fst = self.get_fst()
 */
    __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
    __PYX_ERR(0, 4574, __pyx_L1_error)

    /* "fstlib/cext/pywrapfst.pyx":4573
 * 
 *   def __next__(self):
 *     if self.done():             # <<<<<<<<<<<<<<
 *       raise StopIteration
 *     cdef string _key = self.get_key()
 */
  }

  /* "fstlib/cext/pywrapfst.pyx":4575
 *     if self.done():
 *       raise StopIteration
 *     cdef string _key = self.get_key()             # <<<<<<<<<<<<<<
 *     cdef Fst _fst = self.get_fst()
 *     self.next()
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get_key");
    __PYX_ERR(0, 4575, __pyx_L1_error)
  }
  __pyx_v__key = ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_FarReader *)__pyx_v_self->__pyx_vtab)->get_key(__pyx_v_self, 0);

  /* "fstlib/cext/pywrapfst.pyx":4576
 *       raise StopIteration
 *     cdef string _key = self.get_key()
 *     cdef Fst _fst = self.get_fst()             # <<<<<<<<<<<<<<
 *     self.next()
 *     return (_key, _fst)
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get_fst");
    __PYX_ERR(0, 4576, __pyx_L1_error)
  }
  __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_FarReader *)__pyx_v_self->__pyx_vtab)->get_fst(__pyx_v_self, 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4576, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v__fst = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "fstlib/cext/pywrapfst.pyx":4577
 *     cdef string _key = self.get_key()
 *     cdef Fst _fst = self.get_fst()
 *     self.next()             # <<<<<<<<<<<<<<
 *     return (_key, _fst)
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "next");
    __PYX_ERR(0, 4577, __pyx_L1_error)
  }
  ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_FarReader *)__pyx_v_self->__pyx_vtab)->next(__pyx_v_self, 0);

  /* "fstlib/cext/pywrapfst.pyx":4578
 *     cdef Fst _fst = self.get_fst()
 *     self.next()
 *     return (_key, _fst)             # <<<<<<<<<<<<<<
 * 
 *   # This just registers this class as a possible iterator.
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_v__key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4578, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4578, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_v__fst));
  __Pyx_GIVEREF(((PyObject *)__pyx_v__fst));
  PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v__fst));
  __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":4572
 *       raise KeyError(key)
 * 
 *   def __next__(self):             # <<<<<<<<<<<<<<
 *     if self.done():
 *       raise StopIteration
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.FarReader.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v__fst);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":4581
 * 
 *   # This just registers this class as a possible iterator.
 *   def __iter__(self):             # <<<<<<<<<<<<<<
 *     return self
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_9FarReader_29__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_9FarReader_29__iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_9FarReader_28__iter__(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarReader *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_9FarReader_28__iter__(struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarReader *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);

  /* "fstlib/cext/pywrapfst.pyx":4582
 *   # This just registers this class as a possible iterator.
 *   def __iter__(self):
 *     return self             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":4581
 * 
 *   # This just registers this class as a possible iterator.
 *   def __iter__(self):             # <<<<<<<<<<<<<<
 *     return self
 * 
 */

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

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

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_9FarReader_31__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_9FarReader_31__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_9FarReader_30__reduce_cython__(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarReader *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_9FarReader_30__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarReader *__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("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self._reader cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self._reader cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__55, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __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(1, 2, __pyx_L1_error)

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.FarReader.__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._reader cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self._reader cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_9FarReader_33__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_9FarReader_33__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_9FarReader_32__setstate_cython__(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarReader *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_9FarReader_32__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarReader *__pyx_v_self, CYTHON_UNUSED 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__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self._reader cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self._reader cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__56, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __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(1, 4, __pyx_L1_error)

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.FarReader.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":4605
 *   """
 * 
 *   def __init__(self):             # <<<<<<<<<<<<<<
 *     raise NotImplementedError(f"Cannot construct {self.__class__.__name__}")
 * 
 */

/* Python wrapper */
static int __pyx_pw_6fstlib_4cext_9pywrapfst_9FarWriter_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_6fstlib_4cext_9pywrapfst_9FarWriter_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_9FarWriter___init__(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarWriter *)__pyx_v_self));

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

static int __pyx_pf_6fstlib_4cext_9pywrapfst_9FarWriter___init__(struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarWriter *__pyx_v_self) {
  int __pyx_r;
  __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("__init__", 0);

  /* "fstlib/cext/pywrapfst.pyx":4606
 * 
 *   def __init__(self):
 *     raise NotImplementedError(f"Cannot construct {self.__class__.__name__}")             # <<<<<<<<<<<<<<
 * 
 *   def __repr__(self):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4606, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4606, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_t_2, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4606, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Cannot_construct, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4606, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_NotImplementedError, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4606, __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(0, 4606, __pyx_L1_error)

  /* "fstlib/cext/pywrapfst.pyx":4605
 *   """
 * 
 *   def __init__(self):             # <<<<<<<<<<<<<<
 *     raise NotImplementedError(f"Cannot construct {self.__class__.__name__}")
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.FarWriter.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":4608
 *     raise NotImplementedError(f"Cannot construct {self.__class__.__name__}")
 * 
 *   def __repr__(self):             # <<<<<<<<<<<<<<
 *     return f"<{self.far_type()} FarWriter at 0x{id(self):x}>"
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_9FarWriter_3__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_9FarWriter_3__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_9FarWriter_2__repr__(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarWriter *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_9FarWriter_2__repr__(struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarWriter *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  Py_UCS4 __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "fstlib/cext/pywrapfst.pyx":4609
 * 
 *   def __repr__(self):
 *     return f"<{self.far_type()} FarWriter at 0x{id(self):x}>"             # <<<<<<<<<<<<<<
 * 
 *   @classmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4609, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = 0;
  __pyx_t_3 = 127;
  __Pyx_INCREF(__pyx_kp_u__2);
  __pyx_t_2 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__2);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u__2);
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "far_type");
    __PYX_ERR(0, 4609, __pyx_L1_error)
  }
  __pyx_t_4 = __pyx_convert_PyUnicode_string_to_py_std__in_string(((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_FarWriter *)__pyx_v_self->__pyx_vtab)->far_type(__pyx_v_self, 0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4609, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4);
  __pyx_t_4 = 0;
  __Pyx_INCREF(__pyx_kp_u_FarWriter_at_0x);
  __pyx_t_2 += 16;
  __Pyx_GIVEREF(__pyx_kp_u_FarWriter_at_0x);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_FarWriter_at_0x);
  __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4609, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_Format(__pyx_t_4, __pyx_n_u_x); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4609, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_5);
  __pyx_t_5 = 0;
  __Pyx_INCREF(__pyx_kp_u__3);
  __pyx_t_2 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__3);
  PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u__3);
  __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_1, 5, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4609, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":4608
 *     raise NotImplementedError(f"Cannot construct {self.__class__.__name__}")
 * 
 *   def __repr__(self):             # <<<<<<<<<<<<<<
 *     return f"<{self.far_type()} FarWriter at 0x{id(self):x}>"
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.FarWriter.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":4612
 * 
 *   @classmethod
 *   def create(cls, source, arc_type="standard", far_type="default"):             # <<<<<<<<<<<<<<
 *     """
 *     FarWriter.
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_9FarWriter_5create(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_9FarWriter_4create[] = "\n    FarWriter.\n\n    Creates a FarWriter object.\n\n    This class method creates a FarWriter given the desired output location,\n    arc type, and FAR type.\n\n    Args:\n      source: The string location for the output FAR files.\n      arc_type: A string indicating the arc type.\n      far_type: A string indicating the FAR type; one of: \"fst\", \"stlist\",\n          \"sttable\", \"sstable\", \"default\".\n\n    Returns:\n      A new FarWriter instance.\n\n    Raises:\n      FstIOError: Read failed.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_9FarWriter_5create(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_source = 0;
  PyObject *__pyx_v_arc_type = 0;
  PyObject *__pyx_v_far_type = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("create (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_source,&__pyx_n_s_arc_type,&__pyx_n_s_far_type,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject *)__pyx_n_u_standard);
    values[2] = ((PyObject *)__pyx_n_u_default);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_source)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_arc_type);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_far_type);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "create") < 0)) __PYX_ERR(0, 4612, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_source = values[0];
    __pyx_v_arc_type = values[1];
    __pyx_v_far_type = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("create", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4612, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.FarWriter.create", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_9FarWriter_4create(((PyTypeObject*)__pyx_v_cls), __pyx_v_source, __pyx_v_arc_type, __pyx_v_far_type);

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_9FarWriter_4create(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_source, PyObject *__pyx_v_arc_type, PyObject *__pyx_v_far_type) {
  std::unique_ptr<fst::script::FarWriterClass>  __pyx_v__tfar;
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarWriter *__pyx_v_writer = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  std::string __pyx_t_2;
  std::string __pyx_t_3;
  fst::FarType __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("create", 0);

  /* "fstlib/cext/pywrapfst.pyx":4635
 *     cdef unique_ptr[fst.FarWriterClass] _tfar
 *     _tfar = fst.FarWriterClass.Create(
 *         path_tostring(source),             # <<<<<<<<<<<<<<
 *         tostring(arc_type),
 *         _get_far_type(tostring(far_type)))
 */
  __pyx_t_1 = __pyx_f_6fstlib_4cext_9pywrapfst_path_tostring(__pyx_v_source); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4635, __pyx_L1_error)

  /* "fstlib/cext/pywrapfst.pyx":4636
 *     _tfar = fst.FarWriterClass.Create(
 *         path_tostring(source),
 *         tostring(arc_type),             # <<<<<<<<<<<<<<
 *         _get_far_type(tostring(far_type)))
 *     if _tfar.get() == NULL:
 */
  __pyx_t_2 = __pyx_f_6fstlib_4cext_9pywrapfst_tostring(__pyx_v_arc_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4636, __pyx_L1_error)

  /* "fstlib/cext/pywrapfst.pyx":4637
 *         path_tostring(source),
 *         tostring(arc_type),
 *         _get_far_type(tostring(far_type)))             # <<<<<<<<<<<<<<
 *     if _tfar.get() == NULL:
 *       raise FstIOError(f"Open failed: {source!r}")
 */
  __pyx_t_3 = __pyx_f_6fstlib_4cext_9pywrapfst_tostring(__pyx_v_far_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4637, __pyx_L1_error)
  __pyx_t_4 = __pyx_f_6fstlib_4cext_9pywrapfst__get_far_type(__pyx_t_3); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4637, __pyx_L1_error)

  /* "fstlib/cext/pywrapfst.pyx":4634
 *     """
 *     cdef unique_ptr[fst.FarWriterClass] _tfar
 *     _tfar = fst.FarWriterClass.Create(             # <<<<<<<<<<<<<<
 *         path_tostring(source),
 *         tostring(arc_type),
 */
  __pyx_v__tfar = fst::script::FarWriterClass::Create(__pyx_t_1, __pyx_t_2, __pyx_t_4);

  /* "fstlib/cext/pywrapfst.pyx":4638
 *         tostring(arc_type),
 *         _get_far_type(tostring(far_type)))
 *     if _tfar.get() == NULL:             # <<<<<<<<<<<<<<
 *       raise FstIOError(f"Open failed: {source!r}")
 *     cdef FarWriter writer = FarWriter.__new__(FarWriter)
 */
  __pyx_t_5 = ((__pyx_v__tfar.get() == NULL) != 0);
  if (unlikely(__pyx_t_5)) {

    /* "fstlib/cext/pywrapfst.pyx":4639
 *         _get_far_type(tostring(far_type)))
 *     if _tfar.get() == NULL:
 *       raise FstIOError(f"Open failed: {source!r}")             # <<<<<<<<<<<<<<
 *     cdef FarWriter writer = FarWriter.__new__(FarWriter)
 *     writer._writer = move(_tfar)
 */
    __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_FstIOError); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4639, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_source), __pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4639, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Open_failed, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4639, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
      }
    }
    __pyx_t_6 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_9) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_9);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4639, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_Raise(__pyx_t_6, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __PYX_ERR(0, 4639, __pyx_L1_error)

    /* "fstlib/cext/pywrapfst.pyx":4638
 *         tostring(arc_type),
 *         _get_far_type(tostring(far_type)))
 *     if _tfar.get() == NULL:             # <<<<<<<<<<<<<<
 *       raise FstIOError(f"Open failed: {source!r}")
 *     cdef FarWriter writer = FarWriter.__new__(FarWriter)
 */
  }

  /* "fstlib/cext/pywrapfst.pyx":4640
 *     if _tfar.get() == NULL:
 *       raise FstIOError(f"Open failed: {source!r}")
 *     cdef FarWriter writer = FarWriter.__new__(FarWriter)             # <<<<<<<<<<<<<<
 *     writer._writer = move(_tfar)
 *     return writer
 */
  __pyx_t_6 = ((PyObject *)__pyx_tp_new_6fstlib_4cext_9pywrapfst_FarWriter(((PyTypeObject *)__pyx_ptype_6fstlib_4cext_9pywrapfst_FarWriter), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4640, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_6));
  __pyx_v_writer = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarWriter *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "fstlib/cext/pywrapfst.pyx":4641
 *       raise FstIOError(f"Open failed: {source!r}")
 *     cdef FarWriter writer = FarWriter.__new__(FarWriter)
 *     writer._writer = move(_tfar)             # <<<<<<<<<<<<<<
 *     return writer
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_writer) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_writer");
    __PYX_ERR(0, 4641, __pyx_L1_error)
  }
  __pyx_v_writer->_writer = fst::move<std::unique_ptr<fst::script::FarWriterClass> >(__pyx_v__tfar);

  /* "fstlib/cext/pywrapfst.pyx":4642
 *     cdef FarWriter writer = FarWriter.__new__(FarWriter)
 *     writer._writer = move(_tfar)
 *     return writer             # <<<<<<<<<<<<<<
 * 
 *   # NB: Invoking this method may be dangerous: calling any other method on the
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_writer));
  __pyx_r = ((PyObject *)__pyx_v_writer);
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":4612
 * 
 *   @classmethod
 *   def create(cls, source, arc_type="standard", far_type="default"):             # <<<<<<<<<<<<<<
 *     """
 *     FarWriter.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.FarWriter.create", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_writer);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":4646
 *   # NB: Invoking this method may be dangerous: calling any other method on the
 *   # instance after this is invoked may result in a null dereference.
 *   cdef void close(self):             # <<<<<<<<<<<<<<
 *     self._writer.reset()
 * 
 */

static void __pyx_f_6fstlib_4cext_9pywrapfst_9FarWriter_close(struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarWriter *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("close", 0);

  /* "fstlib/cext/pywrapfst.pyx":4647
 *   # instance after this is invoked may result in a null dereference.
 *   cdef void close(self):
 *     self._writer.reset()             # <<<<<<<<<<<<<<
 * 
 *   cpdef void add(self, key, Fst ifst) except *:
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_writer");
    __PYX_ERR(0, 4647, __pyx_L1_error)
  }
  __pyx_v_self->_writer.reset();

  /* "fstlib/cext/pywrapfst.pyx":4646
 *   # NB: Invoking this method may be dangerous: calling any other method on the
 *   # instance after this is invoked may result in a null dereference.
 *   cdef void close(self):             # <<<<<<<<<<<<<<
 *     self._writer.reset()
 * 
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("fstlib.cext.pywrapfst.FarWriter.close", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "fstlib/cext/pywrapfst.pyx":4649
 *     self._writer.reset()
 * 
 *   cpdef void add(self, key, Fst ifst) except *:             # <<<<<<<<<<<<<<
 *     """
 *     add(self, key, ifst)
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_9FarWriter_7add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static void __pyx_f_6fstlib_4cext_9pywrapfst_9FarWriter_add(struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarWriter *__pyx_v_self, PyObject *__pyx_v_key, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst, int __pyx_skip_dispatch) {
  __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;
  std::string __pyx_t_7;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("add", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4649, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6fstlib_4cext_9pywrapfst_9FarWriter_7add)) {
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        __pyx_t_5 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
            __pyx_t_5 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_key, ((PyObject *)__pyx_v_ifst)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4649, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_key, ((PyObject *)__pyx_v_ifst)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4649, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4649, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          if (__pyx_t_4) {
            __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
          }
          __Pyx_INCREF(__pyx_v_key);
          __Pyx_GIVEREF(__pyx_v_key);
          PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_key);
          __Pyx_INCREF(((PyObject *)__pyx_v_ifst));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_ifst));
          PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, ((PyObject *)__pyx_v_ifst));
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4649, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        }
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "fstlib/cext/pywrapfst.pyx":4667
 *     # Failure here results from passing an FST with a different arc type than
 *     # used by the FAR was initialized to use.
 *     if not self._writer.get().Add(tostring(key), deref(ifst._fst)):             # <<<<<<<<<<<<<<
 *       raise FstOpError("Incompatible or invalid arc type")
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_writer");
    __PYX_ERR(0, 4667, __pyx_L1_error)
  }
  __pyx_t_7 = __pyx_f_6fstlib_4cext_9pywrapfst_tostring(__pyx_v_key); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4667, __pyx_L1_error)
  if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 4667, __pyx_L1_error)
  }
  __pyx_t_8 = ((!(__pyx_v_self->_writer.get()->Add(__pyx_t_7, (*__pyx_v_ifst->_fst)) != 0)) != 0);
  if (unlikely(__pyx_t_8)) {

    /* "fstlib/cext/pywrapfst.pyx":4668
 *     # used by the FAR was initialized to use.
 *     if not self._writer.get().Add(tostring(key), deref(ifst._fst)):
 *       raise FstOpError("Incompatible or invalid arc type")             # <<<<<<<<<<<<<<
 * 
 *   cpdef string arc_type(self):
 */
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FstOpError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4668, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_kp_u_Incompatible_or_invalid_arc_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_u_Incompatible_or_invalid_arc_type);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4668, __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(0, 4668, __pyx_L1_error)

    /* "fstlib/cext/pywrapfst.pyx":4667
 *     # Failure here results from passing an FST with a different arc type than
 *     # used by the FAR was initialized to use.
 *     if not self._writer.get().Add(tostring(key), deref(ifst._fst)):             # <<<<<<<<<<<<<<
 *       raise FstOpError("Incompatible or invalid arc type")
 * 
 */
  }

  /* "fstlib/cext/pywrapfst.pyx":4649
 *     self._writer.reset()
 * 
 *   cpdef void add(self, key, Fst ifst) except *:             # <<<<<<<<<<<<<<
 *     """
 *     add(self, key, ifst)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.FarWriter.add", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_9FarWriter_7add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_9FarWriter_6add[] = "\n    add(self, key, ifst)\n\n    Adds an FST to the FAR.\n\n    This method adds an FST to the FAR which can be retrieved with the\n    specified string key.\n\n    Args:\n      key: The string used to key the input FST.\n      ifst: The FST to write to the FAR.\n\n    Raises:\n      FstOpError: Incompatible or invalid arc type.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_9FarWriter_7add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_key = 0;
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("add (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_key,&__pyx_n_s_ifst,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ifst)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("add", 1, 2, 2, 1); __PYX_ERR(0, 4649, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add") < 0)) __PYX_ERR(0, 4649, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_key = values[0];
    __pyx_v_ifst = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("add", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4649, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.FarWriter.add", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_6fstlib_4cext_9pywrapfst_Fst, 1, "ifst", 0))) __PYX_ERR(0, 4649, __pyx_L1_error)
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_9FarWriter_6add(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarWriter *)__pyx_v_self), __pyx_v_key, __pyx_v_ifst);

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_9FarWriter_6add(struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarWriter *__pyx_v_self, PyObject *__pyx_v_key, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_ifst) {
  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("add", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_6fstlib_4cext_9pywrapfst_9FarWriter_add(__pyx_v_self, __pyx_v_key, __pyx_v_ifst, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4649, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4649, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.FarWriter.add", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":4670
 *       raise FstOpError("Incompatible or invalid arc type")
 * 
 *   cpdef string arc_type(self):             # <<<<<<<<<<<<<<
 *     """
 *     arc_type(self)
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_9FarWriter_9arc_type(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static std::string __pyx_f_6fstlib_4cext_9pywrapfst_9FarWriter_arc_type(struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarWriter *__pyx_v_self, int __pyx_skip_dispatch) {
  std::string __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  std::string __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("arc_type", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_arc_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4670, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6fstlib_4cext_9pywrapfst_9FarWriter_9arc_type)) {
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4670, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4670, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_5;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "fstlib/cext/pywrapfst.pyx":4676
 *     Returns a string indicating the arc type.
 *     """
 *     return self._writer.get().ArcType()             # <<<<<<<<<<<<<<
 * 
 *   cpdef bool error(self):
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_writer");
    __PYX_ERR(0, 4676, __pyx_L1_error)
  }
  __pyx_r = __pyx_v_self->_writer.get()->ArcType();
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":4670
 *       raise FstOpError("Incompatible or invalid arc type")
 * 
 *   cpdef string arc_type(self):             # <<<<<<<<<<<<<<
 *     """
 *     arc_type(self)
 */

  /* 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_WriteUnraisable("fstlib.cext.pywrapfst.FarWriter.arc_type", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_9FarWriter_9arc_type(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_9FarWriter_8arc_type[] = "\n    arc_type(self)\n\n    Returns a string indicating the arc type.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_9FarWriter_9arc_type(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("arc_type (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_9FarWriter_8arc_type(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarWriter *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_9FarWriter_8arc_type(struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarWriter *__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("arc_type", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_f_6fstlib_4cext_9pywrapfst_9FarWriter_arc_type(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4670, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.FarWriter.arc_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":4678
 *     return self._writer.get().ArcType()
 * 
 *   cpdef bool error(self):             # <<<<<<<<<<<<<<
 *     """
 *     error(self)
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_9FarWriter_11error(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static bool __pyx_f_6fstlib_4cext_9pywrapfst_9FarWriter_error(struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarWriter *__pyx_v_self, int __pyx_skip_dispatch) {
  bool __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  bool __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("error", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4678, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6fstlib_4cext_9pywrapfst_9FarWriter_11error)) {
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4678, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4678, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_5;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "fstlib/cext/pywrapfst.pyx":4687
 *       True if the FarWriter is in an errorful state, False otherwise.
 *     """
 *     return self._writer.get().Error()             # <<<<<<<<<<<<<<
 * 
 *   cpdef string far_type(self):
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_writer");
    __PYX_ERR(0, 4687, __pyx_L1_error)
  }
  __pyx_r = __pyx_v_self->_writer.get()->Error();
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":4678
 *     return self._writer.get().ArcType()
 * 
 *   cpdef bool error(self):             # <<<<<<<<<<<<<<
 *     """
 *     error(self)
 */

  /* 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_WriteUnraisable("fstlib.cext.pywrapfst.FarWriter.error", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_9FarWriter_11error(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_9FarWriter_10error[] = "\n    error(self)\n\n    Indicates whether the FarWriter has encountered an error.\n\n    Returns:\n      True if the FarWriter is in an errorful state, False otherwise.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_9FarWriter_11error(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("error (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_9FarWriter_10error(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarWriter *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_9FarWriter_10error(struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarWriter *__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("error", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_6fstlib_4cext_9pywrapfst_9FarWriter_error(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4678, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.FarWriter.error", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":4689
 *     return self._writer.get().Error()
 * 
 *   cpdef string far_type(self):             # <<<<<<<<<<<<<<
 *     """
 *     far_type(self)
 */

static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_9FarWriter_13far_type(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static std::string __pyx_f_6fstlib_4cext_9pywrapfst_9FarWriter_far_type(struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarWriter *__pyx_v_self, int __pyx_skip_dispatch) {
  std::string __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  std::string __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("far_type", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_far_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4689, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6fstlib_4cext_9pywrapfst_9FarWriter_13far_type)) {
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4689, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4689, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_5;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "fstlib/cext/pywrapfst.pyx":4695
 *     Returns a string indicating the FAR type.
 *     """
 *     return fst.GetFarTypeString(self._writer.get().Type())             # <<<<<<<<<<<<<<
 * 
 *   # Dictionary-like assignment.
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_writer");
    __PYX_ERR(0, 4695, __pyx_L1_error)
  }
  __pyx_r = fst::GetFarTypeString(__pyx_v_self->_writer.get()->Type());
  goto __pyx_L0;

  /* "fstlib/cext/pywrapfst.pyx":4689
 *     return self._writer.get().Error()
 * 
 *   cpdef string far_type(self):             # <<<<<<<<<<<<<<
 *     """
 *     far_type(self)
 */

  /* 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_WriteUnraisable("fstlib.cext.pywrapfst.FarWriter.far_type", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_9FarWriter_13far_type(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6fstlib_4cext_9pywrapfst_9FarWriter_12far_type[] = "\n    far_type(self)\n\n    Returns a string indicating the FAR type.\n    ";
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_9FarWriter_13far_type(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("far_type (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_9FarWriter_12far_type(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarWriter *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_9FarWriter_12far_type(struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarWriter *__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("far_type", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_convert_PyUnicode_string_to_py_std__in_string(__pyx_f_6fstlib_4cext_9pywrapfst_9FarWriter_far_type(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4689, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.FarWriter.far_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "fstlib/cext/pywrapfst.pyx":4698
 * 
 *   # Dictionary-like assignment.
 *   def __setitem__(self, key, Fst fst):             # <<<<<<<<<<<<<<
 *     self.add(key, fst)
 * 
 */

/* Python wrapper */
static int __pyx_pw_6fstlib_4cext_9pywrapfst_9FarWriter_15__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_fst); /*proto*/
static int __pyx_pw_6fstlib_4cext_9pywrapfst_9FarWriter_15__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_fst) {
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fst), __pyx_ptype_6fstlib_4cext_9pywrapfst_Fst, 1, "fst", 0))) __PYX_ERR(0, 4698, __pyx_L1_error)
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_9FarWriter_14__setitem__(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarWriter *)__pyx_v_self), ((PyObject *)__pyx_v_key), ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *)__pyx_v_fst));

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

static int __pyx_pf_6fstlib_4cext_9pywrapfst_9FarWriter_14__setitem__(struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarWriter *__pyx_v_self, PyObject *__pyx_v_key, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *__pyx_v_fst) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setitem__", 0);

  /* "fstlib/cext/pywrapfst.pyx":4699
 *   # Dictionary-like assignment.
 *   def __setitem__(self, key, Fst fst):
 *     self.add(key, fst)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "add");
    __PYX_ERR(0, 4699, __pyx_L1_error)
  }
  ((struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_FarWriter *)__pyx_v_self->__pyx_vtab)->add(__pyx_v_self, __pyx_v_key, __pyx_v_fst, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4699, __pyx_L1_error)

  /* "fstlib/cext/pywrapfst.pyx":4698
 * 
 *   # Dictionary-like assignment.
 *   def __setitem__(self, key, Fst fst):             # <<<<<<<<<<<<<<
 *     self.add(key, fst)
 * 
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.FarWriter.__setitem__", __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._writer cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_9FarWriter_17__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_9FarWriter_17__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_9FarWriter_16__reduce_cython__(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarWriter *)__pyx_v_self));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_9FarWriter_16__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarWriter *__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("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self._writer cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self._writer cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__57, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __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(1, 2, __pyx_L1_error)

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.FarWriter.__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._writer cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self._writer cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_9FarWriter_19__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static PyObject *__pyx_pw_6fstlib_4cext_9pywrapfst_9FarWriter_19__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6fstlib_4cext_9pywrapfst_9FarWriter_18__setstate_cython__(((struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarWriter *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

static PyObject *__pyx_pf_6fstlib_4cext_9pywrapfst_9FarWriter_18__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarWriter *__pyx_v_self, CYTHON_UNUSED 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__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self._writer cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self._writer cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__58, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __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(1, 4, __pyx_L1_error)

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("fstlib.cext.pywrapfst.FarWriter.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "string.from_py":13
 * 
 * @cname("__pyx_convert_string_from_py_std__in_string")
 * cdef string __pyx_convert_string_from_py_std__in_string(object o) except *:             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t length = 0
 *     cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length)
 */

static std::string __pyx_convert_string_from_py_std__in_string(PyObject *__pyx_v_o) {
  Py_ssize_t __pyx_v_length;
  char const *__pyx_v_data;
  std::string __pyx_r;
  __Pyx_RefNannyDeclarations
  char const *__pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_convert_string_from_py_std__in_string", 0);

  /* "string.from_py":14
 * @cname("__pyx_convert_string_from_py_std__in_string")
 * cdef string __pyx_convert_string_from_py_std__in_string(object o) except *:
 *     cdef Py_ssize_t length = 0             # <<<<<<<<<<<<<<
 *     cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length)
 *     return string(data, length)
 */
  __pyx_v_length = 0;

  /* "string.from_py":15
 * cdef string __pyx_convert_string_from_py_std__in_string(object o) except *:
 *     cdef Py_ssize_t length = 0
 *     cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length)             # <<<<<<<<<<<<<<
 *     return string(data, length)
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_AsStringAndSize(__pyx_v_o, (&__pyx_v_length)); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(1, 15, __pyx_L1_error)
  __pyx_v_data = __pyx_t_1;

  /* "string.from_py":16
 *     cdef Py_ssize_t length = 0
 *     cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length)
 *     return string(data, length)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = std::string(__pyx_v_data, __pyx_v_length);
  goto __pyx_L0;

  /* "string.from_py":13
 * 
 * @cname("__pyx_convert_string_from_py_std__in_string")
 * cdef string __pyx_convert_string_from_py_std__in_string(object o) except *:             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t length = 0
 *     cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("string.from_py.__pyx_convert_string_from_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "string.to_py":31
 * 
 * @cname("__pyx_convert_PyObject_string_to_py_std__in_string")
 * cdef inline object __pyx_convert_PyObject_string_to_py_std__in_string(const string& s):             # <<<<<<<<<<<<<<
 *     return __Pyx_PyObject_FromStringAndSize(s.data(), s.size())
 * cdef extern from *:
 */

static CYTHON_INLINE PyObject *__pyx_convert_PyObject_string_to_py_std__in_string(std::string const &__pyx_v_s) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_convert_PyObject_string_to_py_std__in_string", 0);

  /* "string.to_py":32
 * @cname("__pyx_convert_PyObject_string_to_py_std__in_string")
 * cdef inline object __pyx_convert_PyObject_string_to_py_std__in_string(const string& s):
 *     return __Pyx_PyObject_FromStringAndSize(s.data(), s.size())             # <<<<<<<<<<<<<<
 * cdef extern from *:
 *     cdef object __Pyx_PyUnicode_FromStringAndSize(const char*, size_t)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_FromStringAndSize(__pyx_v_s.data(), __pyx_v_s.size()); 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;

  /* "string.to_py":31
 * 
 * @cname("__pyx_convert_PyObject_string_to_py_std__in_string")
 * cdef inline object __pyx_convert_PyObject_string_to_py_std__in_string(const string& s):             # <<<<<<<<<<<<<<
 *     return __Pyx_PyObject_FromStringAndSize(s.data(), s.size())
 * cdef extern from *:
 */

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

/* "string.to_py":37
 * 
 * @cname("__pyx_convert_PyUnicode_string_to_py_std__in_string")
 * cdef inline object __pyx_convert_PyUnicode_string_to_py_std__in_string(const string& s):             # <<<<<<<<<<<<<<
 *     return __Pyx_PyUnicode_FromStringAndSize(s.data(), s.size())
 * cdef extern from *:
 */

static CYTHON_INLINE PyObject *__pyx_convert_PyUnicode_string_to_py_std__in_string(std::string const &__pyx_v_s) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_convert_PyUnicode_string_to_py_std__in_string", 0);

  /* "string.to_py":38
 * @cname("__pyx_convert_PyUnicode_string_to_py_std__in_string")
 * cdef inline object __pyx_convert_PyUnicode_string_to_py_std__in_string(const string& s):
 *     return __Pyx_PyUnicode_FromStringAndSize(s.data(), s.size())             # <<<<<<<<<<<<<<
 * cdef extern from *:
 *     cdef object __Pyx_PyStr_FromStringAndSize(const char*, size_t)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyUnicode_FromStringAndSize(__pyx_v_s.data(), __pyx_v_s.size()); 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;

  /* "string.to_py":37
 * 
 * @cname("__pyx_convert_PyUnicode_string_to_py_std__in_string")
 * cdef inline object __pyx_convert_PyUnicode_string_to_py_std__in_string(const string& s):             # <<<<<<<<<<<<<<
 *     return __Pyx_PyUnicode_FromStringAndSize(s.data(), s.size())
 * cdef extern from *:
 */

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

/* "string.to_py":43
 * 
 * @cname("__pyx_convert_PyStr_string_to_py_std__in_string")
 * cdef inline object __pyx_convert_PyStr_string_to_py_std__in_string(const string& s):             # <<<<<<<<<<<<<<
 *     return __Pyx_PyStr_FromStringAndSize(s.data(), s.size())
 * cdef extern from *:
 */

static CYTHON_INLINE PyObject *__pyx_convert_PyStr_string_to_py_std__in_string(std::string const &__pyx_v_s) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_convert_PyStr_string_to_py_std__in_string", 0);

  /* "string.to_py":44
 * @cname("__pyx_convert_PyStr_string_to_py_std__in_string")
 * cdef inline object __pyx_convert_PyStr_string_to_py_std__in_string(const string& s):
 *     return __Pyx_PyStr_FromStringAndSize(s.data(), s.size())             # <<<<<<<<<<<<<<
 * cdef extern from *:
 *     cdef object __Pyx_PyBytes_FromStringAndSize(const char*, size_t)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyStr_FromStringAndSize(__pyx_v_s.data(), __pyx_v_s.size()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 44, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "string.to_py":43
 * 
 * @cname("__pyx_convert_PyStr_string_to_py_std__in_string")
 * cdef inline object __pyx_convert_PyStr_string_to_py_std__in_string(const string& s):             # <<<<<<<<<<<<<<
 *     return __Pyx_PyStr_FromStringAndSize(s.data(), s.size())
 * cdef extern from *:
 */

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

/* "string.to_py":49
 * 
 * @cname("__pyx_convert_PyBytes_string_to_py_std__in_string")
 * cdef inline object __pyx_convert_PyBytes_string_to_py_std__in_string(const string& s):             # <<<<<<<<<<<<<<
 *     return __Pyx_PyBytes_FromStringAndSize(s.data(), s.size())
 * cdef extern from *:
 */

static CYTHON_INLINE PyObject *__pyx_convert_PyBytes_string_to_py_std__in_string(std::string const &__pyx_v_s) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_convert_PyBytes_string_to_py_std__in_string", 0);

  /* "string.to_py":50
 * @cname("__pyx_convert_PyBytes_string_to_py_std__in_string")
 * cdef inline object __pyx_convert_PyBytes_string_to_py_std__in_string(const string& s):
 *     return __Pyx_PyBytes_FromStringAndSize(s.data(), s.size())             # <<<<<<<<<<<<<<
 * cdef extern from *:
 *     cdef object __Pyx_PyByteArray_FromStringAndSize(const char*, size_t)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_s.data(), __pyx_v_s.size()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 50, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "string.to_py":49
 * 
 * @cname("__pyx_convert_PyBytes_string_to_py_std__in_string")
 * cdef inline object __pyx_convert_PyBytes_string_to_py_std__in_string(const string& s):             # <<<<<<<<<<<<<<
 *     return __Pyx_PyBytes_FromStringAndSize(s.data(), s.size())
 * cdef extern from *:
 */

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

/* "string.to_py":55
 * 
 * @cname("__pyx_convert_PyByteArray_string_to_py_std__in_string")
 * cdef inline object __pyx_convert_PyByteArray_string_to_py_std__in_string(const string& s):             # <<<<<<<<<<<<<<
 *     return __Pyx_PyByteArray_FromStringAndSize(s.data(), s.size())
 * 
 */

static CYTHON_INLINE PyObject *__pyx_convert_PyByteArray_string_to_py_std__in_string(std::string const &__pyx_v_s) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_convert_PyByteArray_string_to_py_std__in_string", 0);

  /* "string.to_py":56
 * @cname("__pyx_convert_PyByteArray_string_to_py_std__in_string")
 * cdef inline object __pyx_convert_PyByteArray_string_to_py_std__in_string(const string& s):
 *     return __Pyx_PyByteArray_FromStringAndSize(s.data(), s.size())             # <<<<<<<<<<<<<<
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyByteArray_FromStringAndSize(__pyx_v_s.data(), __pyx_v_s.size()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 56, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "string.to_py":55
 * 
 * @cname("__pyx_convert_PyByteArray_string_to_py_std__in_string")
 * cdef inline object __pyx_convert_PyByteArray_string_to_py_std__in_string(const string& s):             # <<<<<<<<<<<<<<
 *     return __Pyx_PyByteArray_FromStringAndSize(s.data(), s.size())
 * 
 */

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

/* "vector.from_py":45
 * 
 * @cname("__pyx_convert_vector_from_py_int64")
 * cdef vector[X] __pyx_convert_vector_from_py_int64(object o) except *:             # <<<<<<<<<<<<<<
 *     cdef vector[X] v
 *     for item in o:
 */

static std::vector<int64>  __pyx_convert_vector_from_py_int64(PyObject *__pyx_v_o) {
  std::vector<int64>  __pyx_v_v;
  PyObject *__pyx_v_item = NULL;
  std::vector<int64>  __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  int64 __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_convert_vector_from_py_int64", 0);

  /* "vector.from_py":47
 * cdef vector[X] __pyx_convert_vector_from_py_int64(object o) except *:
 *     cdef vector[X] v
 *     for item in o:             # <<<<<<<<<<<<<<
 *         v.push_back(<X>item)
 *     return v
 */
  if (likely(PyList_CheckExact(__pyx_v_o)) || PyTuple_CheckExact(__pyx_v_o)) {
    __pyx_t_1 = __pyx_v_o; __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_o); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 47, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 47, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 47, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 47, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 47, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 47, __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(1, 47, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "vector.from_py":48
 *     cdef vector[X] v
 *     for item in o:
 *         v.push_back(<X>item)             # <<<<<<<<<<<<<<
 *     return v
 * 
 */
    __pyx_t_5 = __Pyx_PyInt_As_int64_t(__pyx_v_item); if (unlikely((__pyx_t_5 == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 48, __pyx_L1_error)
    __pyx_v_v.push_back(((int64)__pyx_t_5));

    /* "vector.from_py":47
 * cdef vector[X] __pyx_convert_vector_from_py_int64(object o) except *:
 *     cdef vector[X] v
 *     for item in o:             # <<<<<<<<<<<<<<
 *         v.push_back(<X>item)
 *     return v
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "vector.from_py":49
 *     for item in o:
 *         v.push_back(<X>item)
 *     return v             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_v;
  goto __pyx_L0;

  /* "vector.from_py":45
 * 
 * @cname("__pyx_convert_vector_from_py_int64")
 * cdef vector[X] __pyx_convert_vector_from_py_int64(object o) except *:             # <<<<<<<<<<<<<<
 *     cdef vector[X] v
 *     for item in o:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("vector.from_py.__pyx_convert_vector_from_py_int64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_item);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static std::vector<std::string>  __pyx_convert_vector_from_py_std_3a__3a_string(PyObject *__pyx_v_o) {
  std::vector<std::string>  __pyx_v_v;
  PyObject *__pyx_v_item = NULL;
  std::vector<std::string>  __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  std::string __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_convert_vector_from_py_std_3a__3a_string", 0);

  /* "vector.from_py":47
 * cdef vector[X] __pyx_convert_vector_from_py_std_3a__3a_string(object o) except *:
 *     cdef vector[X] v
 *     for item in o:             # <<<<<<<<<<<<<<
 *         v.push_back(<X>item)
 *     return v
 */
  if (likely(PyList_CheckExact(__pyx_v_o)) || PyTuple_CheckExact(__pyx_v_o)) {
    __pyx_t_1 = __pyx_v_o; __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_o); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 47, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 47, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 47, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 47, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 47, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 47, __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(1, 47, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "vector.from_py":48
 *     cdef vector[X] v
 *     for item in o:
 *         v.push_back(<X>item)             # <<<<<<<<<<<<<<
 *     return v
 * 
 */
    __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_v_item); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 48, __pyx_L1_error)
    __pyx_v_v.push_back(((std::string)__pyx_t_5));

    /* "vector.from_py":47
 * cdef vector[X] __pyx_convert_vector_from_py_std_3a__3a_string(object o) except *:
 *     cdef vector[X] v
 *     for item in o:             # <<<<<<<<<<<<<<
 *         v.push_back(<X>item)
 *     return v
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "vector.from_py":49
 *     for item in o:
 *         v.push_back(<X>item)
 *     return v             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_v;
  goto __pyx_L0;

  /* "vector.from_py":45
 * 
 * @cname("__pyx_convert_vector_from_py_std_3a__3a_string")
 * cdef vector[X] __pyx_convert_vector_from_py_std_3a__3a_string(object o) except *:             # <<<<<<<<<<<<<<
 *     cdef vector[X] v
 *     for item in o:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("vector.from_py.__pyx_convert_vector_from_py_std_3a__3a_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_item);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_Weight __pyx_vtable_6fstlib_4cext_9pywrapfst_Weight;

static PyObject *__pyx_tp_new_6fstlib_4cext_9pywrapfst_Weight(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *)o);
  p->__pyx_vtab = __pyx_vtabptr_6fstlib_4cext_9pywrapfst_Weight;
  new((void*)&(p->_weight)) std::unique_ptr<fst::script::WeightClass> ();
  return o;
}

static void __pyx_tp_dealloc_6fstlib_4cext_9pywrapfst_Weight(PyObject *o) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *p = (struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  __Pyx_call_destructor(p->_weight);
  (*Py_TYPE(o)->tp_free)(o);
}

static PyObject *__pyx_tp_richcompare_6fstlib_4cext_9pywrapfst_Weight(PyObject *o1, PyObject *o2, int op) {
  switch (op) {
    case Py_EQ: {
      return __pyx_pw_6fstlib_4cext_9pywrapfst_6Weight_17__eq__(o1, o2);
    }
    case Py_NE: {
      return __pyx_pw_6fstlib_4cext_9pywrapfst_6Weight_19__ne__(o1, o2);
    }
    default: {
      return __Pyx_NewRef(Py_NotImplemented);
    }
  }
}

static PyMethodDef __pyx_methods_6fstlib_4cext_9pywrapfst_Weight[] = {
  {"copy", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_6Weight_9copy, METH_NOARGS, __pyx_doc_6fstlib_4cext_9pywrapfst_6Weight_8copy},
  {"zero", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_6Weight_11zero, METH_O, __pyx_doc_6fstlib_4cext_9pywrapfst_6Weight_10zero},
  {"one", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_6Weight_13one, METH_O, __pyx_doc_6fstlib_4cext_9pywrapfst_6Weight_12one},
  {"no_weight", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_6Weight_15no_weight, METH_O, __pyx_doc_6fstlib_4cext_9pywrapfst_6Weight_14no_weight},
  {"to_string", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_6Weight_21to_string, METH_NOARGS, 0},
  {"type", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_6Weight_23type, METH_NOARGS, __pyx_doc_6fstlib_4cext_9pywrapfst_6Weight_22type},
  {"member", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_6Weight_25member, METH_NOARGS, 0},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_6Weight_27__reduce_cython__, METH_NOARGS, 0},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_6Weight_29__setstate_cython__, METH_O, 0},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_Weight = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  __pyx_pw_6fstlib_4cext_9pywrapfst_6Weight_5__float__, /*nb_float*/
  #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  0, /*nb_index*/
  #if PY_VERSION_HEX >= 0x03050000
  0, /*nb_matrix_multiply*/
  #endif
  #if PY_VERSION_HEX >= 0x03050000
  0, /*nb_inplace_matrix_multiply*/
  #endif
};

static PyTypeObject __pyx_type_6fstlib_4cext_9pywrapfst_Weight = {
  PyVarObject_HEAD_INIT(0, 0)
  "fstlib.cext.pywrapfst.Weight", /*tp_name*/
  sizeof(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6fstlib_4cext_9pywrapfst_Weight, /*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
  __pyx_pw_6fstlib_4cext_9pywrapfst_6Weight_1__repr__, /*tp_repr*/
  &__pyx_tp_as_number_Weight, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  __pyx_pw_6fstlib_4cext_9pywrapfst_6Weight_3__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*/
  "\n  Weight(weight_type, weight_string)\n\n  FST weight class.\n\n  This class represents an FST weight. When passed as an argument to an FST\n  operation, it should have the weight type of the input FST(s) to said\n  operation.\n\n  Args:\n    weight_type: A string indicating the weight type.\n    weight_string: A string indicating the underlying weight.\n\n  Raises:\n    FstArgError: Weight type not found.\n    FstBadWeightError: Invalid weight.\n  ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  __pyx_tp_richcompare_6fstlib_4cext_9pywrapfst_Weight, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6fstlib_4cext_9pywrapfst_Weight, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_6fstlib_4cext_9pywrapfst_6Weight_7__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6fstlib_4cext_9pywrapfst_Weight, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
  0, /*tp_pypy_flags*/
  #endif
};
static struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_SymbolTableView __pyx_vtable_6fstlib_4cext_9pywrapfst_SymbolTableView;

static PyObject *__pyx_tp_new_6fstlib_4cext_9pywrapfst_SymbolTableView(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *)o);
  p->__pyx_vtab = __pyx_vtabptr_6fstlib_4cext_9pywrapfst_SymbolTableView;
  return o;
}

static void __pyx_tp_dealloc_6fstlib_4cext_9pywrapfst_SymbolTableView(PyObject *o) {
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  (*Py_TYPE(o)->tp_free)(o);
}

static PyMethodDef __pyx_methods_6fstlib_4cext_9pywrapfst_SymbolTableView[] = {
  {"__reduce__", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_15SymbolTableView_5__reduce__, METH_NOARGS, 0},
  {"available_key", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_15SymbolTableView_7available_key, METH_NOARGS, __pyx_doc_6fstlib_4cext_9pywrapfst_15SymbolTableView_6available_key},
  {"checksum", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_15SymbolTableView_9checksum, METH_NOARGS, __pyx_doc_6fstlib_4cext_9pywrapfst_15SymbolTableView_8checksum},
  {"copy", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_15SymbolTableView_11copy, METH_NOARGS, __pyx_doc_6fstlib_4cext_9pywrapfst_15SymbolTableView_10copy},
  {"find", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_15SymbolTableView_13find, METH_O, __pyx_doc_6fstlib_4cext_9pywrapfst_15SymbolTableView_12find},
  {"get_nth_key", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_15SymbolTableView_15get_nth_key, METH_O, __pyx_doc_6fstlib_4cext_9pywrapfst_15SymbolTableView_14get_nth_key},
  {"labeled_checksum", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_15SymbolTableView_17labeled_checksum, METH_NOARGS, __pyx_doc_6fstlib_4cext_9pywrapfst_15SymbolTableView_16labeled_checksum},
  {"member", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_15SymbolTableView_19member, METH_O, __pyx_doc_6fstlib_4cext_9pywrapfst_15SymbolTableView_18member},
  {"name", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_15SymbolTableView_21name, METH_NOARGS, __pyx_doc_6fstlib_4cext_9pywrapfst_15SymbolTableView_20name},
  {"num_symbols", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_15SymbolTableView_23num_symbols, METH_NOARGS, __pyx_doc_6fstlib_4cext_9pywrapfst_15SymbolTableView_22num_symbols},
  {"write", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_15SymbolTableView_25write, METH_O, __pyx_doc_6fstlib_4cext_9pywrapfst_15SymbolTableView_24write},
  {"write_text", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_15SymbolTableView_27write_text, METH_O, __pyx_doc_6fstlib_4cext_9pywrapfst_15SymbolTableView_26write_text},
  {"write_to_string", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_15SymbolTableView_29write_to_string, METH_NOARGS, __pyx_doc_6fstlib_4cext_9pywrapfst_15SymbolTableView_28write_to_string},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_6fstlib_4cext_9pywrapfst_SymbolTableView = {
  PyVarObject_HEAD_INIT(0, 0)
  "fstlib.cext.pywrapfst.SymbolTableView", /*tp_name*/
  sizeof(struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6fstlib_4cext_9pywrapfst_SymbolTableView, /*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*/
  "\n  (No constructor.)\n\n  Base class for the symbol table hierarchy.\n\n  This class is the base class for SymbolTable. It has a \"deleted\" constructor\n  and implementations for the const methods of the wrapped SymbolTable.\n  ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_6fstlib_4cext_9pywrapfst_15SymbolTableView_3__iter__, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6fstlib_4cext_9pywrapfst_SymbolTableView, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_6fstlib_4cext_9pywrapfst_15SymbolTableView_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6fstlib_4cext_9pywrapfst_SymbolTableView, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
  0, /*tp_pypy_flags*/
  #endif
};
static struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst__EncodeMapperSymbolTableView __pyx_vtable_6fstlib_4cext_9pywrapfst__EncodeMapperSymbolTableView;

static PyObject *__pyx_tp_new_6fstlib_4cext_9pywrapfst__EncodeMapperSymbolTableView(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst__EncodeMapperSymbolTableView *p;
  PyObject *o = __pyx_tp_new_6fstlib_4cext_9pywrapfst_SymbolTableView(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst__EncodeMapperSymbolTableView *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_SymbolTableView*)__pyx_vtabptr_6fstlib_4cext_9pywrapfst__EncodeMapperSymbolTableView;
  new((void*)&(p->_mapper)) std::shared_ptr<fst::script::EncodeMapperClass> ();
  return o;
}

static void __pyx_tp_dealloc_6fstlib_4cext_9pywrapfst__EncodeMapperSymbolTableView(PyObject *o) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst__EncodeMapperSymbolTableView *p = (struct __pyx_obj_6fstlib_4cext_9pywrapfst__EncodeMapperSymbolTableView *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  __Pyx_call_destructor(p->_mapper);
  __pyx_tp_dealloc_6fstlib_4cext_9pywrapfst_SymbolTableView(o);
}

static PyMethodDef __pyx_methods_6fstlib_4cext_9pywrapfst__EncodeMapperSymbolTableView[] = {
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_6fstlib_4cext_9pywrapfst__EncodeMapperSymbolTableView = {
  PyVarObject_HEAD_INIT(0, 0)
  "fstlib.cext.pywrapfst._EncodeMapperSymbolTableView", /*tp_name*/
  sizeof(struct __pyx_obj_6fstlib_4cext_9pywrapfst__EncodeMapperSymbolTableView), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6fstlib_4cext_9pywrapfst__EncodeMapperSymbolTableView, /*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
  __pyx_pw_6fstlib_4cext_9pywrapfst_28_EncodeMapperSymbolTableView_1__repr__, /*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*/
  "\n  (No constructor.)\n\n  Immutable SymbolTable class for tables stored in an EncodeMapper.\n\n  This class wraps a library const SymbolTable and exposes const methods of the\n  wrapped object. It is only to be returned by method, never constructed\n  directly.\n  ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_6fstlib_4cext_9pywrapfst_15SymbolTableView_3__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  __pyx_methods_6fstlib_4cext_9pywrapfst__EncodeMapperSymbolTableView, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_6fstlib_4cext_9pywrapfst_15SymbolTableView_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_6fstlib_4cext_9pywrapfst__EncodeMapperSymbolTableView, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
  0, /*tp_pypy_flags*/
  #endif
};
static struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst__FstSymbolTableView __pyx_vtable_6fstlib_4cext_9pywrapfst__FstSymbolTableView;

static PyObject *__pyx_tp_new_6fstlib_4cext_9pywrapfst__FstSymbolTableView(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst__FstSymbolTableView *p;
  PyObject *o = __pyx_tp_new_6fstlib_4cext_9pywrapfst_SymbolTableView(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst__FstSymbolTableView *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_SymbolTableView*)__pyx_vtabptr_6fstlib_4cext_9pywrapfst__FstSymbolTableView;
  new((void*)&(p->_fst)) std::shared_ptr<fst::script::FstClass> ();
  return o;
}

static void __pyx_tp_dealloc_6fstlib_4cext_9pywrapfst__FstSymbolTableView(PyObject *o) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst__FstSymbolTableView *p = (struct __pyx_obj_6fstlib_4cext_9pywrapfst__FstSymbolTableView *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  __Pyx_call_destructor(p->_fst);
  __pyx_tp_dealloc_6fstlib_4cext_9pywrapfst_SymbolTableView(o);
}

static PyMethodDef __pyx_methods_6fstlib_4cext_9pywrapfst__FstSymbolTableView[] = {
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_6fstlib_4cext_9pywrapfst__FstSymbolTableView = {
  PyVarObject_HEAD_INIT(0, 0)
  "fstlib.cext.pywrapfst._FstSymbolTableView", /*tp_name*/
  sizeof(struct __pyx_obj_6fstlib_4cext_9pywrapfst__FstSymbolTableView), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6fstlib_4cext_9pywrapfst__FstSymbolTableView, /*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
  __pyx_pw_6fstlib_4cext_9pywrapfst_19_FstSymbolTableView_1__repr__, /*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*/
  "\n  (No constructor.)\n\n  Mutable SymbolTable class for tables stored in a mutable FST.\n\n  This class wraps a library SymbolTable and exposes methods of the wrapped\n  object. It is only to be returned by method, never constructed directly.\n  ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_6fstlib_4cext_9pywrapfst_15SymbolTableView_3__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  __pyx_methods_6fstlib_4cext_9pywrapfst__FstSymbolTableView, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_6fstlib_4cext_9pywrapfst_15SymbolTableView_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_6fstlib_4cext_9pywrapfst__FstSymbolTableView, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
  0, /*tp_pypy_flags*/
  #endif
};
static struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst__MutableSymbolTable __pyx_vtable_6fstlib_4cext_9pywrapfst__MutableSymbolTable;

static PyObject *__pyx_tp_new_6fstlib_4cext_9pywrapfst__MutableSymbolTable(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableSymbolTable *p;
  PyObject *o = __pyx_tp_new_6fstlib_4cext_9pywrapfst_SymbolTableView(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableSymbolTable *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_SymbolTableView*)__pyx_vtabptr_6fstlib_4cext_9pywrapfst__MutableSymbolTable;
  return o;
}

static PyMethodDef __pyx_methods_6fstlib_4cext_9pywrapfst__MutableSymbolTable[] = {
  {"add_symbol", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6fstlib_4cext_9pywrapfst_19_MutableSymbolTable_1add_symbol, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6fstlib_4cext_9pywrapfst_19_MutableSymbolTable_add_symbol},
  {"add_table", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_19_MutableSymbolTable_3add_table, METH_O, __pyx_doc_6fstlib_4cext_9pywrapfst_19_MutableSymbolTable_2add_table},
  {"set_name", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_19_MutableSymbolTable_5set_name, METH_O, 0},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_6fstlib_4cext_9pywrapfst__MutableSymbolTable = {
  PyVarObject_HEAD_INIT(0, 0)
  "fstlib.cext.pywrapfst._MutableSymbolTable", /*tp_name*/
  sizeof(struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableSymbolTable), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6fstlib_4cext_9pywrapfst_SymbolTableView, /*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*/
  "\n  (No constructor.)\n\n  Base class for mutable symbol tables.\n\n  This class is the base class for a mutable SymbolTable. It has a \"deleted\"\n  constructor and implementations of all methods of the wrapped SymbolTable.\n  ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_6fstlib_4cext_9pywrapfst_15SymbolTableView_3__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  __pyx_methods_6fstlib_4cext_9pywrapfst__MutableSymbolTable, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_6fstlib_4cext_9pywrapfst_15SymbolTableView_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_6fstlib_4cext_9pywrapfst__MutableSymbolTable, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
  0, /*tp_pypy_flags*/
  #endif
};
static struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst__MutableFstSymbolTableView __pyx_vtable_6fstlib_4cext_9pywrapfst__MutableFstSymbolTableView;

static PyObject *__pyx_tp_new_6fstlib_4cext_9pywrapfst__MutableFstSymbolTableView(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableFstSymbolTableView *p;
  PyObject *o = __pyx_tp_new_6fstlib_4cext_9pywrapfst__MutableSymbolTable(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableFstSymbolTableView *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_SymbolTableView*)__pyx_vtabptr_6fstlib_4cext_9pywrapfst__MutableFstSymbolTableView;
  new((void*)&(p->_mfst)) std::shared_ptr<fst::script::MutableFstClass> ();
  return o;
}

static void __pyx_tp_dealloc_6fstlib_4cext_9pywrapfst__MutableFstSymbolTableView(PyObject *o) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableFstSymbolTableView *p = (struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableFstSymbolTableView *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  __Pyx_call_destructor(p->_mfst);
  __pyx_tp_dealloc_6fstlib_4cext_9pywrapfst_SymbolTableView(o);
}

static PyMethodDef __pyx_methods_6fstlib_4cext_9pywrapfst__MutableFstSymbolTableView[] = {
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_6fstlib_4cext_9pywrapfst__MutableFstSymbolTableView = {
  PyVarObject_HEAD_INIT(0, 0)
  "fstlib.cext.pywrapfst._MutableFstSymbolTableView", /*tp_name*/
  sizeof(struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableFstSymbolTableView), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6fstlib_4cext_9pywrapfst__MutableFstSymbolTableView, /*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
  __pyx_pw_6fstlib_4cext_9pywrapfst_26_MutableFstSymbolTableView_1__repr__, /*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*/
  "\n  (No constructor.)\n\n  Mutable SymbolTable assigned to an FST.\n  ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_6fstlib_4cext_9pywrapfst_15SymbolTableView_3__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  __pyx_methods_6fstlib_4cext_9pywrapfst__MutableFstSymbolTableView, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_6fstlib_4cext_9pywrapfst_15SymbolTableView_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_6fstlib_4cext_9pywrapfst__MutableFstSymbolTableView, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
  0, /*tp_pypy_flags*/
  #endif
};
static struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_SymbolTable __pyx_vtable_6fstlib_4cext_9pywrapfst_SymbolTable;

static PyObject *__pyx_tp_new_6fstlib_4cext_9pywrapfst_SymbolTable(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTable *p;
  PyObject *o = __pyx_tp_new_6fstlib_4cext_9pywrapfst__MutableSymbolTable(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTable *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_SymbolTableView*)__pyx_vtabptr_6fstlib_4cext_9pywrapfst_SymbolTable;
  new((void*)&(p->_smart_table)) std::unique_ptr<fst::SymbolTable> ();
  return o;
}

static void __pyx_tp_dealloc_6fstlib_4cext_9pywrapfst_SymbolTable(PyObject *o) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTable *p = (struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTable *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  __Pyx_call_destructor(p->_smart_table);
  __pyx_tp_dealloc_6fstlib_4cext_9pywrapfst_SymbolTableView(o);
}

static PyMethodDef __pyx_methods_6fstlib_4cext_9pywrapfst_SymbolTable[] = {
  {"read", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_11SymbolTable_5read, METH_O, __pyx_doc_6fstlib_4cext_9pywrapfst_11SymbolTable_4read},
  {"read_text", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6fstlib_4cext_9pywrapfst_11SymbolTable_7read_text, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6fstlib_4cext_9pywrapfst_11SymbolTable_6read_text},
  {"read_fst", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6fstlib_4cext_9pywrapfst_11SymbolTable_9read_fst, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6fstlib_4cext_9pywrapfst_11SymbolTable_8read_fst},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_6fstlib_4cext_9pywrapfst_SymbolTable = {
  PyVarObject_HEAD_INIT(0, 0)
  "fstlib.cext.pywrapfst.SymbolTable", /*tp_name*/
  sizeof(struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTable), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6fstlib_4cext_9pywrapfst_SymbolTable, /*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
  __pyx_pw_6fstlib_4cext_9pywrapfst_11SymbolTable_1__repr__, /*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*/
  "\n  SymbolTable(name=\"<unspecified>\")\n\n  Mutable SymbolTable class.\n\n  This class wraps the library SymbolTable and exposes both const (i.e.,\n  access) and non-const (i.e., mutation) methods of wrapped object.\n\n  Unlike other classes in the hierarchy, it has a working constructor and can be\n  used to programmatically construct a SymbolTable in memory.\n\n  Args:\n    name: An optional string indicating the table's name.\n  ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_6fstlib_4cext_9pywrapfst_15SymbolTableView_3__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  __pyx_methods_6fstlib_4cext_9pywrapfst_SymbolTable, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_6fstlib_4cext_9pywrapfst_11SymbolTable_3__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6fstlib_4cext_9pywrapfst_SymbolTable, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
  0, /*tp_pypy_flags*/
  #endif
};

static PyObject *__pyx_tp_new_6fstlib_4cext_9pywrapfst__SymbolTableIterator(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst__SymbolTableIterator *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst__SymbolTableIterator *)o);
  new((void*)&(p->_siter)) std::unique_ptr<fst::SymbolTable::iterator> ();
  p->_table = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_6fstlib_4cext_9pywrapfst__SymbolTableIterator(PyObject *o) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst__SymbolTableIterator *p = (struct __pyx_obj_6fstlib_4cext_9pywrapfst__SymbolTableIterator *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  __Pyx_call_destructor(p->_siter);
  Py_CLEAR(p->_table);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_6fstlib_4cext_9pywrapfst__SymbolTableIterator(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6fstlib_4cext_9pywrapfst__SymbolTableIterator *p = (struct __pyx_obj_6fstlib_4cext_9pywrapfst__SymbolTableIterator *)o;
  if (p->_table) {
    e = (*v)(((PyObject *)p->_table), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6fstlib_4cext_9pywrapfst__SymbolTableIterator(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_6fstlib_4cext_9pywrapfst__SymbolTableIterator *p = (struct __pyx_obj_6fstlib_4cext_9pywrapfst__SymbolTableIterator *)o;
  tmp = ((PyObject*)p->_table);
  p->_table = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_specialmethod___pyx_pw_6fstlib_4cext_9pywrapfst_20_SymbolTableIterator_7__next__(PyObject *self, CYTHON_UNUSED PyObject *arg) {return __pyx_pw_6fstlib_4cext_9pywrapfst_20_SymbolTableIterator_7__next__(self);}

static PyMethodDef __pyx_methods_6fstlib_4cext_9pywrapfst__SymbolTableIterator[] = {
  {"__next__", (PyCFunction)__pyx_specialmethod___pyx_pw_6fstlib_4cext_9pywrapfst_20_SymbolTableIterator_7__next__, METH_NOARGS|METH_COEXIST, 0},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_20_SymbolTableIterator_9__reduce_cython__, METH_NOARGS, 0},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_20_SymbolTableIterator_11__setstate_cython__, METH_O, 0},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_6fstlib_4cext_9pywrapfst__SymbolTableIterator = {
  PyVarObject_HEAD_INIT(0, 0)
  "fstlib.cext.pywrapfst._SymbolTableIterator", /*tp_name*/
  sizeof(struct __pyx_obj_6fstlib_4cext_9pywrapfst__SymbolTableIterator), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6fstlib_4cext_9pywrapfst__SymbolTableIterator, /*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
  __pyx_pw_6fstlib_4cext_9pywrapfst_20_SymbolTableIterator_1__repr__, /*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*/
  "\n  _SymbolTableIterator(symbols)\n\n  This class is used for iterating over a symbol table.\n  ", /*tp_doc*/
  __pyx_tp_traverse_6fstlib_4cext_9pywrapfst__SymbolTableIterator, /*tp_traverse*/
  __pyx_tp_clear_6fstlib_4cext_9pywrapfst__SymbolTableIterator, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_6fstlib_4cext_9pywrapfst_20_SymbolTableIterator_5__iter__, /*tp_iter*/
  __pyx_pw_6fstlib_4cext_9pywrapfst_20_SymbolTableIterator_7__next__, /*tp_iternext*/
  __pyx_methods_6fstlib_4cext_9pywrapfst__SymbolTableIterator, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_6fstlib_4cext_9pywrapfst_20_SymbolTableIterator_3__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6fstlib_4cext_9pywrapfst__SymbolTableIterator, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
  0, /*tp_pypy_flags*/
  #endif
};
static struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_EncodeMapper __pyx_vtable_6fstlib_4cext_9pywrapfst_EncodeMapper;

static PyObject *__pyx_tp_new_6fstlib_4cext_9pywrapfst_EncodeMapper(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *)o);
  p->__pyx_vtab = __pyx_vtabptr_6fstlib_4cext_9pywrapfst_EncodeMapper;
  new((void*)&(p->_mapper)) std::shared_ptr<fst::script::EncodeMapperClass> ();
  return o;
}

static void __pyx_tp_dealloc_6fstlib_4cext_9pywrapfst_EncodeMapper(PyObject *o) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *p = (struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  __Pyx_call_destructor(p->_mapper);
  (*Py_TYPE(o)->tp_free)(o);
}

static PyMethodDef __pyx_methods_6fstlib_4cext_9pywrapfst_EncodeMapper[] = {
  {"__reduce__", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_12EncodeMapper_7__reduce__, METH_NOARGS, 0},
  {"arc_type", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_12EncodeMapper_9arc_type, METH_NOARGS, __pyx_doc_6fstlib_4cext_9pywrapfst_12EncodeMapper_8arc_type},
  {"weight_type", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_12EncodeMapper_11weight_type, METH_NOARGS, __pyx_doc_6fstlib_4cext_9pywrapfst_12EncodeMapper_10weight_type},
  {"flags", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_12EncodeMapper_13flags, METH_NOARGS, __pyx_doc_6fstlib_4cext_9pywrapfst_12EncodeMapper_12flags},
  {"properties", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_12EncodeMapper_15properties, METH_O, __pyx_doc_6fstlib_4cext_9pywrapfst_12EncodeMapper_14properties},
  {"read", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_12EncodeMapper_17read, METH_O, __pyx_doc_6fstlib_4cext_9pywrapfst_12EncodeMapper_16read},
  {"read_from_string", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6fstlib_4cext_9pywrapfst_12EncodeMapper_19read_from_string, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6fstlib_4cext_9pywrapfst_12EncodeMapper_18read_from_string},
  {"write", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_12EncodeMapper_21write, METH_O, __pyx_doc_6fstlib_4cext_9pywrapfst_12EncodeMapper_20write},
  {"write_to_string", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_12EncodeMapper_23write_to_string, METH_NOARGS, __pyx_doc_6fstlib_4cext_9pywrapfst_12EncodeMapper_22write_to_string},
  {"input_symbols", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_12EncodeMapper_25input_symbols, METH_NOARGS, __pyx_doc_6fstlib_4cext_9pywrapfst_12EncodeMapper_24input_symbols},
  {"output_symbols", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_12EncodeMapper_27output_symbols, METH_NOARGS, __pyx_doc_6fstlib_4cext_9pywrapfst_12EncodeMapper_26output_symbols},
  {"set_input_symbols", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_12EncodeMapper_29set_input_symbols, METH_O, __pyx_doc_6fstlib_4cext_9pywrapfst_12EncodeMapper_28set_input_symbols},
  {"set_output_symbols", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_12EncodeMapper_31set_output_symbols, METH_O, __pyx_doc_6fstlib_4cext_9pywrapfst_12EncodeMapper_30set_output_symbols},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_6fstlib_4cext_9pywrapfst_EncodeMapper = {
  PyVarObject_HEAD_INIT(0, 0)
  "fstlib.cext.pywrapfst.EncodeMapper", /*tp_name*/
  sizeof(struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6fstlib_4cext_9pywrapfst_EncodeMapper, /*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
  __pyx_pw_6fstlib_4cext_9pywrapfst_12EncodeMapper_1__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  __pyx_pw_6fstlib_4cext_9pywrapfst_12EncodeMapper_5__call__, /*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*/
  "\n  EncodeMapper(arc_type=\"standard\", encode_labels=False, encode_weights=False)\n\n  Arc mapper class, wrapping EncodeMapperClass.\n\n  This class provides an object which can be used to encode or decode FST arcs.\n  This is most useful to convert an FST to an unweighted acceptor, on which\n  some FST operations are more efficient, and then decoding the FST afterwards.\n\n  To use an instance of this class to encode or decode a mutable FST, pass it\n  as the first argument to the FST instance methods `encode` and `decode`.\n\n  For implementational reasons, it is not currently possible to use an mapper\n  on disk to construct this class.\n\n  Args:\n    arc_type: A string indicating the arc type.\n    encode_labels: Should labels be encoded?\n    encode_weights: Should weights be encoded?\n  ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6fstlib_4cext_9pywrapfst_EncodeMapper, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_6fstlib_4cext_9pywrapfst_12EncodeMapper_3__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6fstlib_4cext_9pywrapfst_EncodeMapper, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
  0, /*tp_pypy_flags*/
  #endif
};
static struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_Fst __pyx_vtable_6fstlib_4cext_9pywrapfst_Fst;

static PyObject *__pyx_tp_new_6fstlib_4cext_9pywrapfst_Fst(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *)o);
  p->__pyx_vtab = __pyx_vtabptr_6fstlib_4cext_9pywrapfst_Fst;
  new((void*)&(p->_fst)) std::shared_ptr<fst::script::FstClass> ();
  return o;
}

static void __pyx_tp_dealloc_6fstlib_4cext_9pywrapfst_Fst(PyObject *o) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *p = (struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  __Pyx_call_destructor(p->_fst);
  (*Py_TYPE(o)->tp_free)(o);
}

static PyMethodDef __pyx_methods_6fstlib_4cext_9pywrapfst_Fst[] = {
  {"_repr_svg_", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_1_repr_svg_, METH_NOARGS, __pyx_doc_6fstlib_4cext_9pywrapfst_3Fst__repr_svg_},
  {"__reduce__", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_5__reduce__, METH_NOARGS, 0},
  {"arc_type", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_11arc_type, METH_NOARGS, __pyx_doc_6fstlib_4cext_9pywrapfst_3Fst_10arc_type},
  {"arcs", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_13arcs, METH_O, __pyx_doc_6fstlib_4cext_9pywrapfst_3Fst_12arcs},
  {"copy", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_15copy, METH_NOARGS, __pyx_doc_6fstlib_4cext_9pywrapfst_3Fst_14copy},
  {"draw", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_17draw, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6fstlib_4cext_9pywrapfst_3Fst_16draw},
  {"final", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_19final, METH_O, __pyx_doc_6fstlib_4cext_9pywrapfst_3Fst_18final},
  {"fst_type", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_21fst_type, METH_NOARGS, __pyx_doc_6fstlib_4cext_9pywrapfst_3Fst_20fst_type},
  {"input_symbols", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_23input_symbols, METH_NOARGS, __pyx_doc_6fstlib_4cext_9pywrapfst_3Fst_22input_symbols},
  {"num_arcs", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_25num_arcs, METH_O, __pyx_doc_6fstlib_4cext_9pywrapfst_3Fst_24num_arcs},
  {"num_input_epsilons", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_27num_input_epsilons, METH_O, __pyx_doc_6fstlib_4cext_9pywrapfst_3Fst_26num_input_epsilons},
  {"num_output_epsilons", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_29num_output_epsilons, METH_O, __pyx_doc_6fstlib_4cext_9pywrapfst_3Fst_28num_output_epsilons},
  {"output_symbols", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_31output_symbols, METH_NOARGS, __pyx_doc_6fstlib_4cext_9pywrapfst_3Fst_30output_symbols},
  {"print", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_33print, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6fstlib_4cext_9pywrapfst_3Fst_32print},
  {"properties", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_35properties, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6fstlib_4cext_9pywrapfst_3Fst_34properties},
  {"read", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_37read, METH_O, __pyx_doc_6fstlib_4cext_9pywrapfst_3Fst_36read},
  {"read_from_string", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_39read_from_string, METH_O, __pyx_doc_6fstlib_4cext_9pywrapfst_3Fst_38read_from_string},
  {"start", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_41start, METH_NOARGS, __pyx_doc_6fstlib_4cext_9pywrapfst_3Fst_40start},
  {"states", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_43states, METH_NOARGS, __pyx_doc_6fstlib_4cext_9pywrapfst_3Fst_42states},
  {"verify", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_45verify, METH_NOARGS, __pyx_doc_6fstlib_4cext_9pywrapfst_3Fst_44verify},
  {"weight_type", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_47weight_type, METH_NOARGS, __pyx_doc_6fstlib_4cext_9pywrapfst_3Fst_46weight_type},
  {"write", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_49write, METH_O, __pyx_doc_6fstlib_4cext_9pywrapfst_3Fst_48write},
  {"write_to_string", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_51write_to_string, METH_NOARGS, __pyx_doc_6fstlib_4cext_9pywrapfst_3Fst_50write_to_string},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_6fstlib_4cext_9pywrapfst_Fst = {
  PyVarObject_HEAD_INIT(0, 0)
  "fstlib.cext.pywrapfst.Fst", /*tp_name*/
  sizeof(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6fstlib_4cext_9pywrapfst_Fst, /*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
  __pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_7__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  __pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_9__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*/
  "\n  (No constructor.)\n\n  Immutable FST class, wrapping FstClass.\n\n  This class is the basic user-facing FST object. It does not itself support any\n  mutation operations.\n  ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6fstlib_4cext_9pywrapfst_Fst, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_3__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6fstlib_4cext_9pywrapfst_Fst, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
  0, /*tp_pypy_flags*/
  #endif
};
static struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_MutableFst __pyx_vtable_6fstlib_4cext_9pywrapfst_MutableFst;

static PyObject *__pyx_tp_new_6fstlib_4cext_9pywrapfst_MutableFst(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *p;
  PyObject *o = __pyx_tp_new_6fstlib_4cext_9pywrapfst_Fst(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_Fst*)__pyx_vtabptr_6fstlib_4cext_9pywrapfst_MutableFst;
  new((void*)&(p->_mfst)) std::shared_ptr<fst::script::MutableFstClass> ();
  return o;
}

static void __pyx_tp_dealloc_6fstlib_4cext_9pywrapfst_MutableFst(PyObject *o) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *p = (struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  __Pyx_call_destructor(p->_mfst);
  __pyx_tp_dealloc_6fstlib_4cext_9pywrapfst_Fst(o);
}

static PyMethodDef __pyx_methods_6fstlib_4cext_9pywrapfst_MutableFst[] = {
  {"add_arc", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_1add_arc, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6fstlib_4cext_9pywrapfst_10MutableFst_add_arc},
  {"add_state", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_3add_state, METH_NOARGS, __pyx_doc_6fstlib_4cext_9pywrapfst_10MutableFst_2add_state},
  {"add_states", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_5add_states, METH_O, __pyx_doc_6fstlib_4cext_9pywrapfst_10MutableFst_4add_states},
  {"arcsort", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_7arcsort, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6fstlib_4cext_9pywrapfst_10MutableFst_6arcsort},
  {"closure", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_9closure, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6fstlib_4cext_9pywrapfst_10MutableFst_8closure},
  {"concat", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_11concat, METH_O, __pyx_doc_6fstlib_4cext_9pywrapfst_10MutableFst_10concat},
  {"connect", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_13connect, METH_NOARGS, __pyx_doc_6fstlib_4cext_9pywrapfst_10MutableFst_12connect},
  {"decode", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_15decode, METH_O, __pyx_doc_6fstlib_4cext_9pywrapfst_10MutableFst_14decode},
  {"delete_arcs", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_17delete_arcs, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6fstlib_4cext_9pywrapfst_10MutableFst_16delete_arcs},
  {"delete_states", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_19delete_states, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6fstlib_4cext_9pywrapfst_10MutableFst_18delete_states},
  {"encode", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_21encode, METH_O, __pyx_doc_6fstlib_4cext_9pywrapfst_10MutableFst_20encode},
  {"invert", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_23invert, METH_NOARGS, __pyx_doc_6fstlib_4cext_9pywrapfst_10MutableFst_22invert},
  {"minimize", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_25minimize, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6fstlib_4cext_9pywrapfst_10MutableFst_24minimize},
  {"mutable_arcs", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_27mutable_arcs, METH_O, __pyx_doc_6fstlib_4cext_9pywrapfst_10MutableFst_26mutable_arcs},
  {"mutable_input_symbols", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_29mutable_input_symbols, METH_NOARGS, __pyx_doc_6fstlib_4cext_9pywrapfst_10MutableFst_28mutable_input_symbols},
  {"mutable_output_symbols", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_31mutable_output_symbols, METH_NOARGS, __pyx_doc_6fstlib_4cext_9pywrapfst_10MutableFst_30mutable_output_symbols},
  {"num_states", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_33num_states, METH_NOARGS, __pyx_doc_6fstlib_4cext_9pywrapfst_10MutableFst_32num_states},
  {"project", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_35project, METH_O, __pyx_doc_6fstlib_4cext_9pywrapfst_10MutableFst_34project},
  {"prune", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_37prune, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6fstlib_4cext_9pywrapfst_10MutableFst_36prune},
  {"push", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_39push, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6fstlib_4cext_9pywrapfst_10MutableFst_38push},
  {"relabel_pairs", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_41relabel_pairs, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6fstlib_4cext_9pywrapfst_10MutableFst_40relabel_pairs},
  {"relabel_tables", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_43relabel_tables, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6fstlib_4cext_9pywrapfst_10MutableFst_42relabel_tables},
  {"reserve_arcs", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_45reserve_arcs, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6fstlib_4cext_9pywrapfst_10MutableFst_44reserve_arcs},
  {"reserve_states", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_47reserve_states, METH_O, __pyx_doc_6fstlib_4cext_9pywrapfst_10MutableFst_46reserve_states},
  {"reweight", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_49reweight, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6fstlib_4cext_9pywrapfst_10MutableFst_48reweight},
  {"rmepsilon", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_51rmepsilon, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6fstlib_4cext_9pywrapfst_10MutableFst_50rmepsilon},
  {"set_final", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_53set_final, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6fstlib_4cext_9pywrapfst_10MutableFst_52set_final},
  {"set_input_symbols", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_55set_input_symbols, METH_O, __pyx_doc_6fstlib_4cext_9pywrapfst_10MutableFst_54set_input_symbols},
  {"set_output_symbols", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_57set_output_symbols, METH_O, __pyx_doc_6fstlib_4cext_9pywrapfst_10MutableFst_56set_output_symbols},
  {"set_properties", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_59set_properties, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6fstlib_4cext_9pywrapfst_10MutableFst_58set_properties},
  {"set_start", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_61set_start, METH_O, __pyx_doc_6fstlib_4cext_9pywrapfst_10MutableFst_60set_start},
  {"topsort", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_63topsort, METH_NOARGS, __pyx_doc_6fstlib_4cext_9pywrapfst_10MutableFst_62topsort},
  {"union", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6fstlib_4cext_9pywrapfst_10MutableFst_65union, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6fstlib_4cext_9pywrapfst_10MutableFst_64union},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_6fstlib_4cext_9pywrapfst_MutableFst = {
  PyVarObject_HEAD_INIT(0, 0)
  "fstlib.cext.pywrapfst.MutableFst", /*tp_name*/
  sizeof(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6fstlib_4cext_9pywrapfst_MutableFst, /*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
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_7__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_9__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, /*tp_flags*/
  "\n  (No constructor.)\n\n  Mutable FST class, wrapping MutableFstClass.\n\n  This class extends Fst by adding mutation operations.\n  ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6fstlib_4cext_9pywrapfst_MutableFst, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_3__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_6fstlib_4cext_9pywrapfst_MutableFst, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
  0, /*tp_pypy_flags*/
  #endif
};
static struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_VectorFst __pyx_vtable_6fstlib_4cext_9pywrapfst_VectorFst;

static PyObject *__pyx_tp_new_6fstlib_4cext_9pywrapfst_VectorFst(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_VectorFst *p;
  PyObject *o = __pyx_tp_new_6fstlib_4cext_9pywrapfst_MutableFst(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_VectorFst *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_Fst*)__pyx_vtabptr_6fstlib_4cext_9pywrapfst_VectorFst;
  return o;
}

static PyMethodDef __pyx_methods_6fstlib_4cext_9pywrapfst_VectorFst[] = {
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_6fstlib_4cext_9pywrapfst_VectorFst = {
  PyVarObject_HEAD_INIT(0, 0)
  "fstlib.cext.pywrapfst.VectorFst", /*tp_name*/
  sizeof(struct __pyx_obj_6fstlib_4cext_9pywrapfst_VectorFst), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6fstlib_4cext_9pywrapfst_MutableFst, /*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
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_7__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_6fstlib_4cext_9pywrapfst_3Fst_9__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, /*tp_flags*/
  "\n  VectorFst(arc_type=\"standard\")\n\n  Constructs a concrete, empty, mutable FST.\n\n  Args:\n    arc_type: A string indicating the arc type.\n\n  Raises:\n    FstOpError: Unknown arc type.\n  ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6fstlib_4cext_9pywrapfst_VectorFst, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_6fstlib_4cext_9pywrapfst_9VectorFst_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6fstlib_4cext_9pywrapfst_VectorFst, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
  0, /*tp_pypy_flags*/
  #endif
};
static struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_Arc __pyx_vtable_6fstlib_4cext_9pywrapfst_Arc;

static PyObject *__pyx_tp_new_6fstlib_4cext_9pywrapfst_Arc(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_Arc *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Arc *)o);
  p->__pyx_vtab = __pyx_vtabptr_6fstlib_4cext_9pywrapfst_Arc;
  new((void*)&(p->_arc)) std::unique_ptr<fst::script::ArcClass> ();
  return o;
}

static void __pyx_tp_dealloc_6fstlib_4cext_9pywrapfst_Arc(PyObject *o) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_Arc *p = (struct __pyx_obj_6fstlib_4cext_9pywrapfst_Arc *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  __Pyx_call_destructor(p->_arc);
  (*Py_TYPE(o)->tp_free)(o);
}

static PyObject *__pyx_getprop_6fstlib_4cext_9pywrapfst_3Arc_ilabel(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6fstlib_4cext_9pywrapfst_3Arc_6ilabel_1__get__(o);
}

static int __pyx_setprop_6fstlib_4cext_9pywrapfst_3Arc_ilabel(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6fstlib_4cext_9pywrapfst_3Arc_6ilabel_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6fstlib_4cext_9pywrapfst_3Arc_olabel(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6fstlib_4cext_9pywrapfst_3Arc_6olabel_1__get__(o);
}

static int __pyx_setprop_6fstlib_4cext_9pywrapfst_3Arc_olabel(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6fstlib_4cext_9pywrapfst_3Arc_6olabel_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6fstlib_4cext_9pywrapfst_3Arc_weight(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6fstlib_4cext_9pywrapfst_3Arc_6weight_1__get__(o);
}

static int __pyx_setprop_6fstlib_4cext_9pywrapfst_3Arc_weight(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6fstlib_4cext_9pywrapfst_3Arc_6weight_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6fstlib_4cext_9pywrapfst_3Arc_nextstate(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6fstlib_4cext_9pywrapfst_3Arc_9nextstate_1__get__(o);
}

static int __pyx_setprop_6fstlib_4cext_9pywrapfst_3Arc_nextstate(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6fstlib_4cext_9pywrapfst_3Arc_9nextstate_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyMethodDef __pyx_methods_6fstlib_4cext_9pywrapfst_Arc[] = {
  {"copy", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_3Arc_5copy, METH_NOARGS, 0},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_3Arc_7__reduce_cython__, METH_NOARGS, 0},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_3Arc_9__setstate_cython__, METH_O, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_6fstlib_4cext_9pywrapfst_Arc[] = {
  {(char *)"ilabel", __pyx_getprop_6fstlib_4cext_9pywrapfst_3Arc_ilabel, __pyx_setprop_6fstlib_4cext_9pywrapfst_3Arc_ilabel, (char *)0, 0},
  {(char *)"olabel", __pyx_getprop_6fstlib_4cext_9pywrapfst_3Arc_olabel, __pyx_setprop_6fstlib_4cext_9pywrapfst_3Arc_olabel, (char *)0, 0},
  {(char *)"weight", __pyx_getprop_6fstlib_4cext_9pywrapfst_3Arc_weight, __pyx_setprop_6fstlib_4cext_9pywrapfst_3Arc_weight, (char *)0, 0},
  {(char *)"nextstate", __pyx_getprop_6fstlib_4cext_9pywrapfst_3Arc_nextstate, __pyx_setprop_6fstlib_4cext_9pywrapfst_3Arc_nextstate, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_6fstlib_4cext_9pywrapfst_Arc = {
  PyVarObject_HEAD_INIT(0, 0)
  "fstlib.cext.pywrapfst.Arc", /*tp_name*/
  sizeof(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Arc), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6fstlib_4cext_9pywrapfst_Arc, /*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
  __pyx_pw_6fstlib_4cext_9pywrapfst_3Arc_1__repr__, /*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*/
  "\n  Arc(ilabel, olabel, weight, nextstate)\n\n  This class represents an arc while remaining agnostic about the underlying arc\n  type.  Attributes of the arc can be accessed or mutated, and the arc can be\n  copied.\n\n  Attributes:\n    ilabel: The input label.\n    olabel: The output label.\n    weight: The arc weight.\n    nextstate: The destination state for the arc.\n  ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6fstlib_4cext_9pywrapfst_Arc, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_6fstlib_4cext_9pywrapfst_Arc, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_6fstlib_4cext_9pywrapfst_3Arc_3__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6fstlib_4cext_9pywrapfst_Arc, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
  0, /*tp_pypy_flags*/
  #endif
};
static struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst__ArcIterator __pyx_vtable_6fstlib_4cext_9pywrapfst__ArcIterator;

static PyObject *__pyx_tp_new_6fstlib_4cext_9pywrapfst__ArcIterator(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst__ArcIterator *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst__ArcIterator *)o);
  p->__pyx_vtab = __pyx_vtabptr_6fstlib_4cext_9pywrapfst__ArcIterator;
  new((void*)&(p->_fst)) std::shared_ptr<fst::script::FstClass> ();
  new((void*)&(p->_aiter)) std::unique_ptr<fst::script::ArcIteratorClass> ();
  return o;
}

static void __pyx_tp_dealloc_6fstlib_4cext_9pywrapfst__ArcIterator(PyObject *o) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst__ArcIterator *p = (struct __pyx_obj_6fstlib_4cext_9pywrapfst__ArcIterator *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  __Pyx_call_destructor(p->_fst);
  __Pyx_call_destructor(p->_aiter);
  (*Py_TYPE(o)->tp_free)(o);
}

static PyObject *__pyx_specialmethod___pyx_pw_6fstlib_4cext_9pywrapfst_12_ArcIterator_7__next__(PyObject *self, CYTHON_UNUSED PyObject *arg) {return __pyx_pw_6fstlib_4cext_9pywrapfst_12_ArcIterator_7__next__(self);}

static PyMethodDef __pyx_methods_6fstlib_4cext_9pywrapfst__ArcIterator[] = {
  {"__next__", (PyCFunction)__pyx_specialmethod___pyx_pw_6fstlib_4cext_9pywrapfst_12_ArcIterator_7__next__, METH_NOARGS|METH_COEXIST, 0},
  {"done", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_12_ArcIterator_9done, METH_NOARGS, __pyx_doc_6fstlib_4cext_9pywrapfst_12_ArcIterator_8done},
  {"flags", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_12_ArcIterator_11flags, METH_NOARGS, __pyx_doc_6fstlib_4cext_9pywrapfst_12_ArcIterator_10flags},
  {"next", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_12_ArcIterator_13next, METH_NOARGS, __pyx_doc_6fstlib_4cext_9pywrapfst_12_ArcIterator_12next},
  {"position", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_12_ArcIterator_15position, METH_NOARGS, __pyx_doc_6fstlib_4cext_9pywrapfst_12_ArcIterator_14position},
  {"reset", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_12_ArcIterator_17reset, METH_NOARGS, __pyx_doc_6fstlib_4cext_9pywrapfst_12_ArcIterator_16reset},
  {"seek", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_12_ArcIterator_19seek, METH_O, __pyx_doc_6fstlib_4cext_9pywrapfst_12_ArcIterator_18seek},
  {"set_flags", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6fstlib_4cext_9pywrapfst_12_ArcIterator_21set_flags, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6fstlib_4cext_9pywrapfst_12_ArcIterator_20set_flags},
  {"value", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_12_ArcIterator_23value, METH_NOARGS, __pyx_doc_6fstlib_4cext_9pywrapfst_12_ArcIterator_22value},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_12_ArcIterator_25__reduce_cython__, METH_NOARGS, 0},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_12_ArcIterator_27__setstate_cython__, METH_O, 0},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_6fstlib_4cext_9pywrapfst__ArcIterator = {
  PyVarObject_HEAD_INIT(0, 0)
  "fstlib.cext.pywrapfst._ArcIterator", /*tp_name*/
  sizeof(struct __pyx_obj_6fstlib_4cext_9pywrapfst__ArcIterator), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6fstlib_4cext_9pywrapfst__ArcIterator, /*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
  __pyx_pw_6fstlib_4cext_9pywrapfst_12_ArcIterator_1__repr__, /*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*/
  "\n  _ArcIterator(ifst, state)\n\n  This class is used for iterating over the arcs leaving some state of an FST.\n  ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_6fstlib_4cext_9pywrapfst_12_ArcIterator_5__iter__, /*tp_iter*/
  __pyx_pw_6fstlib_4cext_9pywrapfst_12_ArcIterator_7__next__, /*tp_iternext*/
  __pyx_methods_6fstlib_4cext_9pywrapfst__ArcIterator, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_6fstlib_4cext_9pywrapfst_12_ArcIterator_3__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6fstlib_4cext_9pywrapfst__ArcIterator, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
  0, /*tp_pypy_flags*/
  #endif
};
static struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst__MutableArcIterator __pyx_vtable_6fstlib_4cext_9pywrapfst__MutableArcIterator;

static PyObject *__pyx_tp_new_6fstlib_4cext_9pywrapfst__MutableArcIterator(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableArcIterator *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableArcIterator *)o);
  p->__pyx_vtab = __pyx_vtabptr_6fstlib_4cext_9pywrapfst__MutableArcIterator;
  new((void*)&(p->_mfst)) std::shared_ptr<fst::script::MutableFstClass> ();
  new((void*)&(p->_aiter)) std::unique_ptr<fst::script::MutableArcIteratorClass> ();
  return o;
}

static void __pyx_tp_dealloc_6fstlib_4cext_9pywrapfst__MutableArcIterator(PyObject *o) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableArcIterator *p = (struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableArcIterator *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  __Pyx_call_destructor(p->_mfst);
  __Pyx_call_destructor(p->_aiter);
  (*Py_TYPE(o)->tp_free)(o);
}

static PyObject *__pyx_specialmethod___pyx_pw_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_8__next__(PyObject *self, CYTHON_UNUSED PyObject *arg) {return __pyx_pw_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_8__next__(self);}

static PyMethodDef __pyx_methods_6fstlib_4cext_9pywrapfst__MutableArcIterator[] = {
  {"__next__", (PyCFunction)__pyx_specialmethod___pyx_pw_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_8__next__, METH_NOARGS|METH_COEXIST, 0},
  {"done", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_10done, METH_NOARGS, __pyx_doc_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_9done},
  {"flags", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_12flags, METH_NOARGS, __pyx_doc_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_11flags},
  {"next", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_14next, METH_NOARGS, __pyx_doc_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_13next},
  {"position", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_16position, METH_NOARGS, __pyx_doc_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_15position},
  {"reset", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_18reset, METH_NOARGS, __pyx_doc_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_17reset},
  {"seek", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_20seek, METH_O, __pyx_doc_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_19seek},
  {"set_flags", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_22set_flags, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_21set_flags},
  {"set_value", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_24set_value, METH_O, __pyx_doc_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_23set_value},
  {"value", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_26value, METH_NOARGS, __pyx_doc_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_25value},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_28__reduce_cython__, METH_NOARGS, 0},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_30__setstate_cython__, METH_O, 0},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_6fstlib_4cext_9pywrapfst__MutableArcIterator = {
  PyVarObject_HEAD_INIT(0, 0)
  "fstlib.cext.pywrapfst._MutableArcIterator", /*tp_name*/
  sizeof(struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableArcIterator), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6fstlib_4cext_9pywrapfst__MutableArcIterator, /*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
  __pyx_pw_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_1__repr__, /*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*/
  "\n  _MutableArcIterator(ifst, state)\n\n  This class is used for iterating over the arcs leaving some state of an FST,\n  also permitting mutation of the current arc.\n  ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_5__iter__, /*tp_iter*/
  __pyx_pw_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_8__next__, /*tp_iternext*/
  __pyx_methods_6fstlib_4cext_9pywrapfst__MutableArcIterator, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_3__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6fstlib_4cext_9pywrapfst__MutableArcIterator, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
  0, /*tp_pypy_flags*/
  #endif
};
static struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst__StateIterator __pyx_vtable_6fstlib_4cext_9pywrapfst__StateIterator;

static PyObject *__pyx_tp_new_6fstlib_4cext_9pywrapfst__StateIterator(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst__StateIterator *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst__StateIterator *)o);
  p->__pyx_vtab = __pyx_vtabptr_6fstlib_4cext_9pywrapfst__StateIterator;
  new((void*)&(p->_fst)) std::shared_ptr<fst::script::FstClass> ();
  new((void*)&(p->_siter)) std::unique_ptr<fst::script::StateIteratorClass> ();
  return o;
}

static void __pyx_tp_dealloc_6fstlib_4cext_9pywrapfst__StateIterator(PyObject *o) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst__StateIterator *p = (struct __pyx_obj_6fstlib_4cext_9pywrapfst__StateIterator *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  __Pyx_call_destructor(p->_fst);
  __Pyx_call_destructor(p->_siter);
  (*Py_TYPE(o)->tp_free)(o);
}

static PyObject *__pyx_specialmethod___pyx_pw_6fstlib_4cext_9pywrapfst_14_StateIterator_7__next__(PyObject *self, CYTHON_UNUSED PyObject *arg) {return __pyx_pw_6fstlib_4cext_9pywrapfst_14_StateIterator_7__next__(self);}

static PyMethodDef __pyx_methods_6fstlib_4cext_9pywrapfst__StateIterator[] = {
  {"__next__", (PyCFunction)__pyx_specialmethod___pyx_pw_6fstlib_4cext_9pywrapfst_14_StateIterator_7__next__, METH_NOARGS|METH_COEXIST, 0},
  {"done", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_14_StateIterator_9done, METH_NOARGS, __pyx_doc_6fstlib_4cext_9pywrapfst_14_StateIterator_8done},
  {"next", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_14_StateIterator_11next, METH_NOARGS, __pyx_doc_6fstlib_4cext_9pywrapfst_14_StateIterator_10next},
  {"reset", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_14_StateIterator_13reset, METH_NOARGS, __pyx_doc_6fstlib_4cext_9pywrapfst_14_StateIterator_12reset},
  {"value", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_14_StateIterator_15value, METH_NOARGS, __pyx_doc_6fstlib_4cext_9pywrapfst_14_StateIterator_14value},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_14_StateIterator_17__reduce_cython__, METH_NOARGS, 0},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_14_StateIterator_19__setstate_cython__, METH_O, 0},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_6fstlib_4cext_9pywrapfst__StateIterator = {
  PyVarObject_HEAD_INIT(0, 0)
  "fstlib.cext.pywrapfst._StateIterator", /*tp_name*/
  sizeof(struct __pyx_obj_6fstlib_4cext_9pywrapfst__StateIterator), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6fstlib_4cext_9pywrapfst__StateIterator, /*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
  __pyx_pw_6fstlib_4cext_9pywrapfst_14_StateIterator_1__repr__, /*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*/
  "\n  _StateIterator(ifst)\n\n  This class is used for iterating over the states in an FST.\n  ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_6fstlib_4cext_9pywrapfst_14_StateIterator_5__iter__, /*tp_iter*/
  __pyx_pw_6fstlib_4cext_9pywrapfst_14_StateIterator_7__next__, /*tp_iternext*/
  __pyx_methods_6fstlib_4cext_9pywrapfst__StateIterator, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_6fstlib_4cext_9pywrapfst_14_StateIterator_3__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6fstlib_4cext_9pywrapfst__StateIterator, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
  0, /*tp_pypy_flags*/
  #endif
};
static struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_Compiler __pyx_vtable_6fstlib_4cext_9pywrapfst_Compiler;

static PyObject *__pyx_tp_new_6fstlib_4cext_9pywrapfst_Compiler(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_Compiler *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_Compiler *)o);
  p->__pyx_vtab = __pyx_vtabptr_6fstlib_4cext_9pywrapfst_Compiler;
  new((void*)&(p->_sstrm)) std::unique_ptr<std::stringstream> ();
  new((void*)&(p->_fst_type)) std::string();
  new((void*)&(p->_arc_type)) std::string();
  if (unlikely(__pyx_pw_6fstlib_4cext_9pywrapfst_8Compiler_1__cinit__(o, a, k) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_6fstlib_4cext_9pywrapfst_Compiler(PyObject *o) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_Compiler *p = (struct __pyx_obj_6fstlib_4cext_9pywrapfst_Compiler *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  __Pyx_call_destructor(p->_sstrm);
  __Pyx_call_destructor(p->_fst_type);
  __Pyx_call_destructor(p->_arc_type);
  (*Py_TYPE(o)->tp_free)(o);
}

static PyMethodDef __pyx_methods_6fstlib_4cext_9pywrapfst_Compiler[] = {
  {"compile", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_8Compiler_3compile, METH_NOARGS, __pyx_doc_6fstlib_4cext_9pywrapfst_8Compiler_2compile},
  {"write", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_8Compiler_5write, METH_O, __pyx_doc_6fstlib_4cext_9pywrapfst_8Compiler_4write},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_8Compiler_7__reduce_cython__, METH_NOARGS, 0},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_8Compiler_9__setstate_cython__, METH_O, 0},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_6fstlib_4cext_9pywrapfst_Compiler = {
  PyVarObject_HEAD_INIT(0, 0)
  "fstlib.cext.pywrapfst.Compiler", /*tp_name*/
  sizeof(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Compiler), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6fstlib_4cext_9pywrapfst_Compiler, /*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*/
  "\n  Compiler(fst_type=\"vector\", arc_type=\"standard\", isymbols=None,\n           osymbols=None, ssymbols=None, acceptor=False, keep_isymbols=False,\n           keep_osymbols=False, keep_state_numbering=False,\n           allow_negative_labels=False)\n\n  Class used to compile FSTs from strings.\n\n  This class is used to compile FSTs specified using the AT&T FSM library\n  format described here:\n\n  http://web.eecs.umich.edu/~radev/NLP-fall2015/resources/fsm_archive/fsm.5.html\n\n  This is the same format used by the `fstcompile` executable.\n\n  Compiler options (symbol tables, etc.) are set at construction time.\n\n      compiler = fst.Compiler(isymbols=ascii_symbols, osymbols=ascii_symbols)\n\n  Once constructed, Compiler instances behave like a file handle opened for\n  writing:\n\n      # /ba+/\n      compiler.write(\"0 1 50 50\")\n      compiler.write(\"1 2 49 49\")\n      compiler.write(\"2 2 49 49\")\n      compiler.write(\"2\")\n\n  The `compile` method returns an actual FST instance:\n\n      sheep_machine = compiler.compile()\n\n  Compilation flushes the internal buffer, so the compiler instance can be\n  reused to compile new machines with the same symbol tables (etc.)\n\n  Args:\n    fst_type: A string indicating the container type for the compiled FST.\n    arc_type: A string indicating the arc type for the compiled FST.\n    isymbols: An optional SymbolTable used to label input symbols.\n    osymbols: An optional SymbolTable used to label output symbols.\n    ssymbols: An optional SymbolTable used to label states.\n    acceptor: Should the FST be rendered in acceptor format if possible?\n    keep_isymbols: Should the input symbol table be stored in the FST?\n    keep_osymbols: Should the output symbol table be stored in the FST?\n    keep_state_numbering: Should the state numbering be preserved?\n    allow_negative_labels: Should negative labels be allowed? (Not\n        recommended; may cause conflicts).\n  ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6fstlib_4cext_9pywrapfst_Compiler, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6fstlib_4cext_9pywrapfst_Compiler, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
  0, /*tp_pypy_flags*/
  #endif
};
static struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_FarReader __pyx_vtable_6fstlib_4cext_9pywrapfst_FarReader;

static PyObject *__pyx_tp_new_6fstlib_4cext_9pywrapfst_FarReader(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarReader *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarReader *)o);
  p->__pyx_vtab = __pyx_vtabptr_6fstlib_4cext_9pywrapfst_FarReader;
  new((void*)&(p->_reader)) std::unique_ptr<fst::script::FarReaderClass> ();
  return o;
}

static void __pyx_tp_dealloc_6fstlib_4cext_9pywrapfst_FarReader(PyObject *o) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarReader *p = (struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarReader *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  __Pyx_call_destructor(p->_reader);
  (*Py_TYPE(o)->tp_free)(o);
}
static PyObject *__pyx_sq_item_6fstlib_4cext_9pywrapfst_FarReader(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_6fstlib_4cext_9pywrapfst_9FarReader_27__next__(PyObject *self, CYTHON_UNUSED PyObject *arg) {return __pyx_pw_6fstlib_4cext_9pywrapfst_9FarReader_27__next__(self);}

static PyMethodDef __pyx_methods_6fstlib_4cext_9pywrapfst_FarReader[] = {
  {"open", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6fstlib_4cext_9pywrapfst_9FarReader_5open, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6fstlib_4cext_9pywrapfst_9FarReader_4open},
  {"arc_type", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_9FarReader_7arc_type, METH_NOARGS, __pyx_doc_6fstlib_4cext_9pywrapfst_9FarReader_6arc_type},
  {"done", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_9FarReader_9done, METH_NOARGS, __pyx_doc_6fstlib_4cext_9pywrapfst_9FarReader_8done},
  {"error", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_9FarReader_11error, METH_NOARGS, __pyx_doc_6fstlib_4cext_9pywrapfst_9FarReader_10error},
  {"far_type", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_9FarReader_13far_type, METH_NOARGS, 0},
  {"find", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_9FarReader_15find, METH_O, __pyx_doc_6fstlib_4cext_9pywrapfst_9FarReader_14find},
  {"get_fst", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_9FarReader_17get_fst, METH_NOARGS, __pyx_doc_6fstlib_4cext_9pywrapfst_9FarReader_16get_fst},
  {"get_key", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_9FarReader_19get_key, METH_NOARGS, __pyx_doc_6fstlib_4cext_9pywrapfst_9FarReader_18get_key},
  {"next", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_9FarReader_21next, METH_NOARGS, __pyx_doc_6fstlib_4cext_9pywrapfst_9FarReader_20next},
  {"reset", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_9FarReader_23reset, METH_NOARGS, __pyx_doc_6fstlib_4cext_9pywrapfst_9FarReader_22reset},
  {"__next__", (PyCFunction)__pyx_specialmethod___pyx_pw_6fstlib_4cext_9pywrapfst_9FarReader_27__next__, METH_NOARGS|METH_COEXIST, 0},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_9FarReader_31__reduce_cython__, METH_NOARGS, 0},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_9FarReader_33__setstate_cython__, METH_O, 0},
  {0, 0, 0, 0}
};

static PySequenceMethods __pyx_tp_as_sequence_FarReader = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  __pyx_sq_item_6fstlib_4cext_9pywrapfst_FarReader, /*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_FarReader = {
  0, /*mp_length*/
  __pyx_pw_6fstlib_4cext_9pywrapfst_9FarReader_25__getitem__, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyTypeObject __pyx_type_6fstlib_4cext_9pywrapfst_FarReader = {
  PyVarObject_HEAD_INIT(0, 0)
  "fstlib.cext.pywrapfst.FarReader", /*tp_name*/
  sizeof(struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarReader), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6fstlib_4cext_9pywrapfst_FarReader, /*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
  __pyx_pw_6fstlib_4cext_9pywrapfst_9FarReader_3__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  &__pyx_tp_as_sequence_FarReader, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_FarReader, /*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*/
  "\n  (No constructor.)\n\n  FAR (\"Fst ARchive\") reader object.\n\n  This class is used to read a FAR from disk. FARs contain one or more FSTs (of\n  the same arc type) indexed by a unique string key. To construct a FarReader\n  object, use the `open` class method.\n\n  Attributes:\n    arc_type: A string indicating the arc type.\n    far_type: A string indicating the FAR type.\n  ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_6fstlib_4cext_9pywrapfst_9FarReader_29__iter__, /*tp_iter*/
  __pyx_pw_6fstlib_4cext_9pywrapfst_9FarReader_27__next__, /*tp_iternext*/
  __pyx_methods_6fstlib_4cext_9pywrapfst_FarReader, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_6fstlib_4cext_9pywrapfst_9FarReader_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6fstlib_4cext_9pywrapfst_FarReader, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
  0, /*tp_pypy_flags*/
  #endif
};
static struct __pyx_vtabstruct_6fstlib_4cext_9pywrapfst_FarWriter __pyx_vtable_6fstlib_4cext_9pywrapfst_FarWriter;

static PyObject *__pyx_tp_new_6fstlib_4cext_9pywrapfst_FarWriter(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarWriter *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarWriter *)o);
  p->__pyx_vtab = __pyx_vtabptr_6fstlib_4cext_9pywrapfst_FarWriter;
  new((void*)&(p->_writer)) std::unique_ptr<fst::script::FarWriterClass> ();
  return o;
}

static void __pyx_tp_dealloc_6fstlib_4cext_9pywrapfst_FarWriter(PyObject *o) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarWriter *p = (struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarWriter *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  __Pyx_call_destructor(p->_writer);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_mp_ass_subscript_6fstlib_4cext_9pywrapfst_FarWriter(PyObject *o, PyObject *i, PyObject *v) {
  if (v) {
    return __pyx_pw_6fstlib_4cext_9pywrapfst_9FarWriter_15__setitem__(o, i, v);
  }
  else {
    PyErr_Format(PyExc_NotImplementedError,
      "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
    return -1;
  }
}

static PyMethodDef __pyx_methods_6fstlib_4cext_9pywrapfst_FarWriter[] = {
  {"create", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6fstlib_4cext_9pywrapfst_9FarWriter_5create, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6fstlib_4cext_9pywrapfst_9FarWriter_4create},
  {"add", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6fstlib_4cext_9pywrapfst_9FarWriter_7add, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6fstlib_4cext_9pywrapfst_9FarWriter_6add},
  {"arc_type", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_9FarWriter_9arc_type, METH_NOARGS, __pyx_doc_6fstlib_4cext_9pywrapfst_9FarWriter_8arc_type},
  {"error", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_9FarWriter_11error, METH_NOARGS, __pyx_doc_6fstlib_4cext_9pywrapfst_9FarWriter_10error},
  {"far_type", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_9FarWriter_13far_type, METH_NOARGS, __pyx_doc_6fstlib_4cext_9pywrapfst_9FarWriter_12far_type},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_9FarWriter_17__reduce_cython__, METH_NOARGS, 0},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_9FarWriter_19__setstate_cython__, METH_O, 0},
  {0, 0, 0, 0}
};

static PyMappingMethods __pyx_tp_as_mapping_FarWriter = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  __pyx_mp_ass_subscript_6fstlib_4cext_9pywrapfst_FarWriter, /*mp_ass_subscript*/
};

static PyTypeObject __pyx_type_6fstlib_4cext_9pywrapfst_FarWriter = {
  PyVarObject_HEAD_INIT(0, 0)
  "fstlib.cext.pywrapfst.FarWriter", /*tp_name*/
  sizeof(struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarWriter), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6fstlib_4cext_9pywrapfst_FarWriter, /*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
  __pyx_pw_6fstlib_4cext_9pywrapfst_9FarWriter_3__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_FarWriter, /*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*/
  "\n  (No constructor.)\n\n  FAR (\"Fst ARchive\") writer object.\n\n  This class is used to write FSTs (of the same arc type) to a FAR on disk. To\n  construct a FarWriter, use the `create` class method.\n\n  Note that the data is not guaranteed to flush to disk until the FarWriter\n  is garbage-collected. If a FarWriter has been assigned to only one variable,\n  then calling `del` on that variable should decrement the object's reference\n  count from 1 to 0, triggering a flush to disk on the next GC cycle.\n\n  Attributes:\n    arc_type: A string indicating the arc type.\n    far_type: A string indicating the FAR type.\n  ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6fstlib_4cext_9pywrapfst_FarWriter, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_6fstlib_4cext_9pywrapfst_9FarWriter_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6fstlib_4cext_9pywrapfst_FarWriter, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
  0, /*tp_pypy_flags*/
  #endif
};

static struct __pyx_obj_6fstlib_4cext_9pywrapfst___pyx_scope_struct____iter__ *__pyx_freelist_6fstlib_4cext_9pywrapfst___pyx_scope_struct____iter__[8];
static int __pyx_freecount_6fstlib_4cext_9pywrapfst___pyx_scope_struct____iter__ = 0;

static PyObject *__pyx_tp_new_6fstlib_4cext_9pywrapfst___pyx_scope_struct____iter__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_6fstlib_4cext_9pywrapfst___pyx_scope_struct____iter__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_6fstlib_4cext_9pywrapfst___pyx_scope_struct____iter__)))) {
    o = (PyObject*)__pyx_freelist_6fstlib_4cext_9pywrapfst___pyx_scope_struct____iter__[--__pyx_freecount_6fstlib_4cext_9pywrapfst___pyx_scope_struct____iter__];
    memset(o, 0, sizeof(struct __pyx_obj_6fstlib_4cext_9pywrapfst___pyx_scope_struct____iter__));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_6fstlib_4cext_9pywrapfst___pyx_scope_struct____iter__(PyObject *o) {
  struct __pyx_obj_6fstlib_4cext_9pywrapfst___pyx_scope_struct____iter__ *p = (struct __pyx_obj_6fstlib_4cext_9pywrapfst___pyx_scope_struct____iter__ *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_6fstlib_4cext_9pywrapfst___pyx_scope_struct____iter__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6fstlib_4cext_9pywrapfst___pyx_scope_struct____iter__)))) {
    __pyx_freelist_6fstlib_4cext_9pywrapfst___pyx_scope_struct____iter__[__pyx_freecount_6fstlib_4cext_9pywrapfst___pyx_scope_struct____iter__++] = ((struct __pyx_obj_6fstlib_4cext_9pywrapfst___pyx_scope_struct____iter__ *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_6fstlib_4cext_9pywrapfst___pyx_scope_struct____iter__(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6fstlib_4cext_9pywrapfst___pyx_scope_struct____iter__ *p = (struct __pyx_obj_6fstlib_4cext_9pywrapfst___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 PyTypeObject __pyx_type_6fstlib_4cext_9pywrapfst___pyx_scope_struct____iter__ = {
  PyVarObject_HEAD_INIT(0, 0)
  "fstlib.cext.pywrapfst.__pyx_scope_struct____iter__", /*tp_name*/
  sizeof(struct __pyx_obj_6fstlib_4cext_9pywrapfst___pyx_scope_struct____iter__), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6fstlib_4cext_9pywrapfst___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, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6fstlib_4cext_9pywrapfst___pyx_scope_struct____iter__, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6fstlib_4cext_9pywrapfst___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
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
  0, /*tp_pypy_flags*/
  #endif
};

static PyMethodDef __pyx_methods[] = {
  {"_read_SymbolTable_from_string", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_9_read_SymbolTable_from_string, METH_O, 0},
  {"compact_symbol_table", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_11compact_symbol_table, METH_O, __pyx_doc_6fstlib_4cext_9pywrapfst_10compact_symbol_table},
  {"merge_symbol_table", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6fstlib_4cext_9pywrapfst_13merge_symbol_table, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6fstlib_4cext_9pywrapfst_12merge_symbol_table},
  {"_read_EncodeMapper_from_string", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_15_read_EncodeMapper_from_string, METH_O, 0},
  {"_read_Fst", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_17_read_Fst, METH_O, 0},
  {"_read_Fst_from_string", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_19_read_Fst_from_string, METH_O, 0},
  {"arcmap", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6fstlib_4cext_9pywrapfst_21arcmap, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6fstlib_4cext_9pywrapfst_20arcmap},
  {"compose", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6fstlib_4cext_9pywrapfst_23compose, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6fstlib_4cext_9pywrapfst_22compose},
  {"convert", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6fstlib_4cext_9pywrapfst_25convert, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6fstlib_4cext_9pywrapfst_24convert},
  {"determinize", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6fstlib_4cext_9pywrapfst_27determinize, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6fstlib_4cext_9pywrapfst_26determinize},
  {"difference", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6fstlib_4cext_9pywrapfst_29difference, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6fstlib_4cext_9pywrapfst_28difference},
  {"disambiguate", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6fstlib_4cext_9pywrapfst_31disambiguate, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6fstlib_4cext_9pywrapfst_30disambiguate},
  {"epsnormalize", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6fstlib_4cext_9pywrapfst_33epsnormalize, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6fstlib_4cext_9pywrapfst_32epsnormalize},
  {"equal", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6fstlib_4cext_9pywrapfst_35equal, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6fstlib_4cext_9pywrapfst_34equal},
  {"equivalent", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6fstlib_4cext_9pywrapfst_37equivalent, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6fstlib_4cext_9pywrapfst_36equivalent},
  {"intersect", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6fstlib_4cext_9pywrapfst_39intersect, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6fstlib_4cext_9pywrapfst_38intersect},
  {"isomorphic", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6fstlib_4cext_9pywrapfst_41isomorphic, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6fstlib_4cext_9pywrapfst_40isomorphic},
  {"prune", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6fstlib_4cext_9pywrapfst_43prune, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6fstlib_4cext_9pywrapfst_42prune},
  {"push", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6fstlib_4cext_9pywrapfst_45push, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6fstlib_4cext_9pywrapfst_44push},
  {"randequivalent", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6fstlib_4cext_9pywrapfst_47randequivalent, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6fstlib_4cext_9pywrapfst_46randequivalent},
  {"randgen", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6fstlib_4cext_9pywrapfst_49randgen, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6fstlib_4cext_9pywrapfst_48randgen},
  {"replace", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6fstlib_4cext_9pywrapfst_51replace, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6fstlib_4cext_9pywrapfst_50replace},
  {"reverse", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6fstlib_4cext_9pywrapfst_53reverse, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6fstlib_4cext_9pywrapfst_52reverse},
  {"shortestpath", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6fstlib_4cext_9pywrapfst_57shortestpath, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6fstlib_4cext_9pywrapfst_56shortestpath},
  {"statemap", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6fstlib_4cext_9pywrapfst_59statemap, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6fstlib_4cext_9pywrapfst_58statemap},
  {"synchronize", (PyCFunction)__pyx_pw_6fstlib_4cext_9pywrapfst_61synchronize, METH_O, __pyx_doc_6fstlib_4cext_9pywrapfst_60synchronize},
  {0, 0, 0, 0}
};

#if PY_MAJOR_VERSION >= 3
#if CYTHON_PEP489_MULTI_PHASE_INIT
static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
static int __pyx_pymod_exec_pywrapfst(PyObject* module); /*proto*/
static PyModuleDef_Slot __pyx_moduledef_slots[] = {
  {Py_mod_create, (void*)__pyx_pymod_create},
  {Py_mod_exec, (void*)__pyx_pymod_exec_pywrapfst},
  {0, NULL}
};
#endif

static struct PyModuleDef __pyx_moduledef = {
    PyModuleDef_HEAD_INIT,
    "pywrapfst",
    __pyx_k_Python_interface_to_the_FST_scri, /* m_doc */
  #if CYTHON_PEP489_MULTI_PHASE_INIT
    0, /* m_size */
  #else
    -1, /* m_size */
  #endif
    __pyx_methods /* m_methods */,
  #if CYTHON_PEP489_MULTI_PHASE_INIT
    __pyx_moduledef_slots, /* m_slots */
  #else
    NULL, /* m_reload */
  #endif
    NULL, /* m_traverse */
    NULL, /* m_clear */
    NULL /* m_free */
};
#endif
#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

static __Pyx_StringTabEntry __pyx_string_tab[] = {
  {&__pyx_kp_u_, __pyx_k_, sizeof(__pyx_k_), 0, 1, 0, 0},
  {&__pyx_n_s_ACCEPTOR, __pyx_k_ACCEPTOR, sizeof(__pyx_k_ACCEPTOR), 0, 0, 1, 1},
  {&__pyx_n_s_ACCESSIBLE, __pyx_k_ACCESSIBLE, sizeof(__pyx_k_ACCESSIBLE), 0, 0, 1, 1},
  {&__pyx_n_s_ACYCLIC, __pyx_k_ACYCLIC, sizeof(__pyx_k_ACYCLIC), 0, 0, 1, 1},
  {&__pyx_n_s_ADD_ARC_PROPERTIES, __pyx_k_ADD_ARC_PROPERTIES, sizeof(__pyx_k_ADD_ARC_PROPERTIES), 0, 0, 1, 1},
  {&__pyx_n_s_ADD_STATE_PROPERTIES, __pyx_k_ADD_STATE_PROPERTIES, sizeof(__pyx_k_ADD_STATE_PROPERTIES), 0, 0, 1, 1},
  {&__pyx_n_s_ADD_SUPERFINAL_PROPERTIES, __pyx_k_ADD_SUPERFINAL_PROPERTIES, sizeof(__pyx_k_ADD_SUPERFINAL_PROPERTIES), 0, 0, 1, 1},
  {&__pyx_n_s_ARC_FLAGS, __pyx_k_ARC_FLAGS, sizeof(__pyx_k_ARC_FLAGS), 0, 0, 1, 1},
  {&__pyx_n_s_ARC_I_LABEL_VALUE, __pyx_k_ARC_I_LABEL_VALUE, sizeof(__pyx_k_ARC_I_LABEL_VALUE), 0, 0, 1, 1},
  {&__pyx_n_s_ARC_NEXT_STATE_VALUE, __pyx_k_ARC_NEXT_STATE_VALUE, sizeof(__pyx_k_ARC_NEXT_STATE_VALUE), 0, 0, 1, 1},
  {&__pyx_n_s_ARC_NO_CACHE, __pyx_k_ARC_NO_CACHE, sizeof(__pyx_k_ARC_NO_CACHE), 0, 0, 1, 1},
  {&__pyx_n_s_ARC_O_LABEL_VALUE, __pyx_k_ARC_O_LABEL_VALUE, sizeof(__pyx_k_ARC_O_LABEL_VALUE), 0, 0, 1, 1},
  {&__pyx_n_s_ARC_SORT_PROPERTIES, __pyx_k_ARC_SORT_PROPERTIES, sizeof(__pyx_k_ARC_SORT_PROPERTIES), 0, 0, 1, 1},
  {&__pyx_n_s_ARC_VALUE_FLAGS, __pyx_k_ARC_VALUE_FLAGS, sizeof(__pyx_k_ARC_VALUE_FLAGS), 0, 0, 1, 1},
  {&__pyx_n_s_ARC_WEIGHT_VALUE, __pyx_k_ARC_WEIGHT_VALUE, sizeof(__pyx_k_ARC_WEIGHT_VALUE), 0, 0, 1, 1},
  {&__pyx_n_s_Arc, __pyx_k_Arc, sizeof(__pyx_k_Arc), 0, 0, 1, 1},
  {&__pyx_n_s_ArcIterator, __pyx_k_ArcIterator, sizeof(__pyx_k_ArcIterator), 0, 0, 1, 1},
  {&__pyx_kp_u_ArcIterator_at_0x, __pyx_k_ArcIterator_at_0x, sizeof(__pyx_k_ArcIterator_at_0x), 0, 1, 0, 0},
  {&__pyx_n_s_ArcMapType, __pyx_k_ArcMapType, sizeof(__pyx_k_ArcMapType), 0, 0, 1, 1},
  {&__pyx_kp_u_Arc_at_0x, __pyx_k_Arc_at_0x, sizeof(__pyx_k_Arc_at_0x), 0, 1, 0, 0},
  {&__pyx_n_s_BINARY_PROPERTIES, __pyx_k_BINARY_PROPERTIES, sizeof(__pyx_k_BINARY_PROPERTIES), 0, 0, 1, 1},
  {&__pyx_n_s_COACCESSIBLE, __pyx_k_COACCESSIBLE, sizeof(__pyx_k_COACCESSIBLE), 0, 0, 1, 1},
  {&__pyx_n_s_COPY_PROPERTIES, __pyx_k_COPY_PROPERTIES, sizeof(__pyx_k_COPY_PROPERTIES), 0, 0, 1, 1},
  {&__pyx_n_s_CYCLIC, __pyx_k_CYCLIC, sizeof(__pyx_k_CYCLIC), 0, 0, 1, 1},
  {&__pyx_kp_u_Cannot_construct, __pyx_k_Cannot_construct, sizeof(__pyx_k_Cannot_construct), 0, 1, 0, 0},
  {&__pyx_kp_u_Cannot_topsort_cyclic_FST, __pyx_k_Cannot_topsort_cyclic_FST, sizeof(__pyx_k_Cannot_topsort_cyclic_FST), 0, 1, 0, 0},
  {&__pyx_kp_u_Compilation_failed, __pyx_k_Compilation_failed, sizeof(__pyx_k_Compilation_failed), 0, 1, 0, 0},
  {&__pyx_n_s_Compiler, __pyx_k_Compiler, sizeof(__pyx_k_Compiler), 0, 0, 1, 1},
  {&__pyx_n_s_ComposeFilter, __pyx_k_ComposeFilter, sizeof(__pyx_k_ComposeFilter), 0, 0, 1, 1},
  {&__pyx_kp_u_Conversion_to, __pyx_k_Conversion_to, sizeof(__pyx_k_Conversion_to), 0, 1, 0, 0},
  {&__pyx_n_s_DELETE_ARC_PROPERTIES, __pyx_k_DELETE_ARC_PROPERTIES, sizeof(__pyx_k_DELETE_ARC_PROPERTIES), 0, 0, 1, 1},
  {&__pyx_n_s_DELETE_STATE_PROPERTIES, __pyx_k_DELETE_STATE_PROPERTIES, sizeof(__pyx_k_DELETE_STATE_PROPERTIES), 0, 0, 1, 1},
  {&__pyx_n_s_DeterminizeType, __pyx_k_DeterminizeType, sizeof(__pyx_k_DeterminizeType), 0, 0, 1, 1},
  {&__pyx_kp_u_Dot_rendering_failed_s, __pyx_k_Dot_rendering_failed_s, sizeof(__pyx_k_Dot_rendering_failed_s), 0, 1, 0, 0},
  {&__pyx_n_s_DrawFloatFormat, __pyx_k_DrawFloatFormat, sizeof(__pyx_k_DrawFloatFormat), 0, 0, 1, 1},
  {&__pyx_n_s_ENCODE_FLAGS, __pyx_k_ENCODE_FLAGS, sizeof(__pyx_k_ENCODE_FLAGS), 0, 0, 1, 1},
  {&__pyx_n_s_ENCODE_LABELS, __pyx_k_ENCODE_LABELS, sizeof(__pyx_k_ENCODE_LABELS), 0, 0, 1, 1},
  {&__pyx_n_s_ENCODE_WEIGHTS, __pyx_k_ENCODE_WEIGHTS, sizeof(__pyx_k_ENCODE_WEIGHTS), 0, 0, 1, 1},
  {&__pyx_n_s_EPSILONS, __pyx_k_EPSILONS, sizeof(__pyx_k_EPSILONS), 0, 0, 1, 1},
  {&__pyx_n_s_ERROR, __pyx_k_ERROR, sizeof(__pyx_k_ERROR), 0, 0, 1, 1},
  {&__pyx_n_s_EXPANDED, __pyx_k_EXPANDED, sizeof(__pyx_k_EXPANDED), 0, 0, 1, 1},
  {&__pyx_n_s_EXTRINSIC_PROPERTIES, __pyx_k_EXTRINSIC_PROPERTIES, sizeof(__pyx_k_EXTRINSIC_PROPERTIES), 0, 0, 1, 1},
  {&__pyx_n_s_EncodeMapper, __pyx_k_EncodeMapper, sizeof(__pyx_k_EncodeMapper), 0, 0, 1, 1},
  {&__pyx_n_s_EncodeMapperSymbolTableView, __pyx_k_EncodeMapperSymbolTableView, sizeof(__pyx_k_EncodeMapperSymbolTableView), 0, 0, 1, 1},
  {&__pyx_kp_u_EncodeMapper_at_0x, __pyx_k_EncodeMapper_at_0x, sizeof(__pyx_k_EncodeMapper_at_0x), 0, 1, 0, 0},
  {&__pyx_kp_u_Expected, __pyx_k_Expected, sizeof(__pyx_k_Expected), 0, 1, 0, 0},
  {&__pyx_n_s_FST_PROPERTIES, __pyx_k_FST_PROPERTIES, sizeof(__pyx_k_FST_PROPERTIES), 0, 0, 1, 1},
  {&__pyx_n_s_FarReader, __pyx_k_FarReader, sizeof(__pyx_k_FarReader), 0, 0, 1, 1},
  {&__pyx_kp_u_FarReader_at_0x, __pyx_k_FarReader_at_0x, sizeof(__pyx_k_FarReader_at_0x), 0, 1, 0, 0},
  {&__pyx_n_s_FarType, __pyx_k_FarType, sizeof(__pyx_k_FarType), 0, 0, 1, 1},
  {&__pyx_n_s_FarWriter, __pyx_k_FarWriter, sizeof(__pyx_k_FarWriter), 0, 0, 1, 1},
  {&__pyx_kp_u_FarWriter_at_0x, __pyx_k_FarWriter_at_0x, sizeof(__pyx_k_FarWriter_at_0x), 0, 1, 0, 0},
  {&__pyx_n_s_Flag, __pyx_k_Flag, sizeof(__pyx_k_Flag), 0, 0, 1, 1},
  {&__pyx_n_s_Fst, __pyx_k_Fst, sizeof(__pyx_k_Fst), 0, 0, 1, 1},
  {&__pyx_n_s_FstArgError, __pyx_k_FstArgError, sizeof(__pyx_k_FstArgError), 0, 0, 1, 1},
  {&__pyx_n_s_FstBadWeightError, __pyx_k_FstBadWeightError, sizeof(__pyx_k_FstBadWeightError), 0, 0, 1, 1},
  {&__pyx_n_s_FstError, __pyx_k_FstError, sizeof(__pyx_k_FstError), 0, 0, 1, 1},
  {&__pyx_n_s_FstIOError, __pyx_k_FstIOError, sizeof(__pyx_k_FstIOError), 0, 0, 1, 1},
  {&__pyx_n_s_FstIndexError, __pyx_k_FstIndexError, sizeof(__pyx_k_FstIndexError), 0, 0, 1, 1},
  {&__pyx_n_s_FstOpError, __pyx_k_FstOpError, sizeof(__pyx_k_FstOpError), 0, 0, 1, 1},
  {&__pyx_n_s_FstProperties, __pyx_k_FstProperties, sizeof(__pyx_k_FstProperties), 0, 0, 1, 1},
  {&__pyx_n_s_FstSymbolTableView, __pyx_k_FstSymbolTableView, sizeof(__pyx_k_FstSymbolTableView), 0, 0, 1, 1},
  {&__pyx_kp_u_Fst_SymbolTableView, __pyx_k_Fst_SymbolTableView, sizeof(__pyx_k_Fst_SymbolTableView), 0, 1, 0, 0},
  {&__pyx_kp_u_Fst_at_0x, __pyx_k_Fst_at_0x, sizeof(__pyx_k_Fst_at_0x), 0, 1, 0, 0},
  {&__pyx_n_s_INITIAL_ACYCLIC, __pyx_k_INITIAL_ACYCLIC, sizeof(__pyx_k_INITIAL_ACYCLIC), 0, 0, 1, 1},
  {&__pyx_n_s_INITIAL_CYCLIC, __pyx_k_INITIAL_CYCLIC, sizeof(__pyx_k_INITIAL_CYCLIC), 0, 0, 1, 1},
  {&__pyx_n_s_INTRINSIC_PROPERTIES, __pyx_k_INTRINSIC_PROPERTIES, sizeof(__pyx_k_INTRINSIC_PROPERTIES), 0, 0, 1, 1},
  {&__pyx_n_s_IOError, __pyx_k_IOError, sizeof(__pyx_k_IOError), 0, 0, 1, 1},
  {&__pyx_n_s_I_DETERMINISTIC, __pyx_k_I_DETERMINISTIC, sizeof(__pyx_k_I_DETERMINISTIC), 0, 0, 1, 1},
  {&__pyx_n_s_I_EPSILONS, __pyx_k_I_EPSILONS, sizeof(__pyx_k_I_EPSILONS), 0, 0, 1, 1},
  {&__pyx_n_s_I_LABEL_INVARIANT_PROPERTIES, __pyx_k_I_LABEL_INVARIANT_PROPERTIES, sizeof(__pyx_k_I_LABEL_INVARIANT_PROPERTIES), 0, 0, 1, 1},
  {&__pyx_n_s_I_LABEL_SORTED, __pyx_k_I_LABEL_SORTED, sizeof(__pyx_k_I_LABEL_SORTED), 0, 0, 1, 1},
  {&__pyx_kp_u_Incompatible_or_invalid_arc_type, __pyx_k_Incompatible_or_invalid_arc_type, sizeof(__pyx_k_Incompatible_or_invalid_arc_type), 0, 1, 0, 0},
  {&__pyx_kp_u_Incompatible_or_invalid_weight, __pyx_k_Incompatible_or_invalid_weight, sizeof(__pyx_k_Incompatible_or_invalid_weight), 0, 1, 0, 0},
  {&__pyx_kp_u_Incompatible_or_invalid_weight_t, __pyx_k_Incompatible_or_invalid_weight_t, sizeof(__pyx_k_Incompatible_or_invalid_weight_t), 0, 1, 0, 0},
  {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
  {&__pyx_kp_u_Invalid_weight, __pyx_k_Invalid_weight, sizeof(__pyx_k_Invalid_weight), 0, 1, 0, 0},
  {&__pyx_n_s_KeyError, __pyx_k_KeyError, sizeof(__pyx_k_KeyError), 0, 0, 1, 1},
  {&__pyx_n_s_MUTABLE, __pyx_k_MUTABLE, sizeof(__pyx_k_MUTABLE), 0, 0, 1, 1},
  {&__pyx_n_s_MutableArcIterator, __pyx_k_MutableArcIterator, sizeof(__pyx_k_MutableArcIterator), 0, 0, 1, 1},
  {&__pyx_n_s_MutableArcIterator___iter, __pyx_k_MutableArcIterator___iter, sizeof(__pyx_k_MutableArcIterator___iter), 0, 0, 1, 1},
  {&__pyx_kp_u_MutableArcIterator_at_0x, __pyx_k_MutableArcIterator_at_0x, sizeof(__pyx_k_MutableArcIterator_at_0x), 0, 1, 0, 0},
  {&__pyx_n_s_MutableFst, __pyx_k_MutableFst, sizeof(__pyx_k_MutableFst), 0, 0, 1, 1},
  {&__pyx_n_s_MutableFstSymbolTableView, __pyx_k_MutableFstSymbolTableView, sizeof(__pyx_k_MutableFstSymbolTableView), 0, 0, 1, 1},
  {&__pyx_n_s_MutableSymbolTable, __pyx_k_MutableSymbolTable, sizeof(__pyx_k_MutableSymbolTable), 0, 0, 1, 1},
  {&__pyx_n_s_NEG_TRINARY_PROPERTIES, __pyx_k_NEG_TRINARY_PROPERTIES, sizeof(__pyx_k_NEG_TRINARY_PROPERTIES), 0, 0, 1, 1},
  {&__pyx_n_s_NON_I_DETERMINISTIC, __pyx_k_NON_I_DETERMINISTIC, sizeof(__pyx_k_NON_I_DETERMINISTIC), 0, 0, 1, 1},
  {&__pyx_n_s_NON_O_DETERMINISTIC, __pyx_k_NON_O_DETERMINISTIC, sizeof(__pyx_k_NON_O_DETERMINISTIC), 0, 0, 1, 1},
  {&__pyx_n_s_NOT_ACCEPTOR, __pyx_k_NOT_ACCEPTOR, sizeof(__pyx_k_NOT_ACCEPTOR), 0, 0, 1, 1},
  {&__pyx_n_s_NOT_ACCESSIBLE, __pyx_k_NOT_ACCESSIBLE, sizeof(__pyx_k_NOT_ACCESSIBLE), 0, 0, 1, 1},
  {&__pyx_n_s_NOT_COACCESSIBLE, __pyx_k_NOT_COACCESSIBLE, sizeof(__pyx_k_NOT_COACCESSIBLE), 0, 0, 1, 1},
  {&__pyx_n_s_NOT_I_LABEL_SORTED, __pyx_k_NOT_I_LABEL_SORTED, sizeof(__pyx_k_NOT_I_LABEL_SORTED), 0, 0, 1, 1},
  {&__pyx_n_s_NOT_O_LABEL_SORTED, __pyx_k_NOT_O_LABEL_SORTED, sizeof(__pyx_k_NOT_O_LABEL_SORTED), 0, 0, 1, 1},
  {&__pyx_n_s_NOT_STRING, __pyx_k_NOT_STRING, sizeof(__pyx_k_NOT_STRING), 0, 0, 1, 1},
  {&__pyx_n_s_NOT_TOP_SORTED, __pyx_k_NOT_TOP_SORTED, sizeof(__pyx_k_NOT_TOP_SORTED), 0, 0, 1, 1},
  {&__pyx_n_s_NO_EPSILONS, __pyx_k_NO_EPSILONS, sizeof(__pyx_k_NO_EPSILONS), 0, 0, 1, 1},
  {&__pyx_n_s_NO_I_EPSILONS, __pyx_k_NO_I_EPSILONS, sizeof(__pyx_k_NO_I_EPSILONS), 0, 0, 1, 1},
  {&__pyx_n_s_NO_LABEL, __pyx_k_NO_LABEL, sizeof(__pyx_k_NO_LABEL), 0, 0, 1, 1},
  {&__pyx_n_s_NO_O_EPSILONS, __pyx_k_NO_O_EPSILONS, sizeof(__pyx_k_NO_O_EPSILONS), 0, 0, 1, 1},
  {&__pyx_n_s_NO_STATE_ID, __pyx_k_NO_STATE_ID, sizeof(__pyx_k_NO_STATE_ID), 0, 0, 1, 1},
  {&__pyx_n_s_NO_SYMBOL, __pyx_k_NO_SYMBOL, sizeof(__pyx_k_NO_SYMBOL), 0, 0, 1, 1},
  {&__pyx_n_s_NULL_PROPERTIES, __pyx_k_NULL_PROPERTIES, sizeof(__pyx_k_NULL_PROPERTIES), 0, 0, 1, 1},
  {&__pyx_kp_u_No_new_SymbolTables_specified, __pyx_k_No_new_SymbolTables_specified, sizeof(__pyx_k_No_new_SymbolTables_specified), 0, 1, 0, 0},
  {&__pyx_kp_u_No_relabeling_pairs_specified, __pyx_k_No_relabeling_pairs_specified, sizeof(__pyx_k_No_relabeling_pairs_specified), 0, 1, 0, 0},
  {&__pyx_n_s_NotImplementedError, __pyx_k_NotImplementedError, sizeof(__pyx_k_NotImplementedError), 0, 0, 1, 1},
  {&__pyx_n_s_Number, __pyx_k_Number, sizeof(__pyx_k_Number), 0, 0, 1, 1},
  {&__pyx_n_s_O_DETERMINISTIC, __pyx_k_O_DETERMINISTIC, sizeof(__pyx_k_O_DETERMINISTIC), 0, 0, 1, 1},
  {&__pyx_n_s_O_EPSILONS, __pyx_k_O_EPSILONS, sizeof(__pyx_k_O_EPSILONS), 0, 0, 1, 1},
  {&__pyx_n_s_O_LABEL_INVARIANT_PROPERTIES, __pyx_k_O_LABEL_INVARIANT_PROPERTIES, sizeof(__pyx_k_O_LABEL_INVARIANT_PROPERTIES), 0, 0, 1, 1},
  {&__pyx_n_s_O_LABEL_SORTED, __pyx_k_O_LABEL_SORTED, sizeof(__pyx_k_O_LABEL_SORTED), 0, 0, 1, 1},
  {&__pyx_kp_u_Open_failed, __pyx_k_Open_failed, sizeof(__pyx_k_Open_failed), 0, 1, 0, 0},
  {&__pyx_kp_u_Operation_failed, __pyx_k_Operation_failed, sizeof(__pyx_k_Operation_failed), 0, 1, 0, 0},
  {&__pyx_n_s_PIPE, __pyx_k_PIPE, sizeof(__pyx_k_PIPE), 0, 0, 1, 1},
  {&__pyx_n_s_POS_TRINARY_PROPERTIES, __pyx_k_POS_TRINARY_PROPERTIES, sizeof(__pyx_k_POS_TRINARY_PROPERTIES), 0, 0, 1, 1},
  {&__pyx_n_s_Popen, __pyx_k_Popen, sizeof(__pyx_k_Popen), 0, 0, 1, 1},
  {&__pyx_n_s_ProjectType, __pyx_k_ProjectType, sizeof(__pyx_k_ProjectType), 0, 0, 1, 1},
  {&__pyx_n_s_QueueType, __pyx_k_QueueType, sizeof(__pyx_k_QueueType), 0, 0, 1, 1},
  {&__pyx_n_s_RM_SUPERFINAL_PROPERTIES, __pyx_k_RM_SUPERFINAL_PROPERTIES, sizeof(__pyx_k_RM_SUPERFINAL_PROPERTIES), 0, 0, 1, 1},
  {&__pyx_n_s_RandArcSelection, __pyx_k_RandArcSelection, sizeof(__pyx_k_RandArcSelection), 0, 0, 1, 1},
  {&__pyx_kp_u_Read_failed, __pyx_k_Read_failed, sizeof(__pyx_k_Read_failed), 0, 1, 0, 0},
  {&__pyx_kp_u_Read_from_FST_failed, __pyx_k_Read_from_FST_failed, sizeof(__pyx_k_Read_from_FST_failed), 0, 1, 0, 0},
  {&__pyx_kp_u_Read_from_string_failed, __pyx_k_Read_from_string_failed, sizeof(__pyx_k_Read_from_string_failed), 0, 1, 0, 0},
  {&__pyx_n_s_ReplaceLabelType, __pyx_k_ReplaceLabelType, sizeof(__pyx_k_ReplaceLabelType), 0, 0, 1, 1},
  {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
  {&__pyx_n_s_SET_ARC_PROPERTIES, __pyx_k_SET_ARC_PROPERTIES, sizeof(__pyx_k_SET_ARC_PROPERTIES), 0, 0, 1, 1},
  {&__pyx_n_s_SET_FINAL_PROPERTIES, __pyx_k_SET_FINAL_PROPERTIES, sizeof(__pyx_k_SET_FINAL_PROPERTIES), 0, 0, 1, 1},
  {&__pyx_n_s_SET_START_PROPERTIES, __pyx_k_SET_START_PROPERTIES, sizeof(__pyx_k_SET_START_PROPERTIES), 0, 0, 1, 1},
  {&__pyx_n_s_STATE_SORT_PROPERTIES, __pyx_k_STATE_SORT_PROPERTIES, sizeof(__pyx_k_STATE_SORT_PROPERTIES), 0, 0, 1, 1},
  {&__pyx_n_s_STRING, __pyx_k_STRING, sizeof(__pyx_k_STRING), 0, 0, 1, 1},
  {&__pyx_n_s_SortType, __pyx_k_SortType, sizeof(__pyx_k_SortType), 0, 0, 1, 1},
  {&__pyx_n_s_StateIterator, __pyx_k_StateIterator, sizeof(__pyx_k_StateIterator), 0, 0, 1, 1},
  {&__pyx_kp_u_StateIterator_at_0x, __pyx_k_StateIterator_at_0x, sizeof(__pyx_k_StateIterator_at_0x), 0, 1, 0, 0},
  {&__pyx_n_s_StateMapType, __pyx_k_StateMapType, sizeof(__pyx_k_StateMapType), 0, 0, 1, 1},
  {&__pyx_kp_u_State_index_out_of_range, __pyx_k_State_index_out_of_range, sizeof(__pyx_k_State_index_out_of_range), 0, 1, 0, 0},
  {&__pyx_n_s_StopIteration, __pyx_k_StopIteration, sizeof(__pyx_k_StopIteration), 0, 0, 1, 1},
  {&__pyx_kp_u_SymbolTable, __pyx_k_SymbolTable, sizeof(__pyx_k_SymbolTable), 0, 1, 0, 0},
  {&__pyx_n_s_SymbolTableIterator, __pyx_k_SymbolTableIterator, sizeof(__pyx_k_SymbolTableIterator), 0, 0, 1, 1},
  {&__pyx_kp_u_SymbolTableIterator_at_0x, __pyx_k_SymbolTableIterator_at_0x, sizeof(__pyx_k_SymbolTableIterator_at_0x), 0, 1, 0, 0},
  {&__pyx_n_s_SymbolTableView, __pyx_k_SymbolTableView, sizeof(__pyx_k_SymbolTableView), 0, 0, 1, 1},
  {&__pyx_n_s_SymbolTable_2, __pyx_k_SymbolTable_2, sizeof(__pyx_k_SymbolTable_2), 0, 0, 1, 1},
  {&__pyx_kp_u_SymbolTable_no_longer_exists, __pyx_k_SymbolTable_no_longer_exists, sizeof(__pyx_k_SymbolTable_no_longer_exists), 0, 1, 0, 0},
  {&__pyx_n_s_TOP_SORTED, __pyx_k_TOP_SORTED, sizeof(__pyx_k_TOP_SORTED), 0, 0, 1, 1},
  {&__pyx_n_s_TRINARY_PROPERTIES, __pyx_k_TRINARY_PROPERTIES, sizeof(__pyx_k_TRINARY_PROPERTIES), 0, 0, 1, 1},
  {&__pyx_kp_u_Tsvg, __pyx_k_Tsvg, sizeof(__pyx_k_Tsvg), 0, 1, 0, 0},
  {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
  {&__pyx_n_s_UNWEIGHTED, __pyx_k_UNWEIGHTED, sizeof(__pyx_k_UNWEIGHTED), 0, 0, 1, 1},
  {&__pyx_n_s_UNWEIGHTED_CYCLES, __pyx_k_UNWEIGHTED_CYCLES, sizeof(__pyx_k_UNWEIGHTED_CYCLES), 0, 0, 1, 1},
  {&__pyx_kp_u_Unknown_FAR_type, __pyx_k_Unknown_FAR_type, sizeof(__pyx_k_Unknown_FAR_type), 0, 1, 0, 0},
  {&__pyx_kp_u_Unknown_arc_type, __pyx_k_Unknown_arc_type, sizeof(__pyx_k_Unknown_arc_type), 0, 1, 0, 0},
  {&__pyx_kp_u_Unknown_compose_filter_type, __pyx_k_Unknown_compose_filter_type, sizeof(__pyx_k_Unknown_compose_filter_type), 0, 1, 0, 0},
  {&__pyx_kp_u_Unknown_determinization_type, __pyx_k_Unknown_determinization_type, sizeof(__pyx_k_Unknown_determinization_type), 0, 1, 0, 0},
  {&__pyx_kp_u_Unknown_map_type, __pyx_k_Unknown_map_type, sizeof(__pyx_k_Unknown_map_type), 0, 1, 0, 0},
  {&__pyx_kp_u_Unknown_projection_type, __pyx_k_Unknown_projection_type, sizeof(__pyx_k_Unknown_projection_type), 0, 1, 0, 0},
  {&__pyx_kp_u_Unknown_queue_type, __pyx_k_Unknown_queue_type, sizeof(__pyx_k_Unknown_queue_type), 0, 1, 0, 0},
  {&__pyx_kp_u_Unknown_random_arc_selection_typ, __pyx_k_Unknown_random_arc_selection_typ, sizeof(__pyx_k_Unknown_random_arc_selection_typ), 0, 1, 0, 0},
  {&__pyx_kp_u_Unknown_replace_label_type, __pyx_k_Unknown_replace_label_type, sizeof(__pyx_k_Unknown_replace_label_type), 0, 1, 0, 0},
  {&__pyx_kp_u_Unknown_sort_type, __pyx_k_Unknown_sort_type, sizeof(__pyx_k_Unknown_sort_type), 0, 1, 0, 0},
  {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
  {&__pyx_n_s_VectorFst, __pyx_k_VectorFst, sizeof(__pyx_k_VectorFst), 0, 0, 1, 1},
  {&__pyx_n_s_WEIGHTED, __pyx_k_WEIGHTED, sizeof(__pyx_k_WEIGHTED), 0, 0, 1, 1},
  {&__pyx_n_s_WEIGHTED_CYCLES, __pyx_k_WEIGHTED_CYCLES, sizeof(__pyx_k_WEIGHTED_CYCLES), 0, 0, 1, 1},
  {&__pyx_n_s_WEIGHT_INVARIANT_PROPERTIES, __pyx_k_WEIGHT_INVARIANT_PROPERTIES, sizeof(__pyx_k_WEIGHT_INVARIANT_PROPERTIES), 0, 0, 1, 1},
  {&__pyx_kp_u_Weight, __pyx_k_Weight, sizeof(__pyx_k_Weight), 0, 1, 0, 0},
  {&__pyx_n_s_WeightLike, __pyx_k_WeightLike, sizeof(__pyx_k_WeightLike), 0, 0, 1, 1},
  {&__pyx_n_s_Weight_2, __pyx_k_Weight_2, sizeof(__pyx_k_Weight_2), 0, 0, 1, 1},
  {&__pyx_kp_u_Weight_type_not_found, __pyx_k_Weight_type_not_found, sizeof(__pyx_k_Weight_type_not_found), 0, 1, 0, 0},
  {&__pyx_kp_u_Write_failed, __pyx_k_Write_failed, sizeof(__pyx_k_Write_failed), 0, 1, 0, 0},
  {&__pyx_kp_u_Write_to_string_failed, __pyx_k_Write_to_string_failed, sizeof(__pyx_k_Write_to_string_failed), 0, 1, 0, 0},
  {&__pyx_kp_u__11, __pyx_k__11, sizeof(__pyx_k__11), 0, 1, 0, 0},
  {&__pyx_kp_u__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 1, 0, 0},
  {&__pyx_kp_u__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 1, 0, 0},
  {&__pyx_n_s_acceptor, __pyx_k_acceptor, sizeof(__pyx_k_acceptor), 0, 0, 1, 1},
  {&__pyx_n_s_add, __pyx_k_add, sizeof(__pyx_k_add), 0, 0, 1, 1},
  {&__pyx_n_s_add_state, __pyx_k_add_state, sizeof(__pyx_k_add_state), 0, 0, 1, 1},
  {&__pyx_n_s_add_states, __pyx_k_add_states, sizeof(__pyx_k_add_states), 0, 0, 1, 1},
  {&__pyx_n_s_add_symbol, __pyx_k_add_symbol, sizeof(__pyx_k_add_symbol), 0, 0, 1, 1},
  {&__pyx_n_s_add_table, __pyx_k_add_table, sizeof(__pyx_k_add_table), 0, 0, 1, 1},
  {&__pyx_n_s_allow_negative_labels, __pyx_k_allow_negative_labels, sizeof(__pyx_k_allow_negative_labels), 0, 0, 1, 1},
  {&__pyx_n_s_allow_nondet, __pyx_k_allow_nondet, sizeof(__pyx_k_allow_nondet), 0, 0, 1, 1},
  {&__pyx_n_s_arc, __pyx_k_arc, sizeof(__pyx_k_arc), 0, 0, 1, 1},
  {&__pyx_n_s_arc_type, __pyx_k_arc_type, sizeof(__pyx_k_arc_type), 0, 0, 1, 1},
  {&__pyx_n_s_arcs, __pyx_k_arcs, sizeof(__pyx_k_arcs), 0, 0, 1, 1},
  {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1},
  {&__pyx_kp_u_at_0x, __pyx_k_at_0x, sizeof(__pyx_k_at_0x), 0, 1, 0, 0},
  {&__pyx_n_s_attach_new_isymbols, __pyx_k_attach_new_isymbols, sizeof(__pyx_k_attach_new_isymbols), 0, 0, 1, 1},
  {&__pyx_n_s_attach_new_osymbols, __pyx_k_attach_new_osymbols, sizeof(__pyx_k_attach_new_osymbols), 0, 0, 1, 1},
  {&__pyx_n_u_auto, __pyx_k_auto, sizeof(__pyx_k_auto), 0, 1, 0, 1},
  {&__pyx_n_s_available_key, __pyx_k_available_key, sizeof(__pyx_k_available_key), 0, 0, 1, 1},
  {&__pyx_kp_u_but_received, __pyx_k_but_received, sizeof(__pyx_k_but_received), 0, 1, 0, 0},
  {&__pyx_n_s_call_arc_labeling, __pyx_k_call_arc_labeling, sizeof(__pyx_k_call_arc_labeling), 0, 0, 1, 1},
  {&__pyx_n_s_checksum, __pyx_k_checksum, sizeof(__pyx_k_checksum), 0, 0, 1, 1},
  {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1},
  {&__pyx_n_s_class_2, __pyx_k_class_2, sizeof(__pyx_k_class_2), 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_closure_plus, __pyx_k_closure_plus, sizeof(__pyx_k_closure_plus), 0, 0, 1, 1},
  {&__pyx_n_s_communicate, __pyx_k_communicate, sizeof(__pyx_k_communicate), 0, 0, 1, 1},
  {&__pyx_n_s_compile, __pyx_k_compile, sizeof(__pyx_k_compile), 0, 0, 1, 1},
  {&__pyx_n_s_compose_filter, __pyx_k_compose_filter, sizeof(__pyx_k_compose_filter), 0, 0, 1, 1},
  {&__pyx_n_s_connect, __pyx_k_connect, sizeof(__pyx_k_connect), 0, 0, 1, 1},
  {&__pyx_kp_u_const_EncodeMapper_SymbolTableV, __pyx_k_const_EncodeMapper_SymbolTableV, sizeof(__pyx_k_const_EncodeMapper_SymbolTableV), 0, 1, 0, 0},
  {&__pyx_kp_u_const_Fst_SymbolTableView, __pyx_k_const_Fst_SymbolTableView, sizeof(__pyx_k_const_Fst_SymbolTableView), 0, 1, 0, 0},
  {&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1},
  {&__pyx_n_s_create, __pyx_k_create, sizeof(__pyx_k_create), 0, 0, 1, 1},
  {&__pyx_n_u_default, __pyx_k_default, sizeof(__pyx_k_default), 0, 1, 0, 1},
  {&__pyx_n_s_delta, __pyx_k_delta, sizeof(__pyx_k_delta), 0, 0, 1, 1},
  {&__pyx_n_s_det_type, __pyx_k_det_type, sizeof(__pyx_k_det_type), 0, 0, 1, 1},
  {&__pyx_n_s_distance, __pyx_k_distance, sizeof(__pyx_k_distance), 0, 0, 1, 1},
  {&__pyx_n_s_divide, __pyx_k_divide, sizeof(__pyx_k_divide), 0, 0, 1, 1},
  {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1},
  {&__pyx_n_s_done, __pyx_k_done, sizeof(__pyx_k_done), 0, 0, 1, 1},
  {&__pyx_n_u_dot, __pyx_k_dot, sizeof(__pyx_k_dot), 0, 1, 0, 1},
  {&__pyx_n_s_draw, __pyx_k_draw, sizeof(__pyx_k_draw), 0, 0, 1, 1},
  {&__pyx_n_s_encode_labels, __pyx_k_encode_labels, sizeof(__pyx_k_encode_labels), 0, 0, 1, 1},
  {&__pyx_n_s_encode_weights, __pyx_k_encode_weights, sizeof(__pyx_k_encode_weights), 0, 0, 1, 1},
  {&__pyx_n_s_enum, __pyx_k_enum, sizeof(__pyx_k_enum), 0, 0, 1, 1},
  {&__pyx_n_s_eps_norm_output, __pyx_k_eps_norm_output, sizeof(__pyx_k_eps_norm_output), 0, 0, 1, 1},
  {&__pyx_n_s_epsilon_on_replace, __pyx_k_epsilon_on_replace, sizeof(__pyx_k_epsilon_on_replace), 0, 0, 1, 1},
  {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1},
  {&__pyx_kp_u_failed, __pyx_k_failed, sizeof(__pyx_k_failed), 0, 1, 0, 0},
  {&__pyx_n_s_far_type, __pyx_k_far_type, sizeof(__pyx_k_far_type), 0, 0, 1, 1},
  {&__pyx_n_s_final, __pyx_k_final, sizeof(__pyx_k_final), 0, 0, 1, 1},
  {&__pyx_n_s_find, __pyx_k_find, sizeof(__pyx_k_find), 0, 0, 1, 1},
  {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1},
  {&__pyx_n_s_float_format, __pyx_k_float_format, sizeof(__pyx_k_float_format), 0, 0, 1, 1},
  {&__pyx_n_s_fontsize, __pyx_k_fontsize, sizeof(__pyx_k_fontsize), 0, 0, 1, 1},
  {&__pyx_n_s_fspath, __pyx_k_fspath, sizeof(__pyx_k_fspath), 0, 0, 1, 1},
  {&__pyx_n_s_fst_type, __pyx_k_fst_type, sizeof(__pyx_k_fst_type), 0, 0, 1, 1},
  {&__pyx_n_s_fstlib_cext_pywrapfst, __pyx_k_fstlib_cext_pywrapfst, sizeof(__pyx_k_fstlib_cext_pywrapfst), 0, 0, 1, 1},
  {&__pyx_kp_s_fstlib_cext_pywrapfst_pyx, __pyx_k_fstlib_cext_pywrapfst_pyx, sizeof(__pyx_k_fstlib_cext_pywrapfst_pyx), 0, 0, 1, 0},
  {&__pyx_n_u_functional, __pyx_k_functional, sizeof(__pyx_k_functional), 0, 1, 0, 1},
  {&__pyx_n_u_g, __pyx_k_g, sizeof(__pyx_k_g), 0, 1, 0, 1},
  {&__pyx_n_s_get_fst, __pyx_k_get_fst, sizeof(__pyx_k_get_fst), 0, 0, 1, 1},
  {&__pyx_n_s_get_key, __pyx_k_get_key, sizeof(__pyx_k_get_key), 0, 0, 1, 1},
  {&__pyx_n_s_get_nth_key, __pyx_k_get_nth_key, sizeof(__pyx_k_get_nth_key), 0, 0, 1, 1},
  {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
  {&__pyx_n_s_height, __pyx_k_height, sizeof(__pyx_k_height), 0, 0, 1, 1},
  {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1},
  {&__pyx_n_u_identity, __pyx_k_identity, sizeof(__pyx_k_identity), 0, 1, 0, 1},
  {&__pyx_n_s_ifst, __pyx_k_ifst, sizeof(__pyx_k_ifst), 0, 0, 1, 1},
  {&__pyx_n_s_ifst1, __pyx_k_ifst1, sizeof(__pyx_k_ifst1), 0, 0, 1, 1},
  {&__pyx_n_s_ifst2, __pyx_k_ifst2, sizeof(__pyx_k_ifst2), 0, 0, 1, 1},
  {&__pyx_n_s_ilabel, __pyx_k_ilabel, sizeof(__pyx_k_ilabel), 0, 0, 1, 1},
  {&__pyx_n_u_ilabel, __pyx_k_ilabel, sizeof(__pyx_k_ilabel), 0, 1, 0, 1},
  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
  {&__pyx_n_s_increment_subsequential_label, __pyx_k_increment_subsequential_label, sizeof(__pyx_k_increment_subsequential_label), 0, 0, 1, 1},
  {&__pyx_n_u_input, __pyx_k_input, sizeof(__pyx_k_input), 0, 1, 0, 1},
  {&__pyx_n_s_input_symbols, __pyx_k_input_symbols, sizeof(__pyx_k_input_symbols), 0, 0, 1, 1},
  {&__pyx_n_s_input_table, __pyx_k_input_table, sizeof(__pyx_k_input_table), 0, 0, 1, 1},
  {&__pyx_n_s_ipairs, __pyx_k_ipairs, sizeof(__pyx_k_ipairs), 0, 0, 1, 1},
  {&__pyx_n_s_isymbols, __pyx_k_isymbols, sizeof(__pyx_k_isymbols), 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_keep_isymbols, __pyx_k_keep_isymbols, sizeof(__pyx_k_keep_isymbols), 0, 0, 1, 1},
  {&__pyx_n_s_keep_osymbols, __pyx_k_keep_osymbols, sizeof(__pyx_k_keep_osymbols), 0, 0, 1, 1},
  {&__pyx_n_s_keep_state_numbering, __pyx_k_keep_state_numbering, sizeof(__pyx_k_keep_state_numbering), 0, 0, 1, 1},
  {&__pyx_n_s_key, __pyx_k_key, sizeof(__pyx_k_key), 0, 0, 1, 1},
  {&__pyx_n_s_labeled_checksum, __pyx_k_labeled_checksum, sizeof(__pyx_k_labeled_checksum), 0, 0, 1, 1},
  {&__pyx_n_s_lhs, __pyx_k_lhs, sizeof(__pyx_k_lhs), 0, 0, 1, 1},
  {&__pyx_n_s_logging, __pyx_k_logging, sizeof(__pyx_k_logging), 0, 0, 1, 1},
  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
  {&__pyx_n_s_map_type, __pyx_k_map_type, sizeof(__pyx_k_map_type), 0, 0, 1, 1},
  {&__pyx_n_s_mask, __pyx_k_mask, sizeof(__pyx_k_mask), 0, 0, 1, 1},
  {&__pyx_n_s_max_length, __pyx_k_max_length, sizeof(__pyx_k_max_length), 0, 0, 1, 1},
  {&__pyx_n_s_member, __pyx_k_member, sizeof(__pyx_k_member), 0, 0, 1, 1},
  {&__pyx_n_s_members, __pyx_k_members, sizeof(__pyx_k_members), 0, 0, 1, 1},
  {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1},
  {&__pyx_n_s_missing_sym, __pyx_k_missing_sym, sizeof(__pyx_k_missing_sym), 0, 0, 1, 1},
  {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1},
  {&__pyx_n_s_mutable_arcs, __pyx_k_mutable_arcs, sizeof(__pyx_k_mutable_arcs), 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_u_neither, __pyx_k_neither, sizeof(__pyx_k_neither), 0, 1, 0, 1},
  {&__pyx_n_s_new_isymbols, __pyx_k_new_isymbols, sizeof(__pyx_k_new_isymbols), 0, 0, 1, 1},
  {&__pyx_n_s_new_osymbols, __pyx_k_new_osymbols, sizeof(__pyx_k_new_osymbols), 0, 0, 1, 1},
  {&__pyx_n_s_next, __pyx_k_next, sizeof(__pyx_k_next), 0, 0, 1, 1},
  {&__pyx_n_s_nextstate, __pyx_k_nextstate, sizeof(__pyx_k_nextstate), 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_no_weight, __pyx_k_no_weight, sizeof(__pyx_k_no_weight), 0, 0, 1, 1},
  {&__pyx_n_s_nodesep, __pyx_k_nodesep, sizeof(__pyx_k_nodesep), 0, 0, 1, 1},
  {&__pyx_n_s_npath, __pyx_k_npath, sizeof(__pyx_k_npath), 0, 0, 1, 1},
  {&__pyx_n_s_nshortest, __pyx_k_nshortest, sizeof(__pyx_k_nshortest), 0, 0, 1, 1},
  {&__pyx_n_s_nstate, __pyx_k_nstate, sizeof(__pyx_k_nstate), 0, 0, 1, 1},
  {&__pyx_n_s_num_arcs, __pyx_k_num_arcs, sizeof(__pyx_k_num_arcs), 0, 0, 1, 1},
  {&__pyx_n_s_num_input_epsilons, __pyx_k_num_input_epsilons, sizeof(__pyx_k_num_input_epsilons), 0, 0, 1, 1},
  {&__pyx_n_s_num_output_epsilons, __pyx_k_num_output_epsilons, sizeof(__pyx_k_num_output_epsilons), 0, 0, 1, 1},
  {&__pyx_n_s_num_states, __pyx_k_num_states, sizeof(__pyx_k_num_states), 0, 0, 1, 1},
  {&__pyx_n_s_num_symbols, __pyx_k_num_symbols, sizeof(__pyx_k_num_symbols), 0, 0, 1, 1},
  {&__pyx_n_s_numbers, __pyx_k_numbers, sizeof(__pyx_k_numbers), 0, 0, 1, 1},
  {&__pyx_n_s_olabel, __pyx_k_olabel, sizeof(__pyx_k_olabel), 0, 0, 1, 1},
  {&__pyx_n_s_old_isymbols, __pyx_k_old_isymbols, sizeof(__pyx_k_old_isymbols), 0, 0, 1, 1},
  {&__pyx_n_s_old_osymbols, __pyx_k_old_osymbols, sizeof(__pyx_k_old_osymbols), 0, 0, 1, 1},
  {&__pyx_n_s_one, __pyx_k_one, sizeof(__pyx_k_one), 0, 0, 1, 1},
  {&__pyx_n_s_opairs, __pyx_k_opairs, sizeof(__pyx_k_opairs), 0, 0, 1, 1},
  {&__pyx_n_s_open, __pyx_k_open, sizeof(__pyx_k_open), 0, 0, 1, 1},
  {&__pyx_n_s_os, __pyx_k_os, sizeof(__pyx_k_os), 0, 0, 1, 1},
  {&__pyx_n_s_osymbols, __pyx_k_osymbols, sizeof(__pyx_k_osymbols), 0, 0, 1, 1},
  {&__pyx_n_s_output_symbols, __pyx_k_output_symbols, sizeof(__pyx_k_output_symbols), 0, 0, 1, 1},
  {&__pyx_n_s_pairs, __pyx_k_pairs, sizeof(__pyx_k_pairs), 0, 0, 1, 1},
  {&__pyx_n_s_plus, __pyx_k_plus, sizeof(__pyx_k_plus), 0, 0, 1, 1},
  {&__pyx_n_s_portrait, __pyx_k_portrait, sizeof(__pyx_k_portrait), 0, 0, 1, 1},
  {&__pyx_n_s_position, __pyx_k_position, sizeof(__pyx_k_position), 0, 0, 1, 1},
  {&__pyx_n_s_potentials, __pyx_k_potentials, sizeof(__pyx_k_potentials), 0, 0, 1, 1},
  {&__pyx_n_s_power, __pyx_k_power, sizeof(__pyx_k_power), 0, 0, 1, 1},
  {&__pyx_n_s_precision, __pyx_k_precision, sizeof(__pyx_k_precision), 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_props, __pyx_k_props, sizeof(__pyx_k_props), 0, 0, 1, 1},
  {&__pyx_n_s_push_labels, __pyx_k_push_labels, sizeof(__pyx_k_push_labels), 0, 0, 1, 1},
  {&__pyx_n_s_push_weights, __pyx_k_push_weights, sizeof(__pyx_k_push_weights), 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_queue_type, __pyx_k_queue_type, sizeof(__pyx_k_queue_type), 0, 0, 1, 1},
  {&__pyx_n_s_ranksep, __pyx_k_ranksep, sizeof(__pyx_k_ranksep), 0, 0, 1, 1},
  {&__pyx_n_s_read, __pyx_k_read, sizeof(__pyx_k_read), 0, 0, 1, 1},
  {&__pyx_n_s_read_EncodeMapper_from_string, __pyx_k_read_EncodeMapper_from_string, sizeof(__pyx_k_read_EncodeMapper_from_string), 0, 0, 1, 1},
  {&__pyx_n_s_read_Fst_from_string, __pyx_k_read_Fst_from_string, sizeof(__pyx_k_read_Fst_from_string), 0, 0, 1, 1},
  {&__pyx_n_s_read_SymbolTable_from_string, __pyx_k_read_SymbolTable_from_string, sizeof(__pyx_k_read_SymbolTable_from_string), 0, 0, 1, 1},
  {&__pyx_n_s_read_from_string, __pyx_k_read_from_string, sizeof(__pyx_k_read_from_string), 0, 0, 1, 1},
  {&__pyx_n_s_read_fst, __pyx_k_read_fst, sizeof(__pyx_k_read_fst), 0, 0, 1, 1},
  {&__pyx_n_s_read_text, __pyx_k_read_text, sizeof(__pyx_k_read_text), 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_remove_common_affix, __pyx_k_remove_common_affix, sizeof(__pyx_k_remove_common_affix), 0, 0, 1, 1},
  {&__pyx_n_s_remove_total_weight, __pyx_k_remove_total_weight, sizeof(__pyx_k_remove_total_weight), 0, 0, 1, 1},
  {&__pyx_n_s_require_superinitial, __pyx_k_require_superinitial, sizeof(__pyx_k_require_superinitial), 0, 0, 1, 1},
  {&__pyx_n_s_reset, __pyx_k_reset, sizeof(__pyx_k_reset), 0, 0, 1, 1},
  {&__pyx_n_s_return_arc_labeling, __pyx_k_return_arc_labeling, sizeof(__pyx_k_return_arc_labeling), 0, 0, 1, 1},
  {&__pyx_n_s_return_label, __pyx_k_return_label, sizeof(__pyx_k_return_label), 0, 0, 1, 1},
  {&__pyx_n_s_reverse, __pyx_k_reverse, sizeof(__pyx_k_reverse), 0, 0, 1, 1},
  {&__pyx_n_s_rhs, __pyx_k_rhs, sizeof(__pyx_k_rhs), 0, 0, 1, 1},
  {&__pyx_n_s_seed, __pyx_k_seed, sizeof(__pyx_k_seed), 0, 0, 1, 1},
  {&__pyx_n_s_seek, __pyx_k_seek, sizeof(__pyx_k_seek), 0, 0, 1, 1},
  {&__pyx_n_s_select, __pyx_k_select, sizeof(__pyx_k_select), 0, 0, 1, 1},
  {&__pyx_kp_s_self__aiter_self__fst_cannot_be, __pyx_k_self__aiter_self__fst_cannot_be, sizeof(__pyx_k_self__aiter_self__fst_cannot_be), 0, 0, 1, 0},
  {&__pyx_kp_s_self__aiter_self__mfst_cannot_be, __pyx_k_self__aiter_self__mfst_cannot_be, sizeof(__pyx_k_self__aiter_self__mfst_cannot_be), 0, 0, 1, 0},
  {&__pyx_kp_s_self__arc_cannot_be_converted_to, __pyx_k_self__arc_cannot_be_converted_to, sizeof(__pyx_k_self__arc_cannot_be_converted_to), 0, 0, 1, 0},
  {&__pyx_kp_s_self__fst_self__siter_cannot_be, __pyx_k_self__fst_self__siter_cannot_be, sizeof(__pyx_k_self__fst_self__siter_cannot_be), 0, 0, 1, 0},
  {&__pyx_kp_s_self__reader_cannot_be_converted, __pyx_k_self__reader_cannot_be_converted, sizeof(__pyx_k_self__reader_cannot_be_converted), 0, 0, 1, 0},
  {&__pyx_kp_s_self__siter_cannot_be_converted, __pyx_k_self__siter_cannot_be_converted, sizeof(__pyx_k_self__siter_cannot_be_converted), 0, 0, 1, 0},
  {&__pyx_kp_s_self__weight_cannot_be_converted, __pyx_k_self__weight_cannot_be_converted, sizeof(__pyx_k_self__weight_cannot_be_converted), 0, 0, 1, 0},
  {&__pyx_kp_s_self__writer_cannot_be_converted, __pyx_k_self__writer_cannot_be_converted, sizeof(__pyx_k_self__writer_cannot_be_converted), 0, 0, 1, 0},
  {&__pyx_n_s_send, __pyx_k_send, sizeof(__pyx_k_send), 0, 0, 1, 1},
  {&__pyx_n_s_set_flags, __pyx_k_set_flags, sizeof(__pyx_k_set_flags), 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_value, __pyx_k_set_value, sizeof(__pyx_k_set_value), 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_shortestdistance, __pyx_k_shortestdistance, sizeof(__pyx_k_shortestdistance), 0, 0, 1, 1},
  {&__pyx_n_s_show_weight_one, __pyx_k_show_weight_one, sizeof(__pyx_k_show_weight_one), 0, 0, 1, 1},
  {&__pyx_n_s_sort_type, __pyx_k_sort_type, sizeof(__pyx_k_sort_type), 0, 0, 1, 1},
  {&__pyx_n_s_source, __pyx_k_source, sizeof(__pyx_k_source), 0, 0, 1, 1},
  {&__pyx_n_s_ssymbols, __pyx_k_ssymbols, sizeof(__pyx_k_ssymbols), 0, 0, 1, 1},
  {&__pyx_n_u_standard, __pyx_k_standard, sizeof(__pyx_k_standard), 0, 1, 0, 1},
  {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
  {&__pyx_n_s_state, __pyx_k_state, sizeof(__pyx_k_state), 0, 0, 1, 1},
  {&__pyx_n_s_states, __pyx_k_states, sizeof(__pyx_k_states), 0, 0, 1, 1},
  {&__pyx_n_s_staticmethod, __pyx_k_staticmethod, sizeof(__pyx_k_staticmethod), 0, 0, 1, 1},
  {&__pyx_n_s_stdin, __pyx_k_stdin, sizeof(__pyx_k_stdin), 0, 0, 1, 1},
  {&__pyx_n_s_stdout, __pyx_k_stdout, sizeof(__pyx_k_stdout), 0, 0, 1, 1},
  {&__pyx_n_s_subprocess, __pyx_k_subprocess, sizeof(__pyx_k_subprocess), 0, 0, 1, 1},
  {&__pyx_n_s_subsequential_label, __pyx_k_subsequential_label, sizeof(__pyx_k_subsequential_label), 0, 0, 1, 1},
  {&__pyx_n_s_symbol, __pyx_k_symbol, sizeof(__pyx_k_symbol), 0, 0, 1, 1},
  {&__pyx_n_s_symbols, __pyx_k_symbols, sizeof(__pyx_k_symbols), 0, 0, 1, 1},
  {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1},
  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
  {&__pyx_n_s_test_2, __pyx_k_test_2, sizeof(__pyx_k_test_2), 0, 0, 1, 1},
  {&__pyx_n_s_throw, __pyx_k_throw, sizeof(__pyx_k_throw), 0, 0, 1, 1},
  {&__pyx_n_s_times, __pyx_k_times, sizeof(__pyx_k_times), 0, 0, 1, 1},
  {&__pyx_n_s_title, __pyx_k_title, sizeof(__pyx_k_title), 0, 0, 1, 1},
  {&__pyx_n_s_to_final, __pyx_k_to_final, sizeof(__pyx_k_to_final), 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_type, __pyx_k_type, sizeof(__pyx_k_type), 0, 0, 1, 1},
  {&__pyx_n_s_typing, __pyx_k_typing, sizeof(__pyx_k_typing), 0, 0, 1, 1},
  {&__pyx_kp_u_typing_Literal_alt_sequence_auto, __pyx_k_typing_Literal_alt_sequence_auto, sizeof(__pyx_k_typing_Literal_alt_sequence_auto), 0, 1, 0, 0},
  {&__pyx_kp_u_typing_Literal_arc_sum_arc_uniqu, __pyx_k_typing_Literal_arc_sum_arc_uniqu, sizeof(__pyx_k_typing_Literal_arc_sum_arc_uniqu), 0, 1, 0, 0},
  {&__pyx_kp_u_typing_Literal_auto_fifo_lifo_sh, __pyx_k_typing_Literal_auto_fifo_lifo_sh, sizeof(__pyx_k_typing_Literal_auto_fifo_lifo_sh), 0, 1, 0, 0},
  {&__pyx_kp_u_typing_Literal_e_f_g, __pyx_k_typing_Literal_e_f_g, sizeof(__pyx_k_typing_Literal_e_f_g), 0, 1, 0, 0},
  {&__pyx_kp_u_typing_Literal_fst_stlist_sttabl, __pyx_k_typing_Literal_fst_stlist_sttabl, sizeof(__pyx_k_typing_Literal_fst_stlist_sttabl), 0, 1, 0, 0},
  {&__pyx_kp_u_typing_Literal_functional_nonfun, __pyx_k_typing_Literal_functional_nonfun, sizeof(__pyx_k_typing_Literal_functional_nonfun), 0, 1, 0, 0},
  {&__pyx_kp_u_typing_Literal_identity_input_ep, __pyx_k_typing_Literal_identity_input_ep, sizeof(__pyx_k_typing_Literal_identity_input_ep), 0, 1, 0, 0},
  {&__pyx_kp_u_typing_Literal_ilabel_olabel, __pyx_k_typing_Literal_ilabel_olabel, sizeof(__pyx_k_typing_Literal_ilabel_olabel), 0, 1, 0, 0},
  {&__pyx_kp_u_typing_Literal_input_output, __pyx_k_typing_Literal_input_output, sizeof(__pyx_k_typing_Literal_input_output), 0, 1, 0, 0},
  {&__pyx_kp_u_typing_Literal_neither_input_out, __pyx_k_typing_Literal_neither_input_out, sizeof(__pyx_k_typing_Literal_neither_input_out), 0, 1, 0, 0},
  {&__pyx_kp_u_typing_Literal_uniform_log_prob, __pyx_k_typing_Literal_uniform_log_prob, sizeof(__pyx_k_typing_Literal_uniform_log_prob), 0, 1, 0, 0},
  {&__pyx_kp_u_typing_Union_Weight_typing_Union, __pyx_k_typing_Union_Weight_typing_Union, sizeof(__pyx_k_typing_Union_Weight_typing_Union), 0, 1, 0, 0},
  {&__pyx_n_u_uniform, __pyx_k_uniform, sizeof(__pyx_k_uniform), 0, 1, 0, 1},
  {&__pyx_n_s_unique, __pyx_k_unique, sizeof(__pyx_k_unique), 0, 0, 1, 1},
  {&__pyx_n_s_unknown_isymbol, __pyx_k_unknown_isymbol, sizeof(__pyx_k_unknown_isymbol), 0, 0, 1, 1},
  {&__pyx_n_s_unknown_osymbol, __pyx_k_unknown_osymbol, sizeof(__pyx_k_unknown_osymbol), 0, 0, 1, 1},
  {&__pyx_kp_u_unspecified, __pyx_k_unspecified, sizeof(__pyx_k_unspecified), 0, 1, 0, 0},
  {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1},
  {&__pyx_n_u_vector, __pyx_k_vector, sizeof(__pyx_k_vector), 0, 1, 0, 1},
  {&__pyx_n_s_verify, __pyx_k_verify, sizeof(__pyx_k_verify), 0, 0, 1, 1},
  {&__pyx_n_s_vertical, __pyx_k_vertical, sizeof(__pyx_k_vertical), 0, 0, 1, 1},
  {&__pyx_n_s_w, __pyx_k_w, sizeof(__pyx_k_w), 0, 0, 1, 1},
  {&__pyx_n_s_warning, __pyx_k_warning, sizeof(__pyx_k_warning), 0, 0, 1, 1},
  {&__pyx_n_s_weight, __pyx_k_weight, sizeof(__pyx_k_weight), 0, 0, 1, 1},
  {&__pyx_n_s_weight_2, __pyx_k_weight_2, sizeof(__pyx_k_weight_2), 0, 0, 1, 1},
  {&__pyx_n_s_weight_type, __pyx_k_weight_type, sizeof(__pyx_k_weight_type), 0, 0, 1, 1},
  {&__pyx_n_s_weighted, __pyx_k_weighted, sizeof(__pyx_k_weighted), 0, 0, 1, 1},
  {&__pyx_n_s_width, __pyx_k_width, sizeof(__pyx_k_width), 0, 0, 1, 1},
  {&__pyx_n_s_write, __pyx_k_write, sizeof(__pyx_k_write), 0, 0, 1, 1},
  {&__pyx_n_s_write_text, __pyx_k_write_text, sizeof(__pyx_k_write_text), 0, 0, 1, 1},
  {&__pyx_n_s_write_to_string, __pyx_k_write_to_string, sizeof(__pyx_k_write_to_string), 0, 0, 1, 1},
  {&__pyx_n_u_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 1, 0, 1},
  {&__pyx_n_s_zero, __pyx_k_zero, sizeof(__pyx_k_zero), 0, 0, 1, 1},
  {0, 0, 0, 0, 0, 0, 0}
};
static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 148, __pyx_L1_error)
  __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(0, 158, __pyx_L1_error)
  __pyx_builtin_IOError = __Pyx_GetBuiltinName(__pyx_n_s_IOError); if (!__pyx_builtin_IOError) __PYX_ERR(0, 163, __pyx_L1_error)
  __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 168, __pyx_L1_error)
  __pyx_builtin_staticmethod = __Pyx_GetBuiltinName(__pyx_n_s_staticmethod); if (!__pyx_builtin_staticmethod) __PYX_ERR(0, 1421, __pyx_L1_error)
  __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 197, __pyx_L1_error)
  __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(0, 426, __pyx_L1_error)
  __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) __PYX_ERR(0, 747, __pyx_L1_error)
  __pyx_builtin_StopIteration = __Pyx_GetBuiltinName(__pyx_n_s_StopIteration); if (!__pyx_builtin_StopIteration) __PYX_ERR(0, 1287, __pyx_L1_error)
  __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(0, 4570, __pyx_L1_error)
  return 0;
  __pyx_L1_error:;
  return -1;
}

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

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self._weight cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self._weight cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_self__weight_cannot_be_converted); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(1, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__4);
  __Pyx_GIVEREF(__pyx_tuple__4);

  /* "(tree fragment)":4
 *     raise TypeError("self._weight cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self._weight cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_self__weight_cannot_be_converted); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__5);
  __Pyx_GIVEREF(__pyx_tuple__5);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self._siter cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self._siter cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_self__siter_cannot_be_converted); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(1, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__7);
  __Pyx_GIVEREF(__pyx_tuple__7);

  /* "(tree fragment)":4
 *     raise TypeError("self._siter cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self._siter cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_self__siter_cannot_be_converted); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__8);
  __Pyx_GIVEREF(__pyx_tuple__8);

  /* "fstlib/cext/pywrapfst.pyx":1579
 *   @staticmethod
 *   cdef string _local_render_svg(const string &dot):
 *     proc = subprocess.Popen(("dot", "-Tsvg"),             # <<<<<<<<<<<<<<
 *                             stdin=subprocess.PIPE,
 *                             stdout=subprocess.PIPE)
 */
  __pyx_tuple__9 = PyTuple_Pack(2, __pyx_n_u_dot, __pyx_kp_u_Tsvg); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 1579, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__9);
  __Pyx_GIVEREF(__pyx_tuple__9);
  __pyx_tuple__10 = PyTuple_Pack(1, __pyx_tuple__9); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 1579, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__10);
  __Pyx_GIVEREF(__pyx_tuple__10);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self._arc cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self._arc cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_self__arc_cannot_be_converted_to); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(1, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__24);
  __Pyx_GIVEREF(__pyx_tuple__24);

  /* "(tree fragment)":4
 *     raise TypeError("self._arc cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self._arc cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_self__arc_cannot_be_converted_to); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__25);
  __Pyx_GIVEREF(__pyx_tuple__25);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self._aiter,self._fst cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self._aiter,self._fst cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_self__aiter_self__fst_cannot_be); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(1, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__26);
  __Pyx_GIVEREF(__pyx_tuple__26);

  /* "(tree fragment)":4
 *     raise TypeError("self._aiter,self._fst cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self._aiter,self._fst cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_self__aiter_self__fst_cannot_be); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__27);
  __Pyx_GIVEREF(__pyx_tuple__27);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self._aiter,self._mfst cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self._aiter,self._mfst cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_self__aiter_self__mfst_cannot_be); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(1, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__28);
  __Pyx_GIVEREF(__pyx_tuple__28);

  /* "(tree fragment)":4
 *     raise TypeError("self._aiter,self._mfst cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self._aiter,self._mfst cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_self__aiter_self__mfst_cannot_be); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__29);
  __Pyx_GIVEREF(__pyx_tuple__29);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self._fst,self._siter cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self._fst,self._siter cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_self__fst_self__siter_cannot_be); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(1, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__30);
  __Pyx_GIVEREF(__pyx_tuple__30);

  /* "(tree fragment)":4
 *     raise TypeError("self._fst,self._siter cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self._fst,self._siter cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_self__fst_self__siter_cannot_be); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__31);
  __Pyx_GIVEREF(__pyx_tuple__31);

  /* "(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_tuple__53 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(1, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__53);
  __Pyx_GIVEREF(__pyx_tuple__53);

  /* "(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_tuple__54 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__54);
  __Pyx_GIVEREF(__pyx_tuple__54);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self._reader cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self._reader cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__55 = PyTuple_Pack(1, __pyx_kp_s_self__reader_cannot_be_converted); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(1, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__55);
  __Pyx_GIVEREF(__pyx_tuple__55);

  /* "(tree fragment)":4
 *     raise TypeError("self._reader cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self._reader cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__56 = PyTuple_Pack(1, __pyx_kp_s_self__reader_cannot_be_converted); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__56);
  __Pyx_GIVEREF(__pyx_tuple__56);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self._writer cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self._writer cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__57 = PyTuple_Pack(1, __pyx_kp_s_self__writer_cannot_be_converted); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(1, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__57);
  __Pyx_GIVEREF(__pyx_tuple__57);

  /* "(tree fragment)":4
 *     raise TypeError("self._writer cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self._writer cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__58 = PyTuple_Pack(1, __pyx_kp_s_self__writer_cannot_be_converted); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__58);
  __Pyx_GIVEREF(__pyx_tuple__58);

  /* "fstlib/cext/pywrapfst.pyx":515
 * 
 * 
 * def plus(Weight lhs, Weight rhs):             # <<<<<<<<<<<<<<
 *   """
 *   plus(lhs, rhs)
 */
  __pyx_tuple__59 = PyTuple_Pack(3, __pyx_n_s_lhs, __pyx_n_s_rhs, __pyx_n_s_weight_2); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(0, 515, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__59);
  __Pyx_GIVEREF(__pyx_tuple__59);
  __pyx_codeobj__60 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__59, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fstlib_cext_pywrapfst_pyx, __pyx_n_s_plus, 515, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__60)) __PYX_ERR(0, 515, __pyx_L1_error)

  /* "fstlib/cext/pywrapfst.pyx":547
 * 
 * 
 * def times(Weight lhs, Weight rhs):             # <<<<<<<<<<<<<<
 *   """
 *   times(lhs, rhs)
 */
  __pyx_tuple__61 = PyTuple_Pack(3, __pyx_n_s_lhs, __pyx_n_s_rhs, __pyx_n_s_weight_2); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(0, 547, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__61);
  __Pyx_GIVEREF(__pyx_tuple__61);
  __pyx_codeobj__62 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__61, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fstlib_cext_pywrapfst_pyx, __pyx_n_s_times, 547, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__62)) __PYX_ERR(0, 547, __pyx_L1_error)

  /* "fstlib/cext/pywrapfst.pyx":579
 * 
 * 
 * def divide(Weight lhs, Weight rhs):             # <<<<<<<<<<<<<<
 *   """
 *   divide(lhs, rhs)
 */
  __pyx_tuple__63 = PyTuple_Pack(3, __pyx_n_s_lhs, __pyx_n_s_rhs, __pyx_n_s_weight_2); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(0, 579, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__63);
  __Pyx_GIVEREF(__pyx_tuple__63);
  __pyx_codeobj__64 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__63, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fstlib_cext_pywrapfst_pyx, __pyx_n_s_divide, 579, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__64)) __PYX_ERR(0, 579, __pyx_L1_error)

  /* "fstlib/cext/pywrapfst.pyx":612
 * 
 * 
 * def power(Weight w, size_t n):             # <<<<<<<<<<<<<<
 *   """
 *   power(lhs, rhs)
 */
  __pyx_tuple__65 = PyTuple_Pack(3, __pyx_n_s_w, __pyx_n_s_n, __pyx_n_s_weight_2); if (unlikely(!__pyx_tuple__65)) __PYX_ERR(0, 612, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__65);
  __Pyx_GIVEREF(__pyx_tuple__65);
  __pyx_codeobj__66 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__65, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fstlib_cext_pywrapfst_pyx, __pyx_n_s_power, 612, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__66)) __PYX_ERR(0, 612, __pyx_L1_error)

  /* "fstlib/cext/pywrapfst.pyx":1422
 * 
 *   @staticmethod
 *   def read_from_string(state):             # <<<<<<<<<<<<<<
 *     """
 *     read_from_string(state)
 */
  __pyx_tuple__67 = PyTuple_Pack(1, __pyx_n_s_state); if (unlikely(!__pyx_tuple__67)) __PYX_ERR(0, 1422, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__67);
  __Pyx_GIVEREF(__pyx_tuple__67);
  __pyx_codeobj__68 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__67, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fstlib_cext_pywrapfst_pyx, __pyx_n_s_read_from_string, 1422, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__68)) __PYX_ERR(0, 1422, __pyx_L1_error)

  /* "fstlib/cext/pywrapfst.pyx":4148
 * 
 * 
 * def shortestdistance(Fst ifst,             # <<<<<<<<<<<<<<
 *                      float delta=fst.kShortestDelta,
 *                      int64 nstate=fst.kNoStateId,
 */
  __pyx_tuple__69 = PyTuple_Pack(7, __pyx_n_s_ifst, __pyx_n_s_delta, __pyx_n_s_nstate, __pyx_n_s_queue_type, __pyx_n_s_reverse, __pyx_n_s_distance, __pyx_n_s_weight); if (unlikely(!__pyx_tuple__69)) __PYX_ERR(0, 4148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__69);
  __Pyx_GIVEREF(__pyx_tuple__69);
  __pyx_codeobj__70 = (PyObject*)__Pyx_PyCode_New(5, 0, 7, 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_fstlib_cext_pywrapfst_pyx, __pyx_n_s_shortestdistance, 4148, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__70)) __PYX_ERR(0, 4148, __pyx_L1_error)
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
  if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  return 0;
  __pyx_L1_error:;
  return -1;
}

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
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
  /*--- Function export code ---*/
  if (__Pyx_ExportFunction("tostring", (void (*)(void))__pyx_f_6fstlib_4cext_9pywrapfst_tostring, "std::string (PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("weight_tostring", (void (*)(void))__pyx_f_6fstlib_4cext_9pywrapfst_weight_tostring, "std::string (PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("path_tostring", (void (*)(void))__pyx_f_6fstlib_4cext_9pywrapfst_path_tostring, "std::string (PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_get_compose_filter", (void (*)(void))__pyx_f_6fstlib_4cext_9pywrapfst__get_compose_filter, "enum fst::ComposeFilter (std::string const &)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_get_determinize_type", (void (*)(void))__pyx_f_6fstlib_4cext_9pywrapfst__get_determinize_type, "enum fst::DeterminizeType (std::string const &)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_get_queue_type", (void (*)(void))__pyx_f_6fstlib_4cext_9pywrapfst__get_queue_type, "enum fst::QueueType (std::string const &)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_get_rand_arc_selection", (void (*)(void))__pyx_f_6fstlib_4cext_9pywrapfst__get_rand_arc_selection, "fst::script::RandArcSelection (std::string const &)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_get_replace_label_type", (void (*)(void))__pyx_f_6fstlib_4cext_9pywrapfst__get_replace_label_type, "enum fst::ReplaceLabelType (std::string const &, bool)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_get_WeightClass_or_one", (void (*)(void))__pyx_f_6fstlib_4cext_9pywrapfst__get_WeightClass_or_one, "fst::script::WeightClass (std::string const &, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_get_WeightClass_or_zero", (void (*)(void))__pyx_f_6fstlib_4cext_9pywrapfst__get_WeightClass_or_zero, "fst::script::WeightClass (std::string const &, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_zero", (void (*)(void))__pyx_f_6fstlib_4cext_9pywrapfst__zero, "struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *(PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_one", (void (*)(void))__pyx_f_6fstlib_4cext_9pywrapfst__one, "struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *(PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_no_weight", (void (*)(void))__pyx_f_6fstlib_4cext_9pywrapfst__no_weight, "struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *(PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_plus", (void (*)(void))__pyx_f_6fstlib_4cext_9pywrapfst__plus, "struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_times", (void (*)(void))__pyx_f_6fstlib_4cext_9pywrapfst__times, "struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_divide", (void (*)(void))__pyx_f_6fstlib_4cext_9pywrapfst__divide, "struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_power", (void (*)(void))__pyx_f_6fstlib_4cext_9pywrapfst__power, "struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *, size_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_init_EncodeMapperSymbolTableView", (void (*)(void))__pyx_f_6fstlib_4cext_9pywrapfst__init_EncodeMapperSymbolTableView, "struct __pyx_obj_6fstlib_4cext_9pywrapfst__EncodeMapperSymbolTableView *(std::shared_ptr<fst::script::EncodeMapperClass> , bool)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_init_FstSymbolTableView", (void (*)(void))__pyx_f_6fstlib_4cext_9pywrapfst__init_FstSymbolTableView, "struct __pyx_obj_6fstlib_4cext_9pywrapfst__FstSymbolTableView *(std::shared_ptr<fst::script::FstClass> , bool)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_init_MutableFstSymbolTableView", (void (*)(void))__pyx_f_6fstlib_4cext_9pywrapfst__init_MutableFstSymbolTableView, "struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableFstSymbolTableView *(std::shared_ptr<fst::script::MutableFstClass> , bool)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_init_SymbolTable", (void (*)(void))__pyx_f_6fstlib_4cext_9pywrapfst__init_SymbolTable, "struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTable *(std::unique_ptr<fst::SymbolTable> )") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_read_SymbolTable_from_string", (void (*)(void))__pyx_f_6fstlib_4cext_9pywrapfst__read_SymbolTable_from_string, "struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTable *(std::string, int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_init_EncodeMapper", (void (*)(void))__pyx_f_6fstlib_4cext_9pywrapfst__init_EncodeMapper, "struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *(__pyx_t_6fstlib_4cext_9pywrapfst_EncodeMapperClass_ptr)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_read_EncodeMapper_from_string", (void (*)(void))__pyx_f_6fstlib_4cext_9pywrapfst__read_EncodeMapper_from_string, "struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *(std::string, int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_init_Fst", (void (*)(void))__pyx_f_6fstlib_4cext_9pywrapfst__init_Fst, "struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *(__pyx_t_6fstlib_4cext_9pywrapfst_FstClass_ptr)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_init_MutableFst", (void (*)(void))__pyx_f_6fstlib_4cext_9pywrapfst__init_MutableFst, "struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *(__pyx_t_6fstlib_4cext_9pywrapfst_MutableFstClass_ptr)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_init_XFst", (void (*)(void))__pyx_f_6fstlib_4cext_9pywrapfst__init_XFst, "struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *(__pyx_t_6fstlib_4cext_9pywrapfst_FstClass_ptr)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_read_Fst", (void (*)(void))__pyx_f_6fstlib_4cext_9pywrapfst__read_Fst, "struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *(PyObject *, int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_read_Fst_from_string", (void (*)(void))__pyx_f_6fstlib_4cext_9pywrapfst__read_Fst_from_string, "struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *(std::string, int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_init_Arc", (void (*)(void))__pyx_f_6fstlib_4cext_9pywrapfst__init_Arc, "struct __pyx_obj_6fstlib_4cext_9pywrapfst_Arc *(fst::script::ArcClass const &)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_map", (void (*)(void))__pyx_f_6fstlib_4cext_9pywrapfst__map, "struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst__map *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("arcmap", (void (*)(void))__pyx_f_6fstlib_4cext_9pywrapfst_arcmap, "struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *, int __pyx_skip_dispatch, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_arcmap *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("compose", (void (*)(void))__pyx_f_6fstlib_4cext_9pywrapfst_compose, "struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *, int __pyx_skip_dispatch, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_compose *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("convert", (void (*)(void))__pyx_f_6fstlib_4cext_9pywrapfst_convert, "struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *, int __pyx_skip_dispatch, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_convert *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("determinize", (void (*)(void))__pyx_f_6fstlib_4cext_9pywrapfst_determinize, "struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *, int __pyx_skip_dispatch, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_determinize *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("difference", (void (*)(void))__pyx_f_6fstlib_4cext_9pywrapfst_difference, "struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *, int __pyx_skip_dispatch, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_difference *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("disambiguate", (void (*)(void))__pyx_f_6fstlib_4cext_9pywrapfst_disambiguate, "struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *, int __pyx_skip_dispatch, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_disambiguate *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("epsnormalize", (void (*)(void))__pyx_f_6fstlib_4cext_9pywrapfst_epsnormalize, "struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *, int __pyx_skip_dispatch, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_epsnormalize *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("equal", (void (*)(void))__pyx_f_6fstlib_4cext_9pywrapfst_equal, "bool (struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *, int __pyx_skip_dispatch, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_equal *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("equivalent", (void (*)(void))__pyx_f_6fstlib_4cext_9pywrapfst_equivalent, "bool (struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *, int __pyx_skip_dispatch, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_equivalent *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("intersect", (void (*)(void))__pyx_f_6fstlib_4cext_9pywrapfst_intersect, "struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *, int __pyx_skip_dispatch, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_intersect *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("isomorphic", (void (*)(void))__pyx_f_6fstlib_4cext_9pywrapfst_isomorphic, "bool (struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *, int __pyx_skip_dispatch, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_isomorphic *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("prune", (void (*)(void))__pyx_f_6fstlib_4cext_9pywrapfst_prune, "struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *, int __pyx_skip_dispatch, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_prune *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("push", (void (*)(void))__pyx_f_6fstlib_4cext_9pywrapfst_push, "struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *, int __pyx_skip_dispatch, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_push *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("randequivalent", (void (*)(void))__pyx_f_6fstlib_4cext_9pywrapfst_randequivalent, "bool (struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *, int __pyx_skip_dispatch, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_randequivalent *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("randgen", (void (*)(void))__pyx_f_6fstlib_4cext_9pywrapfst_randgen, "struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *, int __pyx_skip_dispatch, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_randgen *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("replace", (void (*)(void))__pyx_f_6fstlib_4cext_9pywrapfst_replace, "struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *(PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_replace *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("reverse", (void (*)(void))__pyx_f_6fstlib_4cext_9pywrapfst_reverse, "struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *, int __pyx_skip_dispatch, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_reverse *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_shortestdistance", (void (*)(void))__pyx_f_6fstlib_4cext_9pywrapfst__shortestdistance, "void (struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *, std::vector<fst::script::WeightClass>  *, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst__shortestdistance *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("shortestpath", (void (*)(void))__pyx_f_6fstlib_4cext_9pywrapfst_shortestpath, "struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *, int __pyx_skip_dispatch, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_shortestpath *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("statemap", (void (*)(void))__pyx_f_6fstlib_4cext_9pywrapfst_statemap, "struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *, PyObject *, int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("synchronize", (void (*)(void))__pyx_f_6fstlib_4cext_9pywrapfst_synchronize, "struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *, int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_type_init_code(void) {
  __Pyx_RefNannyDeclarations
  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_6fstlib_4cext_9pywrapfst_Weight = &__pyx_vtable_6fstlib_4cext_9pywrapfst_Weight;
  __pyx_vtable_6fstlib_4cext_9pywrapfst_Weight._check_weight = (void (*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *))__pyx_f_6fstlib_4cext_9pywrapfst_6Weight__check_weight;
  __pyx_vtable_6fstlib_4cext_9pywrapfst_Weight.copy = (struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *(*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *, int __pyx_skip_dispatch))__pyx_f_6fstlib_4cext_9pywrapfst_6Weight_copy;
  __pyx_vtable_6fstlib_4cext_9pywrapfst_Weight.to_string = (std::string (*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *, int __pyx_skip_dispatch))__pyx_f_6fstlib_4cext_9pywrapfst_6Weight_to_string;
  __pyx_vtable_6fstlib_4cext_9pywrapfst_Weight.type = (std::string (*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *, int __pyx_skip_dispatch))__pyx_f_6fstlib_4cext_9pywrapfst_6Weight_type;
  __pyx_vtable_6fstlib_4cext_9pywrapfst_Weight.member = (bool (*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *, int __pyx_skip_dispatch))__pyx_f_6fstlib_4cext_9pywrapfst_6Weight_member;
  if (PyType_Ready(&__pyx_type_6fstlib_4cext_9pywrapfst_Weight) < 0) __PYX_ERR(0, 405, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_6fstlib_4cext_9pywrapfst_Weight.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6fstlib_4cext_9pywrapfst_Weight.tp_dictoffset && __pyx_type_6fstlib_4cext_9pywrapfst_Weight.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_6fstlib_4cext_9pywrapfst_Weight.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_6fstlib_4cext_9pywrapfst_Weight.tp_dict, __pyx_vtabptr_6fstlib_4cext_9pywrapfst_Weight) < 0) __PYX_ERR(0, 405, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Weight_2, (PyObject *)&__pyx_type_6fstlib_4cext_9pywrapfst_Weight) < 0) __PYX_ERR(0, 405, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_6fstlib_4cext_9pywrapfst_Weight) < 0) __PYX_ERR(0, 405, __pyx_L1_error)
  __pyx_ptype_6fstlib_4cext_9pywrapfst_Weight = &__pyx_type_6fstlib_4cext_9pywrapfst_Weight;
  __pyx_vtabptr_6fstlib_4cext_9pywrapfst_SymbolTableView = &__pyx_vtable_6fstlib_4cext_9pywrapfst_SymbolTableView;
  __pyx_vtable_6fstlib_4cext_9pywrapfst_SymbolTableView._raw = (fst::SymbolTable const *(*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *))__pyx_f_6fstlib_4cext_9pywrapfst_15SymbolTableView__raw;
  __pyx_vtable_6fstlib_4cext_9pywrapfst_SymbolTableView._raise_nonexistent = (void (*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *))__pyx_f_6fstlib_4cext_9pywrapfst_15SymbolTableView__raise_nonexistent;
  __pyx_vtable_6fstlib_4cext_9pywrapfst_SymbolTableView._raw_ptr_or_raise = (fst::SymbolTable const *(*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *))__pyx_f_6fstlib_4cext_9pywrapfst_15SymbolTableView__raw_ptr_or_raise;
  __pyx_vtable_6fstlib_4cext_9pywrapfst_SymbolTableView.available_key = (int64 (*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *, int __pyx_skip_dispatch))__pyx_f_6fstlib_4cext_9pywrapfst_15SymbolTableView_available_key;
  __pyx_vtable_6fstlib_4cext_9pywrapfst_SymbolTableView.checksum = (PyObject *(*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *, int __pyx_skip_dispatch))__pyx_f_6fstlib_4cext_9pywrapfst_15SymbolTableView_checksum;
  __pyx_vtable_6fstlib_4cext_9pywrapfst_SymbolTableView.copy = (struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTable *(*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *, int __pyx_skip_dispatch))__pyx_f_6fstlib_4cext_9pywrapfst_15SymbolTableView_copy;
  __pyx_vtable_6fstlib_4cext_9pywrapfst_SymbolTableView.get_nth_key = (int64 (*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *, Py_ssize_t, int __pyx_skip_dispatch))__pyx_f_6fstlib_4cext_9pywrapfst_15SymbolTableView_get_nth_key;
  __pyx_vtable_6fstlib_4cext_9pywrapfst_SymbolTableView.labeled_checksum = (PyObject *(*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *, int __pyx_skip_dispatch))__pyx_f_6fstlib_4cext_9pywrapfst_15SymbolTableView_labeled_checksum;
  __pyx_vtable_6fstlib_4cext_9pywrapfst_SymbolTableView.member = (bool (*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6fstlib_4cext_9pywrapfst_15SymbolTableView_member;
  __pyx_vtable_6fstlib_4cext_9pywrapfst_SymbolTableView.name = (std::string (*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *, int __pyx_skip_dispatch))__pyx_f_6fstlib_4cext_9pywrapfst_15SymbolTableView_name;
  __pyx_vtable_6fstlib_4cext_9pywrapfst_SymbolTableView.num_symbols = (size_t (*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *, int __pyx_skip_dispatch))__pyx_f_6fstlib_4cext_9pywrapfst_15SymbolTableView_num_symbols;
  __pyx_vtable_6fstlib_4cext_9pywrapfst_SymbolTableView.write = (void (*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6fstlib_4cext_9pywrapfst_15SymbolTableView_write;
  __pyx_vtable_6fstlib_4cext_9pywrapfst_SymbolTableView.write_text = (void (*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6fstlib_4cext_9pywrapfst_15SymbolTableView_write_text;
  __pyx_vtable_6fstlib_4cext_9pywrapfst_SymbolTableView.write_to_string = (PyObject *(*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *, int __pyx_skip_dispatch))__pyx_f_6fstlib_4cext_9pywrapfst_15SymbolTableView_write_to_string;
  if (PyType_Ready(&__pyx_type_6fstlib_4cext_9pywrapfst_SymbolTableView) < 0) __PYX_ERR(0, 732, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_6fstlib_4cext_9pywrapfst_SymbolTableView.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6fstlib_4cext_9pywrapfst_SymbolTableView.tp_dictoffset && __pyx_type_6fstlib_4cext_9pywrapfst_SymbolTableView.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_6fstlib_4cext_9pywrapfst_SymbolTableView.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_6fstlib_4cext_9pywrapfst_SymbolTableView.tp_dict, __pyx_vtabptr_6fstlib_4cext_9pywrapfst_SymbolTableView) < 0) __PYX_ERR(0, 732, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_SymbolTableView, (PyObject *)&__pyx_type_6fstlib_4cext_9pywrapfst_SymbolTableView) < 0) __PYX_ERR(0, 732, __pyx_L1_error)
  __pyx_ptype_6fstlib_4cext_9pywrapfst_SymbolTableView = &__pyx_type_6fstlib_4cext_9pywrapfst_SymbolTableView;
  __pyx_vtabptr_6fstlib_4cext_9pywrapfst__EncodeMapperSymbolTableView = &__pyx_vtable_6fstlib_4cext_9pywrapfst__EncodeMapperSymbolTableView;
  __pyx_vtable_6fstlib_4cext_9pywrapfst__EncodeMapperSymbolTableView.__pyx_base = *__pyx_vtabptr_6fstlib_4cext_9pywrapfst_SymbolTableView;
  __pyx_vtable_6fstlib_4cext_9pywrapfst__EncodeMapperSymbolTableView.__pyx_base._raw = (fst::SymbolTable const *(*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *))__pyx_f_6fstlib_4cext_9pywrapfst_28_EncodeMapperSymbolTableView__raw;
  __pyx_type_6fstlib_4cext_9pywrapfst__EncodeMapperSymbolTableView.tp_base = __pyx_ptype_6fstlib_4cext_9pywrapfst_SymbolTableView;
  if (PyType_Ready(&__pyx_type_6fstlib_4cext_9pywrapfst__EncodeMapperSymbolTableView) < 0) __PYX_ERR(0, 935, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_6fstlib_4cext_9pywrapfst__EncodeMapperSymbolTableView.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6fstlib_4cext_9pywrapfst__EncodeMapperSymbolTableView.tp_dictoffset && __pyx_type_6fstlib_4cext_9pywrapfst__EncodeMapperSymbolTableView.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_6fstlib_4cext_9pywrapfst__EncodeMapperSymbolTableView.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_6fstlib_4cext_9pywrapfst__EncodeMapperSymbolTableView.tp_dict, __pyx_vtabptr_6fstlib_4cext_9pywrapfst__EncodeMapperSymbolTableView) < 0) __PYX_ERR(0, 935, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_EncodeMapperSymbolTableView, (PyObject *)&__pyx_type_6fstlib_4cext_9pywrapfst__EncodeMapperSymbolTableView) < 0) __PYX_ERR(0, 935, __pyx_L1_error)
  __pyx_ptype_6fstlib_4cext_9pywrapfst__EncodeMapperSymbolTableView = &__pyx_type_6fstlib_4cext_9pywrapfst__EncodeMapperSymbolTableView;
  __pyx_vtabptr_6fstlib_4cext_9pywrapfst__FstSymbolTableView = &__pyx_vtable_6fstlib_4cext_9pywrapfst__FstSymbolTableView;
  __pyx_vtable_6fstlib_4cext_9pywrapfst__FstSymbolTableView.__pyx_base = *__pyx_vtabptr_6fstlib_4cext_9pywrapfst_SymbolTableView;
  __pyx_vtable_6fstlib_4cext_9pywrapfst__FstSymbolTableView.__pyx_base._raw = (fst::SymbolTable const *(*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *))__pyx_f_6fstlib_4cext_9pywrapfst_19_FstSymbolTableView__raw;
  __pyx_type_6fstlib_4cext_9pywrapfst__FstSymbolTableView.tp_base = __pyx_ptype_6fstlib_4cext_9pywrapfst_SymbolTableView;
  if (PyType_Ready(&__pyx_type_6fstlib_4cext_9pywrapfst__FstSymbolTableView) < 0) __PYX_ERR(0, 959, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_6fstlib_4cext_9pywrapfst__FstSymbolTableView.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6fstlib_4cext_9pywrapfst__FstSymbolTableView.tp_dictoffset && __pyx_type_6fstlib_4cext_9pywrapfst__FstSymbolTableView.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_6fstlib_4cext_9pywrapfst__FstSymbolTableView.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_6fstlib_4cext_9pywrapfst__FstSymbolTableView.tp_dict, __pyx_vtabptr_6fstlib_4cext_9pywrapfst__FstSymbolTableView) < 0) __PYX_ERR(0, 959, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_FstSymbolTableView, (PyObject *)&__pyx_type_6fstlib_4cext_9pywrapfst__FstSymbolTableView) < 0) __PYX_ERR(0, 959, __pyx_L1_error)
  __pyx_ptype_6fstlib_4cext_9pywrapfst__FstSymbolTableView = &__pyx_type_6fstlib_4cext_9pywrapfst__FstSymbolTableView;
  __pyx_vtabptr_6fstlib_4cext_9pywrapfst__MutableSymbolTable = &__pyx_vtable_6fstlib_4cext_9pywrapfst__MutableSymbolTable;
  __pyx_vtable_6fstlib_4cext_9pywrapfst__MutableSymbolTable.__pyx_base = *__pyx_vtabptr_6fstlib_4cext_9pywrapfst_SymbolTableView;
  __pyx_vtable_6fstlib_4cext_9pywrapfst__MutableSymbolTable.__pyx_base._raw = (fst::SymbolTable const *(*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *))__pyx_f_6fstlib_4cext_9pywrapfst_19_MutableSymbolTable__raw;
  __pyx_vtable_6fstlib_4cext_9pywrapfst__MutableSymbolTable._mutable_raw = (fst::SymbolTable *(*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableSymbolTable *))__pyx_f_6fstlib_4cext_9pywrapfst_19_MutableSymbolTable__mutable_raw;
  __pyx_vtable_6fstlib_4cext_9pywrapfst__MutableSymbolTable._mutable_raw_ptr_or_raise = (fst::SymbolTable *(*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableSymbolTable *))__pyx_f_6fstlib_4cext_9pywrapfst_19_MutableSymbolTable__mutable_raw_ptr_or_raise;
  __pyx_vtable_6fstlib_4cext_9pywrapfst__MutableSymbolTable.add_symbol = (int64 (*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableSymbolTable *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_19_MutableSymbolTable_add_symbol *__pyx_optional_args))__pyx_f_6fstlib_4cext_9pywrapfst_19_MutableSymbolTable_add_symbol;
  __pyx_vtable_6fstlib_4cext_9pywrapfst__MutableSymbolTable.add_table = (void (*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableSymbolTable *, struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *, int __pyx_skip_dispatch))__pyx_f_6fstlib_4cext_9pywrapfst_19_MutableSymbolTable_add_table;
  __pyx_vtable_6fstlib_4cext_9pywrapfst__MutableSymbolTable.set_name = (void (*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableSymbolTable *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6fstlib_4cext_9pywrapfst_19_MutableSymbolTable_set_name;
  __pyx_type_6fstlib_4cext_9pywrapfst__MutableSymbolTable.tp_base = __pyx_ptype_6fstlib_4cext_9pywrapfst_SymbolTableView;
  if (PyType_Ready(&__pyx_type_6fstlib_4cext_9pywrapfst__MutableSymbolTable) < 0) __PYX_ERR(0, 982, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_6fstlib_4cext_9pywrapfst__MutableSymbolTable.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6fstlib_4cext_9pywrapfst__MutableSymbolTable.tp_dictoffset && __pyx_type_6fstlib_4cext_9pywrapfst__MutableSymbolTable.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_6fstlib_4cext_9pywrapfst__MutableSymbolTable.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_6fstlib_4cext_9pywrapfst__MutableSymbolTable.tp_dict, __pyx_vtabptr_6fstlib_4cext_9pywrapfst__MutableSymbolTable) < 0) __PYX_ERR(0, 982, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_MutableSymbolTable, (PyObject *)&__pyx_type_6fstlib_4cext_9pywrapfst__MutableSymbolTable) < 0) __PYX_ERR(0, 982, __pyx_L1_error)
  __pyx_ptype_6fstlib_4cext_9pywrapfst__MutableSymbolTable = &__pyx_type_6fstlib_4cext_9pywrapfst__MutableSymbolTable;
  __pyx_vtabptr_6fstlib_4cext_9pywrapfst__MutableFstSymbolTableView = &__pyx_vtable_6fstlib_4cext_9pywrapfst__MutableFstSymbolTableView;
  __pyx_vtable_6fstlib_4cext_9pywrapfst__MutableFstSymbolTableView.__pyx_base = *__pyx_vtabptr_6fstlib_4cext_9pywrapfst__MutableSymbolTable;
  __pyx_vtable_6fstlib_4cext_9pywrapfst__MutableFstSymbolTableView.__pyx_base._mutable_raw = (fst::SymbolTable *(*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableSymbolTable *))__pyx_f_6fstlib_4cext_9pywrapfst_26_MutableFstSymbolTableView__mutable_raw;
  __pyx_type_6fstlib_4cext_9pywrapfst__MutableFstSymbolTableView.tp_base = __pyx_ptype_6fstlib_4cext_9pywrapfst__MutableSymbolTable;
  if (PyType_Ready(&__pyx_type_6fstlib_4cext_9pywrapfst__MutableFstSymbolTableView) < 0) __PYX_ERR(0, 1054, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_6fstlib_4cext_9pywrapfst__MutableFstSymbolTableView.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6fstlib_4cext_9pywrapfst__MutableFstSymbolTableView.tp_dictoffset && __pyx_type_6fstlib_4cext_9pywrapfst__MutableFstSymbolTableView.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_6fstlib_4cext_9pywrapfst__MutableFstSymbolTableView.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_6fstlib_4cext_9pywrapfst__MutableFstSymbolTableView.tp_dict, __pyx_vtabptr_6fstlib_4cext_9pywrapfst__MutableFstSymbolTableView) < 0) __PYX_ERR(0, 1054, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_MutableFstSymbolTableView, (PyObject *)&__pyx_type_6fstlib_4cext_9pywrapfst__MutableFstSymbolTableView) < 0) __PYX_ERR(0, 1054, __pyx_L1_error)
  __pyx_ptype_6fstlib_4cext_9pywrapfst__MutableFstSymbolTableView = &__pyx_type_6fstlib_4cext_9pywrapfst__MutableFstSymbolTableView;
  __pyx_vtabptr_6fstlib_4cext_9pywrapfst_SymbolTable = &__pyx_vtable_6fstlib_4cext_9pywrapfst_SymbolTable;
  __pyx_vtable_6fstlib_4cext_9pywrapfst_SymbolTable.__pyx_base = *__pyx_vtabptr_6fstlib_4cext_9pywrapfst__MutableSymbolTable;
  __pyx_vtable_6fstlib_4cext_9pywrapfst_SymbolTable.__pyx_base._mutable_raw = (fst::SymbolTable *(*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableSymbolTable *))__pyx_f_6fstlib_4cext_9pywrapfst_11SymbolTable__mutable_raw;
  __pyx_type_6fstlib_4cext_9pywrapfst_SymbolTable.tp_base = __pyx_ptype_6fstlib_4cext_9pywrapfst__MutableSymbolTable;
  if (PyType_Ready(&__pyx_type_6fstlib_4cext_9pywrapfst_SymbolTable) < 0) __PYX_ERR(0, 1069, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_6fstlib_4cext_9pywrapfst_SymbolTable.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6fstlib_4cext_9pywrapfst_SymbolTable.tp_dictoffset && __pyx_type_6fstlib_4cext_9pywrapfst_SymbolTable.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_6fstlib_4cext_9pywrapfst_SymbolTable.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_6fstlib_4cext_9pywrapfst_SymbolTable.tp_dict, __pyx_vtabptr_6fstlib_4cext_9pywrapfst_SymbolTable) < 0) __PYX_ERR(0, 1069, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_SymbolTable_2, (PyObject *)&__pyx_type_6fstlib_4cext_9pywrapfst_SymbolTable) < 0) __PYX_ERR(0, 1069, __pyx_L1_error)
  __pyx_ptype_6fstlib_4cext_9pywrapfst_SymbolTable = &__pyx_type_6fstlib_4cext_9pywrapfst_SymbolTable;
  if (PyType_Ready(&__pyx_type_6fstlib_4cext_9pywrapfst__SymbolTableIterator) < 0) __PYX_ERR(0, 1265, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_6fstlib_4cext_9pywrapfst__SymbolTableIterator.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6fstlib_4cext_9pywrapfst__SymbolTableIterator.tp_dictoffset && __pyx_type_6fstlib_4cext_9pywrapfst__SymbolTableIterator.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_6fstlib_4cext_9pywrapfst__SymbolTableIterator.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_SymbolTableIterator, (PyObject *)&__pyx_type_6fstlib_4cext_9pywrapfst__SymbolTableIterator) < 0) __PYX_ERR(0, 1265, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_6fstlib_4cext_9pywrapfst__SymbolTableIterator) < 0) __PYX_ERR(0, 1265, __pyx_L1_error)
  __pyx_ptype_6fstlib_4cext_9pywrapfst__SymbolTableIterator = &__pyx_type_6fstlib_4cext_9pywrapfst__SymbolTableIterator;
  __pyx_vtabptr_6fstlib_4cext_9pywrapfst_EncodeMapper = &__pyx_vtable_6fstlib_4cext_9pywrapfst_EncodeMapper;
  __pyx_vtable_6fstlib_4cext_9pywrapfst_EncodeMapper.arc_type = (std::string (*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *, int __pyx_skip_dispatch))__pyx_f_6fstlib_4cext_9pywrapfst_12EncodeMapper_arc_type;
  __pyx_vtable_6fstlib_4cext_9pywrapfst_EncodeMapper.weight_type = (std::string (*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *, int __pyx_skip_dispatch))__pyx_f_6fstlib_4cext_9pywrapfst_12EncodeMapper_weight_type;
  __pyx_vtable_6fstlib_4cext_9pywrapfst_EncodeMapper.flags = (uint8 (*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *, int __pyx_skip_dispatch))__pyx_f_6fstlib_4cext_9pywrapfst_12EncodeMapper_flags;
  __pyx_vtable_6fstlib_4cext_9pywrapfst_EncodeMapper.write = (void (*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6fstlib_4cext_9pywrapfst_12EncodeMapper_write;
  __pyx_vtable_6fstlib_4cext_9pywrapfst_EncodeMapper.write_to_string = (PyObject *(*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *, int __pyx_skip_dispatch))__pyx_f_6fstlib_4cext_9pywrapfst_12EncodeMapper_write_to_string;
  __pyx_vtable_6fstlib_4cext_9pywrapfst_EncodeMapper.input_symbols = (struct __pyx_obj_6fstlib_4cext_9pywrapfst__EncodeMapperSymbolTableView *(*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *, int __pyx_skip_dispatch))__pyx_f_6fstlib_4cext_9pywrapfst_12EncodeMapper_input_symbols;
  __pyx_vtable_6fstlib_4cext_9pywrapfst_EncodeMapper.output_symbols = (struct __pyx_obj_6fstlib_4cext_9pywrapfst__EncodeMapperSymbolTableView *(*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *, int __pyx_skip_dispatch))__pyx_f_6fstlib_4cext_9pywrapfst_12EncodeMapper_output_symbols;
  __pyx_vtable_6fstlib_4cext_9pywrapfst_EncodeMapper._set_input_symbols = (void (*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *, struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *))__pyx_f_6fstlib_4cext_9pywrapfst_12EncodeMapper__set_input_symbols;
  __pyx_vtable_6fstlib_4cext_9pywrapfst_EncodeMapper._set_output_symbols = (void (*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *, struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *))__pyx_f_6fstlib_4cext_9pywrapfst_12EncodeMapper__set_output_symbols;
  if (PyType_Ready(&__pyx_type_6fstlib_4cext_9pywrapfst_EncodeMapper) < 0) __PYX_ERR(0, 1297, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_6fstlib_4cext_9pywrapfst_EncodeMapper.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6fstlib_4cext_9pywrapfst_EncodeMapper.tp_dictoffset && __pyx_type_6fstlib_4cext_9pywrapfst_EncodeMapper.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_6fstlib_4cext_9pywrapfst_EncodeMapper.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_6fstlib_4cext_9pywrapfst_EncodeMapper, "__call__"); if (unlikely(!wrapper)) __PYX_ERR(0, 1297, __pyx_L1_error)
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_6fstlib_4cext_9pywrapfst_12EncodeMapper_4__call__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_6fstlib_4cext_9pywrapfst_12EncodeMapper_4__call__.doc = __pyx_doc_6fstlib_4cext_9pywrapfst_12EncodeMapper_4__call__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_6fstlib_4cext_9pywrapfst_12EncodeMapper_4__call__;
    }
  }
  #endif
  if (__Pyx_SetVtable(__pyx_type_6fstlib_4cext_9pywrapfst_EncodeMapper.tp_dict, __pyx_vtabptr_6fstlib_4cext_9pywrapfst_EncodeMapper) < 0) __PYX_ERR(0, 1297, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_EncodeMapper, (PyObject *)&__pyx_type_6fstlib_4cext_9pywrapfst_EncodeMapper) < 0) __PYX_ERR(0, 1297, __pyx_L1_error)
  __pyx_ptype_6fstlib_4cext_9pywrapfst_EncodeMapper = &__pyx_type_6fstlib_4cext_9pywrapfst_EncodeMapper;
  __pyx_vtabptr_6fstlib_4cext_9pywrapfst_Fst = &__pyx_vtable_6fstlib_4cext_9pywrapfst_Fst;
  __pyx_vtable_6fstlib_4cext_9pywrapfst_Fst._local_render_svg = (std::string (*)(std::string const &))__pyx_f_6fstlib_4cext_9pywrapfst_3Fst__local_render_svg;
  __pyx_vtable_6fstlib_4cext_9pywrapfst_Fst.arc_type = (std::string (*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *, int __pyx_skip_dispatch))__pyx_f_6fstlib_4cext_9pywrapfst_3Fst_arc_type;
  __pyx_vtable_6fstlib_4cext_9pywrapfst_Fst.arcs = (struct __pyx_obj_6fstlib_4cext_9pywrapfst__ArcIterator *(*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *, int64, int __pyx_skip_dispatch))__pyx_f_6fstlib_4cext_9pywrapfst_3Fst_arcs;
  __pyx_vtable_6fstlib_4cext_9pywrapfst_Fst.copy = (struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *(*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *, int __pyx_skip_dispatch))__pyx_f_6fstlib_4cext_9pywrapfst_3Fst_copy;
  __pyx_vtable_6fstlib_4cext_9pywrapfst_Fst.draw = (void (*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_3Fst_draw *__pyx_optional_args))__pyx_f_6fstlib_4cext_9pywrapfst_3Fst_draw;
  __pyx_vtable_6fstlib_4cext_9pywrapfst_Fst.final = (struct __pyx_obj_6fstlib_4cext_9pywrapfst_Weight *(*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *, int64, int __pyx_skip_dispatch))__pyx_f_6fstlib_4cext_9pywrapfst_3Fst_final;
  __pyx_vtable_6fstlib_4cext_9pywrapfst_Fst.fst_type = (std::string (*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *, int __pyx_skip_dispatch))__pyx_f_6fstlib_4cext_9pywrapfst_3Fst_fst_type;
  __pyx_vtable_6fstlib_4cext_9pywrapfst_Fst.input_symbols = (struct __pyx_obj_6fstlib_4cext_9pywrapfst__FstSymbolTableView *(*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *, int __pyx_skip_dispatch))__pyx_f_6fstlib_4cext_9pywrapfst_3Fst_input_symbols;
  __pyx_vtable_6fstlib_4cext_9pywrapfst_Fst.num_arcs = (size_t (*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *, int64, int __pyx_skip_dispatch))__pyx_f_6fstlib_4cext_9pywrapfst_3Fst_num_arcs;
  __pyx_vtable_6fstlib_4cext_9pywrapfst_Fst.num_input_epsilons = (size_t (*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *, int64, int __pyx_skip_dispatch))__pyx_f_6fstlib_4cext_9pywrapfst_3Fst_num_input_epsilons;
  __pyx_vtable_6fstlib_4cext_9pywrapfst_Fst.num_output_epsilons = (size_t (*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *, int64, int __pyx_skip_dispatch))__pyx_f_6fstlib_4cext_9pywrapfst_3Fst_num_output_epsilons;
  __pyx_vtable_6fstlib_4cext_9pywrapfst_Fst.output_symbols = (struct __pyx_obj_6fstlib_4cext_9pywrapfst__FstSymbolTableView *(*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *, int __pyx_skip_dispatch))__pyx_f_6fstlib_4cext_9pywrapfst_3Fst_output_symbols;
  __pyx_vtable_6fstlib_4cext_9pywrapfst_Fst.print = (std::string (*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *, int __pyx_skip_dispatch, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_3Fst_print *__pyx_optional_args))__pyx_f_6fstlib_4cext_9pywrapfst_3Fst_print;
  __pyx_vtable_6fstlib_4cext_9pywrapfst_Fst.start = (int64 (*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *, int __pyx_skip_dispatch))__pyx_f_6fstlib_4cext_9pywrapfst_3Fst_start;
  __pyx_vtable_6fstlib_4cext_9pywrapfst_Fst.states = (struct __pyx_obj_6fstlib_4cext_9pywrapfst__StateIterator *(*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *, int __pyx_skip_dispatch))__pyx_f_6fstlib_4cext_9pywrapfst_3Fst_states;
  __pyx_vtable_6fstlib_4cext_9pywrapfst_Fst.verify = (bool (*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *, int __pyx_skip_dispatch))__pyx_f_6fstlib_4cext_9pywrapfst_3Fst_verify;
  __pyx_vtable_6fstlib_4cext_9pywrapfst_Fst.weight_type = (std::string (*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *, int __pyx_skip_dispatch))__pyx_f_6fstlib_4cext_9pywrapfst_3Fst_weight_type;
  __pyx_vtable_6fstlib_4cext_9pywrapfst_Fst.write = (void (*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6fstlib_4cext_9pywrapfst_3Fst_write;
  __pyx_vtable_6fstlib_4cext_9pywrapfst_Fst.write_to_string = (PyObject *(*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *, int __pyx_skip_dispatch))__pyx_f_6fstlib_4cext_9pywrapfst_3Fst_write_to_string;
  if (PyType_Ready(&__pyx_type_6fstlib_4cext_9pywrapfst_Fst) < 0) __PYX_ERR(0, 1564, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_6fstlib_4cext_9pywrapfst_Fst.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6fstlib_4cext_9pywrapfst_Fst.tp_dictoffset && __pyx_type_6fstlib_4cext_9pywrapfst_Fst.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_6fstlib_4cext_9pywrapfst_Fst.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_6fstlib_4cext_9pywrapfst_Fst.tp_dict, __pyx_vtabptr_6fstlib_4cext_9pywrapfst_Fst) < 0) __PYX_ERR(0, 1564, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Fst, (PyObject *)&__pyx_type_6fstlib_4cext_9pywrapfst_Fst) < 0) __PYX_ERR(0, 1564, __pyx_L1_error)
  __pyx_ptype_6fstlib_4cext_9pywrapfst_Fst = &__pyx_type_6fstlib_4cext_9pywrapfst_Fst;
  __pyx_vtabptr_6fstlib_4cext_9pywrapfst_MutableFst = &__pyx_vtable_6fstlib_4cext_9pywrapfst_MutableFst;
  __pyx_vtable_6fstlib_4cext_9pywrapfst_MutableFst.__pyx_base = *__pyx_vtabptr_6fstlib_4cext_9pywrapfst_Fst;
  __pyx_vtable_6fstlib_4cext_9pywrapfst_MutableFst._check_mutating_imethod = (void (*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *))__pyx_f_6fstlib_4cext_9pywrapfst_10MutableFst__check_mutating_imethod;
  __pyx_vtable_6fstlib_4cext_9pywrapfst_MutableFst._add_arc = (void (*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *, int64, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Arc *))__pyx_f_6fstlib_4cext_9pywrapfst_10MutableFst__add_arc;
  __pyx_vtable_6fstlib_4cext_9pywrapfst_MutableFst.add_state = (int64 (*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *, int __pyx_skip_dispatch))__pyx_f_6fstlib_4cext_9pywrapfst_10MutableFst_add_state;
  __pyx_vtable_6fstlib_4cext_9pywrapfst_MutableFst.add_states = (void (*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *, size_t, int __pyx_skip_dispatch))__pyx_f_6fstlib_4cext_9pywrapfst_10MutableFst_add_states;
  __pyx_vtable_6fstlib_4cext_9pywrapfst_MutableFst._arcsort = (void (*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_10MutableFst__arcsort *__pyx_optional_args))__pyx_f_6fstlib_4cext_9pywrapfst_10MutableFst__arcsort;
  __pyx_vtable_6fstlib_4cext_9pywrapfst_MutableFst._closure = (void (*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_10MutableFst__closure *__pyx_optional_args))__pyx_f_6fstlib_4cext_9pywrapfst_10MutableFst__closure;
  __pyx_vtable_6fstlib_4cext_9pywrapfst_MutableFst._concat = (void (*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *))__pyx_f_6fstlib_4cext_9pywrapfst_10MutableFst__concat;
  __pyx_vtable_6fstlib_4cext_9pywrapfst_MutableFst._connect = (void (*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *))__pyx_f_6fstlib_4cext_9pywrapfst_10MutableFst__connect;
  __pyx_vtable_6fstlib_4cext_9pywrapfst_MutableFst._decode = (void (*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *, struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *))__pyx_f_6fstlib_4cext_9pywrapfst_10MutableFst__decode;
  __pyx_vtable_6fstlib_4cext_9pywrapfst_MutableFst._delete_arcs = (void (*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *, int64, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_10MutableFst__delete_arcs *__pyx_optional_args))__pyx_f_6fstlib_4cext_9pywrapfst_10MutableFst__delete_arcs;
  __pyx_vtable_6fstlib_4cext_9pywrapfst_MutableFst._delete_states = (void (*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_10MutableFst__delete_states *__pyx_optional_args))__pyx_f_6fstlib_4cext_9pywrapfst_10MutableFst__delete_states;
  __pyx_vtable_6fstlib_4cext_9pywrapfst_MutableFst._encode = (void (*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *, struct __pyx_obj_6fstlib_4cext_9pywrapfst_EncodeMapper *))__pyx_f_6fstlib_4cext_9pywrapfst_10MutableFst__encode;
  __pyx_vtable_6fstlib_4cext_9pywrapfst_MutableFst._invert = (void (*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *))__pyx_f_6fstlib_4cext_9pywrapfst_10MutableFst__invert;
  __pyx_vtable_6fstlib_4cext_9pywrapfst_MutableFst._minimize = (void (*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_10MutableFst__minimize *__pyx_optional_args))__pyx_f_6fstlib_4cext_9pywrapfst_10MutableFst__minimize;
  __pyx_vtable_6fstlib_4cext_9pywrapfst_MutableFst.mutable_arcs = (struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableArcIterator *(*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *, int64, int __pyx_skip_dispatch))__pyx_f_6fstlib_4cext_9pywrapfst_10MutableFst_mutable_arcs;
  __pyx_vtable_6fstlib_4cext_9pywrapfst_MutableFst.num_states = (int64 (*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *, int __pyx_skip_dispatch))__pyx_f_6fstlib_4cext_9pywrapfst_10MutableFst_num_states;
  __pyx_vtable_6fstlib_4cext_9pywrapfst_MutableFst._project = (void (*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *, PyObject *))__pyx_f_6fstlib_4cext_9pywrapfst_10MutableFst__project;
  __pyx_vtable_6fstlib_4cext_9pywrapfst_MutableFst._prune = (void (*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_10MutableFst__prune *__pyx_optional_args))__pyx_f_6fstlib_4cext_9pywrapfst_10MutableFst__prune;
  __pyx_vtable_6fstlib_4cext_9pywrapfst_MutableFst._push = (void (*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_10MutableFst__push *__pyx_optional_args))__pyx_f_6fstlib_4cext_9pywrapfst_10MutableFst__push;
  __pyx_vtable_6fstlib_4cext_9pywrapfst_MutableFst._relabel_pairs = (void (*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_10MutableFst__relabel_pairs *__pyx_optional_args))__pyx_f_6fstlib_4cext_9pywrapfst_10MutableFst__relabel_pairs;
  __pyx_vtable_6fstlib_4cext_9pywrapfst_MutableFst._relabel_tables = (void (*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_10MutableFst__relabel_tables *__pyx_optional_args))__pyx_f_6fstlib_4cext_9pywrapfst_10MutableFst__relabel_tables;
  __pyx_vtable_6fstlib_4cext_9pywrapfst_MutableFst._reserve_arcs = (void (*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *, int64, size_t))__pyx_f_6fstlib_4cext_9pywrapfst_10MutableFst__reserve_arcs;
  __pyx_vtable_6fstlib_4cext_9pywrapfst_MutableFst._reserve_states = (void (*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *, int64))__pyx_f_6fstlib_4cext_9pywrapfst_10MutableFst__reserve_states;
  __pyx_vtable_6fstlib_4cext_9pywrapfst_MutableFst._reweight = (void (*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *, PyObject *, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_10MutableFst__reweight *__pyx_optional_args))__pyx_f_6fstlib_4cext_9pywrapfst_10MutableFst__reweight;
  __pyx_vtable_6fstlib_4cext_9pywrapfst_MutableFst._rmepsilon = (void (*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_10MutableFst__rmepsilon *__pyx_optional_args))__pyx_f_6fstlib_4cext_9pywrapfst_10MutableFst__rmepsilon;
  __pyx_vtable_6fstlib_4cext_9pywrapfst_MutableFst._set_final = (void (*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *, int64, struct __pyx_opt_args_6fstlib_4cext_9pywrapfst_10MutableFst__set_final *__pyx_optional_args))__pyx_f_6fstlib_4cext_9pywrapfst_10MutableFst__set_final;
  __pyx_vtable_6fstlib_4cext_9pywrapfst_MutableFst._set_start = (void (*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *, int64))__pyx_f_6fstlib_4cext_9pywrapfst_10MutableFst__set_start;
  __pyx_vtable_6fstlib_4cext_9pywrapfst_MutableFst._set_input_symbols = (void (*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *, struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *))__pyx_f_6fstlib_4cext_9pywrapfst_10MutableFst__set_input_symbols;
  __pyx_vtable_6fstlib_4cext_9pywrapfst_MutableFst._set_output_symbols = (void (*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *, struct __pyx_obj_6fstlib_4cext_9pywrapfst_SymbolTableView *))__pyx_f_6fstlib_4cext_9pywrapfst_10MutableFst__set_output_symbols;
  __pyx_vtable_6fstlib_4cext_9pywrapfst_MutableFst._topsort = (void (*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_MutableFst *))__pyx_f_6fstlib_4cext_9pywrapfst_10MutableFst__topsort;
  __pyx_type_6fstlib_4cext_9pywrapfst_MutableFst.tp_base = __pyx_ptype_6fstlib_4cext_9pywrapfst_Fst;
  if (PyType_Ready(&__pyx_type_6fstlib_4cext_9pywrapfst_MutableFst) < 0) __PYX_ERR(0, 2029, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_6fstlib_4cext_9pywrapfst_MutableFst.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6fstlib_4cext_9pywrapfst_MutableFst.tp_dictoffset && __pyx_type_6fstlib_4cext_9pywrapfst_MutableFst.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_6fstlib_4cext_9pywrapfst_MutableFst.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_6fstlib_4cext_9pywrapfst_MutableFst.tp_dict, __pyx_vtabptr_6fstlib_4cext_9pywrapfst_MutableFst) < 0) __PYX_ERR(0, 2029, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_MutableFst, (PyObject *)&__pyx_type_6fstlib_4cext_9pywrapfst_MutableFst) < 0) __PYX_ERR(0, 2029, __pyx_L1_error)
  __pyx_ptype_6fstlib_4cext_9pywrapfst_MutableFst = &__pyx_type_6fstlib_4cext_9pywrapfst_MutableFst;
  __pyx_vtabptr_6fstlib_4cext_9pywrapfst_VectorFst = &__pyx_vtable_6fstlib_4cext_9pywrapfst_VectorFst;
  __pyx_vtable_6fstlib_4cext_9pywrapfst_VectorFst.__pyx_base = *__pyx_vtabptr_6fstlib_4cext_9pywrapfst_MutableFst;
  __pyx_type_6fstlib_4cext_9pywrapfst_VectorFst.tp_base = __pyx_ptype_6fstlib_4cext_9pywrapfst_MutableFst;
  if (PyType_Ready(&__pyx_type_6fstlib_4cext_9pywrapfst_VectorFst) < 0) __PYX_ERR(0, 2891, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_6fstlib_4cext_9pywrapfst_VectorFst.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6fstlib_4cext_9pywrapfst_VectorFst.tp_dictoffset && __pyx_type_6fstlib_4cext_9pywrapfst_VectorFst.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_6fstlib_4cext_9pywrapfst_VectorFst.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_6fstlib_4cext_9pywrapfst_VectorFst.tp_dict, __pyx_vtabptr_6fstlib_4cext_9pywrapfst_VectorFst) < 0) __PYX_ERR(0, 2891, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_VectorFst, (PyObject *)&__pyx_type_6fstlib_4cext_9pywrapfst_VectorFst) < 0) __PYX_ERR(0, 2891, __pyx_L1_error)
  __pyx_ptype_6fstlib_4cext_9pywrapfst_VectorFst = &__pyx_type_6fstlib_4cext_9pywrapfst_VectorFst;
  __pyx_vtabptr_6fstlib_4cext_9pywrapfst_Arc = &__pyx_vtable_6fstlib_4cext_9pywrapfst_Arc;
  __pyx_vtable_6fstlib_4cext_9pywrapfst_Arc.copy = (struct __pyx_obj_6fstlib_4cext_9pywrapfst_Arc *(*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Arc *, int __pyx_skip_dispatch))__pyx_f_6fstlib_4cext_9pywrapfst_3Arc_copy;
  if (PyType_Ready(&__pyx_type_6fstlib_4cext_9pywrapfst_Arc) < 0) __PYX_ERR(0, 3074, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_6fstlib_4cext_9pywrapfst_Arc.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6fstlib_4cext_9pywrapfst_Arc.tp_dictoffset && __pyx_type_6fstlib_4cext_9pywrapfst_Arc.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_6fstlib_4cext_9pywrapfst_Arc.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_6fstlib_4cext_9pywrapfst_Arc.tp_dict, __pyx_vtabptr_6fstlib_4cext_9pywrapfst_Arc) < 0) __PYX_ERR(0, 3074, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Arc, (PyObject *)&__pyx_type_6fstlib_4cext_9pywrapfst_Arc) < 0) __PYX_ERR(0, 3074, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_6fstlib_4cext_9pywrapfst_Arc) < 0) __PYX_ERR(0, 3074, __pyx_L1_error)
  __pyx_ptype_6fstlib_4cext_9pywrapfst_Arc = &__pyx_type_6fstlib_4cext_9pywrapfst_Arc;
  __pyx_vtabptr_6fstlib_4cext_9pywrapfst__ArcIterator = &__pyx_vtable_6fstlib_4cext_9pywrapfst__ArcIterator;
  __pyx_vtable_6fstlib_4cext_9pywrapfst__ArcIterator.done = (bool (*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst__ArcIterator *, int __pyx_skip_dispatch))__pyx_f_6fstlib_4cext_9pywrapfst_12_ArcIterator_done;
  __pyx_vtable_6fstlib_4cext_9pywrapfst__ArcIterator.flags = (uint8 (*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst__ArcIterator *, int __pyx_skip_dispatch))__pyx_f_6fstlib_4cext_9pywrapfst_12_ArcIterator_flags;
  __pyx_vtable_6fstlib_4cext_9pywrapfst__ArcIterator.next = (void (*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst__ArcIterator *, int __pyx_skip_dispatch))__pyx_f_6fstlib_4cext_9pywrapfst_12_ArcIterator_next;
  __pyx_vtable_6fstlib_4cext_9pywrapfst__ArcIterator.position = (size_t (*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst__ArcIterator *, int __pyx_skip_dispatch))__pyx_f_6fstlib_4cext_9pywrapfst_12_ArcIterator_position;
  __pyx_vtable_6fstlib_4cext_9pywrapfst__ArcIterator.reset = (void (*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst__ArcIterator *, int __pyx_skip_dispatch))__pyx_f_6fstlib_4cext_9pywrapfst_12_ArcIterator_reset;
  __pyx_vtable_6fstlib_4cext_9pywrapfst__ArcIterator.seek = (void (*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst__ArcIterator *, size_t, int __pyx_skip_dispatch))__pyx_f_6fstlib_4cext_9pywrapfst_12_ArcIterator_seek;
  __pyx_vtable_6fstlib_4cext_9pywrapfst__ArcIterator.set_flags = (void (*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst__ArcIterator *, uint8, uint8, int __pyx_skip_dispatch))__pyx_f_6fstlib_4cext_9pywrapfst_12_ArcIterator_set_flags;
  __pyx_vtable_6fstlib_4cext_9pywrapfst__ArcIterator.value = (PyObject *(*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst__ArcIterator *, int __pyx_skip_dispatch))__pyx_f_6fstlib_4cext_9pywrapfst_12_ArcIterator_value;
  if (PyType_Ready(&__pyx_type_6fstlib_4cext_9pywrapfst__ArcIterator) < 0) __PYX_ERR(0, 3144, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_6fstlib_4cext_9pywrapfst__ArcIterator.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6fstlib_4cext_9pywrapfst__ArcIterator.tp_dictoffset && __pyx_type_6fstlib_4cext_9pywrapfst__ArcIterator.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_6fstlib_4cext_9pywrapfst__ArcIterator.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_6fstlib_4cext_9pywrapfst__ArcIterator.tp_dict, __pyx_vtabptr_6fstlib_4cext_9pywrapfst__ArcIterator) < 0) __PYX_ERR(0, 3144, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ArcIterator, (PyObject *)&__pyx_type_6fstlib_4cext_9pywrapfst__ArcIterator) < 0) __PYX_ERR(0, 3144, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_6fstlib_4cext_9pywrapfst__ArcIterator) < 0) __PYX_ERR(0, 3144, __pyx_L1_error)
  __pyx_ptype_6fstlib_4cext_9pywrapfst__ArcIterator = &__pyx_type_6fstlib_4cext_9pywrapfst__ArcIterator;
  __pyx_vtabptr_6fstlib_4cext_9pywrapfst__MutableArcIterator = &__pyx_vtable_6fstlib_4cext_9pywrapfst__MutableArcIterator;
  __pyx_vtable_6fstlib_4cext_9pywrapfst__MutableArcIterator.done = (bool (*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableArcIterator *, int __pyx_skip_dispatch))__pyx_f_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_done;
  __pyx_vtable_6fstlib_4cext_9pywrapfst__MutableArcIterator.flags = (uint8 (*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableArcIterator *, int __pyx_skip_dispatch))__pyx_f_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_flags;
  __pyx_vtable_6fstlib_4cext_9pywrapfst__MutableArcIterator.next = (void (*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableArcIterator *, int __pyx_skip_dispatch))__pyx_f_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_next;
  __pyx_vtable_6fstlib_4cext_9pywrapfst__MutableArcIterator.position = (size_t (*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableArcIterator *, int __pyx_skip_dispatch))__pyx_f_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_position;
  __pyx_vtable_6fstlib_4cext_9pywrapfst__MutableArcIterator.reset = (void (*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableArcIterator *, int __pyx_skip_dispatch))__pyx_f_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_reset;
  __pyx_vtable_6fstlib_4cext_9pywrapfst__MutableArcIterator.seek = (void (*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableArcIterator *, size_t, int __pyx_skip_dispatch))__pyx_f_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_seek;
  __pyx_vtable_6fstlib_4cext_9pywrapfst__MutableArcIterator.set_flags = (void (*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableArcIterator *, uint8, uint8, int __pyx_skip_dispatch))__pyx_f_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_set_flags;
  __pyx_vtable_6fstlib_4cext_9pywrapfst__MutableArcIterator.set_value = (void (*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableArcIterator *, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Arc *, int __pyx_skip_dispatch))__pyx_f_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_set_value;
  __pyx_vtable_6fstlib_4cext_9pywrapfst__MutableArcIterator.value = (PyObject *(*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst__MutableArcIterator *, int __pyx_skip_dispatch))__pyx_f_6fstlib_4cext_9pywrapfst_19_MutableArcIterator_value;
  if (PyType_Ready(&__pyx_type_6fstlib_4cext_9pywrapfst__MutableArcIterator) < 0) __PYX_ERR(0, 3255, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_6fstlib_4cext_9pywrapfst__MutableArcIterator.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6fstlib_4cext_9pywrapfst__MutableArcIterator.tp_dictoffset && __pyx_type_6fstlib_4cext_9pywrapfst__MutableArcIterator.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_6fstlib_4cext_9pywrapfst__MutableArcIterator.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_6fstlib_4cext_9pywrapfst__MutableArcIterator.tp_dict, __pyx_vtabptr_6fstlib_4cext_9pywrapfst__MutableArcIterator) < 0) __PYX_ERR(0, 3255, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_MutableArcIterator, (PyObject *)&__pyx_type_6fstlib_4cext_9pywrapfst__MutableArcIterator) < 0) __PYX_ERR(0, 3255, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_6fstlib_4cext_9pywrapfst__MutableArcIterator) < 0) __PYX_ERR(0, 3255, __pyx_L1_error)
  __pyx_ptype_6fstlib_4cext_9pywrapfst__MutableArcIterator = &__pyx_type_6fstlib_4cext_9pywrapfst__MutableArcIterator;
  __pyx_vtabptr_6fstlib_4cext_9pywrapfst__StateIterator = &__pyx_vtable_6fstlib_4cext_9pywrapfst__StateIterator;
  __pyx_vtable_6fstlib_4cext_9pywrapfst__StateIterator.done = (bool (*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst__StateIterator *, int __pyx_skip_dispatch))__pyx_f_6fstlib_4cext_9pywrapfst_14_StateIterator_done;
  __pyx_vtable_6fstlib_4cext_9pywrapfst__StateIterator.next = (void (*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst__StateIterator *, int __pyx_skip_dispatch))__pyx_f_6fstlib_4cext_9pywrapfst_14_StateIterator_next;
  __pyx_vtable_6fstlib_4cext_9pywrapfst__StateIterator.reset = (void (*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst__StateIterator *, int __pyx_skip_dispatch))__pyx_f_6fstlib_4cext_9pywrapfst_14_StateIterator_reset;
  __pyx_vtable_6fstlib_4cext_9pywrapfst__StateIterator.value = (int64 (*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst__StateIterator *, int __pyx_skip_dispatch))__pyx_f_6fstlib_4cext_9pywrapfst_14_StateIterator_value;
  if (PyType_Ready(&__pyx_type_6fstlib_4cext_9pywrapfst__StateIterator) < 0) __PYX_ERR(0, 3383, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_6fstlib_4cext_9pywrapfst__StateIterator.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6fstlib_4cext_9pywrapfst__StateIterator.tp_dictoffset && __pyx_type_6fstlib_4cext_9pywrapfst__StateIterator.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_6fstlib_4cext_9pywrapfst__StateIterator.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_6fstlib_4cext_9pywrapfst__StateIterator.tp_dict, __pyx_vtabptr_6fstlib_4cext_9pywrapfst__StateIterator) < 0) __PYX_ERR(0, 3383, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_StateIterator, (PyObject *)&__pyx_type_6fstlib_4cext_9pywrapfst__StateIterator) < 0) __PYX_ERR(0, 3383, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_6fstlib_4cext_9pywrapfst__StateIterator) < 0) __PYX_ERR(0, 3383, __pyx_L1_error)
  __pyx_ptype_6fstlib_4cext_9pywrapfst__StateIterator = &__pyx_type_6fstlib_4cext_9pywrapfst__StateIterator;
  __pyx_vtabptr_6fstlib_4cext_9pywrapfst_Compiler = &__pyx_vtable_6fstlib_4cext_9pywrapfst_Compiler;
  __pyx_vtable_6fstlib_4cext_9pywrapfst_Compiler.compile = (struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *(*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Compiler *, int __pyx_skip_dispatch))__pyx_f_6fstlib_4cext_9pywrapfst_8Compiler_compile;
  __pyx_vtable_6fstlib_4cext_9pywrapfst_Compiler.write = (void (*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_Compiler *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6fstlib_4cext_9pywrapfst_8Compiler_write;
  if (PyType_Ready(&__pyx_type_6fstlib_4cext_9pywrapfst_Compiler) < 0) __PYX_ERR(0, 4293, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_6fstlib_4cext_9pywrapfst_Compiler.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6fstlib_4cext_9pywrapfst_Compiler.tp_dictoffset && __pyx_type_6fstlib_4cext_9pywrapfst_Compiler.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_6fstlib_4cext_9pywrapfst_Compiler.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_6fstlib_4cext_9pywrapfst_Compiler.tp_dict, __pyx_vtabptr_6fstlib_4cext_9pywrapfst_Compiler) < 0) __PYX_ERR(0, 4293, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Compiler, (PyObject *)&__pyx_type_6fstlib_4cext_9pywrapfst_Compiler) < 0) __PYX_ERR(0, 4293, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_6fstlib_4cext_9pywrapfst_Compiler) < 0) __PYX_ERR(0, 4293, __pyx_L1_error)
  __pyx_ptype_6fstlib_4cext_9pywrapfst_Compiler = &__pyx_type_6fstlib_4cext_9pywrapfst_Compiler;
  __pyx_vtabptr_6fstlib_4cext_9pywrapfst_FarReader = &__pyx_vtable_6fstlib_4cext_9pywrapfst_FarReader;
  __pyx_vtable_6fstlib_4cext_9pywrapfst_FarReader.arc_type = (std::string (*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarReader *, int __pyx_skip_dispatch))__pyx_f_6fstlib_4cext_9pywrapfst_9FarReader_arc_type;
  __pyx_vtable_6fstlib_4cext_9pywrapfst_FarReader.done = (bool (*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarReader *, int __pyx_skip_dispatch))__pyx_f_6fstlib_4cext_9pywrapfst_9FarReader_done;
  __pyx_vtable_6fstlib_4cext_9pywrapfst_FarReader.error = (bool (*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarReader *, int __pyx_skip_dispatch))__pyx_f_6fstlib_4cext_9pywrapfst_9FarReader_error;
  __pyx_vtable_6fstlib_4cext_9pywrapfst_FarReader.far_type = (std::string (*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarReader *, int __pyx_skip_dispatch))__pyx_f_6fstlib_4cext_9pywrapfst_9FarReader_far_type;
  __pyx_vtable_6fstlib_4cext_9pywrapfst_FarReader.find = (bool (*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarReader *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6fstlib_4cext_9pywrapfst_9FarReader_find;
  __pyx_vtable_6fstlib_4cext_9pywrapfst_FarReader.get_fst = (struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *(*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarReader *, int __pyx_skip_dispatch))__pyx_f_6fstlib_4cext_9pywrapfst_9FarReader_get_fst;
  __pyx_vtable_6fstlib_4cext_9pywrapfst_FarReader.get_key = (std::string (*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarReader *, int __pyx_skip_dispatch))__pyx_f_6fstlib_4cext_9pywrapfst_9FarReader_get_key;
  __pyx_vtable_6fstlib_4cext_9pywrapfst_FarReader.next = (void (*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarReader *, int __pyx_skip_dispatch))__pyx_f_6fstlib_4cext_9pywrapfst_9FarReader_next;
  __pyx_vtable_6fstlib_4cext_9pywrapfst_FarReader.reset = (void (*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarReader *, int __pyx_skip_dispatch))__pyx_f_6fstlib_4cext_9pywrapfst_9FarReader_reset;
  if (PyType_Ready(&__pyx_type_6fstlib_4cext_9pywrapfst_FarReader) < 0) __PYX_ERR(0, 4430, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_6fstlib_4cext_9pywrapfst_FarReader.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6fstlib_4cext_9pywrapfst_FarReader.tp_dictoffset && __pyx_type_6fstlib_4cext_9pywrapfst_FarReader.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_6fstlib_4cext_9pywrapfst_FarReader.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_6fstlib_4cext_9pywrapfst_FarReader.tp_dict, __pyx_vtabptr_6fstlib_4cext_9pywrapfst_FarReader) < 0) __PYX_ERR(0, 4430, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_FarReader, (PyObject *)&__pyx_type_6fstlib_4cext_9pywrapfst_FarReader) < 0) __PYX_ERR(0, 4430, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_6fstlib_4cext_9pywrapfst_FarReader) < 0) __PYX_ERR(0, 4430, __pyx_L1_error)
  __pyx_ptype_6fstlib_4cext_9pywrapfst_FarReader = &__pyx_type_6fstlib_4cext_9pywrapfst_FarReader;
  __pyx_vtabptr_6fstlib_4cext_9pywrapfst_FarWriter = &__pyx_vtable_6fstlib_4cext_9pywrapfst_FarWriter;
  __pyx_vtable_6fstlib_4cext_9pywrapfst_FarWriter.arc_type = (std::string (*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarWriter *, int __pyx_skip_dispatch))__pyx_f_6fstlib_4cext_9pywrapfst_9FarWriter_arc_type;
  __pyx_vtable_6fstlib_4cext_9pywrapfst_FarWriter.close = (void (*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarWriter *))__pyx_f_6fstlib_4cext_9pywrapfst_9FarWriter_close;
  __pyx_vtable_6fstlib_4cext_9pywrapfst_FarWriter.add = (void (*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarWriter *, PyObject *, struct __pyx_obj_6fstlib_4cext_9pywrapfst_Fst *, int __pyx_skip_dispatch))__pyx_f_6fstlib_4cext_9pywrapfst_9FarWriter_add;
  __pyx_vtable_6fstlib_4cext_9pywrapfst_FarWriter.error = (bool (*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarWriter *, int __pyx_skip_dispatch))__pyx_f_6fstlib_4cext_9pywrapfst_9FarWriter_error;
  __pyx_vtable_6fstlib_4cext_9pywrapfst_FarWriter.far_type = (std::string (*)(struct __pyx_obj_6fstlib_4cext_9pywrapfst_FarWriter *, int __pyx_skip_dispatch))__pyx_f_6fstlib_4cext_9pywrapfst_9FarWriter_far_type;
  if (PyType_Ready(&__pyx_type_6fstlib_4cext_9pywrapfst_FarWriter) < 0) __PYX_ERR(0, 4585, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_6fstlib_4cext_9pywrapfst_FarWriter.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6fstlib_4cext_9pywrapfst_FarWriter.tp_dictoffset && __pyx_type_6fstlib_4cext_9pywrapfst_FarWriter.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_6fstlib_4cext_9pywrapfst_FarWriter.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_6fstlib_4cext_9pywrapfst_FarWriter.tp_dict, __pyx_vtabptr_6fstlib_4cext_9pywrapfst_FarWriter) < 0) __PYX_ERR(0, 4585, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_FarWriter, (PyObject *)&__pyx_type_6fstlib_4cext_9pywrapfst_FarWriter) < 0) __PYX_ERR(0, 4585, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_6fstlib_4cext_9pywrapfst_FarWriter) < 0) __PYX_ERR(0, 4585, __pyx_L1_error)
  __pyx_ptype_6fstlib_4cext_9pywrapfst_FarWriter = &__pyx_type_6fstlib_4cext_9pywrapfst_FarWriter;
  if (PyType_Ready(&__pyx_type_6fstlib_4cext_9pywrapfst___pyx_scope_struct____iter__) < 0) __PYX_ERR(0, 3275, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_6fstlib_4cext_9pywrapfst___pyx_scope_struct____iter__.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6fstlib_4cext_9pywrapfst___pyx_scope_struct____iter__.tp_dictoffset && __pyx_type_6fstlib_4cext_9pywrapfst___pyx_scope_struct____iter__.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_6fstlib_4cext_9pywrapfst___pyx_scope_struct____iter__.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_6fstlib_4cext_9pywrapfst___pyx_scope_struct____iter__ = &__pyx_type_6fstlib_4cext_9pywrapfst___pyx_scope_struct____iter__;
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_type_import_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
  /*--- Type import code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_variable_import_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
  /*--- Variable import code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_function_import_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
  /*--- Function import code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}


#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 initpywrapfst(void) CYTHON_SMALL_CODE; /*proto*/
__Pyx_PyMODINIT_FUNC initpywrapfst(void)
#else
__Pyx_PyMODINIT_FUNC PyInit_pywrapfst(void) CYTHON_SMALL_CODE; /*proto*/
__Pyx_PyMODINIT_FUNC PyInit_pywrapfst(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;
}
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) {
    PyObject *value = PyObject_GetAttrString(spec, from_name);
    int result = 0;
    if (likely(value)) {
        if (allow_none || value != Py_None) {
            result = PyDict_SetItemString(moddict, to_name, value);
        }
        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, CYTHON_UNUSED PyModuleDef *def) {
    PyObject *module = NULL, *moddict, *modname;
    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;
    moddict = PyModule_GetDict(module);
    if (unlikely(!moddict)) goto bad;
    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_pywrapfst(PyObject *__pyx_pyinit_module)
#endif
#endif
{
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  if (__pyx_m) {
    if (__pyx_m == __pyx_pyinit_module) return 0;
    PyErr_SetString(PyExc_RuntimeError, "Module 'pywrapfst' 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
  #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_pywrapfst(void)", 0);
  if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 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(0, 1, __pyx_L1_error)
  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
  #ifdef __Pyx_CyFunction_USED
  if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_FusedFunction_USED
  if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_Coroutine_USED
  if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_Generator_USED
  if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_AsyncGen_USED
  if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_StopAsyncIteration_USED
  if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  /*--- Library function declarations ---*/
  /*--- Threads initialization code ---*/
  #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
  PyEval_InitThreads();
  #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("pywrapfst", __pyx_methods, __pyx_k_Python_interface_to_the_FST_scri, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
  #else
  __pyx_m = PyModule_Create(&__pyx_moduledef);
  #endif
  if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
  Py_INCREF(__pyx_d);
  __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
  Py_INCREF(__pyx_b);
  __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
  Py_INCREF(__pyx_cython_runtime);
  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  /*--- Initialize various global constants etc. ---*/
  if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
  if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  if (__pyx_module_is_main_fstlib__cext__pywrapfst) {
    if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  }
  #if PY_MAJOR_VERSION >= 3
  {
    PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
    if (!PyDict_GetItemString(modules, "fstlib.cext.pywrapfst")) {
      if (unlikely(PyDict_SetItemString(modules, "fstlib.cext.pywrapfst", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
    }
  }
  #endif
  /*--- Builtin init code ---*/
  if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Constants init code ---*/
  if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Global type/function init code ---*/
  (void)__Pyx_modinit_global_init_code();
  (void)__Pyx_modinit_variable_export_code();
  if (unlikely(__Pyx_modinit_function_export_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
  if (unlikely(__Pyx_modinit_type_init_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
  (void)__Pyx_modinit_type_import_code();
  (void)__Pyx_modinit_variable_import_code();
  (void)__Pyx_modinit_function_import_code();
  /*--- Execution code ---*/
  #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
  if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif

  /* "fstlib/cext/pywrapfst.pyx":100
 * 
 * # Python imports.
 * import logging             # <<<<<<<<<<<<<<
 * import enum
 * import numbers
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_logging, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 100, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_logging, __pyx_t_1) < 0) __PYX_ERR(0, 100, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "fstlib/cext/pywrapfst.pyx":101
 * # Python imports.
 * import logging
 * import enum             # <<<<<<<<<<<<<<
 * import numbers
 * import os
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_enum, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 101, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_enum, __pyx_t_1) < 0) __PYX_ERR(0, 101, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "fstlib/cext/pywrapfst.pyx":102
 * import logging
 * import enum
 * import numbers             # <<<<<<<<<<<<<<
 * import os
 * import subprocess
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_numbers, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 102, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_numbers, __pyx_t_1) < 0) __PYX_ERR(0, 102, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "fstlib/cext/pywrapfst.pyx":103
 * import enum
 * import numbers
 * import os             # <<<<<<<<<<<<<<
 * import subprocess
 * import sys
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_os, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 103, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_os, __pyx_t_1) < 0) __PYX_ERR(0, 103, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "fstlib/cext/pywrapfst.pyx":104
 * import numbers
 * import os
 * import subprocess             # <<<<<<<<<<<<<<
 * import sys
 * 
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_subprocess, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 104, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_subprocess, __pyx_t_1) < 0) __PYX_ERR(0, 104, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "fstlib/cext/pywrapfst.pyx":105
 * import os
 * import subprocess
 * import sys             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 105, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_1) < 0) __PYX_ERR(0, 105, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "fstlib/cext/pywrapfst.pyx":112
 * # These defintions only ensure that these are defined to avoid attribute errors,
 * # but don't actually contain the type definitions. Those are in pywrapfst.pyi.
 * import typing             # <<<<<<<<<<<<<<
 * 
 * ArcMapType = """typing.Literal["identity", "input_epsilon", "invert",
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_typing, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 112, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_typing, __pyx_t_1) < 0) __PYX_ERR(0, 112, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "fstlib/cext/pywrapfst.pyx":114
 * import typing
 * 
 * ArcMapType = """typing.Literal["identity", "input_epsilon", "invert",             # <<<<<<<<<<<<<<
 *                                "output_epsilon", "plus", "power", "quantize",
 *                                "rmweight", "superfinal", "times", "to_log",
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ArcMapType, __pyx_kp_u_typing_Literal_identity_input_ep) < 0) __PYX_ERR(0, 114, __pyx_L1_error)

  /* "fstlib/cext/pywrapfst.pyx":119
 *                                # NOTE: Both spellings of "to_std"
 *                                "to_log64", "to_std", "to_standard"]"""
 * ComposeFilter = """typing.Literal["alt_sequence", "auto", "match", "no_match",             # <<<<<<<<<<<<<<
 *                            "null", "sequence", "trivial"]"""
 * DeterminizeType = """typing.Literal["functional", "nonfunctional",
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ComposeFilter, __pyx_kp_u_typing_Literal_alt_sequence_auto) < 0) __PYX_ERR(0, 119, __pyx_L1_error)

  /* "fstlib/cext/pywrapfst.pyx":121
 * ComposeFilter = """typing.Literal["alt_sequence", "auto", "match", "no_match",
 *                            "null", "sequence", "trivial"]"""
 * DeterminizeType = """typing.Literal["functional", "nonfunctional",             # <<<<<<<<<<<<<<
 *                                     "disambiguate"]"""
 * DrawFloatFormat = """typing.Literal["e", "f", "g"]"""
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_DeterminizeType, __pyx_kp_u_typing_Literal_functional_nonfun) < 0) __PYX_ERR(0, 121, __pyx_L1_error)

  /* "fstlib/cext/pywrapfst.pyx":123
 * DeterminizeType = """typing.Literal["functional", "nonfunctional",
 *                                     "disambiguate"]"""
 * DrawFloatFormat = """typing.Literal["e", "f", "g"]"""             # <<<<<<<<<<<<<<
 * FarType = """typing.Literal[
 *   "fst",
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_DrawFloatFormat, __pyx_kp_u_typing_Literal_e_f_g) < 0) __PYX_ERR(0, 123, __pyx_L1_error)

  /* "fstlib/cext/pywrapfst.pyx":124
 *                                     "disambiguate"]"""
 * DrawFloatFormat = """typing.Literal["e", "f", "g"]"""
 * FarType = """typing.Literal[             # <<<<<<<<<<<<<<
 *   "fst",
 *   "stlist",
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FarType, __pyx_kp_u_typing_Literal_fst_stlist_sttabl) < 0) __PYX_ERR(0, 124, __pyx_L1_error)

  /* "fstlib/cext/pywrapfst.pyx":130
 *   "default"
 * ]"""
 * ProjectType = """typing.Literal["input", "output"]"""             # <<<<<<<<<<<<<<
 * QueueType = """typing.Literal["auto", "fifo", "lifo", "shortest", "state",
 *                               "top"]"""
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ProjectType, __pyx_kp_u_typing_Literal_input_output) < 0) __PYX_ERR(0, 130, __pyx_L1_error)

  /* "fstlib/cext/pywrapfst.pyx":131
 * ]"""
 * ProjectType = """typing.Literal["input", "output"]"""
 * QueueType = """typing.Literal["auto", "fifo", "lifo", "shortest", "state",             # <<<<<<<<<<<<<<
 *                               "top"]"""
 * RandArcSelection = """typing.Literal["uniform", "log_prob", "fast_log_prob"]"""
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_QueueType, __pyx_kp_u_typing_Literal_auto_fifo_lifo_sh) < 0) __PYX_ERR(0, 131, __pyx_L1_error)

  /* "fstlib/cext/pywrapfst.pyx":133
 * QueueType = """typing.Literal["auto", "fifo", "lifo", "shortest", "state",
 *                               "top"]"""
 * RandArcSelection = """typing.Literal["uniform", "log_prob", "fast_log_prob"]"""             # <<<<<<<<<<<<<<
 * ReplaceLabelType = """typing.Literal["neither", "input", "output", "both"]"""
 * SortType = """typing.Literal["ilabel", "olabel"]"""
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_RandArcSelection, __pyx_kp_u_typing_Literal_uniform_log_prob) < 0) __PYX_ERR(0, 133, __pyx_L1_error)

  /* "fstlib/cext/pywrapfst.pyx":134
 *                               "top"]"""
 * RandArcSelection = """typing.Literal["uniform", "log_prob", "fast_log_prob"]"""
 * ReplaceLabelType = """typing.Literal["neither", "input", "output", "both"]"""             # <<<<<<<<<<<<<<
 * SortType = """typing.Literal["ilabel", "olabel"]"""
 * StateMapType = """typing.Literal["arc_sum", "arc_unique", "identity"]"""
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ReplaceLabelType, __pyx_kp_u_typing_Literal_neither_input_out) < 0) __PYX_ERR(0, 134, __pyx_L1_error)

  /* "fstlib/cext/pywrapfst.pyx":135
 * RandArcSelection = """typing.Literal["uniform", "log_prob", "fast_log_prob"]"""
 * ReplaceLabelType = """typing.Literal["neither", "input", "output", "both"]"""
 * SortType = """typing.Literal["ilabel", "olabel"]"""             # <<<<<<<<<<<<<<
 * StateMapType = """typing.Literal["arc_sum", "arc_unique", "identity"]"""
 * 
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_SortType, __pyx_kp_u_typing_Literal_ilabel_olabel) < 0) __PYX_ERR(0, 135, __pyx_L1_error)

  /* "fstlib/cext/pywrapfst.pyx":136
 * ReplaceLabelType = """typing.Literal["neither", "input", "output", "both"]"""
 * SortType = """typing.Literal["ilabel", "olabel"]"""
 * StateMapType = """typing.Literal["arc_sum", "arc_unique", "identity"]"""             # <<<<<<<<<<<<<<
 * 
 * WeightLike = "typing.Union[Weight, typing.Union[str, int, float]]"
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_StateMapType, __pyx_kp_u_typing_Literal_arc_sum_arc_uniqu) < 0) __PYX_ERR(0, 136, __pyx_L1_error)

  /* "fstlib/cext/pywrapfst.pyx":138
 * StateMapType = """typing.Literal["arc_sum", "arc_unique", "identity"]"""
 * 
 * WeightLike = "typing.Union[Weight, typing.Union[str, int, float]]"             # <<<<<<<<<<<<<<
 * 
 * ## Custom exceptions.
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_WeightLike, __pyx_kp_u_typing_Union_Weight_typing_Union) < 0) __PYX_ERR(0, 138, __pyx_L1_error)

  /* "fstlib/cext/pywrapfst.pyx":143
 * 
 * 
 * class FstError(Exception):             # <<<<<<<<<<<<<<
 * 
 *   pass
 */
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 143, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
  __Pyx_GIVEREF(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 143, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_FstError, __pyx_n_s_FstError, (PyObject *) NULL, __pyx_n_s_fstlib_cext_pywrapfst, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 143, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_FstError, __pyx_t_1, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 143, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FstError, __pyx_t_4) < 0) __PYX_ERR(0, 143, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "fstlib/cext/pywrapfst.pyx":148
 * 
 * 
 * class FstArgError(FstError, ValueError):             # <<<<<<<<<<<<<<
 * 
 *   pass
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_FstError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_INCREF(__pyx_builtin_ValueError);
  __Pyx_GIVEREF(__pyx_builtin_ValueError);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_builtin_ValueError);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_FstArgError, __pyx_n_s_FstArgError, (PyObject *) NULL, __pyx_n_s_fstlib_cext_pywrapfst, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_FstArgError, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FstArgError, __pyx_t_4) < 0) __PYX_ERR(0, 148, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "fstlib/cext/pywrapfst.pyx":153
 * 
 * 
 * class FstBadWeightError(FstError, ValueError):             # <<<<<<<<<<<<<<
 * 
 *   pass
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FstError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 153, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 153, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __Pyx_INCREF(__pyx_builtin_ValueError);
  __Pyx_GIVEREF(__pyx_builtin_ValueError);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_builtin_ValueError);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 153, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_FstBadWeightError, __pyx_n_s_FstBadWeightError, (PyObject *) NULL, __pyx_n_s_fstlib_cext_pywrapfst, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 153, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_FstBadWeightError, __pyx_t_1, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 153, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FstBadWeightError, __pyx_t_4) < 0) __PYX_ERR(0, 153, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "fstlib/cext/pywrapfst.pyx":158
 * 
 * 
 * class FstIndexError(FstError, IndexError):             # <<<<<<<<<<<<<<
 * 
 *   pass
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_FstError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 158, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 158, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_INCREF(__pyx_builtin_IndexError);
  __Pyx_GIVEREF(__pyx_builtin_IndexError);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_builtin_IndexError);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 158, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_FstIndexError, __pyx_n_s_FstIndexError, (PyObject *) NULL, __pyx_n_s_fstlib_cext_pywrapfst, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 158, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_FstIndexError, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 158, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FstIndexError, __pyx_t_4) < 0) __PYX_ERR(0, 158, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "fstlib/cext/pywrapfst.pyx":163
 * 
 * 
 * class FstIOError(FstError, IOError):             # <<<<<<<<<<<<<<
 * 
 *   pass
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FstError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 163, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 163, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __Pyx_INCREF(__pyx_builtin_IOError);
  __Pyx_GIVEREF(__pyx_builtin_IOError);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_builtin_IOError);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 163, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_FstIOError, __pyx_n_s_FstIOError, (PyObject *) NULL, __pyx_n_s_fstlib_cext_pywrapfst, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 163, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_FstIOError, __pyx_t_1, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 163, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FstIOError, __pyx_t_4) < 0) __PYX_ERR(0, 163, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "fstlib/cext/pywrapfst.pyx":168
 * 
 * 
 * class FstOpError(FstError, RuntimeError):             # <<<<<<<<<<<<<<
 * 
 *   pass
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_FstError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 168, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 168, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_INCREF(__pyx_builtin_RuntimeError);
  __Pyx_GIVEREF(__pyx_builtin_RuntimeError);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_builtin_RuntimeError);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 168, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_FstOpError, __pyx_n_s_FstOpError, (PyObject *) NULL, __pyx_n_s_fstlib_cext_pywrapfst, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 168, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_FstOpError, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 168, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FstOpError, __pyx_t_4) < 0) __PYX_ERR(0, 168, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "fstlib/cext/pywrapfst.pyx":462
 * 
 *   @classmethod
 *   def zero(cls, weight_type):             # <<<<<<<<<<<<<<
 *     """
 *     Weight.zero(weight_type)
 */
  __Pyx_GetNameInClass(__pyx_t_2, (PyObject *)__pyx_ptype_6fstlib_4cext_9pywrapfst_Weight, __pyx_n_s_zero); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 462, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "fstlib/cext/pywrapfst.pyx":461
 *   # C++ part out-of-class and then call it from within.
 * 
 *   @classmethod             # <<<<<<<<<<<<<<
 *   def zero(cls, weight_type):
 *     """
 */
  __pyx_t_1 = __Pyx_Method_ClassMethod(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 461, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6fstlib_4cext_9pywrapfst_Weight->tp_dict, __pyx_n_s_zero, __pyx_t_1) < 0) __PYX_ERR(0, 462, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_6fstlib_4cext_9pywrapfst_Weight);

  /* "fstlib/cext/pywrapfst.pyx":471
 * 
 *   @classmethod
 *   def one(cls, weight_type):             # <<<<<<<<<<<<<<
 *     """
 *     Weight.one(weight_type)
 */
  __Pyx_GetNameInClass(__pyx_t_1, (PyObject *)__pyx_ptype_6fstlib_4cext_9pywrapfst_Weight, __pyx_n_s_one); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 471, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "fstlib/cext/pywrapfst.pyx":470
 *     return _zero(weight_type)
 * 
 *   @classmethod             # <<<<<<<<<<<<<<
 *   def one(cls, weight_type):
 *     """
 */
  __pyx_t_2 = __Pyx_Method_ClassMethod(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 470, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6fstlib_4cext_9pywrapfst_Weight->tp_dict, __pyx_n_s_one, __pyx_t_2) < 0) __PYX_ERR(0, 471, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_6fstlib_4cext_9pywrapfst_Weight);

  /* "fstlib/cext/pywrapfst.pyx":480
 * 
 *   @classmethod
 *   def no_weight(cls, weight_type):             # <<<<<<<<<<<<<<
 *     """
 *     Weight.no_weight(weight_type)
 */
  __Pyx_GetNameInClass(__pyx_t_2, (PyObject *)__pyx_ptype_6fstlib_4cext_9pywrapfst_Weight, __pyx_n_s_no_weight); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 480, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "fstlib/cext/pywrapfst.pyx":479
 *     return _one(weight_type)
 * 
 *   @classmethod             # <<<<<<<<<<<<<<
 *   def no_weight(cls, weight_type):
 *     """
 */
  __pyx_t_1 = __Pyx_Method_ClassMethod(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 479, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6fstlib_4cext_9pywrapfst_Weight->tp_dict, __pyx_n_s_no_weight, __pyx_t_1) < 0) __PYX_ERR(0, 480, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_6fstlib_4cext_9pywrapfst_Weight);

  /* "fstlib/cext/pywrapfst.pyx":515
 * 
 * 
 * def plus(Weight lhs, Weight rhs):             # <<<<<<<<<<<<<<
 *   """
 *   plus(lhs, rhs)
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6fstlib_4cext_9pywrapfst_1plus, NULL, __pyx_n_s_fstlib_cext_pywrapfst); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 515, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_plus, __pyx_t_1) < 0) __PYX_ERR(0, 515, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "fstlib/cext/pywrapfst.pyx":547
 * 
 * 
 * def times(Weight lhs, Weight rhs):             # <<<<<<<<<<<<<<
 *   """
 *   times(lhs, rhs)
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6fstlib_4cext_9pywrapfst_3times, NULL, __pyx_n_s_fstlib_cext_pywrapfst); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 547, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_times, __pyx_t_1) < 0) __PYX_ERR(0, 547, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "fstlib/cext/pywrapfst.pyx":579
 * 
 * 
 * def divide(Weight lhs, Weight rhs):             # <<<<<<<<<<<<<<
 *   """
 *   divide(lhs, rhs)
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6fstlib_4cext_9pywrapfst_5divide, NULL, __pyx_n_s_fstlib_cext_pywrapfst); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 579, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_divide, __pyx_t_1) < 0) __PYX_ERR(0, 579, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "fstlib/cext/pywrapfst.pyx":612
 * 
 * 
 * def power(Weight w, size_t n):             # <<<<<<<<<<<<<<
 *   """
 *   power(lhs, rhs)
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6fstlib_4cext_9pywrapfst_7power, NULL, __pyx_n_s_fstlib_cext_pywrapfst); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 612, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_power, __pyx_t_1) < 0) __PYX_ERR(0, 612, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "fstlib/cext/pywrapfst.pyx":1011
 *     return mutable_raw
 * 
 *   cpdef int64 add_symbol(self, symbol, int64 key=fst.kNoSymbol) except *:             # <<<<<<<<<<<<<<
 *     """
 *     add_symbol(self, symbol, key=NO_SYMBOL)
 */
  __pyx_k__6 = fst::kNoSymbol;
  __pyx_k__6 = fst::kNoSymbol;

  /* "fstlib/cext/pywrapfst.pyx":1096
 * 
 *   @classmethod
 *   def read(cls, source):             # <<<<<<<<<<<<<<
 *     """
 *     SymbolTable.read(source)
 */
  __Pyx_GetNameInClass(__pyx_t_1, (PyObject *)__pyx_ptype_6fstlib_4cext_9pywrapfst_SymbolTable, __pyx_n_s_read); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1096, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "fstlib/cext/pywrapfst.pyx":1095
 *     return self._smart_table.get()
 * 
 *   @classmethod             # <<<<<<<<<<<<<<
 *   def read(cls, source):
 *     """
 */
  __pyx_t_2 = __Pyx_Method_ClassMethod(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1095, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6fstlib_4cext_9pywrapfst_SymbolTable->tp_dict, __pyx_n_s_read, __pyx_t_2) < 0) __PYX_ERR(0, 1096, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_6fstlib_4cext_9pywrapfst_SymbolTable);

  /* "fstlib/cext/pywrapfst.pyx":1117
 * 
 *   @classmethod
 *   def read_text(cls, source, bool allow_negative_labels=False):             # <<<<<<<<<<<<<<
 *     """
 *     SymbolTable.read_text(source)
 */
  __Pyx_GetNameInClass(__pyx_t_2, (PyObject *)__pyx_ptype_6fstlib_4cext_9pywrapfst_SymbolTable, __pyx_n_s_read_text); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "fstlib/cext/pywrapfst.pyx":1116
 *     return _init_SymbolTable(move(_symbols))
 * 
 *   @classmethod             # <<<<<<<<<<<<<<
 *   def read_text(cls, source, bool allow_negative_labels=False):
 *     """
 */
  __pyx_t_1 = __Pyx_Method_ClassMethod(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1116, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6fstlib_4cext_9pywrapfst_SymbolTable->tp_dict, __pyx_n_s_read_text, __pyx_t_1) < 0) __PYX_ERR(0, 1117, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_6fstlib_4cext_9pywrapfst_SymbolTable);

  /* "fstlib/cext/pywrapfst.pyx":1143
 * 
 *   @classmethod
 *   def read_fst(cls, source, bool input_table):             # <<<<<<<<<<<<<<
 *     """
 *     SymbolTable.read_fst(source, input_table)
 */
  __Pyx_GetNameInClass(__pyx_t_1, (PyObject *)__pyx_ptype_6fstlib_4cext_9pywrapfst_SymbolTable, __pyx_n_s_read_fst); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1143, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "fstlib/cext/pywrapfst.pyx":1142
 *     return _init_SymbolTable(move(_symbols))
 * 
 *   @classmethod             # <<<<<<<<<<<<<<
 *   def read_fst(cls, source, bool input_table):
 *     """
 */
  __pyx_t_2 = __Pyx_Method_ClassMethod(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1142, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6fstlib_4cext_9pywrapfst_SymbolTable->tp_dict, __pyx_n_s_read_fst, __pyx_t_2) < 0) __PYX_ERR(0, 1143, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_6fstlib_4cext_9pywrapfst_SymbolTable);

  /* "fstlib/cext/pywrapfst.pyx":1400
 * 
 *   @classmethod
 *   def read(cls, source):             # <<<<<<<<<<<<<<
 *     """
 *     EncodeMapper.read(source)
 */
  __Pyx_GetNameInClass(__pyx_t_2, (PyObject *)__pyx_ptype_6fstlib_4cext_9pywrapfst_EncodeMapper, __pyx_n_s_read); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1400, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "fstlib/cext/pywrapfst.pyx":1399
 *     return FstProperties(self._mapper.get().Properties(mask.value))
 * 
 *   @classmethod             # <<<<<<<<<<<<<<
 *   def read(cls, source):
 *     """
 */
  __pyx_t_1 = __Pyx_Method_ClassMethod(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1399, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6fstlib_4cext_9pywrapfst_EncodeMapper->tp_dict, __pyx_n_s_read, __pyx_t_1) < 0) __PYX_ERR(0, 1400, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_6fstlib_4cext_9pywrapfst_EncodeMapper);

  /* "fstlib/cext/pywrapfst.pyx":1422
 * 
 *   @staticmethod
 *   def read_from_string(state):             # <<<<<<<<<<<<<<
 *     """
 *     read_from_string(state)
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6fstlib_4cext_9pywrapfst_12EncodeMapper_19read_from_string, NULL, __pyx_n_s_fstlib_cext_pywrapfst); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1422, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6fstlib_4cext_9pywrapfst_EncodeMapper->tp_dict, __pyx_n_s_read_from_string, __pyx_t_1) < 0) __PYX_ERR(0, 1422, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_6fstlib_4cext_9pywrapfst_EncodeMapper);

  /* "fstlib/cext/pywrapfst.pyx":1421
 *     return _init_EncodeMapper(_mapper.release())
 * 
 *   @staticmethod             # <<<<<<<<<<<<<<
 *   def read_from_string(state):
 *     """
 */
  __Pyx_GetNameInClass(__pyx_t_1, (PyObject *)__pyx_ptype_6fstlib_4cext_9pywrapfst_EncodeMapper, __pyx_n_s_read_from_string); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1422, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1421, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6fstlib_4cext_9pywrapfst_EncodeMapper->tp_dict, __pyx_n_s_read_from_string, __pyx_t_2) < 0) __PYX_ERR(0, 1422, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_6fstlib_4cext_9pywrapfst_EncodeMapper);

  /* "fstlib/cext/pywrapfst.pyx":1918
 * 
 *   @classmethod
 *   def read(cls, source):             # <<<<<<<<<<<<<<
 *     """
 *     read(source)
 */
  __Pyx_GetNameInClass(__pyx_t_2, (PyObject *)__pyx_ptype_6fstlib_4cext_9pywrapfst_Fst, __pyx_n_s_read); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1918, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "fstlib/cext/pywrapfst.pyx":1917
 *     return FstProperties(self._fst.get().Properties(mask.value, test))
 * 
 *   @classmethod             # <<<<<<<<<<<<<<
 *   def read(cls, source):
 *     """
 */
  __pyx_t_1 = __Pyx_Method_ClassMethod(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1917, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6fstlib_4cext_9pywrapfst_Fst->tp_dict, __pyx_n_s_read, __pyx_t_1) < 0) __PYX_ERR(0, 1918, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_6fstlib_4cext_9pywrapfst_Fst);

  /* "fstlib/cext/pywrapfst.pyx":1936
 * 
 *   @classmethod
 *   def read_from_string(cls, state):             # <<<<<<<<<<<<<<
 *     """
 *     read_from_string(state)
 */
  __Pyx_GetNameInClass(__pyx_t_1, (PyObject *)__pyx_ptype_6fstlib_4cext_9pywrapfst_Fst, __pyx_n_s_read_from_string); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1936, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "fstlib/cext/pywrapfst.pyx":1935
 *     return _read_Fst(source)
 * 
 *   @classmethod             # <<<<<<<<<<<<<<
 *   def read_from_string(cls, state):
 *     """
 */
  __pyx_t_2 = __Pyx_Method_ClassMethod(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1935, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6fstlib_4cext_9pywrapfst_Fst->tp_dict, __pyx_n_s_read_from_string, __pyx_t_2) < 0) __PYX_ERR(0, 1936, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_6fstlib_4cext_9pywrapfst_Fst);

  /* "fstlib/cext/pywrapfst.pyx":2309
 * 
 *   cdef void _minimize(self,
 *                       float delta=fst.kShortestDelta,             # <<<<<<<<<<<<<<
 *                       bool allow_nondet=False) except *:
 *     # This runs in-place when the second argument is null.
 */
  __pyx_k__12 = fst::kShortestDelta;

  /* "fstlib/cext/pywrapfst.pyx":2315
 *     self._check_mutating_imethod()
 * 
 *   def minimize(self, float delta=fst.kShortestDelta, bool allow_nondet=False):             # <<<<<<<<<<<<<<
 *     """
 *     minimize(self, delta=1e-6, allow_nondet=False)
 */
  __pyx_k__13 = fst::kShortestDelta;

  /* "fstlib/cext/pywrapfst.pyx":2410
 * 
 *   cdef void _prune(self,
 *                    float delta=fst.kDelta,             # <<<<<<<<<<<<<<
 *                    int64 nstate=fst.kNoStateId,
 *                    weight=None) except *:
 */
  __pyx_k__14 = fst::kDelta;

  /* "fstlib/cext/pywrapfst.pyx":2411
 *   cdef void _prune(self,
 *                    float delta=fst.kDelta,
 *                    int64 nstate=fst.kNoStateId,             # <<<<<<<<<<<<<<
 *                    weight=None) except *:
 *     # Threshold is set to semiring Zero (no pruning) if no weight is specified.
 */
  __pyx_k__15 = fst::kNoStateId;

  /* "fstlib/cext/pywrapfst.pyx":2420
 * 
 *   def prune(self,
 *             float delta=fst.kDelta,             # <<<<<<<<<<<<<<
 *             int64 nstate=fst.kNoStateId,
 *             weight=None):
 */
  __pyx_k__16 = fst::kDelta;

  /* "fstlib/cext/pywrapfst.pyx":2421
 *   def prune(self,
 *             float delta=fst.kDelta,
 *             int64 nstate=fst.kNoStateId,             # <<<<<<<<<<<<<<
 *             weight=None):
 *     """
 */
  __pyx_k__17 = fst::kNoStateId;

  /* "fstlib/cext/pywrapfst.pyx":2446
 * 
 *   cdef void _push(self,
 *                   float delta=fst.kShortestDelta,             # <<<<<<<<<<<<<<
 *                   bool remove_total_weight=False,
 *                   bool to_final=False):
 */
  __pyx_k__18 = fst::kShortestDelta;

  /* "fstlib/cext/pywrapfst.pyx":2455
 * 
 *   def push(self,
 *            float delta=fst.kShortestDelta,             # <<<<<<<<<<<<<<
 *            bool remove_total_weight=False,
 *            bool to_final=False):
 */
  __pyx_k__19 = fst::kShortestDelta;

  /* "fstlib/cext/pywrapfst.pyx":2686
 *                        bool connect=True,
 *                        weight=None,
 *                        int64 nstate=fst.kNoStateId,             # <<<<<<<<<<<<<<
 *                        float delta=fst.kShortestDelta) except *:
 *     cdef fst.WeightClass _weight = _get_WeightClass_or_zero(self.weight_type(),
 */
  __pyx_k__20 = fst::kNoStateId;

  /* "fstlib/cext/pywrapfst.pyx":2687
 *                        weight=None,
 *                        int64 nstate=fst.kNoStateId,
 *                        float delta=fst.kShortestDelta) except *:             # <<<<<<<<<<<<<<
 *     cdef fst.WeightClass _weight = _get_WeightClass_or_zero(self.weight_type(),
 *                                                             weight)
 */
  __pyx_k__21 = fst::kShortestDelta;

  /* "fstlib/cext/pywrapfst.pyx":2704
 *                 bool connect=True,
 *                 weight=None,
 *                 int64 nstate=fst.kNoStateId,             # <<<<<<<<<<<<<<
 *                 float delta=fst.kShortestDelta):
 *     """
 */
  __pyx_k__22 = fst::kNoStateId;

  /* "fstlib/cext/pywrapfst.pyx":2705
 *                 weight=None,
 *                 int64 nstate=fst.kNoStateId,
 *                 float delta=fst.kShortestDelta):             # <<<<<<<<<<<<<<
 *     """
 *     rmepsilon(self, queue_type="auto", connect=True, weight=None,
 */
  __pyx_k__23 = fst::kShortestDelta;

  /* "fstlib/cext/pywrapfst.pyx":2977
 * 
 * 
 * NO_LABEL = fst.kNoLabel             # <<<<<<<<<<<<<<
 * NO_STATE_ID = fst.kNoStateId
 * NO_SYMBOL = fst.kNoSymbol
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(fst::kNoLabel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2977, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_NO_LABEL, __pyx_t_2) < 0) __PYX_ERR(0, 2977, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "fstlib/cext/pywrapfst.pyx":2978
 * 
 * NO_LABEL = fst.kNoLabel
 * NO_STATE_ID = fst.kNoStateId             # <<<<<<<<<<<<<<
 * NO_SYMBOL = fst.kNoSymbol
 * 
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(fst::kNoStateId); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2978, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_NO_STATE_ID, __pyx_t_2) < 0) __PYX_ERR(0, 2978, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "fstlib/cext/pywrapfst.pyx":2979
 * NO_LABEL = fst.kNoLabel
 * NO_STATE_ID = fst.kNoStateId
 * NO_SYMBOL = fst.kNoSymbol             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_PyInt_From_int64_t(fst::kNoSymbol); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2979, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_NO_SYMBOL, __pyx_t_2) < 0) __PYX_ERR(0, 2979, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "fstlib/cext/pywrapfst.pyx":2984
 * ## FST properties.
 * 
 * class FstProperties(enum.Flag):             # <<<<<<<<<<<<<<
 *   EXPANDED = fst.kExpanded
 *   MUTABLE = fst.kMutable
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_enum); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2984, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_Flag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2984, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2984, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2984, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_FstProperties, __pyx_n_s_FstProperties, (PyObject *) NULL, __pyx_n_s_fstlib_cext_pywrapfst, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2984, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "fstlib/cext/pywrapfst.pyx":2985
 * 
 * class FstProperties(enum.Flag):
 *   EXPANDED = fst.kExpanded             # <<<<<<<<<<<<<<
 *   MUTABLE = fst.kMutable
 *   ERROR = fst.kError
 */
  __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kExpanded); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2985, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_EXPANDED, __pyx_t_4) < 0) __PYX_ERR(0, 2985, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "fstlib/cext/pywrapfst.pyx":2986
 * class FstProperties(enum.Flag):
 *   EXPANDED = fst.kExpanded
 *   MUTABLE = fst.kMutable             # <<<<<<<<<<<<<<
 *   ERROR = fst.kError
 *   ACCEPTOR = fst.kAcceptor
 */
  __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kMutable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2986, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_MUTABLE, __pyx_t_4) < 0) __PYX_ERR(0, 2986, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "fstlib/cext/pywrapfst.pyx":2987
 *   EXPANDED = fst.kExpanded
 *   MUTABLE = fst.kMutable
 *   ERROR = fst.kError             # <<<<<<<<<<<<<<
 *   ACCEPTOR = fst.kAcceptor
 *   NOT_ACCEPTOR = fst.kNotAcceptor
 */
  __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2987, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_ERROR, __pyx_t_4) < 0) __PYX_ERR(0, 2987, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "fstlib/cext/pywrapfst.pyx":2988
 *   MUTABLE = fst.kMutable
 *   ERROR = fst.kError
 *   ACCEPTOR = fst.kAcceptor             # <<<<<<<<<<<<<<
 *   NOT_ACCEPTOR = fst.kNotAcceptor
 *   I_DETERMINISTIC = fst.kIDeterministic
 */
  __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kAcceptor); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2988, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_ACCEPTOR, __pyx_t_4) < 0) __PYX_ERR(0, 2988, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "fstlib/cext/pywrapfst.pyx":2989
 *   ERROR = fst.kError
 *   ACCEPTOR = fst.kAcceptor
 *   NOT_ACCEPTOR = fst.kNotAcceptor             # <<<<<<<<<<<<<<
 *   I_DETERMINISTIC = fst.kIDeterministic
 *   NON_I_DETERMINISTIC = fst.kNonIDeterministic
 */
  __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kNotAcceptor); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2989, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_NOT_ACCEPTOR, __pyx_t_4) < 0) __PYX_ERR(0, 2989, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "fstlib/cext/pywrapfst.pyx":2990
 *   ACCEPTOR = fst.kAcceptor
 *   NOT_ACCEPTOR = fst.kNotAcceptor
 *   I_DETERMINISTIC = fst.kIDeterministic             # <<<<<<<<<<<<<<
 *   NON_I_DETERMINISTIC = fst.kNonIDeterministic
 *   O_DETERMINISTIC = fst.kODeterministic
 */
  __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kIDeterministic); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2990, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_I_DETERMINISTIC, __pyx_t_4) < 0) __PYX_ERR(0, 2990, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "fstlib/cext/pywrapfst.pyx":2991
 *   NOT_ACCEPTOR = fst.kNotAcceptor
 *   I_DETERMINISTIC = fst.kIDeterministic
 *   NON_I_DETERMINISTIC = fst.kNonIDeterministic             # <<<<<<<<<<<<<<
 *   O_DETERMINISTIC = fst.kODeterministic
 *   NON_O_DETERMINISTIC = fst.kNonODeterministic
 */
  __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kNonIDeterministic); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2991, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_NON_I_DETERMINISTIC, __pyx_t_4) < 0) __PYX_ERR(0, 2991, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "fstlib/cext/pywrapfst.pyx":2992
 *   I_DETERMINISTIC = fst.kIDeterministic
 *   NON_I_DETERMINISTIC = fst.kNonIDeterministic
 *   O_DETERMINISTIC = fst.kODeterministic             # <<<<<<<<<<<<<<
 *   NON_O_DETERMINISTIC = fst.kNonODeterministic
 *   EPSILONS = fst.kEpsilons
 */
  __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kODeterministic); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2992, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_O_DETERMINISTIC, __pyx_t_4) < 0) __PYX_ERR(0, 2992, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "fstlib/cext/pywrapfst.pyx":2993
 *   NON_I_DETERMINISTIC = fst.kNonIDeterministic
 *   O_DETERMINISTIC = fst.kODeterministic
 *   NON_O_DETERMINISTIC = fst.kNonODeterministic             # <<<<<<<<<<<<<<
 *   EPSILONS = fst.kEpsilons
 *   NO_EPSILONS = fst.kNoEpsilons
 */
  __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kNonODeterministic); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2993, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_NON_O_DETERMINISTIC, __pyx_t_4) < 0) __PYX_ERR(0, 2993, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "fstlib/cext/pywrapfst.pyx":2994
 *   O_DETERMINISTIC = fst.kODeterministic
 *   NON_O_DETERMINISTIC = fst.kNonODeterministic
 *   EPSILONS = fst.kEpsilons             # <<<<<<<<<<<<<<
 *   NO_EPSILONS = fst.kNoEpsilons
 *   I_EPSILONS = fst.kIEpsilons
 */
  __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kEpsilons); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2994, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_EPSILONS, __pyx_t_4) < 0) __PYX_ERR(0, 2994, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "fstlib/cext/pywrapfst.pyx":2995
 *   NON_O_DETERMINISTIC = fst.kNonODeterministic
 *   EPSILONS = fst.kEpsilons
 *   NO_EPSILONS = fst.kNoEpsilons             # <<<<<<<<<<<<<<
 *   I_EPSILONS = fst.kIEpsilons
 *   NO_I_EPSILONS = fst.kNoIEpsilons
 */
  __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kNoEpsilons); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2995, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_NO_EPSILONS, __pyx_t_4) < 0) __PYX_ERR(0, 2995, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "fstlib/cext/pywrapfst.pyx":2996
 *   EPSILONS = fst.kEpsilons
 *   NO_EPSILONS = fst.kNoEpsilons
 *   I_EPSILONS = fst.kIEpsilons             # <<<<<<<<<<<<<<
 *   NO_I_EPSILONS = fst.kNoIEpsilons
 *   O_EPSILONS = fst.kOEpsilons
 */
  __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kIEpsilons); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2996, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_I_EPSILONS, __pyx_t_4) < 0) __PYX_ERR(0, 2996, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "fstlib/cext/pywrapfst.pyx":2997
 *   NO_EPSILONS = fst.kNoEpsilons
 *   I_EPSILONS = fst.kIEpsilons
 *   NO_I_EPSILONS = fst.kNoIEpsilons             # <<<<<<<<<<<<<<
 *   O_EPSILONS = fst.kOEpsilons
 *   NO_O_EPSILONS = fst.kNoOEpsilons
 */
  __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kNoIEpsilons); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2997, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_NO_I_EPSILONS, __pyx_t_4) < 0) __PYX_ERR(0, 2997, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "fstlib/cext/pywrapfst.pyx":2998
 *   I_EPSILONS = fst.kIEpsilons
 *   NO_I_EPSILONS = fst.kNoIEpsilons
 *   O_EPSILONS = fst.kOEpsilons             # <<<<<<<<<<<<<<
 *   NO_O_EPSILONS = fst.kNoOEpsilons
 *   I_LABEL_SORTED = fst.kILabelSorted
 */
  __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kOEpsilons); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2998, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_O_EPSILONS, __pyx_t_4) < 0) __PYX_ERR(0, 2998, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "fstlib/cext/pywrapfst.pyx":2999
 *   NO_I_EPSILONS = fst.kNoIEpsilons
 *   O_EPSILONS = fst.kOEpsilons
 *   NO_O_EPSILONS = fst.kNoOEpsilons             # <<<<<<<<<<<<<<
 *   I_LABEL_SORTED = fst.kILabelSorted
 *   NOT_I_LABEL_SORTED = fst.kNotILabelSorted
 */
  __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kNoOEpsilons); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2999, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_NO_O_EPSILONS, __pyx_t_4) < 0) __PYX_ERR(0, 2999, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "fstlib/cext/pywrapfst.pyx":3000
 *   O_EPSILONS = fst.kOEpsilons
 *   NO_O_EPSILONS = fst.kNoOEpsilons
 *   I_LABEL_SORTED = fst.kILabelSorted             # <<<<<<<<<<<<<<
 *   NOT_I_LABEL_SORTED = fst.kNotILabelSorted
 *   O_LABEL_SORTED = fst.kOLabelSorted
 */
  __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kILabelSorted); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3000, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_I_LABEL_SORTED, __pyx_t_4) < 0) __PYX_ERR(0, 3000, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "fstlib/cext/pywrapfst.pyx":3001
 *   NO_O_EPSILONS = fst.kNoOEpsilons
 *   I_LABEL_SORTED = fst.kILabelSorted
 *   NOT_I_LABEL_SORTED = fst.kNotILabelSorted             # <<<<<<<<<<<<<<
 *   O_LABEL_SORTED = fst.kOLabelSorted
 *   NOT_O_LABEL_SORTED = fst.kNotOLabelSorted
 */
  __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kNotILabelSorted); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3001, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_NOT_I_LABEL_SORTED, __pyx_t_4) < 0) __PYX_ERR(0, 3001, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "fstlib/cext/pywrapfst.pyx":3002
 *   I_LABEL_SORTED = fst.kILabelSorted
 *   NOT_I_LABEL_SORTED = fst.kNotILabelSorted
 *   O_LABEL_SORTED = fst.kOLabelSorted             # <<<<<<<<<<<<<<
 *   NOT_O_LABEL_SORTED = fst.kNotOLabelSorted
 *   WEIGHTED = fst.kWeighted
 */
  __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kOLabelSorted); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3002, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_O_LABEL_SORTED, __pyx_t_4) < 0) __PYX_ERR(0, 3002, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "fstlib/cext/pywrapfst.pyx":3003
 *   NOT_I_LABEL_SORTED = fst.kNotILabelSorted
 *   O_LABEL_SORTED = fst.kOLabelSorted
 *   NOT_O_LABEL_SORTED = fst.kNotOLabelSorted             # <<<<<<<<<<<<<<
 *   WEIGHTED = fst.kWeighted
 *   UNWEIGHTED = fst.kUnweighted
 */
  __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kNotOLabelSorted); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3003, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_NOT_O_LABEL_SORTED, __pyx_t_4) < 0) __PYX_ERR(0, 3003, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "fstlib/cext/pywrapfst.pyx":3004
 *   O_LABEL_SORTED = fst.kOLabelSorted
 *   NOT_O_LABEL_SORTED = fst.kNotOLabelSorted
 *   WEIGHTED = fst.kWeighted             # <<<<<<<<<<<<<<
 *   UNWEIGHTED = fst.kUnweighted
 *   CYCLIC = fst.kCyclic
 */
  __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kWeighted); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3004, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_WEIGHTED, __pyx_t_4) < 0) __PYX_ERR(0, 3004, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "fstlib/cext/pywrapfst.pyx":3005
 *   NOT_O_LABEL_SORTED = fst.kNotOLabelSorted
 *   WEIGHTED = fst.kWeighted
 *   UNWEIGHTED = fst.kUnweighted             # <<<<<<<<<<<<<<
 *   CYCLIC = fst.kCyclic
 *   ACYCLIC = fst.kAcyclic
 */
  __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kUnweighted); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3005, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_UNWEIGHTED, __pyx_t_4) < 0) __PYX_ERR(0, 3005, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "fstlib/cext/pywrapfst.pyx":3006
 *   WEIGHTED = fst.kWeighted
 *   UNWEIGHTED = fst.kUnweighted
 *   CYCLIC = fst.kCyclic             # <<<<<<<<<<<<<<
 *   ACYCLIC = fst.kAcyclic
 *   INITIAL_CYCLIC = fst.kInitialCyclic
 */
  __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kCyclic); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3006, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_CYCLIC, __pyx_t_4) < 0) __PYX_ERR(0, 3006, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "fstlib/cext/pywrapfst.pyx":3007
 *   UNWEIGHTED = fst.kUnweighted
 *   CYCLIC = fst.kCyclic
 *   ACYCLIC = fst.kAcyclic             # <<<<<<<<<<<<<<
 *   INITIAL_CYCLIC = fst.kInitialCyclic
 *   INITIAL_ACYCLIC = fst.kInitialAcyclic
 */
  __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kAcyclic); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3007, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_ACYCLIC, __pyx_t_4) < 0) __PYX_ERR(0, 3007, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "fstlib/cext/pywrapfst.pyx":3008
 *   CYCLIC = fst.kCyclic
 *   ACYCLIC = fst.kAcyclic
 *   INITIAL_CYCLIC = fst.kInitialCyclic             # <<<<<<<<<<<<<<
 *   INITIAL_ACYCLIC = fst.kInitialAcyclic
 *   TOP_SORTED = fst.kTopSorted
 */
  __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kInitialCyclic); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3008, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_INITIAL_CYCLIC, __pyx_t_4) < 0) __PYX_ERR(0, 3008, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "fstlib/cext/pywrapfst.pyx":3009
 *   ACYCLIC = fst.kAcyclic
 *   INITIAL_CYCLIC = fst.kInitialCyclic
 *   INITIAL_ACYCLIC = fst.kInitialAcyclic             # <<<<<<<<<<<<<<
 *   TOP_SORTED = fst.kTopSorted
 *   NOT_TOP_SORTED = fst.kNotTopSorted
 */
  __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kInitialAcyclic); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3009, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_INITIAL_ACYCLIC, __pyx_t_4) < 0) __PYX_ERR(0, 3009, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "fstlib/cext/pywrapfst.pyx":3010
 *   INITIAL_CYCLIC = fst.kInitialCyclic
 *   INITIAL_ACYCLIC = fst.kInitialAcyclic
 *   TOP_SORTED = fst.kTopSorted             # <<<<<<<<<<<<<<
 *   NOT_TOP_SORTED = fst.kNotTopSorted
 *   ACCESSIBLE = fst.kAccessible
 */
  __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kTopSorted); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3010, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_TOP_SORTED, __pyx_t_4) < 0) __PYX_ERR(0, 3010, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "fstlib/cext/pywrapfst.pyx":3011
 *   INITIAL_ACYCLIC = fst.kInitialAcyclic
 *   TOP_SORTED = fst.kTopSorted
 *   NOT_TOP_SORTED = fst.kNotTopSorted             # <<<<<<<<<<<<<<
 *   ACCESSIBLE = fst.kAccessible
 *   NOT_ACCESSIBLE = fst.kNotAccessible
 */
  __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kNotTopSorted); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3011, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_NOT_TOP_SORTED, __pyx_t_4) < 0) __PYX_ERR(0, 3011, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "fstlib/cext/pywrapfst.pyx":3012
 *   TOP_SORTED = fst.kTopSorted
 *   NOT_TOP_SORTED = fst.kNotTopSorted
 *   ACCESSIBLE = fst.kAccessible             # <<<<<<<<<<<<<<
 *   NOT_ACCESSIBLE = fst.kNotAccessible
 *   COACCESSIBLE = fst.kCoAccessible
 */
  __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kAccessible); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3012, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_ACCESSIBLE, __pyx_t_4) < 0) __PYX_ERR(0, 3012, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "fstlib/cext/pywrapfst.pyx":3013
 *   NOT_TOP_SORTED = fst.kNotTopSorted
 *   ACCESSIBLE = fst.kAccessible
 *   NOT_ACCESSIBLE = fst.kNotAccessible             # <<<<<<<<<<<<<<
 *   COACCESSIBLE = fst.kCoAccessible
 *   NOT_COACCESSIBLE = fst.kNotCoAccessible
 */
  __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kNotAccessible); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3013, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_NOT_ACCESSIBLE, __pyx_t_4) < 0) __PYX_ERR(0, 3013, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "fstlib/cext/pywrapfst.pyx":3014
 *   ACCESSIBLE = fst.kAccessible
 *   NOT_ACCESSIBLE = fst.kNotAccessible
 *   COACCESSIBLE = fst.kCoAccessible             # <<<<<<<<<<<<<<
 *   NOT_COACCESSIBLE = fst.kNotCoAccessible
 *   STRING = fst.kString
 */
  __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kCoAccessible); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3014, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_COACCESSIBLE, __pyx_t_4) < 0) __PYX_ERR(0, 3014, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "fstlib/cext/pywrapfst.pyx":3015
 *   NOT_ACCESSIBLE = fst.kNotAccessible
 *   COACCESSIBLE = fst.kCoAccessible
 *   NOT_COACCESSIBLE = fst.kNotCoAccessible             # <<<<<<<<<<<<<<
 *   STRING = fst.kString
 *   NOT_STRING = fst.kNotString
 */
  __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kNotCoAccessible); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3015, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_NOT_COACCESSIBLE, __pyx_t_4) < 0) __PYX_ERR(0, 3015, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "fstlib/cext/pywrapfst.pyx":3016
 *   COACCESSIBLE = fst.kCoAccessible
 *   NOT_COACCESSIBLE = fst.kNotCoAccessible
 *   STRING = fst.kString             # <<<<<<<<<<<<<<
 *   NOT_STRING = fst.kNotString
 *   WEIGHTED_CYCLES = fst.kWeightedCycles
 */
  __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kString); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3016, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_STRING, __pyx_t_4) < 0) __PYX_ERR(0, 3016, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "fstlib/cext/pywrapfst.pyx":3017
 *   NOT_COACCESSIBLE = fst.kNotCoAccessible
 *   STRING = fst.kString
 *   NOT_STRING = fst.kNotString             # <<<<<<<<<<<<<<
 *   WEIGHTED_CYCLES = fst.kWeightedCycles
 *   UNWEIGHTED_CYCLES = fst.kUnweightedCycles
 */
  __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kNotString); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3017, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_NOT_STRING, __pyx_t_4) < 0) __PYX_ERR(0, 3017, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "fstlib/cext/pywrapfst.pyx":3018
 *   STRING = fst.kString
 *   NOT_STRING = fst.kNotString
 *   WEIGHTED_CYCLES = fst.kWeightedCycles             # <<<<<<<<<<<<<<
 *   UNWEIGHTED_CYCLES = fst.kUnweightedCycles
 *   # TODO(wolfsonkin): Figure out how to keep the composite properties (all the
 */
  __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kWeightedCycles); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3018, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_WEIGHTED_CYCLES, __pyx_t_4) < 0) __PYX_ERR(0, 3018, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "fstlib/cext/pywrapfst.pyx":3019
 *   NOT_STRING = fst.kNotString
 *   WEIGHTED_CYCLES = fst.kWeightedCycles
 *   UNWEIGHTED_CYCLES = fst.kUnweightedCycles             # <<<<<<<<<<<<<<
 *   # TODO(wolfsonkin): Figure out how to keep the composite properties (all the
 *   # below properties) out of the `repr`, but still available as an attribute on
 */
  __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kUnweightedCycles); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3019, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_UNWEIGHTED_CYCLES, __pyx_t_4) < 0) __PYX_ERR(0, 3019, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "fstlib/cext/pywrapfst.pyx":3023
 *   # below properties) out of the `repr`, but still available as an attribute on
 *   # the class. I think this could be done with `property`.
 *   NULL_PROPERTIES = fst.kNullProperties             # <<<<<<<<<<<<<<
 *   COPY_PROPERTIES = fst.kCopyProperties
 *   INTRINSIC_PROPERTIES = fst.kIntrinsicProperties
 */
  __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kNullProperties); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3023, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_NULL_PROPERTIES, __pyx_t_4) < 0) __PYX_ERR(0, 3023, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "fstlib/cext/pywrapfst.pyx":3024
 *   # the class. I think this could be done with `property`.
 *   NULL_PROPERTIES = fst.kNullProperties
 *   COPY_PROPERTIES = fst.kCopyProperties             # <<<<<<<<<<<<<<
 *   INTRINSIC_PROPERTIES = fst.kIntrinsicProperties
 *   EXTRINSIC_PROPERTIES = fst.kExtrinsicProperties
 */
  __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kCopyProperties); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3024, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_COPY_PROPERTIES, __pyx_t_4) < 0) __PYX_ERR(0, 3024, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "fstlib/cext/pywrapfst.pyx":3025
 *   NULL_PROPERTIES = fst.kNullProperties
 *   COPY_PROPERTIES = fst.kCopyProperties
 *   INTRINSIC_PROPERTIES = fst.kIntrinsicProperties             # <<<<<<<<<<<<<<
 *   EXTRINSIC_PROPERTIES = fst.kExtrinsicProperties
 *   SET_START_PROPERTIES = fst.kSetStartProperties
 */
  __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kIntrinsicProperties); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3025, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_INTRINSIC_PROPERTIES, __pyx_t_4) < 0) __PYX_ERR(0, 3025, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "fstlib/cext/pywrapfst.pyx":3026
 *   COPY_PROPERTIES = fst.kCopyProperties
 *   INTRINSIC_PROPERTIES = fst.kIntrinsicProperties
 *   EXTRINSIC_PROPERTIES = fst.kExtrinsicProperties             # <<<<<<<<<<<<<<
 *   SET_START_PROPERTIES = fst.kSetStartProperties
 *   SET_FINAL_PROPERTIES = fst.kSetFinalProperties
 */
  __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kExtrinsicProperties); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3026, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_EXTRINSIC_PROPERTIES, __pyx_t_4) < 0) __PYX_ERR(0, 3026, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "fstlib/cext/pywrapfst.pyx":3027
 *   INTRINSIC_PROPERTIES = fst.kIntrinsicProperties
 *   EXTRINSIC_PROPERTIES = fst.kExtrinsicProperties
 *   SET_START_PROPERTIES = fst.kSetStartProperties             # <<<<<<<<<<<<<<
 *   SET_FINAL_PROPERTIES = fst.kSetFinalProperties
 *   ADD_STATE_PROPERTIES = fst.kAddStateProperties
 */
  __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kSetStartProperties); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3027, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_SET_START_PROPERTIES, __pyx_t_4) < 0) __PYX_ERR(0, 3027, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "fstlib/cext/pywrapfst.pyx":3028
 *   EXTRINSIC_PROPERTIES = fst.kExtrinsicProperties
 *   SET_START_PROPERTIES = fst.kSetStartProperties
 *   SET_FINAL_PROPERTIES = fst.kSetFinalProperties             # <<<<<<<<<<<<<<
 *   ADD_STATE_PROPERTIES = fst.kAddStateProperties
 *   ADD_ARC_PROPERTIES = fst.kAddArcProperties
 */
  __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kSetFinalProperties); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3028, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_SET_FINAL_PROPERTIES, __pyx_t_4) < 0) __PYX_ERR(0, 3028, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "fstlib/cext/pywrapfst.pyx":3029
 *   SET_START_PROPERTIES = fst.kSetStartProperties
 *   SET_FINAL_PROPERTIES = fst.kSetFinalProperties
 *   ADD_STATE_PROPERTIES = fst.kAddStateProperties             # <<<<<<<<<<<<<<
 *   ADD_ARC_PROPERTIES = fst.kAddArcProperties
 *   SET_ARC_PROPERTIES = fst.kSetArcProperties
 */
  __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kAddStateProperties); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3029, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_ADD_STATE_PROPERTIES, __pyx_t_4) < 0) __PYX_ERR(0, 3029, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "fstlib/cext/pywrapfst.pyx":3030
 *   SET_FINAL_PROPERTIES = fst.kSetFinalProperties
 *   ADD_STATE_PROPERTIES = fst.kAddStateProperties
 *   ADD_ARC_PROPERTIES = fst.kAddArcProperties             # <<<<<<<<<<<<<<
 *   SET_ARC_PROPERTIES = fst.kSetArcProperties
 *   DELETE_STATE_PROPERTIES = fst.kDeleteStatesProperties
 */
  __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kAddArcProperties); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3030, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_ADD_ARC_PROPERTIES, __pyx_t_4) < 0) __PYX_ERR(0, 3030, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "fstlib/cext/pywrapfst.pyx":3031
 *   ADD_STATE_PROPERTIES = fst.kAddStateProperties
 *   ADD_ARC_PROPERTIES = fst.kAddArcProperties
 *   SET_ARC_PROPERTIES = fst.kSetArcProperties             # <<<<<<<<<<<<<<
 *   DELETE_STATE_PROPERTIES = fst.kDeleteStatesProperties
 *   DELETE_ARC_PROPERTIES = fst.kDeleteArcsProperties
 */
  __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kSetArcProperties); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3031, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_SET_ARC_PROPERTIES, __pyx_t_4) < 0) __PYX_ERR(0, 3031, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "fstlib/cext/pywrapfst.pyx":3032
 *   ADD_ARC_PROPERTIES = fst.kAddArcProperties
 *   SET_ARC_PROPERTIES = fst.kSetArcProperties
 *   DELETE_STATE_PROPERTIES = fst.kDeleteStatesProperties             # <<<<<<<<<<<<<<
 *   DELETE_ARC_PROPERTIES = fst.kDeleteArcsProperties
 *   STATE_SORT_PROPERTIES = fst.kStateSortProperties
 */
  __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kDeleteStatesProperties); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3032, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_DELETE_STATE_PROPERTIES, __pyx_t_4) < 0) __PYX_ERR(0, 3032, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "fstlib/cext/pywrapfst.pyx":3033
 *   SET_ARC_PROPERTIES = fst.kSetArcProperties
 *   DELETE_STATE_PROPERTIES = fst.kDeleteStatesProperties
 *   DELETE_ARC_PROPERTIES = fst.kDeleteArcsProperties             # <<<<<<<<<<<<<<
 *   STATE_SORT_PROPERTIES = fst.kStateSortProperties
 *   ARC_SORT_PROPERTIES = fst.kArcSortProperties
 */
  __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kDeleteArcsProperties); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3033, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_DELETE_ARC_PROPERTIES, __pyx_t_4) < 0) __PYX_ERR(0, 3033, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "fstlib/cext/pywrapfst.pyx":3034
 *   DELETE_STATE_PROPERTIES = fst.kDeleteStatesProperties
 *   DELETE_ARC_PROPERTIES = fst.kDeleteArcsProperties
 *   STATE_SORT_PROPERTIES = fst.kStateSortProperties             # <<<<<<<<<<<<<<
 *   ARC_SORT_PROPERTIES = fst.kArcSortProperties
 *   I_LABEL_INVARIANT_PROPERTIES = fst.kILabelInvariantProperties
 */
  __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kStateSortProperties); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3034, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_STATE_SORT_PROPERTIES, __pyx_t_4) < 0) __PYX_ERR(0, 3034, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "fstlib/cext/pywrapfst.pyx":3035
 *   DELETE_ARC_PROPERTIES = fst.kDeleteArcsProperties
 *   STATE_SORT_PROPERTIES = fst.kStateSortProperties
 *   ARC_SORT_PROPERTIES = fst.kArcSortProperties             # <<<<<<<<<<<<<<
 *   I_LABEL_INVARIANT_PROPERTIES = fst.kILabelInvariantProperties
 *   O_LABEL_INVARIANT_PROPERTIES = fst.kOLabelInvariantProperties
 */
  __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kArcSortProperties); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3035, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_ARC_SORT_PROPERTIES, __pyx_t_4) < 0) __PYX_ERR(0, 3035, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "fstlib/cext/pywrapfst.pyx":3036
 *   STATE_SORT_PROPERTIES = fst.kStateSortProperties
 *   ARC_SORT_PROPERTIES = fst.kArcSortProperties
 *   I_LABEL_INVARIANT_PROPERTIES = fst.kILabelInvariantProperties             # <<<<<<<<<<<<<<
 *   O_LABEL_INVARIANT_PROPERTIES = fst.kOLabelInvariantProperties
 *   WEIGHT_INVARIANT_PROPERTIES = fst.kWeightInvariantProperties
 */
  __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kILabelInvariantProperties); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3036, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_I_LABEL_INVARIANT_PROPERTIES, __pyx_t_4) < 0) __PYX_ERR(0, 3036, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "fstlib/cext/pywrapfst.pyx":3037
 *   ARC_SORT_PROPERTIES = fst.kArcSortProperties
 *   I_LABEL_INVARIANT_PROPERTIES = fst.kILabelInvariantProperties
 *   O_LABEL_INVARIANT_PROPERTIES = fst.kOLabelInvariantProperties             # <<<<<<<<<<<<<<
 *   WEIGHT_INVARIANT_PROPERTIES = fst.kWeightInvariantProperties
 *   ADD_SUPERFINAL_PROPERTIES = fst.kAddSuperFinalProperties
 */
  __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kOLabelInvariantProperties); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3037, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_O_LABEL_INVARIANT_PROPERTIES, __pyx_t_4) < 0) __PYX_ERR(0, 3037, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "fstlib/cext/pywrapfst.pyx":3038
 *   I_LABEL_INVARIANT_PROPERTIES = fst.kILabelInvariantProperties
 *   O_LABEL_INVARIANT_PROPERTIES = fst.kOLabelInvariantProperties
 *   WEIGHT_INVARIANT_PROPERTIES = fst.kWeightInvariantProperties             # <<<<<<<<<<<<<<
 *   ADD_SUPERFINAL_PROPERTIES = fst.kAddSuperFinalProperties
 *   RM_SUPERFINAL_PROPERTIES = fst.kRmSuperFinalProperties
 */
  __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kWeightInvariantProperties); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3038, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_WEIGHT_INVARIANT_PROPERTIES, __pyx_t_4) < 0) __PYX_ERR(0, 3038, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "fstlib/cext/pywrapfst.pyx":3039
 *   O_LABEL_INVARIANT_PROPERTIES = fst.kOLabelInvariantProperties
 *   WEIGHT_INVARIANT_PROPERTIES = fst.kWeightInvariantProperties
 *   ADD_SUPERFINAL_PROPERTIES = fst.kAddSuperFinalProperties             # <<<<<<<<<<<<<<
 *   RM_SUPERFINAL_PROPERTIES = fst.kRmSuperFinalProperties
 *   BINARY_PROPERTIES = fst.kBinaryProperties
 */
  __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kAddSuperFinalProperties); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3039, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_ADD_SUPERFINAL_PROPERTIES, __pyx_t_4) < 0) __PYX_ERR(0, 3039, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "fstlib/cext/pywrapfst.pyx":3040
 *   WEIGHT_INVARIANT_PROPERTIES = fst.kWeightInvariantProperties
 *   ADD_SUPERFINAL_PROPERTIES = fst.kAddSuperFinalProperties
 *   RM_SUPERFINAL_PROPERTIES = fst.kRmSuperFinalProperties             # <<<<<<<<<<<<<<
 *   BINARY_PROPERTIES = fst.kBinaryProperties
 *   TRINARY_PROPERTIES = fst.kTrinaryProperties
 */
  __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kRmSuperFinalProperties); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3040, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_RM_SUPERFINAL_PROPERTIES, __pyx_t_4) < 0) __PYX_ERR(0, 3040, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "fstlib/cext/pywrapfst.pyx":3041
 *   ADD_SUPERFINAL_PROPERTIES = fst.kAddSuperFinalProperties
 *   RM_SUPERFINAL_PROPERTIES = fst.kRmSuperFinalProperties
 *   BINARY_PROPERTIES = fst.kBinaryProperties             # <<<<<<<<<<<<<<
 *   TRINARY_PROPERTIES = fst.kTrinaryProperties
 *   POS_TRINARY_PROPERTIES = fst.kPosTrinaryProperties
 */
  __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kBinaryProperties); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3041, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_BINARY_PROPERTIES, __pyx_t_4) < 0) __PYX_ERR(0, 3041, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "fstlib/cext/pywrapfst.pyx":3042
 *   RM_SUPERFINAL_PROPERTIES = fst.kRmSuperFinalProperties
 *   BINARY_PROPERTIES = fst.kBinaryProperties
 *   TRINARY_PROPERTIES = fst.kTrinaryProperties             # <<<<<<<<<<<<<<
 *   POS_TRINARY_PROPERTIES = fst.kPosTrinaryProperties
 *   NEG_TRINARY_PROPERTIES = fst.kNegTrinaryProperties
 */
  __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kTrinaryProperties); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3042, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_TRINARY_PROPERTIES, __pyx_t_4) < 0) __PYX_ERR(0, 3042, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "fstlib/cext/pywrapfst.pyx":3043
 *   BINARY_PROPERTIES = fst.kBinaryProperties
 *   TRINARY_PROPERTIES = fst.kTrinaryProperties
 *   POS_TRINARY_PROPERTIES = fst.kPosTrinaryProperties             # <<<<<<<<<<<<<<
 *   NEG_TRINARY_PROPERTIES = fst.kNegTrinaryProperties
 *   FST_PROPERTIES = fst.kFstProperties
 */
  __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kPosTrinaryProperties); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3043, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_POS_TRINARY_PROPERTIES, __pyx_t_4) < 0) __PYX_ERR(0, 3043, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "fstlib/cext/pywrapfst.pyx":3044
 *   TRINARY_PROPERTIES = fst.kTrinaryProperties
 *   POS_TRINARY_PROPERTIES = fst.kPosTrinaryProperties
 *   NEG_TRINARY_PROPERTIES = fst.kNegTrinaryProperties             # <<<<<<<<<<<<<<
 *   FST_PROPERTIES = fst.kFstProperties
 * 
 */
  __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kNegTrinaryProperties); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3044, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_NEG_TRINARY_PROPERTIES, __pyx_t_4) < 0) __PYX_ERR(0, 3044, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "fstlib/cext/pywrapfst.pyx":3045
 *   POS_TRINARY_PROPERTIES = fst.kPosTrinaryProperties
 *   NEG_TRINARY_PROPERTIES = fst.kNegTrinaryProperties
 *   FST_PROPERTIES = fst.kFstProperties             # <<<<<<<<<<<<<<
 * 
 * for name, member in FstProperties.__members__.items():
 */
  __pyx_t_4 = __Pyx_PyInt_From_uint64_t(fst::kFstProperties); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3045, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_FST_PROPERTIES, __pyx_t_4) < 0) __PYX_ERR(0, 3045, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "fstlib/cext/pywrapfst.pyx":2984
 * ## FST properties.
 * 
 * class FstProperties(enum.Flag):             # <<<<<<<<<<<<<<
 *   EXPANDED = fst.kExpanded
 *   MUTABLE = fst.kMutable
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_FstProperties, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2984, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FstProperties, __pyx_t_4) < 0) __PYX_ERR(0, 2984, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "fstlib/cext/pywrapfst.pyx":3047
 *   FST_PROPERTIES = fst.kFstProperties
 * 
 * for name, member in FstProperties.__members__.items():             # <<<<<<<<<<<<<<
 *   globals()[name] = member
 * 
 */
  __pyx_t_5 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_FstProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3047, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_members); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3047, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(__pyx_t_3 == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items");
    __PYX_ERR(0, 3047, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_dict_iterator(__pyx_t_3, 0, __pyx_n_s_items, (&__pyx_t_6), (&__pyx_t_7)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3047, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_XDECREF(__pyx_t_2);
  __pyx_t_2 = __pyx_t_1;
  __pyx_t_1 = 0;
  while (1) {
    __pyx_t_8 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_6, &__pyx_t_5, &__pyx_t_1, &__pyx_t_3, NULL, __pyx_t_7);
    if (unlikely(__pyx_t_8 == 0)) break;
    if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 3047, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GOTREF(__pyx_t_3);
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_name_2, __pyx_t_1) < 0) __PYX_ERR(0, 3047, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_member, __pyx_t_3) < 0) __PYX_ERR(0, 3047, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "fstlib/cext/pywrapfst.pyx":3048
 * 
 * for name, member in FstProperties.__members__.items():
 *   globals()[name] = member             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_member); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3048, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_Globals(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3048, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (unlikely(__pyx_t_1 == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(0, 3048, __pyx_L1_error)
    }
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_name_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3048, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_t_4, __pyx_t_3) < 0)) __PYX_ERR(0, 3048, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "fstlib/cext/pywrapfst.pyx":3054
 * 
 * 
 * ARC_I_LABEL_VALUE = fst.kArcILabelValue             # <<<<<<<<<<<<<<
 * ARC_O_LABEL_VALUE = fst.kArcOLabelValue
 * ARC_WEIGHT_VALUE = fst.kArcWeightValue
 */
  __pyx_t_2 = __Pyx_PyInt_From_uint8_t(fst::kArcILabelValue); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3054, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARC_I_LABEL_VALUE, __pyx_t_2) < 0) __PYX_ERR(0, 3054, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "fstlib/cext/pywrapfst.pyx":3055
 * 
 * ARC_I_LABEL_VALUE = fst.kArcILabelValue
 * ARC_O_LABEL_VALUE = fst.kArcOLabelValue             # <<<<<<<<<<<<<<
 * ARC_WEIGHT_VALUE = fst.kArcWeightValue
 * ARC_NEXT_STATE_VALUE = fst.kArcNextStateValue
 */
  __pyx_t_2 = __Pyx_PyInt_From_uint8_t(fst::kArcOLabelValue); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3055, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARC_O_LABEL_VALUE, __pyx_t_2) < 0) __PYX_ERR(0, 3055, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "fstlib/cext/pywrapfst.pyx":3056
 * ARC_I_LABEL_VALUE = fst.kArcILabelValue
 * ARC_O_LABEL_VALUE = fst.kArcOLabelValue
 * ARC_WEIGHT_VALUE = fst.kArcWeightValue             # <<<<<<<<<<<<<<
 * ARC_NEXT_STATE_VALUE = fst.kArcNextStateValue
 * ARC_NO_CACHE = fst.kArcNoCache
 */
  __pyx_t_2 = __Pyx_PyInt_From_uint8_t(fst::kArcWeightValue); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3056, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARC_WEIGHT_VALUE, __pyx_t_2) < 0) __PYX_ERR(0, 3056, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "fstlib/cext/pywrapfst.pyx":3057
 * ARC_O_LABEL_VALUE = fst.kArcOLabelValue
 * ARC_WEIGHT_VALUE = fst.kArcWeightValue
 * ARC_NEXT_STATE_VALUE = fst.kArcNextStateValue             # <<<<<<<<<<<<<<
 * ARC_NO_CACHE = fst.kArcNoCache
 * ARC_VALUE_FLAGS = fst.kArcValueFlags
 */
  __pyx_t_2 = __Pyx_PyInt_From_uint8_t(fst::kArcNextStateValue); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3057, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARC_NEXT_STATE_VALUE, __pyx_t_2) < 0) __PYX_ERR(0, 3057, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "fstlib/cext/pywrapfst.pyx":3058
 * ARC_WEIGHT_VALUE = fst.kArcWeightValue
 * ARC_NEXT_STATE_VALUE = fst.kArcNextStateValue
 * ARC_NO_CACHE = fst.kArcNoCache             # <<<<<<<<<<<<<<
 * ARC_VALUE_FLAGS = fst.kArcValueFlags
 * ARC_FLAGS = fst.kArcFlags
 */
  __pyx_t_2 = __Pyx_PyInt_From_uint8_t(fst::kArcNoCache); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3058, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARC_NO_CACHE, __pyx_t_2) < 0) __PYX_ERR(0, 3058, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "fstlib/cext/pywrapfst.pyx":3059
 * ARC_NEXT_STATE_VALUE = fst.kArcNextStateValue
 * ARC_NO_CACHE = fst.kArcNoCache
 * ARC_VALUE_FLAGS = fst.kArcValueFlags             # <<<<<<<<<<<<<<
 * ARC_FLAGS = fst.kArcFlags
 * 
 */
  __pyx_t_2 = __Pyx_PyInt_From_uint8_t(fst::kArcValueFlags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3059, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARC_VALUE_FLAGS, __pyx_t_2) < 0) __PYX_ERR(0, 3059, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "fstlib/cext/pywrapfst.pyx":3060
 * ARC_NO_CACHE = fst.kArcNoCache
 * ARC_VALUE_FLAGS = fst.kArcValueFlags
 * ARC_FLAGS = fst.kArcFlags             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_PyInt_From_uint8_t(fst::kArcFlags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3060, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARC_FLAGS, __pyx_t_2) < 0) __PYX_ERR(0, 3060, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "fstlib/cext/pywrapfst.pyx":3066
 * 
 * 
 * ENCODE_LABELS = fst.kEncodeLabels             # <<<<<<<<<<<<<<
 * ENCODE_WEIGHTS = fst.kEncodeWeights
 * ENCODE_FLAGS = fst.kEncodeFlags
 */
  __pyx_t_2 = __Pyx_PyInt_From_uint8_t(fst::kEncodeLabels); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3066, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ENCODE_LABELS, __pyx_t_2) < 0) __PYX_ERR(0, 3066, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "fstlib/cext/pywrapfst.pyx":3067
 * 
 * ENCODE_LABELS = fst.kEncodeLabels
 * ENCODE_WEIGHTS = fst.kEncodeWeights             # <<<<<<<<<<<<<<
 * ENCODE_FLAGS = fst.kEncodeFlags
 * 
 */
  __pyx_t_2 = __Pyx_PyInt_From_uint8_t(fst::kEncodeWeights); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3067, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ENCODE_WEIGHTS, __pyx_t_2) < 0) __PYX_ERR(0, 3067, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "fstlib/cext/pywrapfst.pyx":3068
 * ENCODE_LABELS = fst.kEncodeLabels
 * ENCODE_WEIGHTS = fst.kEncodeWeights
 * ENCODE_FLAGS = fst.kEncodeFlags             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_PyInt_From_uint8_t(fst::kEncodeFlags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3068, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ENCODE_FLAGS, __pyx_t_2) < 0) __PYX_ERR(0, 3068, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "fstlib/cext/pywrapfst.pyx":3451
 * 
 * cdef Fst _map(Fst ifst,
 *                float delta=fst.kDelta,             # <<<<<<<<<<<<<<
 *                map_type="identity",
 *                double power=1.,
 */
  __pyx_k__32 = fst::kDelta;

  /* "fstlib/cext/pywrapfst.pyx":3468
 * 
 * cpdef Fst arcmap(Fst ifst,
 *                  float delta=fst.kDelta,             # <<<<<<<<<<<<<<
 *                  map_type="identity",
 *                  double power=1.,
 */
  __pyx_k__33 = fst::kDelta;

  /* "fstlib/cext/pywrapfst.pyx":3467
 * 
 * 
 * cpdef Fst arcmap(Fst ifst,             # <<<<<<<<<<<<<<
 *                  float delta=fst.kDelta,
 *                  map_type="identity",
 */
  __pyx_k__33 = fst::kDelta;

  /* "fstlib/cext/pywrapfst.pyx":3577
 * 
 * cpdef MutableFst determinize(Fst ifst,
 *                              float delta=fst.kShortestDelta,             # <<<<<<<<<<<<<<
 *                              det_type="functional",
 *                              int64 nstate=fst.kNoStateId,
 */
  __pyx_k__34 = fst::kShortestDelta;

  /* "fstlib/cext/pywrapfst.pyx":3579
 *                              float delta=fst.kShortestDelta,
 *                              det_type="functional",
 *                              int64 nstate=fst.kNoStateId,             # <<<<<<<<<<<<<<
 *                              int64 subsequential_label=0,
 *                              weight=None,
 */
  __pyx_k__35 = fst::kNoStateId;

  /* "fstlib/cext/pywrapfst.pyx":3577
 * 
 * cpdef MutableFst determinize(Fst ifst,
 *                              float delta=fst.kShortestDelta,             # <<<<<<<<<<<<<<
 *                              det_type="functional",
 *                              int64 nstate=fst.kNoStateId,
 */
  __pyx_k__34 = fst::kShortestDelta;

  /* "fstlib/cext/pywrapfst.pyx":3579
 *                              float delta=fst.kShortestDelta,
 *                              det_type="functional",
 *                              int64 nstate=fst.kNoStateId,             # <<<<<<<<<<<<<<
 *                              int64 subsequential_label=0,
 *                              weight=None,
 */
  __pyx_k__35 = fst::kNoStateId;

  /* "fstlib/cext/pywrapfst.pyx":3676
 * 
 * cpdef MutableFst disambiguate(Fst ifst,
 *                               float delta=fst.kDelta,             # <<<<<<<<<<<<<<
 *                               int64 nstate=fst.kNoStateId,
 *                               int64 subsequential_label=0,
 */
  __pyx_k__36 = fst::kDelta;

  /* "fstlib/cext/pywrapfst.pyx":3677
 * cpdef MutableFst disambiguate(Fst ifst,
 *                               float delta=fst.kDelta,
 *                               int64 nstate=fst.kNoStateId,             # <<<<<<<<<<<<<<
 *                               int64 subsequential_label=0,
 *                               weight=None):
 */
  __pyx_k__37 = fst::kNoStateId;

  /* "fstlib/cext/pywrapfst.pyx":3676
 * 
 * cpdef MutableFst disambiguate(Fst ifst,
 *                               float delta=fst.kDelta,             # <<<<<<<<<<<<<<
 *                               int64 nstate=fst.kNoStateId,
 *                               int64 subsequential_label=0,
 */
  __pyx_k__36 = fst::kDelta;

  /* "fstlib/cext/pywrapfst.pyx":3677
 * cpdef MutableFst disambiguate(Fst ifst,
 *                               float delta=fst.kDelta,
 *                               int64 nstate=fst.kNoStateId,             # <<<<<<<<<<<<<<
 *                               int64 subsequential_label=0,
 *                               weight=None):
 */
  __pyx_k__37 = fst::kNoStateId;

  /* "fstlib/cext/pywrapfst.pyx":3747
 * 
 * 
 * cpdef bool equal(Fst ifst1, Fst ifst2, float delta=fst.kDelta):             # <<<<<<<<<<<<<<
 *   """
 *   equal(ifst1, ifst2, delta=0.0009765625)
 */
  __pyx_k__38 = fst::kDelta;
  __pyx_k__38 = fst::kDelta;

  /* "fstlib/cext/pywrapfst.pyx":3768
 * 
 * 
 * cpdef bool equivalent(Fst ifst1, Fst ifst2, float delta=fst.kDelta):             # <<<<<<<<<<<<<<
 *   """
 *   equivalent(ifst1, ifst2, delta=0.0009765625)
 */
  __pyx_k__39 = fst::kDelta;
  __pyx_k__39 = fst::kDelta;

  /* "fstlib/cext/pywrapfst.pyx":3824
 * 
 * 
 * cpdef bool isomorphic(Fst ifst1, Fst ifst2, float delta=fst.kDelta):             # <<<<<<<<<<<<<<
 *   """
 *   isomorphic(ifst1, ifst2, delta=0.0009765625)
 */
  __pyx_k__40 = fst::kDelta;
  __pyx_k__40 = fst::kDelta;

  /* "fstlib/cext/pywrapfst.pyx":3849
 * 
 * cpdef MutableFst prune(Fst ifst,
 *                        float delta=fst.kDelta,             # <<<<<<<<<<<<<<
 *                        int64 nstate=fst.kNoStateId,
 *                        weight=None):
 */
  __pyx_k__41 = fst::kDelta;

  /* "fstlib/cext/pywrapfst.pyx":3850
 * cpdef MutableFst prune(Fst ifst,
 *                        float delta=fst.kDelta,
 *                        int64 nstate=fst.kNoStateId,             # <<<<<<<<<<<<<<
 *                        weight=None):
 *   """
 */
  __pyx_k__42 = fst::kNoStateId;

  /* "fstlib/cext/pywrapfst.pyx":3849
 * 
 * cpdef MutableFst prune(Fst ifst,
 *                        float delta=fst.kDelta,             # <<<<<<<<<<<<<<
 *                        int64 nstate=fst.kNoStateId,
 *                        weight=None):
 */
  __pyx_k__41 = fst::kDelta;

  /* "fstlib/cext/pywrapfst.pyx":3850
 * cpdef MutableFst prune(Fst ifst,
 *                        float delta=fst.kDelta,
 *                        int64 nstate=fst.kNoStateId,             # <<<<<<<<<<<<<<
 *                        weight=None):
 *   """
 */
  __pyx_k__42 = fst::kNoStateId;

  /* "fstlib/cext/pywrapfst.pyx":3881
 * 
 * cpdef MutableFst push(Fst ifst,
 *                       float delta=fst.kDelta,             # <<<<<<<<<<<<<<
 *                       bool push_weights=False,
 *                       bool push_labels=False,
 */
  __pyx_k__43 = fst::kDelta;

  /* "fstlib/cext/pywrapfst.pyx":3880
 * 
 * 
 * cpdef MutableFst push(Fst ifst,             # <<<<<<<<<<<<<<
 *                       float delta=fst.kDelta,
 *                       bool push_weights=False,
 */
  __pyx_k__43 = fst::kDelta;

  /* "fstlib/cext/pywrapfst.pyx":3939
 *                           Fst ifst2,
 *                           int32 npath=1,
 *                           float delta=fst.kDelta,             # <<<<<<<<<<<<<<
 *                           select="uniform",
 *                           int32 max_length=INT32_MAX,
 */
  __pyx_k__44 = fst::kDelta;

  /* "fstlib/cext/pywrapfst.pyx":3941
 *                           float delta=fst.kDelta,
 *                           select="uniform",
 *                           int32 max_length=INT32_MAX,             # <<<<<<<<<<<<<<
 *                           uint64 seed=0) except *:
 *   """
 */
  __pyx_k__45 = INT32_MAX;

  /* "fstlib/cext/pywrapfst.pyx":3939
 *                           Fst ifst2,
 *                           int32 npath=1,
 *                           float delta=fst.kDelta,             # <<<<<<<<<<<<<<
 *                           select="uniform",
 *                           int32 max_length=INT32_MAX,
 */
  __pyx_k__44 = fst::kDelta;

  /* "fstlib/cext/pywrapfst.pyx":3941
 *                           float delta=fst.kDelta,
 *                           select="uniform",
 *                           int32 max_length=INT32_MAX,             # <<<<<<<<<<<<<<
 *                           uint64 seed=0) except *:
 *   """
 */
  __pyx_k__45 = INT32_MAX;

  /* "fstlib/cext/pywrapfst.pyx":3991
 *                          int32 npath=1,
 *                          select="uniform",
 *                          int32 max_length=INT32_MAX,             # <<<<<<<<<<<<<<
 *                          bool weighted=False,
 *                          bool remove_total_weight=False,
 */
  __pyx_k__46 = INT32_MAX;

  /* "fstlib/cext/pywrapfst.pyx":3988
 * 
 * 
 * cpdef MutableFst randgen(Fst ifst,             # <<<<<<<<<<<<<<
 *                          int32 npath=1,
 *                          select="uniform",
 */
  __pyx_k__46 = INT32_MAX;

  /* "fstlib/cext/pywrapfst.pyx":4130
 * cdef void _shortestdistance(Fst ifst,
 *                             vector[fst.WeightClass] *distance,
 *                             float delta=fst.kShortestDelta,             # <<<<<<<<<<<<<<
 *                             int64 nstate=fst.kNoStateId,
 *                             queue_type="auto",
 */
  __pyx_k__47 = fst::kShortestDelta;

  /* "fstlib/cext/pywrapfst.pyx":4131
 *                             vector[fst.WeightClass] *distance,
 *                             float delta=fst.kShortestDelta,
 *                             int64 nstate=fst.kNoStateId,             # <<<<<<<<<<<<<<
 *                             queue_type="auto",
 *                             bool reverse=False) except *:
 */
  __pyx_k__48 = fst::kNoStateId;

  /* "fstlib/cext/pywrapfst.pyx":4149
 * 
 * def shortestdistance(Fst ifst,
 *                      float delta=fst.kShortestDelta,             # <<<<<<<<<<<<<<
 *                      int64 nstate=fst.kNoStateId,
 *                      queue_type="auto",
 */
  __pyx_k__49 = fst::kShortestDelta;

  /* "fstlib/cext/pywrapfst.pyx":4150
 * def shortestdistance(Fst ifst,
 *                      float delta=fst.kShortestDelta,
 *                      int64 nstate=fst.kNoStateId,             # <<<<<<<<<<<<<<
 *                      queue_type="auto",
 *                      bool reverse=False):
 */
  __pyx_k__50 = fst::kNoStateId;

  /* "fstlib/cext/pywrapfst.pyx":4148
 * 
 * 
 * def shortestdistance(Fst ifst,             # <<<<<<<<<<<<<<
 *                      float delta=fst.kShortestDelta,
 *                      int64 nstate=fst.kNoStateId,
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6fstlib_4cext_9pywrapfst_55shortestdistance, NULL, __pyx_n_s_fstlib_cext_pywrapfst); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_shortestdistance, __pyx_t_2) < 0) __PYX_ERR(0, 4148, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "fstlib/cext/pywrapfst.pyx":4186
 * 
 * cpdef MutableFst shortestpath(Fst ifst,
 *                               float delta=fst.kShortestDelta,             # <<<<<<<<<<<<<<
 *                               int32 nshortest=1,
 *                               int64 nstate=fst.kNoStateId,
 */
  __pyx_k__51 = fst::kShortestDelta;

  /* "fstlib/cext/pywrapfst.pyx":4188
 *                               float delta=fst.kShortestDelta,
 *                               int32 nshortest=1,
 *                               int64 nstate=fst.kNoStateId,             # <<<<<<<<<<<<<<
 *                               queue_type="auto",
 *                               bool unique=False,
 */
  __pyx_k__52 = fst::kNoStateId;

  /* "fstlib/cext/pywrapfst.pyx":4186
 * 
 * cpdef MutableFst shortestpath(Fst ifst,
 *                               float delta=fst.kShortestDelta,             # <<<<<<<<<<<<<<
 *                               int32 nshortest=1,
 *                               int64 nstate=fst.kNoStateId,
 */
  __pyx_k__51 = fst::kShortestDelta;

  /* "fstlib/cext/pywrapfst.pyx":4188
 *                               float delta=fst.kShortestDelta,
 *                               int32 nshortest=1,
 *                               int64 nstate=fst.kNoStateId,             # <<<<<<<<<<<<<<
 *                               queue_type="auto",
 *                               bool unique=False,
 */
  __pyx_k__52 = fst::kNoStateId;

  /* "fstlib/cext/pywrapfst.pyx":4453
 * 
 *   @classmethod
 *   def open(cls, *sources):             # <<<<<<<<<<<<<<
 *     """
 *     FarReader.open(*sources)
 */
  __Pyx_GetNameInClass(__pyx_t_2, (PyObject *)__pyx_ptype_6fstlib_4cext_9pywrapfst_FarReader, __pyx_n_s_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4453, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "fstlib/cext/pywrapfst.pyx":4452
 *     return f"<{self.far_type()} FarReader at 0x{id(self):x}>"
 * 
 *   @classmethod             # <<<<<<<<<<<<<<
 *   def open(cls, *sources):
 *     """
 */
  __pyx_t_3 = __Pyx_Method_ClassMethod(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4452, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6fstlib_4cext_9pywrapfst_FarReader->tp_dict, __pyx_n_s_open, __pyx_t_3) < 0) __PYX_ERR(0, 4453, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_6fstlib_4cext_9pywrapfst_FarReader);

  /* "fstlib/cext/pywrapfst.pyx":4612
 * 
 *   @classmethod
 *   def create(cls, source, arc_type="standard", far_type="default"):             # <<<<<<<<<<<<<<
 *     """
 *     FarWriter.
 */
  __Pyx_GetNameInClass(__pyx_t_3, (PyObject *)__pyx_ptype_6fstlib_4cext_9pywrapfst_FarWriter, __pyx_n_s_create); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4612, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "fstlib/cext/pywrapfst.pyx":4611
 *     return f"<{self.far_type()} FarWriter at 0x{id(self):x}>"
 * 
 *   @classmethod             # <<<<<<<<<<<<<<
 *   def create(cls, source, arc_type="standard", far_type="default"):
 *     """
 */
  __pyx_t_2 = __Pyx_Method_ClassMethod(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4611, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6fstlib_4cext_9pywrapfst_FarWriter->tp_dict, __pyx_n_s_create, __pyx_t_2) < 0) __PYX_ERR(0, 4612, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_6fstlib_4cext_9pywrapfst_FarWriter);

  /* "fstlib/cext/pywrapfst.pyx":4703
 * 
 * # Masks fst_error_fatal in-module.
 * fst.FST_FLAGS_fst_error_fatal = False             # <<<<<<<<<<<<<<
 */
  FST_FLAGS_fst_error_fatal = 0;

  /* "fstlib/cext/pywrapfst.pyx":1
 * #cython: c_string_encoding=utf8, c_string_type=unicode, language_level=3, nonecheck=True             # <<<<<<<<<<<<<<
 * # Copyright 2005-2020 Google LLC
 * #
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test_2, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "vector.from_py":45
 * 
 * @cname("__pyx_convert_vector_from_py_std_3a__3a_string")
 * cdef vector[X] __pyx_convert_vector_from_py_std_3a__3a_string(object o) except *:             # <<<<<<<<<<<<<<
 *     cdef vector[X] v
 *     for item in o:
 */

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

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  if (__pyx_m) {
    if (__pyx_d) {
      __Pyx_AddTraceback("init fstlib.cext.pywrapfst", __pyx_clineno, __pyx_lineno, __pyx_filename);
    }
    Py_CLEAR(__pyx_m);
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init fstlib.cext.pywrapfst");
  }
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  return (__pyx_m != NULL) ? 0 : -1;
  #elif PY_MAJOR_VERSION >= 3
  return __pyx_m;
  #else
  return;
  #endif
}

/* --- Runtime support code --- */
/* Refnanny */
#if CYTHON_REFNANNY
static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
    PyObject *m = NULL, *p = NULL;
    void *r = NULL;
    m = PyImport_ImportModule(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

/* PyObjectGetAttrStr */
#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_getattro))
        return tp->tp_getattro(obj, attr_name);
#if PY_MAJOR_VERSION < 3
    if (likely(tp->tp_getattr))
        return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
#endif
    return PyObject_GetAttr(obj, attr_name);
}
#endif

/* GetBuiltinName */
static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
    PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
    if (unlikely(!result)) {
        PyErr_Format(PyExc_NameError,
#if PY_MAJOR_VERSION >= 3
            "name '%U' is not defined", name);
#else
            "name '%.200s' is not defined", PyString_AS_STRING(name));
#endif
    }
    return result;
}

/* PyObjectFormatAndDecref */
static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f) {
    if (unlikely(!s)) return NULL;
    if (likely(PyUnicode_CheckExact(s))) return s;
    #if PY_MAJOR_VERSION < 3
    if (likely(PyString_CheckExact(s))) {
        PyObject *result = PyUnicode_FromEncodedObject(s, NULL, "strict");
        Py_DECREF(s);
        return result;
    }
    #endif
    return __Pyx_PyObject_FormatAndDecref(s, f);
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f) {
    PyObject *result = PyObject_Format(s, f);
    Py_DECREF(s);
    return result;
}

/* JoinPyUnicode */
static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength,
                                      CYTHON_UNUSED Py_UCS4 max_char) {
#if CYTHON_USE_UNICODE_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    PyObject *result_uval;
    int result_ukind;
    Py_ssize_t i, char_pos;
    void *result_udata;
#if CYTHON_PEP393_ENABLED
    result_uval = PyUnicode_New(result_ulength, max_char);
    if (unlikely(!result_uval)) return NULL;
    result_ukind = (max_char <= 255) ? PyUnicode_1BYTE_KIND : (max_char <= 65535) ? PyUnicode_2BYTE_KIND : PyUnicode_4BYTE_KIND;
    result_udata = PyUnicode_DATA(result_uval);
#else
    result_uval = PyUnicode_FromUnicode(NULL, result_ulength);
    if (unlikely(!result_uval)) return NULL;
    result_ukind = sizeof(Py_UNICODE);
    result_udata = PyUnicode_AS_UNICODE(result_uval);
#endif
    char_pos = 0;
    for (i=0; i < value_count; i++) {
        int ukind;
        Py_ssize_t ulength;
        void *udata;
        PyObject *uval = PyTuple_GET_ITEM(value_tuple, i);
        if (unlikely(__Pyx_PyUnicode_READY(uval)))
            goto bad;
        ulength = __Pyx_PyUnicode_GET_LENGTH(uval);
        if (unlikely(!ulength))
            continue;
        if (unlikely(char_pos + ulength < 0))
            goto overflow;
        ukind = __Pyx_PyUnicode_KIND(uval);
        udata = __Pyx_PyUnicode_DATA(uval);
        if (!CYTHON_PEP393_ENABLED || ukind == result_ukind) {
            memcpy((char *)result_udata + char_pos * result_ukind, udata, (size_t) (ulength * result_ukind));
        } else {
            #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030300F0 || defined(_PyUnicode_FastCopyCharacters)
            _PyUnicode_FastCopyCharacters(result_uval, char_pos, uval, 0, ulength);
            #else
            Py_ssize_t j;
            for (j=0; j < ulength; j++) {
                Py_UCS4 uchar = __Pyx_PyUnicode_READ(ukind, udata, j);
                __Pyx_PyUnicode_WRITE(result_ukind, result_udata, char_pos+j, uchar);
            }
            #endif
        }
        char_pos += ulength;
    }
    return result_uval;
overflow:
    PyErr_SetString(PyExc_OverflowError, "join() result is too long for a Python string");
bad:
    Py_DECREF(result_uval);
    return NULL;
#else
    result_ulength++;
    value_count++;
    return PyUnicode_Join(__pyx_empty_unicode, value_tuple);
#endif
}

/* PyCFunctionFastCall */
#if CYTHON_FAST_PYCCALL
static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
    PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
    PyCFunction meth = PyCFunction_GET_FUNCTION(func);
    PyObject *self = PyCFunction_GET_SELF(func);
    int flags = PyCFunction_GET_FLAGS(func);
    assert(PyCFunction_Check(func));
    assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
    assert(nargs >= 0);
    assert(nargs == 0 || args != NULL);
    /* _PyCFunction_FastCallDict() must not be called with an exception set,
       because it may clear it (directly or indirectly) and so the
       caller loses its exception */
    assert(!PyErr_Occurred());
    if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
        return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL);
    } else {
        return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs);
    }
}
#endif

/* PyFunctionFastCall */
#if CYTHON_FAST_PYCALL
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;
}
#if 1 || PY_VERSION_HEX < 0x030600B1
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_EnterRecursiveCall((char*)" while calling a Python object")) {
        return NULL;
    }
    if (
#if PY_MAJOR_VERSION >= 3
            co->co_kwonlyargcount == 0 &&
#endif
            likely(kwargs == NULL || nk == 0) &&
            co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
        if (argdefs == NULL && co->co_argcount == nargs) {
            result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
            goto done;
        }
        else if (nargs == 0 && argdefs != NULL
                 && co->co_argcount == Py_SIZE(argdefs)) {
            /* function called with no arguments, but all parameters have
               a default value: use default values as arguments .*/
            args = &PyTuple_GET_ITEM(argdefs, 0);
            result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
            goto done;
        }
    }
    if (kwargs != NULL) {
        Py_ssize_t pos, i;
        kwtuple = PyTuple_New(2 * nk);
        if (kwtuple == NULL) {
            result = NULL;
            goto done;
        }
        k = &PyTuple_GET_ITEM(kwtuple, 0);
        pos = i = 0;
        while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
            Py_INCREF(k[i]);
            Py_INCREF(k[i+1]);
            i += 2;
        }
        nk = i / 2;
    }
    else {
        kwtuple = NULL;
        k = NULL;
    }
    closure = PyFunction_GET_CLOSURE(func);
#if PY_MAJOR_VERSION >= 3
    kwdefs = PyFunction_GET_KW_DEFAULTS(func);
#endif
    if (argdefs != NULL) {
        d = &PyTuple_GET_ITEM(argdefs, 0);
        nd = Py_SIZE(argdefs);
    }
    else {
        d = NULL;
        nd = 0;
    }
#if PY_MAJOR_VERSION >= 3
    result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
                               args, (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
#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 (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
        return NULL;
    result = (*call)(func, arg, kw);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

/* PyObjectCallMethO */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
    PyObject *self, *result;
    PyCFunction cfunc;
    cfunc = PyCFunction_GET_FUNCTION(func);
    self = PyCFunction_GET_SELF(func);
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
        return NULL;
    result = cfunc(self, arg);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

/* PyObjectCallOneArg */
#if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject *result;
    PyObject *args = PyTuple_New(1);
    if (unlikely(!args)) return NULL;
    Py_INCREF(arg);
    PyTuple_SET_ITEM(args, 0, arg);
    result = __Pyx_PyObject_Call(func, args, NULL);
    Py_DECREF(args);
    return result;
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
#if CYTHON_FAST_PYCALL
    if (PyFunction_Check(func)) {
        return __Pyx_PyFunction_FastCall(func, &arg, 1);
    }
#endif
    if (likely(PyCFunction_Check(func))) {
        if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
            return __Pyx_PyObject_CallMethO(func, arg);
#if CYTHON_FAST_PYCCALL
        } else if (__Pyx_PyFastCFunction_Check(func)) {
            return __Pyx_PyCFunction_FastCall(func, &arg, 1);
#endif
        }
    }
    return __Pyx__PyObject_CallOneArg(func, arg);
}
#else
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject *result;
    PyObject *args = PyTuple_Pack(1, arg);
    if (unlikely(!args)) return NULL;
    result = __Pyx_PyObject_Call(func, args, NULL);
    Py_DECREF(args);
    return result;
}
#endif

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

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

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

/* PyObjectCall2Args */
static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
    PyObject *args, *result = NULL;
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(function)) {
        PyObject *args[2] = {arg1, arg2};
        return __Pyx_PyFunction_FastCall(function, args, 2);
    }
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(function)) {
        PyObject *args[2] = {arg1, arg2};
        return __Pyx_PyCFunction_FastCall(function, args, 2);
    }
    #endif
    args = PyTuple_New(2);
    if (unlikely(!args)) goto done;
    Py_INCREF(arg1);
    PyTuple_SET_ITEM(args, 0, arg1);
    Py_INCREF(arg2);
    PyTuple_SET_ITEM(args, 1, arg2);
    Py_INCREF(function);
    result = __Pyx_PyObject_Call(function, args, NULL);
    Py_DECREF(args);
    Py_DECREF(function);
done:
    return result;
}

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

/* RaiseArgTupleInvalid */
static void __Pyx_RaiseArgtupleInvalid(
    const char* func_name,
    int exact,
    Py_ssize_t num_min,
    Py_ssize_t num_max,
    Py_ssize_t num_found)
{
    Py_ssize_t num_expected;
    const char *more_or_less;
    if (num_found < num_min) {
        num_expected = num_min;
        more_or_less = "at least";
    } else {
        num_expected = num_max;
        more_or_less = "at most";
    }
    if (exact) {
        more_or_less = "exactly";
    }
    PyErr_Format(PyExc_TypeError,
                 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
                 func_name, more_or_less, num_expected,
                 (num_expected == 1) ? "" : "s", num_found);
}

/* RaiseDoubleKeywords */
static void __Pyx_RaiseDoubleKeywordsError(
    const char* func_name,
    PyObject* kw_name)
{
    PyErr_Format(PyExc_TypeError,
        #if PY_MAJOR_VERSION >= 3
        "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
        #else
        "%s() got multiple values for keyword argument '%s'", func_name,
        PyString_AsString(kw_name));
        #endif
}

/* ParseKeywords */
static int __Pyx_ParseOptionalKeywords(
    PyObject *kwds,
    PyObject **argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    const char* function_name)
{
    PyObject *key = 0, *value = 0;
    Py_ssize_t pos = 0;
    PyObject*** name;
    PyObject*** first_kw_arg = argnames + num_pos_args;
    while (PyDict_Next(kwds, &pos, &key, &value)) {
        name = first_kw_arg;
        while (*name && (**name != key)) name++;
        if (*name) {
            values[name-argnames] = value;
            continue;
        }
        name = first_kw_arg;
        #if PY_MAJOR_VERSION < 3
        if (likely(PyString_Check(key))) {
            while (*name) {
                if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
                        && _PyString_Eq(**name, key)) {
                    values[name-argnames] = value;
                    break;
                }
                name++;
            }
            if (*name) continue;
            else {
                PyObject*** argname = argnames;
                while (argname != first_kw_arg) {
                    if ((**argname == key) || (
                            (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
                             && _PyString_Eq(**argname, key))) {
                        goto arg_passed_twice;
                    }
                    argname++;
                }
            }
        } else
        #endif
        if (likely(PyUnicode_Check(key))) {
            while (*name) {
                int cmp = (**name == key) ? 0 :
                #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                    (__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;
                    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;
        }
    }
    return 0;
arg_passed_twice:
    __Pyx_RaiseDoubleKeywordsError(function_name, key);
    goto bad;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%.200s() keywords must be strings", function_name);
    goto bad;
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
    #if PY_MAJOR_VERSION < 3
        "%.200s() got an unexpected keyword argument '%.200s'",
        function_name, PyString_AsString(key));
    #else
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
bad:
    return -1;
}

/* PyObjectCallNoArg */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
#if CYTHON_FAST_PYCALL
    if (PyFunction_Check(func)) {
        return __Pyx_PyFunction_FastCall(func, NULL, 0);
    }
#endif
#ifdef __Pyx_CyFunction_USED
    if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func)))
#else
    if (likely(PyCFunction_Check(func)))
#endif
    {
        if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
            return __Pyx_PyObject_CallMethO(func, NULL);
        }
    }
    return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
}
#endif

/* ExtTypeTest */
static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
    if (unlikely(!type)) {
        PyErr_SetString(PyExc_SystemError, "Missing type object");
        return 0;
    }
    if (likely(__Pyx_TypeCheck(obj, type)))
        return 1;
    PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
                 Py_TYPE(obj)->tp_name, type->tp_name);
    return 0;
}

/* ArgTypeTest */
static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
{
    if (unlikely(!type)) {
        PyErr_SetString(PyExc_SystemError, "Missing type object");
        return 0;
    }
    else if (exact) {
        #if PY_MAJOR_VERSION == 2
        if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
        #endif
    }
    else {
        if (likely(__Pyx_TypeCheck(obj, type))) return 1;
    }
    PyErr_Format(PyExc_TypeError,
        "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
        name, type->tp_name, Py_TYPE(obj)->tp_name);
    return 0;
}

/* WriteUnraisableException */
static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
                                  CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
                                  int full_traceback, CYTHON_UNUSED 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();
#ifdef _MSC_VER
    else state = (PyGILState_STATE)-1;
#endif
#endif
    __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(1);
    }
    #if PY_MAJOR_VERSION < 3
    ctx = PyString_FromString(name);
    #else
    ctx = PyUnicode_FromString(name);
    #endif
    __Pyx_ErrRestore(old_exc, old_val, old_tb);
    if (!ctx) {
        PyErr_WriteUnraisable(Py_None);
    } else {
        PyErr_WriteUnraisable(ctx);
        Py_DECREF(ctx);
    }
#ifdef WITH_THREAD
    if (nogil)
        PyGILState_Release(state);
#endif
}

/* KeywordStringCheck */
static int __Pyx_CheckKeywordStrings(
    PyObject *kwdict,
    const char* function_name,
    int kw_allowed)
{
    PyObject* key = 0;
    Py_ssize_t pos = 0;
#if CYTHON_COMPILING_IN_PYPY
    if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0))
        goto invalid_keyword;
    return 1;
#else
    while (PyDict_Next(kwdict, &pos, &key, 0)) {
        #if PY_MAJOR_VERSION < 3
        if (unlikely(!PyString_Check(key)))
        #endif
            if (unlikely(!PyUnicode_Check(key)))
                goto invalid_keyword_type;
    }
    if ((!kw_allowed) && unlikely(key))
        goto invalid_keyword;
    return 1;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%.200s() keywords must be strings", function_name);
    return 0;
#endif
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
    #if PY_MAJOR_VERSION < 3
        "%.200s() got an unexpected keyword argument '%.200s'",
        function_name, PyString_AsString(key));
    #else
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
    return 0;
}

/* GetTopmostException */
#if CYTHON_USE_EXC_INFO_STACK
static _PyErr_StackItem *
__Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
{
    _PyErr_StackItem *exc_info = tstate->exc_info;
    while ((exc_info->exc_type == NULL || exc_info->exc_type == 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
    _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
    *type = exc_info->exc_type;
    *value = exc_info->exc_value;
    *tb = exc_info->exc_traceback;
    #else
    *type = tstate->exc_type;
    *value = tstate->exc_value;
    *tb = tstate->exc_traceback;
    #endif
    Py_XINCREF(*type);
    Py_XINCREF(*value);
    Py_XINCREF(*tb);
}
static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    #if 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

/* PyErrExceptionMatches */
#if CYTHON_FAST_THREAD_STATE
static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
    Py_ssize_t i, n;
    n = PyTuple_GET_SIZE(tuple);
#if PY_MAJOR_VERSION >= 3
    for (i=0; i<n; i++) {
        if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
    }
#endif
    for (i=0; i<n; i++) {
        if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
    }
    return 0;
}
static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
    PyObject *exc_type = tstate->curexc_type;
    if (exc_type == err) return 1;
    if (unlikely(!exc_type)) return 0;
    if (unlikely(PyTuple_Check(err)))
        return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
    return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
}
#endif

/* GetException */
#if CYTHON_FAST_THREAD_STATE
static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
#else
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
#endif
{
    PyObject *local_type, *local_value, *local_tb;
#if CYTHON_FAST_THREAD_STATE
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    local_type = tstate->curexc_type;
    local_value = tstate->curexc_value;
    local_tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
#else
    PyErr_Fetch(&local_type, &local_value, &local_tb);
#endif
    PyErr_NormalizeException(&local_type, &local_value, &local_tb);
#if CYTHON_FAST_THREAD_STATE
    if (unlikely(tstate->curexc_type))
#else
    if (unlikely(PyErr_Occurred()))
#endif
        goto bad;
    #if PY_MAJOR_VERSION >= 3
    if (local_tb) {
        if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
            goto bad;
    }
    #endif
    Py_XINCREF(local_tb);
    Py_XINCREF(local_type);
    Py_XINCREF(local_value);
    *type = local_type;
    *value = local_value;
    *tb = local_tb;
#if CYTHON_FAST_THREAD_STATE
    #if 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 = local_type;
        exc_info->exc_value = local_value;
        exc_info->exc_traceback = local_tb;
    }
    #else
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = local_type;
    tstate->exc_value = local_value;
    tstate->exc_traceback = local_tb;
    #endif
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
#else
    PyErr_SetExcInfo(local_type, local_value, local_tb);
#endif
    return 0;
bad:
    *type = 0;
    *value = 0;
    *tb = 0;
    Py_XDECREF(local_type);
    Py_XDECREF(local_value);
    Py_XDECREF(local_tb);
    return -1;
}

/* GetItemInt */
static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
    PyObject *r;
    if (!j) return NULL;
    r = PyObject_GetItem(o, j);
    Py_DECREF(j);
    return r;
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
                                                              CYTHON_NCP_UNUSED int wraparound,
                                                              CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    Py_ssize_t wrapped_i = i;
    if (wraparound & unlikely(i < 0)) {
        wrapped_i += PyList_GET_SIZE(o);
    }
    if ((!boundscheck) || likely(__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 {
        PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
        if (likely(m && m->sq_item)) {
            if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
                Py_ssize_t l = m->sq_length(o);
                if (likely(l >= 0)) {
                    i += l;
                } else {
                    if (!PyErr_ExceptionMatches(PyExc_OverflowError))
                        return NULL;
                    PyErr_Clear();
                }
            }
            return m->sq_item(o, i);
        }
    }
#else
    if (is_list || PySequence_Check(o)) {
        return PySequence_GetItem(o, i);
    }
#endif
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
}

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

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

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

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

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

/* PyObject_GenericGetAttrNoDict */
#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
    PyErr_Format(PyExc_AttributeError,
#if PY_MAJOR_VERSION >= 3
                 "'%.50s' object has no attribute '%U'",
                 tp->tp_name, attr_name);
#else
                 "'%.50s' object has no attribute '%.400s'",
                 tp->tp_name, PyString_AS_STRING(attr_name));
#endif
    return NULL;
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
    PyObject *descr;
    PyTypeObject *tp = Py_TYPE(obj);
    if (unlikely(!PyString_Check(attr_name))) {
        return PyObject_GenericGetAttr(obj, attr_name);
    }
    assert(!tp->tp_dictoffset);
    descr = _PyType_Lookup(tp, attr_name);
    if (unlikely(!descr)) {
        return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
    }
    Py_INCREF(descr);
    #if PY_MAJOR_VERSION < 3
    if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
    #endif
    {
        descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
        if (unlikely(f)) {
            PyObject *res = f(descr, obj, (PyObject *)tp);
            Py_DECREF(descr);
            return res;
        }
    }
    return descr;
}
#endif

/* 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(PyObject *dict, void *vtable) {
#if PY_VERSION_HEX >= 0x02070000
    PyObject *ob = PyCapsule_New(vtable, 0, 0);
#else
    PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
#endif
    if (!ob)
        goto bad;
    if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
        goto bad;
    Py_DECREF(ob);
    return 0;
bad:
    Py_XDECREF(ob);
    return -1;
}

/* PyObjectGetAttrStrNoError */
static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
        __Pyx_PyErr_Clear();
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
    PyObject *result;
#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;
}

/* SetupReduce */
static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
  int ret;
  PyObject *name_attr;
  name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name);
  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_reduce_ex = NULL;
    PyObject *reduce = NULL;
    PyObject *reduce_ex = NULL;
    PyObject *reduce_cython = NULL;
    PyObject *setstate = NULL;
    PyObject *setstate_cython = NULL;
#if CYTHON_USE_PYTYPE_LOOKUP
    if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD;
#else
    if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD;
#endif
#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_GetAttrStr(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())
        PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
    ret = -1;
__PYX_GOOD:
#if !CYTHON_USE_PYTYPE_LOOKUP
    Py_XDECREF(object_reduce);
    Py_XDECREF(object_reduce_ex);
#endif
    Py_XDECREF(reduce);
    Py_XDECREF(reduce_ex);
    Py_XDECREF(reduce_cython);
    Py_XDECREF(setstate);
    Py_XDECREF(setstate_cython);
    return ret;
}

/* Import */
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
    PyObject *empty_list = 0;
    PyObject *module = 0;
    PyObject *global_dict = 0;
    PyObject *empty_dict = 0;
    PyObject *list;
    #if PY_MAJOR_VERSION < 3
    PyObject *py_import;
    py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
    if (!py_import)
        goto bad;
    #endif
    if (from_list)
        list = from_list;
    else {
        empty_list = PyList_New(0);
        if (!empty_list)
            goto bad;
        list = empty_list;
    }
    global_dict = PyModule_GetDict(__pyx_m);
    if (!global_dict)
        goto bad;
    empty_dict = PyDict_New();
    if (!empty_dict)
        goto bad;
    {
        #if PY_MAJOR_VERSION >= 3
        if (level == -1) {
            if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) {
                module = PyImport_ImportModuleLevelObject(
                    name, global_dict, empty_dict, list, 1);
                if (!module) {
                    if (!PyErr_ExceptionMatches(PyExc_ImportError))
                        goto bad;
                    PyErr_Clear();
                }
            }
            level = 0;
        }
        #endif
        if (!module) {
            #if PY_MAJOR_VERSION < 3
            PyObject *py_level = PyInt_FromLong(level);
            if (!py_level)
                goto bad;
            module = PyObject_CallFunctionObjArgs(py_import,
                name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
            Py_DECREF(py_level);
            #else
            module = PyImport_ImportModuleLevelObject(
                name, global_dict, empty_dict, list, level);
            #endif
        }
    }
bad:
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(py_import);
    #endif
    Py_XDECREF(empty_list);
    Py_XDECREF(empty_dict);
    return module;
}

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

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

/* 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_PYSTON || CYTHON_COMPILING_IN_PYPY
    if (PyMethodDescr_Check(method))
#else
    #if PY_MAJOR_VERSION == 2
    static PyTypeObject *methoddescr_type = NULL;
    if (methoddescr_type == NULL) {
       PyObject *meth = PyObject_GetAttrString((PyObject*)&PyList_Type, "append");
       if (!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);
    }
}

/* GetNameInClass */
static PyObject *__Pyx_GetGlobalNameAfterAttributeLookup(PyObject *name) {
    PyObject *result;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
        return NULL;
    __Pyx_PyErr_Clear();
    __Pyx_GetModuleGlobalNameUncached(result, name);
    return result;
}
static PyObject *__Pyx__GetNameInClass(PyObject *nmspace, PyObject *name) {
    PyObject *result;
    result = __Pyx_PyObject_GetAttrStr(nmspace, name);
    if (!result) {
        result = __Pyx_GetGlobalNameAfterAttributeLookup(name);
    }
    return result;
}

/* 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
    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 PY_MAJOR_VERSION >= 3
        #ifdef __Pyx_CyFunction_USED
        if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr)))
        #else
        if (likely(PyFunction_Check(descr) || (Py_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 (descr != NULL) {
        *method = descr;
        return 0;
    }
    PyErr_Format(PyExc_AttributeError,
#if PY_MAJOR_VERSION >= 3
                 "'%.50s' object has no attribute '%U'",
                 tp->tp_name, name);
#else
                 "'%.50s' object has no attribute '%.400s'",
                 tp->tp_name, PyString_AS_STRING(name));
#endif
    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;
}

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

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

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

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

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

/* Globals */
static PyObject* __Pyx_Globals(void) {
    Py_ssize_t i;
    PyObject *names;
    PyObject *globals = __pyx_d;
    Py_INCREF(globals);
    names = PyObject_Dir(__pyx_m);
    if (!names)
        goto bad;
    for (i = PyList_GET_SIZE(names)-1; i >= 0; i--) {
#if CYTHON_COMPILING_IN_PYPY
        PyObject* name = PySequence_ITEM(names, i);
        if (!name)
            goto bad;
#else
        PyObject* name = PyList_GET_ITEM(names, i);
#endif
        if (!PyDict_Contains(globals, name)) {
            PyObject* value = __Pyx_GetAttr(__pyx_m, name);
            if (!value) {
#if CYTHON_COMPILING_IN_PYPY
                Py_DECREF(name);
#endif
                goto bad;
            }
            if (PyDict_SetItem(globals, name, value) < 0) {
#if CYTHON_COMPILING_IN_PYPY
                Py_DECREF(name);
#endif
                Py_DECREF(value);
                goto bad;
            }
        }
#if CYTHON_COMPILING_IN_PYPY
        Py_DECREF(name);
#endif
    }
    Py_DECREF(names);
    return globals;
bad:
    Py_XDECREF(names);
    Py_XDECREF(globals);
    return NULL;
}

/* CLineInTraceback */
#ifndef CYTHON_CLINE_IN_TRACEBACK
static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) {
    PyObject *use_cline;
    PyObject *ptype, *pvalue, *ptraceback;
#if CYTHON_COMPILING_IN_CPYTHON
    PyObject **cython_runtime_dict;
#endif
    if (unlikely(!__pyx_cython_runtime)) {
        return c_line;
    }
    __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
#if CYTHON_COMPILING_IN_CPYTHON
    cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
    if (likely(cython_runtime_dict)) {
        __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_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
      if (use_cline_obj) {
        use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
        Py_DECREF(use_cline_obj);
      } else {
        PyErr_Clear();
        use_cline = NULL;
      }
    }
    if (!use_cline) {
        c_line = 0;
        (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 */
static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
    int start = 0, mid = 0, end = count - 1;
    if (end >= 0 && code_line > entries[end].code_line) {
        return count;
    }
    while (start < end) {
        mid = start + (end - start) / 2;
        if (code_line < entries[mid].code_line) {
            end = mid;
        } else if (code_line > entries[mid].code_line) {
             start = mid + 1;
        } else {
            return mid;
        }
    }
    if (code_line <= entries[mid].code_line) {
        return mid;
    } else {
        return mid + 1;
    }
}
static PyCodeObject *__pyx_find_code_object(int code_line) {
    PyCodeObject* code_object;
    int pos;
    if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
        return NULL;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
        return NULL;
    }
    code_object = __pyx_code_cache.entries[pos].code_object;
    Py_INCREF(code_object);
    return code_object;
}
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
    int pos, i;
    __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
    if (unlikely(!code_line)) {
        return;
    }
    if (unlikely(!entries)) {
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
        if (likely(entries)) {
            __pyx_code_cache.entries = entries;
            __pyx_code_cache.max_count = 64;
            __pyx_code_cache.count = 1;
            entries[0].code_line = code_line;
            entries[0].code_object = code_object;
            Py_INCREF(code_object);
        }
        return;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
        PyCodeObject* tmp = entries[pos].code_object;
        entries[pos].code_object = code_object;
        Py_DECREF(tmp);
        return;
    }
    if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
        int new_max = __pyx_code_cache.max_count + 64;
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
            __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
        if (unlikely(!entries)) {
            return;
        }
        __pyx_code_cache.entries = entries;
        __pyx_code_cache.max_count = new_max;
    }
    for (i=__pyx_code_cache.count; i>pos; i--) {
        entries[i] = entries[i-1];
    }
    entries[pos].code_line = code_line;
    entries[pos].code_object = code_object;
    __pyx_code_cache.count++;
    Py_INCREF(code_object);
}

/* AddTraceback */
#include "compile.h"
#include "frameobject.h"
#include "traceback.h"
static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
            const char *funcname, int c_line,
            int py_line, const char *filename) {
    PyCodeObject *py_code = 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,
        __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);  // XDECREF since it's only set on Py3 if cline
    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;
    if (c_line) {
        c_line = __Pyx_CLineForTraceback(tstate, c_line);
    }
    py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
    if (!py_code) {
        py_code = __Pyx_CreateCodeObjectForTraceback(
            funcname, c_line, py_line, filename);
        if (!py_code) goto bad;
        __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
    }
    py_frame = PyFrame_New(
        tstate,            /*PyThreadState *tstate,*/
        py_code,           /*PyCodeObject *code,*/
        __pyx_d,    /*PyObject *globals,*/
        0                  /*PyObject *locals*/
    );
    if (!py_frame) goto bad;
    __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
    PyTraceBack_Here(py_frame);
bad:
    Py_XDECREF(py_code);
    Py_XDECREF(py_frame);
}

/* CIntFromPyVerify */
#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
    __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
    __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
    {\
        func_type value = func_value;\
        if (sizeof(target_type) < sizeof(func_type)) {\
            if (unlikely(value != (func_type) (target_type) value)) {\
                func_type zero = 0;\
                if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
                    return (target_type) -1;\
                if (is_unsigned && unlikely(value < zero))\
                    goto raise_neg_overflow;\
                else\
                    goto raise_overflow;\
            }\
        }\
        return (target_type) value;\
    }

/* CIntFromPy */
static CYTHON_INLINE 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;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (size_t) 0;
                case  1: __PYX_VERIFY_RETURN_INT(size_t, digit, digits[0])
                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
            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
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (size_t) 0;
                case -1: __PYX_VERIFY_RETURN_INT(size_t, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(size_t,  digit, +digits[0])
                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
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            size_t val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (size_t) -1;
        }
    } else {
        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;
    }
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;
}

/* CIntFromPy */
static CYTHON_INLINE int64_t __Pyx_PyInt_As_int64_t(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const int64_t neg_one = (int64_t) -1, const_zero = (int64_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(int64_t) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(int64_t, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (int64_t) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (int64_t) 0;
                case  1: __PYX_VERIFY_RETURN_INT(int64_t, digit, digits[0])
                case 2:
                    if (8 * sizeof(int64_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int64_t) >= 2 * PyLong_SHIFT) {
                            return (int64_t) (((((int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(int64_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int64_t) >= 3 * PyLong_SHIFT) {
                            return (int64_t) (((((((int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(int64_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int64_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(int64_t) >= 4 * PyLong_SHIFT) {
                            return (int64_t) (((((((((int64_t)digits[3]) << PyLong_SHIFT) | (int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (int64_t) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(int64_t) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(int64_t, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(int64_t) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(int64_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (int64_t) 0;
                case -1: __PYX_VERIFY_RETURN_INT(int64_t, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(int64_t,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(int64_t) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int64_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int64_t) - 1 > 2 * PyLong_SHIFT) {
                            return (int64_t) (((int64_t)-1)*(((((int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(int64_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int64_t) - 1 > 2 * PyLong_SHIFT) {
                            return (int64_t) ((((((int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(int64_t) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int64_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int64_t) - 1 > 3 * PyLong_SHIFT) {
                            return (int64_t) (((int64_t)-1)*(((((((int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(int64_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int64_t) - 1 > 3 * PyLong_SHIFT) {
                            return (int64_t) ((((((((int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(int64_t) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int64_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(int64_t) - 1 > 4 * PyLong_SHIFT) {
                            return (int64_t) (((int64_t)-1)*(((((((((int64_t)digits[3]) << PyLong_SHIFT) | (int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(int64_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int64_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(int64_t) - 1 > 4 * PyLong_SHIFT) {
                            return (int64_t) ((((((((((int64_t)digits[3]) << PyLong_SHIFT) | (int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(int64_t) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(int64_t, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(int64_t) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(int64_t, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            int64_t val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (int64_t) -1;
        }
    } else {
        int64_t val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (int64_t) -1;
        val = __Pyx_PyInt_As_int64_t(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to int64_t");
    return (int64_t) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to int64_t");
    return (int64_t) -1;
}

/* CIntFromPy */
static CYTHON_INLINE int32_t __Pyx_PyInt_As_int32_t(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const int32_t neg_one = (int32_t) -1, const_zero = (int32_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(int32_t) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(int32_t, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (int32_t) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (int32_t) 0;
                case  1: __PYX_VERIFY_RETURN_INT(int32_t, digit, digits[0])
                case 2:
                    if (8 * sizeof(int32_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int32_t) >= 2 * PyLong_SHIFT) {
                            return (int32_t) (((((int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(int32_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int32_t) >= 3 * PyLong_SHIFT) {
                            return (int32_t) (((((((int32_t)digits[2]) << PyLong_SHIFT) | (int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(int32_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int32_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(int32_t) >= 4 * PyLong_SHIFT) {
                            return (int32_t) (((((((((int32_t)digits[3]) << PyLong_SHIFT) | (int32_t)digits[2]) << PyLong_SHIFT) | (int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (int32_t) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(int32_t) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(int32_t, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(int32_t) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(int32_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (int32_t) 0;
                case -1: __PYX_VERIFY_RETURN_INT(int32_t, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(int32_t,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(int32_t) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int32_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int32_t) - 1 > 2 * PyLong_SHIFT) {
                            return (int32_t) (((int32_t)-1)*(((((int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(int32_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int32_t) - 1 > 2 * PyLong_SHIFT) {
                            return (int32_t) ((((((int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(int32_t) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int32_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int32_t) - 1 > 3 * PyLong_SHIFT) {
                            return (int32_t) (((int32_t)-1)*(((((((int32_t)digits[2]) << PyLong_SHIFT) | (int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(int32_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int32_t) - 1 > 3 * PyLong_SHIFT) {
                            return (int32_t) ((((((((int32_t)digits[2]) << PyLong_SHIFT) | (int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(int32_t) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int32_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(int32_t) - 1 > 4 * PyLong_SHIFT) {
                            return (int32_t) (((int32_t)-1)*(((((((((int32_t)digits[3]) << PyLong_SHIFT) | (int32_t)digits[2]) << PyLong_SHIFT) | (int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(int32_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int32_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(int32_t) - 1 > 4 * PyLong_SHIFT) {
                            return (int32_t) ((((((((((int32_t)digits[3]) << PyLong_SHIFT) | (int32_t)digits[2]) << PyLong_SHIFT) | (int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(int32_t) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(int32_t, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(int32_t) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(int32_t, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            int32_t val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (int32_t) -1;
        }
    } else {
        int32_t val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (int32_t) -1;
        val = __Pyx_PyInt_As_int32_t(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to int32_t");
    return (int32_t) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to int32_t");
    return (int32_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
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(int),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int64_t(int64_t value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const int64_t neg_one = (int64_t) -1, const_zero = (int64_t) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(int64_t) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(int64_t) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(int64_t) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(int64_t) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(int64_t) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(int64_t),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint64_t(uint64_t value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const uint64_t neg_one = (uint64_t) -1, const_zero = (uint64_t) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(uint64_t) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(uint64_t) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(uint64_t) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(uint64_t) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(uint64_t) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(uint64_t),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const uint8_t neg_one = (uint8_t) -1, const_zero = (uint8_t) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(uint8_t) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(uint8_t) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(uint8_t) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(uint8_t) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(uint8_t) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(uint8_t),
                                     little, !is_unsigned);
    }
}

/* CIntFromPy */
static CYTHON_INLINE uint8_t __Pyx_PyInt_As_uint8_t(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const uint8_t neg_one = (uint8_t) -1, const_zero = (uint8_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(uint8_t) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(uint8_t, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (uint8_t) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (uint8_t) 0;
                case  1: __PYX_VERIFY_RETURN_INT(uint8_t, digit, digits[0])
                case 2:
                    if (8 * sizeof(uint8_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(uint8_t) >= 2 * PyLong_SHIFT) {
                            return (uint8_t) (((((uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(uint8_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(uint8_t) >= 3 * PyLong_SHIFT) {
                            return (uint8_t) (((((((uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(uint8_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint8_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(uint8_t) >= 4 * PyLong_SHIFT) {
                            return (uint8_t) (((((((((uint8_t)digits[3]) << PyLong_SHIFT) | (uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (uint8_t) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(uint8_t) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(uint8_t, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(uint8_t) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(uint8_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (uint8_t) 0;
                case -1: __PYX_VERIFY_RETURN_INT(uint8_t, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(uint8_t,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(uint8_t) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint8_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(uint8_t) - 1 > 2 * PyLong_SHIFT) {
                            return (uint8_t) (((uint8_t)-1)*(((((uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(uint8_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(uint8_t) - 1 > 2 * PyLong_SHIFT) {
                            return (uint8_t) ((((((uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(uint8_t) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint8_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(uint8_t) - 1 > 3 * PyLong_SHIFT) {
                            return (uint8_t) (((uint8_t)-1)*(((((((uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(uint8_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(uint8_t) - 1 > 3 * PyLong_SHIFT) {
                            return (uint8_t) ((((((((uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(uint8_t) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint8_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(uint8_t) - 1 > 4 * PyLong_SHIFT) {
                            return (uint8_t) (((uint8_t)-1)*(((((((((uint8_t)digits[3]) << PyLong_SHIFT) | (uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(uint8_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint8_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(uint8_t) - 1 > 4 * PyLong_SHIFT) {
                            return (uint8_t) ((((((((((uint8_t)digits[3]) << PyLong_SHIFT) | (uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(uint8_t) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(uint8_t, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(uint8_t) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(uint8_t, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            uint8_t val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (uint8_t) -1;
        }
    } else {
        uint8_t val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (uint8_t) -1;
        val = __Pyx_PyInt_As_uint8_t(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to uint8_t");
    return (uint8_t) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to uint8_t");
    return (uint8_t) -1;
}

/* CIntFromPy */
static CYTHON_INLINE uint64_t __Pyx_PyInt_As_uint64_t(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const uint64_t neg_one = (uint64_t) -1, const_zero = (uint64_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(uint64_t) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(uint64_t, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (uint64_t) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (uint64_t) 0;
                case  1: __PYX_VERIFY_RETURN_INT(uint64_t, digit, digits[0])
                case 2:
                    if (8 * sizeof(uint64_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint64_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(uint64_t) >= 2 * PyLong_SHIFT) {
                            return (uint64_t) (((((uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(uint64_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint64_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(uint64_t) >= 3 * PyLong_SHIFT) {
                            return (uint64_t) (((((((uint64_t)digits[2]) << PyLong_SHIFT) | (uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(uint64_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint64_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(uint64_t) >= 4 * PyLong_SHIFT) {
                            return (uint64_t) (((((((((uint64_t)digits[3]) << PyLong_SHIFT) | (uint64_t)digits[2]) << PyLong_SHIFT) | (uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (uint64_t) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(uint64_t) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(uint64_t, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(uint64_t) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(uint64_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (uint64_t) 0;
                case -1: __PYX_VERIFY_RETURN_INT(uint64_t, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(uint64_t,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(uint64_t) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint64_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(uint64_t) - 1 > 2 * PyLong_SHIFT) {
                            return (uint64_t) (((uint64_t)-1)*(((((uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(uint64_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint64_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(uint64_t) - 1 > 2 * PyLong_SHIFT) {
                            return (uint64_t) ((((((uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(uint64_t) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint64_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(uint64_t) - 1 > 3 * PyLong_SHIFT) {
                            return (uint64_t) (((uint64_t)-1)*(((((((uint64_t)digits[2]) << PyLong_SHIFT) | (uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(uint64_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint64_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(uint64_t) - 1 > 3 * PyLong_SHIFT) {
                            return (uint64_t) ((((((((uint64_t)digits[2]) << PyLong_SHIFT) | (uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(uint64_t) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint64_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(uint64_t) - 1 > 4 * PyLong_SHIFT) {
                            return (uint64_t) (((uint64_t)-1)*(((((((((uint64_t)digits[3]) << PyLong_SHIFT) | (uint64_t)digits[2]) << PyLong_SHIFT) | (uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(uint64_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint64_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(uint64_t) - 1 > 4 * PyLong_SHIFT) {
                            return (uint64_t) ((((((((((uint64_t)digits[3]) << PyLong_SHIFT) | (uint64_t)digits[2]) << PyLong_SHIFT) | (uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(uint64_t) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(uint64_t, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(uint64_t) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(uint64_t, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            uint64_t val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (uint64_t) -1;
        }
    } else {
        uint64_t val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (uint64_t) -1;
        val = __Pyx_PyInt_As_uint64_t(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to uint64_t");
    return (uint64_t) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to uint64_t");
    return (uint64_t) -1;
}

/* 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
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(long),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int32_t(int32_t value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const int32_t neg_one = (int32_t) -1, const_zero = (int32_t) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(int32_t) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(int32_t) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(int32_t) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(int32_t) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(int32_t) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(int32_t),
                                     little, !is_unsigned);
    }
}

/* 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;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (long) 0;
                case  1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
                case 2:
                    if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
                            return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
                            return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
                            return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (long) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(long) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (long) 0;
                case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(long,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                            return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                            return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                            return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                            return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                            return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                            return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(long) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            long val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (long) -1;
        }
    } else {
        long val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (long) -1;
        val = __Pyx_PyInt_As_long(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to long");
    return (long) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to long");
    return (long) -1;
}

/* CIntFromPy */
static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
#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;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (int) 0;
                case  1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
                case 2:
                    if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
                            return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
                            return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
                            return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (int) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(int) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (int) 0;
                case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(int,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
                            return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
                            return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
                            return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
                            return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
                            return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
                            return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(int) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            int val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (int) -1;
        }
    } else {
        int val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (int) -1;
        val = __Pyx_PyInt_As_int(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to int");
    return (int) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to int");
    return (int) -1;
}

/* FastTypeChecks */
#if CYTHON_COMPILING_IN_CPYTHON
static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
    while (a) {
        a = a->tp_base;
        if (a == b)
            return 1;
    }
    return b == &PyBaseObject_Type;
}
static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
    PyObject *mro;
    if (a == b) return 1;
    mro = a->tp_mro;
    if (likely(mro)) {
        Py_ssize_t i, n;
        n = PyTuple_GET_SIZE(mro);
        for (i = 0; i < n; i++) {
            if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
                return 1;
        }
        return 0;
    }
    return __Pyx_InBases(a, b);
}
#if PY_MAJOR_VERSION == 2
static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
    PyObject *exception, *value, *tb;
    int res;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&exception, &value, &tb);
    res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
    if (unlikely(res == -1)) {
        PyErr_WriteUnraisable(err);
        res = 0;
    }
    if (!res) {
        res = PyObject_IsSubclass(err, exc_type2);
        if (unlikely(res == -1)) {
            PyErr_WriteUnraisable(err);
            res = 0;
        }
    }
    __Pyx_ErrRestore(exception, value, tb);
    return res;
}
#else
static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
    int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
    if (!res) {
        res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
    }
    return res;
}
#endif
static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
    Py_ssize_t i, n;
    assert(PyExceptionClass_Check(exc_type));
    n = PyTuple_GET_SIZE(tuple);
#if PY_MAJOR_VERSION >= 3
    for (i=0; i<n; i++) {
        if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
    }
#endif
    for (i=0; i<n; i++) {
        PyObject *t = PyTuple_GET_ITEM(tuple, i);
        #if PY_MAJOR_VERSION < 3
        if (likely(exc_type == t)) return 1;
        #endif
        if (likely(PyExceptionClass_Check(t))) {
            if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
        } else {
        }
    }
    return 0;
}
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
    if (likely(err == exc_type)) return 1;
    if (likely(PyExceptionClass_Check(err))) {
        if (likely(PyExceptionClass_Check(exc_type))) {
            return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
        } else if (likely(PyTuple_Check(exc_type))) {
            return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
        } else {
        }
    }
    return PyErr_GivenExceptionMatches(err, exc_type);
}
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
    assert(PyExceptionClass_Check(exc_type1));
    assert(PyExceptionClass_Check(exc_type2));
    if (likely(err == exc_type1 || err == exc_type2)) return 1;
    if (likely(PyExceptionClass_Check(err))) {
        return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
    }
    return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
}
#endif

/* FetchCommonType */
static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
    PyObject* fake_module;
    PyTypeObject* cached_type = NULL;
    fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
    if (!fake_module) return NULL;
    Py_INCREF(fake_module);
    cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
    if (cached_type) {
        if (!PyType_Check((PyObject*)cached_type)) {
            PyErr_Format(PyExc_TypeError,
                "Shared Cython type %.200s is not a type object",
                type->tp_name);
            goto bad;
        }
        if (cached_type->tp_basicsize != type->tp_basicsize) {
            PyErr_Format(PyExc_TypeError,
                "Shared Cython type %.200s has the wrong size, try recompiling",
                type->tp_name);
            goto bad;
        }
    } else {
        if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
        PyErr_Clear();
        if (PyType_Ready(type) < 0) goto bad;
        if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
            goto bad;
        Py_INCREF(type);
        cached_type = type;
    }
done:
    Py_DECREF(fake_module);
    return cached_type;
bad:
    Py_XDECREF(cached_type);
    cached_type = NULL;
    goto done;
}

/* PyObjectCallMethod1 */
static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) {
    PyObject *result = __Pyx_PyObject_CallOneArg(method, arg);
    Py_DECREF(method);
    return result;
}
static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
    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);
}

/* CoroutineBase */
#include <structmember.h>
#include <frameobject.h>
#define __Pyx_Coroutine_Undelegate(gen) Py_CLEAR((gen)->yieldfrom)
static int __Pyx_PyGen__FetchStopIterationValue(CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject **pvalue) {
    PyObject *et, *ev, *tb;
    PyObject *value = NULL;
    __Pyx_ErrFetch(&et, &ev, &tb);
    if (!et) {
        Py_XDECREF(tb);
        Py_XDECREF(ev);
        Py_INCREF(Py_None);
        *pvalue = Py_None;
        return 0;
    }
    if (likely(et == PyExc_StopIteration)) {
        if (!ev) {
            Py_INCREF(Py_None);
            value = Py_None;
        }
#if PY_VERSION_HEX >= 0x030300A0
        else if (Py_TYPE(ev) == (PyTypeObject*)PyExc_StopIteration) {
            value = ((PyStopIterationObject *)ev)->value;
            Py_INCREF(value);
            Py_DECREF(ev);
        }
#endif
        else if (unlikely(PyTuple_Check(ev))) {
            if (PyTuple_GET_SIZE(ev) >= 1) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                value = PyTuple_GET_ITEM(ev, 0);
                Py_INCREF(value);
#else
                value = PySequence_ITEM(ev, 0);
#endif
            } else {
                Py_INCREF(Py_None);
                value = Py_None;
            }
            Py_DECREF(ev);
        }
        else if (!__Pyx_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration)) {
            value = ev;
        }
        if (likely(value)) {
            Py_XDECREF(tb);
            Py_DECREF(et);
            *pvalue = value;
            return 0;
        }
    } else if (!__Pyx_PyErr_GivenExceptionMatches(et, PyExc_StopIteration)) {
        __Pyx_ErrRestore(et, ev, tb);
        return -1;
    }
    PyErr_NormalizeException(&et, &ev, &tb);
    if (unlikely(!PyObject_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration))) {
        __Pyx_ErrRestore(et, ev, tb);
        return -1;
    }
    Py_XDECREF(tb);
    Py_DECREF(et);
#if PY_VERSION_HEX >= 0x030300A0
    value = ((PyStopIterationObject *)ev)->value;
    Py_INCREF(value);
    Py_DECREF(ev);
#else
    {
        PyObject* args = __Pyx_PyObject_GetAttrStr(ev, __pyx_n_s_args);
        Py_DECREF(ev);
        if (likely(args)) {
            value = PySequence_GetItem(args, 0);
            Py_DECREF(args);
        }
        if (unlikely(!value)) {
            __Pyx_ErrRestore(NULL, NULL, NULL);
            Py_INCREF(Py_None);
            value = Py_None;
        }
    }
#endif
    *pvalue = value;
    return 0;
}
static CYTHON_INLINE
void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *exc_state) {
    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);
}
#define __Pyx_Coroutine_AlreadyRunningError(gen)  (__Pyx__Coroutine_AlreadyRunningError(gen), (PyObject*)NULL)
static void __Pyx__Coroutine_AlreadyRunningError(CYTHON_UNUSED __pyx_CoroutineObject *gen) {
    const char *msg;
    if ((0)) {
    #ifdef __Pyx_Coroutine_USED
    } else if (__Pyx_Coroutine_Check((PyObject*)gen)) {
        msg = "coroutine already executing";
    #endif
    #ifdef __Pyx_AsyncGen_USED
    } else if (__Pyx_AsyncGen_CheckExact((PyObject*)gen)) {
        msg = "async generator already executing";
    #endif
    } else {
        msg = "generator already executing";
    }
    PyErr_SetString(PyExc_ValueError, msg);
}
#define __Pyx_Coroutine_NotStartedError(gen)  (__Pyx__Coroutine_NotStartedError(gen), (PyObject*)NULL)
static void __Pyx__Coroutine_NotStartedError(CYTHON_UNUSED PyObject *gen) {
    const char *msg;
    if ((0)) {
    #ifdef __Pyx_Coroutine_USED
    } else if (__Pyx_Coroutine_Check(gen)) {
        msg = "can't send non-None value to a just-started coroutine";
    #endif
    #ifdef __Pyx_AsyncGen_USED
    } else if (__Pyx_AsyncGen_CheckExact(gen)) {
        msg = "can't send non-None value to a just-started async generator";
    #endif
    } else {
        msg = "can't send non-None value to a just-started generator";
    }
    PyErr_SetString(PyExc_TypeError, msg);
}
#define __Pyx_Coroutine_AlreadyTerminatedError(gen, value, closing)  (__Pyx__Coroutine_AlreadyTerminatedError(gen, value, closing), (PyObject*)NULL)
static void __Pyx__Coroutine_AlreadyTerminatedError(CYTHON_UNUSED PyObject *gen, PyObject *value, CYTHON_UNUSED int closing) {
    #ifdef __Pyx_Coroutine_USED
    if (!closing && __Pyx_Coroutine_Check(gen)) {
        PyErr_SetString(PyExc_RuntimeError, "cannot reuse already awaited coroutine");
    } else
    #endif
    if (value) {
        #ifdef __Pyx_AsyncGen_USED
        if (__Pyx_AsyncGen_CheckExact(gen))
            PyErr_SetNone(__Pyx_PyExc_StopAsyncIteration);
        else
        #endif
        PyErr_SetNone(PyExc_StopIteration);
    }
}
static
PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value, int closing) {
    __Pyx_PyThreadState_declare
    PyThreadState *tstate;
    __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_type) {
        #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON
        #else
        if (exc_state->exc_traceback) {
            PyTracebackObject *tb = (PyTracebackObject *) exc_state->exc_traceback;
            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
        }
        #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((PyObject *) 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) {
    PyObject *exc_tb = exc_state->exc_traceback;
    if (likely(exc_tb)) {
#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON
#else
        PyTracebackObject *tb = (PyTracebackObject *) exc_tb;
        PyFrameObject *f = tb->tb_frame;
        Py_CLEAR(f->f_back);
#endif
    }
}
static CYTHON_INLINE
PyObject *__Pyx_Coroutine_MethodReturn(CYTHON_UNUSED PyObject* gen, PyObject *retval) {
    if (unlikely(!retval)) {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        if (!__Pyx_PyErr_Occurred()) {
            PyObject *exc = PyExc_StopIteration;
            #ifdef __Pyx_AsyncGen_USED
            if (__Pyx_AsyncGen_CheckExact(gen))
                exc = __Pyx_PyExc_StopAsyncIteration;
            #endif
            __Pyx_PyErr_SetNone(exc);
        }
    }
    return retval;
}
#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 {
            _PyGen_SetStopIterationValue(result);
        }
        Py_CLEAR(result);
    }
    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 = Py_TYPE(yf)->tp_iternext(yf);
            else
                ret = __Pyx_PyObject_CallMethod1(yf, __pyx_n_s_send, value);
        }
        gen->is_running = 0;
        if (likely(ret)) {
            return ret;
        }
        retval = __Pyx_Coroutine_FinishDelegation(gen);
    } else {
        retval = __Pyx_Coroutine_SendEx(gen, value, 0);
    }
    return __Pyx_Coroutine_MethodReturn(self, retval);
}
static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) {
    PyObject *retval = NULL;
    int err = 0;
    #ifdef __Pyx_Generator_USED
    if (__Pyx_Generator_CheckExact(yf)) {
        retval = __Pyx_Coroutine_Close(yf);
        if (!retval)
            return -1;
    } else
    #endif
    #ifdef __Pyx_Coroutine_USED
    if (__Pyx_Coroutine_Check(yf)) {
        retval = __Pyx_Coroutine_Close(yf);
        if (!retval)
            return -1;
    } else
    if (__Pyx_CoroutineAwait_CheckExact(yf)) {
        retval = __Pyx_CoroutineAwait_Close((__pyx_CoroutineAwaitObject*)yf, 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_GetAttrStr(yf, __pyx_n_s_close);
        if (unlikely(!meth)) {
            if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
                PyErr_WriteUnraisable(yf);
            }
            PyErr_Clear();
        } else {
            retval = PyObject_CallFunction(meth, NULL);
            Py_DECREF(meth);
            if (!retval)
                err = -1;
        }
        gen->is_running = 0;
    }
    Py_XDECREF(retval);
    return err;
}
static PyObject *__Pyx_Generator_Next(PyObject *self) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
    PyObject *yf = gen->yieldfrom;
    if (unlikely(gen->is_running))
        return __Pyx_Coroutine_AlreadyRunningError(gen);
    if (yf) {
        PyObject *ret;
        gen->is_running = 1;
        #ifdef __Pyx_Generator_USED
        if (__Pyx_Generator_CheckExact(yf)) {
            ret = __Pyx_Generator_Next(yf);
        } else
        #endif
        #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
        if (PyGen_CheckExact(yf)) {
            ret = __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 = Py_TYPE(yf)->tp_iternext(yf);
        gen->is_running = 0;
        if (likely(ret)) {
            return ret;
        }
        return __Pyx_Coroutine_FinishDelegation(gen);
    }
    return __Pyx_Coroutine_SendEx(gen, Py_None, 0);
}
static PyObject *__Pyx_Coroutine_Close_Method(PyObject *self, CYTHON_UNUSED PyObject *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_GetAttrStr(yf, __pyx_n_s_throw);
            if (unlikely(!meth)) {
                Py_DECREF(yf);
                if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
                    gen->is_running = 0;
                    return NULL;
                }
                PyErr_Clear();
                __Pyx_Coroutine_Undelegate(gen);
                gen->is_running = 0;
                goto throw_here;
            }
            if (likely(args)) {
                ret = PyObject_CallObject(meth, args);
            } else {
                ret = PyObject_CallFunctionObjArgs(meth, typ, val, tb, NULL);
            }
            Py_DECREF(meth);
        }
        gen->is_running = 0;
        Py_DECREF(yf);
        if (!ret) {
            ret = __Pyx_Coroutine_FinishDelegation(gen);
        }
        return __Pyx_Coroutine_MethodReturn(self, ret);
    }
throw_here:
    __Pyx_Raise(typ, val, tb, NULL);
    return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0));
}
static PyObject *__Pyx_Coroutine_Throw(PyObject *self, PyObject *args) {
    PyObject *typ;
    PyObject *val = NULL;
    PyObject *tb = NULL;
    if (!PyArg_UnpackTuple(args, (char *)"throw", 1, 3, &typ, &val, &tb))
        return NULL;
    return __Pyx__Coroutine_Throw(self, typ, val, tb, args, 1);
}
static CYTHON_INLINE int __Pyx_Coroutine_traverse_excstate(__Pyx_ExcInfoStruct *exc_state, visitproc visit, void *arg) {
    Py_VISIT(exc_state->exc_type);
    Py_VISIT(exc_state->exc_value);
    Py_VISIT(exc_state->exc_traceback);
    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 (PyObject_CallFinalizerFromDealloc(self))
#else
        Py_TYPE(gen)->tp_del(self);
        if (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);
    PyObject_GC_Del(gen);
}
static void __Pyx_Coroutine_del(PyObject *self) {
    PyObject *error_type, *error_value, *error_traceback;
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    __Pyx_PyThreadState_declare
    if (gen->resume_label < 0) {
        return;
    }
#if !CYTHON_USE_TP_FINALIZE
    assert(self->ob_refcnt == 0);
    __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 (--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, CYTHON_UNUSED void *context)
{
    PyObject *name = self->gi_name;
    if (unlikely(!name)) name = Py_None;
    Py_INCREF(name);
    return name;
}
static int
__Pyx_Coroutine_set_name(__pyx_CoroutineObject *self, PyObject *value, CYTHON_UNUSED void *context)
{
    PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value)))
#else
    if (unlikely(value == NULL || !PyString_Check(value)))
#endif
    {
        PyErr_SetString(PyExc_TypeError,
                        "__name__ must be set to a string object");
        return -1;
    }
    tmp = self->gi_name;
    Py_INCREF(value);
    self->gi_name = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_Coroutine_get_qualname(__pyx_CoroutineObject *self, CYTHON_UNUSED void *context)
{
    PyObject *name = self->gi_qualname;
    if (unlikely(!name)) name = Py_None;
    Py_INCREF(name);
    return name;
}
static int
__Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *self, PyObject *value, CYTHON_UNUSED void *context)
{
    PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value)))
#else
    if (unlikely(value == NULL || !PyString_Check(value)))
#endif
    {
        PyErr_SetString(PyExc_TypeError,
                        "__qualname__ must be set to a string object");
        return -1;
    }
    tmp = self->gi_qualname;
    Py_INCREF(value);
    self->gi_qualname = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_Coroutine_get_frame(__pyx_CoroutineObject *self, CYTHON_UNUSED void *context)
{
    PyObject *frame = self->gi_frame;
    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;
    gen->gi_exc_state.exc_type = NULL;
    gen->gi_exc_state.exc_value = NULL;
    gen->gi_exc_state.exc_traceback = NULL;
#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 (!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},
    {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}
};
static PyTypeObject __pyx_GeneratorType_type = {
    PyVarObject_HEAD_INIT(0, 0)
    "generator",
    sizeof(__pyx_CoroutineObject),
    0,
    (destructor) __Pyx_Coroutine_dealloc,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE,
    0,
    (traverseproc) __Pyx_Coroutine_traverse,
    0,
    0,
    offsetof(__pyx_CoroutineObject, gi_weakreflist),
    0,
    (iternextfunc) __Pyx_Generator_Next,
    __pyx_Generator_methods,
    __pyx_Generator_memberlist,
    __pyx_Generator_getsets,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
#if CYTHON_USE_TP_FINALIZE
    0,
#else
    __Pyx_Coroutine_del,
#endif
    0,
#if CYTHON_USE_TP_FINALIZE
    __Pyx_Coroutine_del,
#elif PY_VERSION_HEX >= 0x030400a1
    0,
#endif
#if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
    0,
#endif
#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
    0,
#endif
#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
    0,
#endif
};
static int __pyx_Generator_init(void) {
    __pyx_GeneratorType_type.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
    __pyx_GeneratorType_type.tp_iter = PyObject_SelfIter;
    __pyx_GeneratorType = __Pyx_FetchCommonType(&__pyx_GeneratorType_type);
    if (unlikely(!__pyx_GeneratorType)) {
        return -1;
    }
    return 0;
}

/* CheckBinaryVersion */
static int __Pyx_check_binary_version(void) {
    char ctversion[4], rtversion[4];
    PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
    PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
    if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
        char message[200];
        PyOS_snprintf(message, sizeof(message),
                      "compiletime version %s of module '%.100s' "
                      "does not match runtime version %s",
                      ctversion, __Pyx_MODULE_NAME, rtversion);
        return PyErr_WarnEx(NULL, message, 1);
    }
    return 0;
}

/* FunctionExport */
static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) {
    PyObject *d = 0;
    PyObject *cobj = 0;
    union {
        void (*fp)(void);
        void *p;
    } tmp;
    d = PyObject_GetAttrString(__pyx_m, (char *)"__pyx_capi__");
    if (!d) {
        PyErr_Clear();
        d = PyDict_New();
        if (!d)
            goto bad;
        Py_INCREF(d);
        if (PyModule_AddObject(__pyx_m, (char *)"__pyx_capi__", d) < 0)
            goto bad;
    }
    tmp.fp = f;
#if PY_VERSION_HEX >= 0x02070000
    cobj = PyCapsule_New(tmp.p, sig, 0);
#else
    cobj = PyCObject_FromVoidPtrAndDesc(tmp.p, (void *)sig, 0);
#endif
    if (!cobj)
        goto bad;
    if (PyDict_SetItemString(d, name, cobj) < 0)
        goto bad;
    Py_DECREF(cobj);
    Py_DECREF(d);
    return 0;
bad:
    Py_XDECREF(cobj);
    Py_XDECREF(d);
    return -1;
}

/* InitStrings */
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
    while (t->p) {
        #if PY_MAJOR_VERSION < 3
        if (t->is_unicode) {
            *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
        } else if (t->intern) {
            *t->p = PyString_InternFromString(t->s);
        } else {
            *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
        }
        #else
        if (t->is_unicode | t->is_str) {
            if (t->intern) {
                *t->p = PyUnicode_InternFromString(t->s);
            } else if (t->encoding) {
                *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
            } else {
                *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
            }
        } else {
            *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
        }
        #endif
        if (!*t->p)
            return -1;
        if (PyObject_Hash(*t->p) == -1)
            return -1;
        ++t;
    }
    return 0;
}

static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
    return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
}
static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
    Py_ssize_t ignore;
    return __Pyx_PyObject_AsStringAndSize(o, &ignore);
}
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
#if !CYTHON_PEP393_ENABLED
static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
    char* defenc_c;
    PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
    if (!defenc) return NULL;
    defenc_c = PyBytes_AS_STRING(defenc);
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
    {
        char* end = defenc_c + PyBytes_GET_SIZE(defenc);
        char* c;
        for (c = defenc_c; c < end; c++) {
            if ((unsigned char) (*c) >= 128) {
                PyUnicode_AsASCIIString(o);
                return NULL;
            }
        }
    }
#endif
    *length = PyBytes_GET_SIZE(defenc);
    return defenc_c;
}
#else
static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
    if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
    if (likely(PyUnicode_IS_ASCII(o))) {
        *length = PyUnicode_GET_LENGTH(o);
        return PyUnicode_AsUTF8(o);
    } else {
        PyUnicode_AsASCIIString(o);
        return NULL;
    }
#else
    return PyUnicode_AsUTF8AndSize(o, length);
#endif
}
#endif
#endif
static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
    if (
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
            __Pyx_sys_getdefaultencoding_not_ascii &&
#endif
            PyUnicode_Check(o)) {
        return __Pyx_PyUnicode_AsStringAndSize(o, length);
    } else
#endif
#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
    if (PyByteArray_Check(o)) {
        *length = PyByteArray_GET_SIZE(o);
        return PyByteArray_AS_STRING(o);
    } else
#endif
    {
        char* result;
        int r = PyBytes_AsStringAndSize(o, &result, length);
        if (unlikely(r < 0)) {
            return NULL;
        } else {
            return result;
        }
    }
}
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
   int is_true = x == Py_True;
   if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
   else return PyObject_IsTrue(x);
}
static 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) {
#if PY_MAJOR_VERSION >= 3
    if (PyLong_Check(result)) {
        if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
                "__int__ returned non-int (type %.200s).  "
                "The ability to return an instance of a strict subclass of int "
                "is deprecated, and may be removed in a future version of Python.",
                Py_TYPE(result)->tp_name)) {
            Py_DECREF(result);
            return NULL;
        }
        return result;
    }
#endif
    PyErr_Format(PyExc_TypeError,
                 "__%.4s__ returned non-%.4s (type %.200s)",
                 type_name, type_name, Py_TYPE(result)->tp_name);
    Py_DECREF(result);
    return NULL;
}
static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
#if CYTHON_USE_TYPE_SLOTS
  PyNumberMethods *m;
#endif
  const char *name = NULL;
  PyObject *res = NULL;
#if PY_MAJOR_VERSION < 3
  if (likely(PyInt_Check(x) || PyLong_Check(x)))
#else
  if (likely(PyLong_Check(x)))
#endif
    return __Pyx_NewRef(x);
#if CYTHON_USE_TYPE_SLOTS
  m = Py_TYPE(x)->tp_as_number;
  #if PY_MAJOR_VERSION < 3
  if (m && m->nb_int) {
    name = "int";
    res = m->nb_int(x);
  }
  else if (m && m->nb_long) {
    name = "long";
    res = m->nb_long(x);
  }
  #else
  if (likely(m && m->nb_int)) {
    name = "int";
    res = m->nb_int(x);
  }
  #endif
#else
  if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
    res = PyNumber_Int(x);
  }
#endif
  if (likely(res)) {
#if PY_MAJOR_VERSION < 3
    if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
#else
    if (unlikely(!PyLong_CheckExact(res))) {
#endif
        return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
    }
  }
  else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_TypeError,
                    "an integer is required");
  }
  return res;
}
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
  Py_ssize_t ival;
  PyObject *x;
#if PY_MAJOR_VERSION < 3
  if (likely(PyInt_CheckExact(b))) {
    if (sizeof(Py_ssize_t) >= sizeof(long))
        return PyInt_AS_LONG(b);
    else
        return PyInt_AsSsize_t(b);
  }
#endif
  if (likely(PyLong_CheckExact(b))) {
    #if CYTHON_USE_PYLONG_INTERNALS
    const digit* digits = ((PyLongObject*)b)->ob_digit;
    const Py_ssize_t size = Py_SIZE(b);
    if (likely(__Pyx_sst_abs(size) <= 1)) {
        ival = likely(size) ? digits[0] : 0;
        if (size == -1) ival = -ival;
        return ival;
    } else {
      switch (size) {
         case 2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case 3:
           if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -3:
           if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case 4:
           if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -4:
           if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
      }
    }
    #endif
    return PyLong_AsSsize_t(b);
  }
  x = PyNumber_Index(b);
  if (!x) return -1;
  ival = PyInt_AsSsize_t(x);
  Py_DECREF(x);
  return ival;
}
static CYTHON_INLINE 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);
}


#endif /* Py_PYTHON_H */
