/* Generated by Cython 0.27.3 */

#define PY_SSIZE_T_CLEAN
#include "Python.h"
#ifndef Py_PYTHON_H
    #error Python headers needed to compile C extensions, please install development version of Python.
#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
    #error Cython requires Python 2.6+ or Python 3.3+.
#else
#define CYTHON_ABI "0_27_3"
#define CYTHON_FUTURE_DIVISION 0
#include <stddef.h>
#ifndef offsetof
  #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
#endif
#if !defined(WIN32) && !defined(MS_WINDOWS)
  #ifndef __stdcall
    #define __stdcall
  #endif
  #ifndef __cdecl
    #define __cdecl
  #endif
  #ifndef __fastcall
    #define __fastcall
  #endif
#endif
#ifndef DL_IMPORT
  #define DL_IMPORT(t) t
#endif
#ifndef DL_EXPORT
  #define DL_EXPORT(t) t
#endif
#define __PYX_COMMA ,
#ifndef HAVE_LONG_LONG
  #if PY_VERSION_HEX >= 0x02070000
    #define HAVE_LONG_LONG
  #endif
#endif
#ifndef PY_LONG_LONG
  #define PY_LONG_LONG LONG_LONG
#endif
#ifndef Py_HUGE_VAL
  #define Py_HUGE_VAL HUGE_VAL
#endif
#ifdef PYPY_VERSION
  #define CYTHON_COMPILING_IN_PYPY 1
  #define CYTHON_COMPILING_IN_PYSTON 0
  #define CYTHON_COMPILING_IN_CPYTHON 0
  #undef CYTHON_USE_TYPE_SLOTS
  #define CYTHON_USE_TYPE_SLOTS 0
  #undef CYTHON_USE_PYTYPE_LOOKUP
  #define CYTHON_USE_PYTYPE_LOOKUP 0
  #if PY_VERSION_HEX < 0x03050000
    #undef CYTHON_USE_ASYNC_SLOTS
    #define CYTHON_USE_ASYNC_SLOTS 0
  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
    #define CYTHON_USE_ASYNC_SLOTS 1
  #endif
  #undef CYTHON_USE_PYLIST_INTERNALS
  #define CYTHON_USE_PYLIST_INTERNALS 0
  #undef CYTHON_USE_UNICODE_INTERNALS
  #define CYTHON_USE_UNICODE_INTERNALS 0
  #undef CYTHON_USE_UNICODE_WRITER
  #define CYTHON_USE_UNICODE_WRITER 0
  #undef CYTHON_USE_PYLONG_INTERNALS
  #define CYTHON_USE_PYLONG_INTERNALS 0
  #undef CYTHON_AVOID_BORROWED_REFS
  #define CYTHON_AVOID_BORROWED_REFS 1
  #undef CYTHON_ASSUME_SAFE_MACROS
  #define CYTHON_ASSUME_SAFE_MACROS 0
  #undef CYTHON_UNPACK_METHODS
  #define CYTHON_UNPACK_METHODS 0
  #undef CYTHON_FAST_THREAD_STATE
  #define CYTHON_FAST_THREAD_STATE 0
  #undef CYTHON_FAST_PYCALL
  #define CYTHON_FAST_PYCALL 0
  #undef CYTHON_PEP489_MULTI_PHASE_INIT
  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
  #undef CYTHON_USE_TP_FINALIZE
  #define CYTHON_USE_TP_FINALIZE 0
#elif defined(PYSTON_VERSION)
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_PYSTON 1
  #define CYTHON_COMPILING_IN_CPYTHON 0
  #ifndef CYTHON_USE_TYPE_SLOTS
    #define CYTHON_USE_TYPE_SLOTS 1
  #endif
  #undef CYTHON_USE_PYTYPE_LOOKUP
  #define CYTHON_USE_PYTYPE_LOOKUP 0
  #undef CYTHON_USE_ASYNC_SLOTS
  #define CYTHON_USE_ASYNC_SLOTS 0
  #undef CYTHON_USE_PYLIST_INTERNALS
  #define CYTHON_USE_PYLIST_INTERNALS 0
  #ifndef CYTHON_USE_UNICODE_INTERNALS
    #define CYTHON_USE_UNICODE_INTERNALS 1
  #endif
  #undef CYTHON_USE_UNICODE_WRITER
  #define CYTHON_USE_UNICODE_WRITER 0
  #undef CYTHON_USE_PYLONG_INTERNALS
  #define CYTHON_USE_PYLONG_INTERNALS 0
  #ifndef CYTHON_AVOID_BORROWED_REFS
    #define CYTHON_AVOID_BORROWED_REFS 0
  #endif
  #ifndef CYTHON_ASSUME_SAFE_MACROS
    #define CYTHON_ASSUME_SAFE_MACROS 1
  #endif
  #ifndef CYTHON_UNPACK_METHODS
    #define CYTHON_UNPACK_METHODS 1
  #endif
  #undef CYTHON_FAST_THREAD_STATE
  #define CYTHON_FAST_THREAD_STATE 0
  #undef CYTHON_FAST_PYCALL
  #define CYTHON_FAST_PYCALL 0
  #undef CYTHON_PEP489_MULTI_PHASE_INIT
  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
  #undef CYTHON_USE_TP_FINALIZE
  #define CYTHON_USE_TP_FINALIZE 0
#else
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_PYSTON 0
  #define CYTHON_COMPILING_IN_CPYTHON 1
  #ifndef CYTHON_USE_TYPE_SLOTS
    #define CYTHON_USE_TYPE_SLOTS 1
  #endif
  #if PY_VERSION_HEX < 0x02070000
    #undef CYTHON_USE_PYTYPE_LOOKUP
    #define CYTHON_USE_PYTYPE_LOOKUP 0
  #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
    #define CYTHON_USE_PYTYPE_LOOKUP 1
  #endif
  #if PY_MAJOR_VERSION < 3
    #undef CYTHON_USE_ASYNC_SLOTS
    #define CYTHON_USE_ASYNC_SLOTS 0
  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
    #define CYTHON_USE_ASYNC_SLOTS 1
  #endif
  #if PY_VERSION_HEX < 0x02070000
    #undef CYTHON_USE_PYLONG_INTERNALS
    #define CYTHON_USE_PYLONG_INTERNALS 0
  #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
    #define CYTHON_USE_PYLONG_INTERNALS 1
  #endif
  #ifndef CYTHON_USE_PYLIST_INTERNALS
    #define CYTHON_USE_PYLIST_INTERNALS 1
  #endif
  #ifndef CYTHON_USE_UNICODE_INTERNALS
    #define CYTHON_USE_UNICODE_INTERNALS 1
  #endif
  #if PY_VERSION_HEX < 0x030300F0
    #undef CYTHON_USE_UNICODE_WRITER
    #define CYTHON_USE_UNICODE_WRITER 0
  #elif !defined(CYTHON_USE_UNICODE_WRITER)
    #define CYTHON_USE_UNICODE_WRITER 1
  #endif
  #ifndef CYTHON_AVOID_BORROWED_REFS
    #define CYTHON_AVOID_BORROWED_REFS 0
  #endif
  #ifndef CYTHON_ASSUME_SAFE_MACROS
    #define CYTHON_ASSUME_SAFE_MACROS 1
  #endif
  #ifndef CYTHON_UNPACK_METHODS
    #define CYTHON_UNPACK_METHODS 1
  #endif
  #ifndef CYTHON_FAST_THREAD_STATE
    #define CYTHON_FAST_THREAD_STATE 1
  #endif
  #ifndef CYTHON_FAST_PYCALL
    #define CYTHON_FAST_PYCALL 1
  #endif
  #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
    #define CYTHON_PEP489_MULTI_PHASE_INIT (0 && PY_VERSION_HEX >= 0x03050000)
  #endif
  #ifndef CYTHON_USE_TP_FINALIZE
    #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
  #endif
#endif
#if !defined(CYTHON_FAST_PYCCALL)
#define CYTHON_FAST_PYCCALL  (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
#endif
#if CYTHON_USE_PYLONG_INTERNALS
  #include "longintrepr.h"
  #undef SHIFT
  #undef BASE
  #undef MASK
#endif
#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
  #define Py_OptimizeFlag 0
#endif
#define __PYX_BUILD_PY_SSIZE_T "n"
#define CYTHON_FORMAT_SSIZE_T "z"
#if PY_MAJOR_VERSION < 3
  #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
          PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
  #define __Pyx_DefaultClassType PyClass_Type
#else
  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
          PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
  #define __Pyx_DefaultClassType PyType_Type
#endif
#ifndef Py_TPFLAGS_CHECKTYPES
  #define Py_TPFLAGS_CHECKTYPES 0
#endif
#ifndef Py_TPFLAGS_HAVE_INDEX
  #define Py_TPFLAGS_HAVE_INDEX 0
#endif
#ifndef Py_TPFLAGS_HAVE_NEWBUFFER
  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
#endif
#ifndef Py_TPFLAGS_HAVE_FINALIZE
  #define Py_TPFLAGS_HAVE_FINALIZE 0
#endif
#if PY_VERSION_HEX < 0x030700A0 || !defined(METH_FASTCALL)
  #ifndef METH_FASTCALL
     #define METH_FASTCALL 0x80
  #endif
  typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, Py_ssize_t nargs);
  typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject **args,
                                                          Py_ssize_t nargs, PyObject *kwnames);
#else
  #define __Pyx_PyCFunctionFast _PyCFunctionFast
  #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
#endif
#if CYTHON_FAST_PYCCALL
#define __Pyx_PyFastCFunction_Check(func)\
    ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS)))))
#else
#define __Pyx_PyFastCFunction_Check(func) 0
#endif
#if !CYTHON_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 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 PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
  #define CYTHON_PEP393_ENABLED 1
  #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ?\
                                              0 : _PyUnicode_Ready((PyObject *)(op)))
  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_LENGTH(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   PyUnicode_MAX_CHAR_VALUE(u)
  #define __Pyx_PyUnicode_KIND(u)         PyUnicode_KIND(u)
  #define __Pyx_PyUnicode_DATA(u)         PyUnicode_DATA(u)
  #define __Pyx_PyUnicode_READ(k, d, i)   PyUnicode_READ(k, d, i)
  #define __Pyx_PyUnicode_WRITE(k, d, i, ch)  PyUnicode_WRITE(k, d, i, ch)
  #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
#else
  #define CYTHON_PEP393_ENABLED 0
  #define PyUnicode_1BYTE_KIND  1
  #define PyUnicode_2BYTE_KIND  2
  #define PyUnicode_4BYTE_KIND  4
  #define __Pyx_PyUnicode_READY(op)       (0)
  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_SIZE(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
  #define __Pyx_PyUnicode_KIND(u)         (sizeof(Py_UNICODE))
  #define __Pyx_PyUnicode_DATA(u)         ((void*)PyUnicode_AS_UNICODE(u))
  #define __Pyx_PyUnicode_READ(k, d, i)   ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
  #define __Pyx_PyUnicode_WRITE(k, d, i, ch)  (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
  #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GET_SIZE(u))
#endif
#if CYTHON_COMPILING_IN_PYPY
  #define __Pyx_PyUnicode_Concat(a, b)      PyNumber_Add(a, b)
  #define __Pyx_PyUnicode_ConcatSafe(a, b)  PyNumber_Add(a, b)
#else
  #define __Pyx_PyUnicode_Concat(a, b)      PyUnicode_Concat(a, b)
  #define __Pyx_PyUnicode_ConcatSafe(a, b)  ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
      PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
  #define PyUnicode_Contains(u, s)  PySequence_Contains(u, s)
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
  #define PyByteArray_Check(obj)  PyObject_TypeCheck(obj, &PyByteArray_Type)
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
  #define PyObject_Format(obj, fmt)  PyObject_CallMethod(obj, "__format__", "O", fmt)
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
  #define PyObject_Malloc(s)   PyMem_Malloc(s)
  #define PyObject_Free(p)     PyMem_Free(p)
  #define PyObject_Realloc(p)  PyMem_Realloc(p)
#endif
#if CYTHON_COMPILING_IN_PYSTON
  #define __Pyx_PyCode_HasFreeVars(co)  PyCode_HasFreeVars(co)
  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
#else
  #define __Pyx_PyCode_HasFreeVars(co)  (PyCode_GetNumFree(co) > 0)
  #define __Pyx_PyFrame_SetLineNumber(frame, lineno)  (frame)->f_lineno = (lineno)
#endif
#define __Pyx_PyString_FormatSafe(a, b)   ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
#define __Pyx_PyUnicode_FormatSafe(a, b)  ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyString_Format(a, b)  PyUnicode_Format(a, b)
#else
  #define __Pyx_PyString_Format(a, b)  PyString_Format(a, b)
#endif
#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
  #define PyObject_ASCII(o)            PyObject_Repr(o)
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyBaseString_Type            PyUnicode_Type
  #define PyStringObject               PyUnicodeObject
  #define PyString_Type                PyUnicode_Type
  #define PyString_Check               PyUnicode_Check
  #define PyString_CheckExact          PyUnicode_CheckExact
#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
#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
#if PY_MAJOR_VERSION >= 3
  #define PyIntObject                  PyLongObject
  #define PyInt_Type                   PyLong_Type
  #define PyInt_Check(op)              PyLong_Check(op)
  #define PyInt_CheckExact(op)         PyLong_CheckExact(op)
  #define PyInt_FromString             PyLong_FromString
  #define PyInt_FromUnicode            PyLong_FromUnicode
  #define PyInt_FromLong               PyLong_FromLong
  #define PyInt_FromSize_t             PyLong_FromSize_t
  #define PyInt_FromSsize_t            PyLong_FromSsize_t
  #define PyInt_AsLong                 PyLong_AsLong
  #define PyInt_AS_LONG                PyLong_AS_LONG
  #define PyInt_AsSsize_t              PyLong_AsSsize_t
  #define PyInt_AsUnsignedLongMask     PyLong_AsUnsignedLongMask
  #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
  #define PyNumber_Int                 PyNumber_Long
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyBoolObject                 PyLongObject
#endif
#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
  #ifndef PyUnicode_InternFromString
    #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
  #endif
#endif
#if PY_VERSION_HEX < 0x030200A4
  typedef long Py_hash_t;
  #define __Pyx_PyInt_FromHash_t PyInt_FromLong
  #define __Pyx_PyInt_AsHash_t   PyInt_AsLong
#else
  #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
  #define __Pyx_PyInt_AsHash_t   PyInt_AsSsize_t
#endif
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
#else
  #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
#endif
#ifndef __has_attribute
  #define __has_attribute(x) 0
#endif
#ifndef __has_cpp_attribute
  #define __has_cpp_attribute(x) 0
#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
#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 defined(WIN32) || defined(MS_WINDOWS)
  #define _USE_MATH_DEFINES
#endif
#include <math.h>
#ifdef NAN
#define __PYX_NAN() ((float) NAN)
#else
static CYTHON_INLINE float __PYX_NAN() {
  float value;
  memset(&value, 0xFF, sizeof(value));
  return value;
}
#endif
#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
#define __Pyx_truncl trunc
#else
#define __Pyx_truncl truncl
#endif


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

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

#define __PYX_HAVE__pywrapfst
#define __PYX_HAVE_API__pywrapfst
#include <stddef.h>
#include <time.h>
#include <memory>
#include "ios"
#include "new"
#include "stdexcept"
#include "typeinfo"
#include <utility>
#include <vector>
#include <string.h>
#include <string>
#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 <sys/types.h>
#include <unistd.h>
#ifdef _OPENMP
#include <omp.h>
#endif /* _OPENMP */

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

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

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


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

static PyObject *__pyx_m = NULL;
static PyObject *__pyx_d;
static PyObject *__pyx_b;
static PyObject *__pyx_cython_runtime;
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[] = {
  "pywrapfst.pyx",
  "stringsource",
};

/* "basictypes.pxd":22
 * 
 * 
 * ctypedef int8_t int8             # <<<<<<<<<<<<<<
 * ctypedef int16_t int16
 * ctypedef int32_t int32
 */
typedef int8_t __pyx_t_10basictypes_int8;

/* "basictypes.pxd":23
 * 
 * ctypedef int8_t int8
 * ctypedef int16_t int16             # <<<<<<<<<<<<<<
 * ctypedef int32_t int32
 * ctypedef int64_t int64
 */
typedef int16_t __pyx_t_10basictypes_int16;

/* "basictypes.pxd":24
 * ctypedef int8_t int8
 * ctypedef int16_t int16
 * ctypedef int32_t int32             # <<<<<<<<<<<<<<
 * ctypedef int64_t int64
 * ctypedef uint8_t uint8
 */
typedef int32_t __pyx_t_10basictypes_int32;

/* "basictypes.pxd":25
 * ctypedef int16_t int16
 * ctypedef int32_t int32
 * ctypedef int64_t int64             # <<<<<<<<<<<<<<
 * ctypedef uint8_t uint8
 * ctypedef uint16_t uint16
 */
typedef int64_t __pyx_t_10basictypes_int64;

/* "basictypes.pxd":26
 * ctypedef int32_t int32
 * ctypedef int64_t int64
 * ctypedef uint8_t uint8             # <<<<<<<<<<<<<<
 * ctypedef uint16_t uint16
 * ctypedef uint32_t uint32
 */
typedef uint8_t __pyx_t_10basictypes_uint8;

/* "basictypes.pxd":27
 * ctypedef int64_t int64
 * ctypedef uint8_t uint8
 * ctypedef uint16_t uint16             # <<<<<<<<<<<<<<
 * ctypedef uint32_t uint32
 * ctypedef uint64_t uint64
 */
typedef uint16_t __pyx_t_10basictypes_uint16;

/* "basictypes.pxd":28
 * ctypedef uint8_t uint8
 * ctypedef uint16_t uint16
 * ctypedef uint32_t uint32             # <<<<<<<<<<<<<<
 * ctypedef uint64_t uint64
 */
typedef uint32_t __pyx_t_10basictypes_uint32;

/* "basictypes.pxd":29
 * ctypedef uint16_t uint16
 * ctypedef uint32_t uint32
 * ctypedef uint64_t uint64             # <<<<<<<<<<<<<<
 */
typedef uint64_t __pyx_t_10basictypes_uint64;

/*--- Type declarations ---*/
struct __pyx_obj_9pywrapfst_Weight;
struct __pyx_obj_9pywrapfst__SymbolTable;
struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTable;
struct __pyx_obj_9pywrapfst__FstSymbolTable;
struct __pyx_obj_9pywrapfst__MutableSymbolTable;
struct __pyx_obj_9pywrapfst__MutableFstSymbolTable;
struct __pyx_obj_9pywrapfst_SymbolTable;
struct __pyx_obj_9pywrapfst_SymbolTableIterator;
struct __pyx_obj_9pywrapfst_EncodeMapper;
struct __pyx_obj_9pywrapfst__Fst;
struct __pyx_obj_9pywrapfst__MutableFst;
struct __pyx_obj_9pywrapfst_Arc;
struct __pyx_obj_9pywrapfst_ArcIterator;
struct __pyx_obj_9pywrapfst_MutableArcIterator;
struct __pyx_obj_9pywrapfst_StateIterator;
struct __pyx_obj_9pywrapfst_Compiler;
struct __pyx_obj_9pywrapfst_FarReader;
struct __pyx_obj_9pywrapfst_FarWriter;

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

/* "fst.pxd":498
 * ctypedef pair[int64, const FstClass *] LabelFstClassPair
 * 
 * ctypedef pair[int64, int64] LabelPair             # <<<<<<<<<<<<<<
 * 
 * 
 */
typedef std::pair<__pyx_t_10basictypes_int64,__pyx_t_10basictypes_int64>  __pyx_t_3fst_LabelPair;
struct __pyx_opt_args_9pywrapfst_tostring;
struct __pyx_opt_args_9pywrapfst_weight_tostring;
struct __pyx_opt_args_9pywrapfst_19_MutableSymbolTable_add_symbol;
struct __pyx_opt_args_9pywrapfst_4_Fst_draw;
struct __pyx_opt_args_9pywrapfst_4_Fst_text;
struct __pyx_opt_args_9pywrapfst_11_MutableFst__arcsort;
struct __pyx_opt_args_9pywrapfst_11_MutableFst__closure;
struct __pyx_opt_args_9pywrapfst_11_MutableFst__delete_arcs;
struct __pyx_opt_args_9pywrapfst_11_MutableFst__delete_states;
struct __pyx_opt_args_9pywrapfst_11_MutableFst__minimize;
struct __pyx_opt_args_9pywrapfst_11_MutableFst__project;
struct __pyx_opt_args_9pywrapfst_11_MutableFst__prune;
struct __pyx_opt_args_9pywrapfst_11_MutableFst__push;
struct __pyx_opt_args_9pywrapfst_11_MutableFst__relabel_pairs;
struct __pyx_opt_args_9pywrapfst_11_MutableFst__relabel_tables;
struct __pyx_opt_args_9pywrapfst_11_MutableFst__reweight;
struct __pyx_opt_args_9pywrapfst_11_MutableFst__rmepsilon;
struct __pyx_opt_args_9pywrapfst_11_MutableFst__set_final;
struct __pyx_opt_args_9pywrapfst__create_Fst;
struct __pyx_opt_args_9pywrapfst__map;
struct __pyx_opt_args_9pywrapfst_arcmap;
struct __pyx_opt_args_9pywrapfst_compose;
struct __pyx_opt_args_9pywrapfst_convert;
struct __pyx_opt_args_9pywrapfst_determinize;
struct __pyx_opt_args_9pywrapfst_difference;
struct __pyx_opt_args_9pywrapfst_disambiguate;
struct __pyx_opt_args_9pywrapfst_epsnormalize;
struct __pyx_opt_args_9pywrapfst_equal;
struct __pyx_opt_args_9pywrapfst_equivalent;
struct __pyx_opt_args_9pywrapfst_intersect;
struct __pyx_opt_args_9pywrapfst_isomorphic;
struct __pyx_opt_args_9pywrapfst_prune;
struct __pyx_opt_args_9pywrapfst_push;
struct __pyx_opt_args_9pywrapfst_randequivalent;
struct __pyx_opt_args_9pywrapfst_randgen;
struct __pyx_opt_args_9pywrapfst_replace;
struct __pyx_opt_args_9pywrapfst_reverse;
struct __pyx_opt_args_9pywrapfst__shortestdistance;
struct __pyx_opt_args_9pywrapfst_shortestpath;

/* "pywrapfst.pxd":41
 * 
 * 
 * cdef string tostring(data, encoding=?) except *             # <<<<<<<<<<<<<<
 * 
 * cdef string weight_tostring(data, encoding=?) except *
 */
struct __pyx_opt_args_9pywrapfst_tostring {
  int __pyx_n;
  PyObject *encoding;
};

/* "pywrapfst.pxd":43
 * cdef string tostring(data, encoding=?) except *
 * 
 * cdef string weight_tostring(data, encoding=?) except *             # <<<<<<<<<<<<<<
 * 
 * cdef fst.ComposeFilter _get_compose_filter(
 */
struct __pyx_opt_args_9pywrapfst_weight_tostring {
  int __pyx_n;
  PyObject *encoding;
};

/* "pywrapfst.pxd":99
 * # SymbolTable.
 * 
 * ctypedef fst.SymbolTable * SymbolTable_ptr             # <<<<<<<<<<<<<<
 * 
 * 
 */
typedef fst::SymbolTable *__pyx_t_9pywrapfst_SymbolTable_ptr;

/* "pywrapfst.pxd":139
 * cdef class _MutableSymbolTable(_SymbolTable):
 * 
 *   cpdef int64 add_symbol(self, symbol, int64 key=?)             # <<<<<<<<<<<<<<
 * 
 *   cpdef void add_table(self, _SymbolTable syms)
 */
struct __pyx_opt_args_9pywrapfst_19_MutableSymbolTable_add_symbol {
  int __pyx_n;
  __pyx_t_10basictypes_int64 key;
};

/* "pywrapfst.pxd":215
 * 
 * 
 * ctypedef fst.FstClass * FstClass_ptr             # <<<<<<<<<<<<<<
 * ctypedef fst.MutableFstClass * MutableFstClass_ptr
 * ctypedef fst.VectorFstClass * VectorFstClass_ptr
 */
typedef fst::script::FstClass *__pyx_t_9pywrapfst_FstClass_ptr;

/* "pywrapfst.pxd":216
 * 
 * ctypedef fst.FstClass * FstClass_ptr
 * ctypedef fst.MutableFstClass * MutableFstClass_ptr             # <<<<<<<<<<<<<<
 * ctypedef fst.VectorFstClass * VectorFstClass_ptr
 * 
 */
typedef fst::script::MutableFstClass *__pyx_t_9pywrapfst_MutableFstClass_ptr;

/* "pywrapfst.pxd":217
 * ctypedef fst.FstClass * FstClass_ptr
 * ctypedef fst.MutableFstClass * MutableFstClass_ptr
 * ctypedef fst.VectorFstClass * VectorFstClass_ptr             # <<<<<<<<<<<<<<
 * 
 * 
 */
typedef fst::script::VectorFstClass *__pyx_t_9pywrapfst_VectorFstClass_ptr;

/* "pywrapfst.pxd":230
 *   cpdef _Fst copy(self)
 * 
 *   cpdef void draw(self, filename, _SymbolTable isymbols=?,             # <<<<<<<<<<<<<<
 *                   _SymbolTable osymbols=?, SymbolTable ssymbols=?,
 *                   bool acceptor=?, title=?, double width=?,
 */
struct __pyx_opt_args_9pywrapfst_4_Fst_draw {
  int __pyx_n;
  struct __pyx_obj_9pywrapfst__SymbolTable *isymbols;
  struct __pyx_obj_9pywrapfst__SymbolTable *osymbols;
  struct __pyx_obj_9pywrapfst_SymbolTable *ssymbols;
  bool acceptor;
  PyObject *title;
  double width;
  double height;
  bool portrait;
  bool vertical;
  double ranksep;
  double nodesep;
  __pyx_t_10basictypes_int32 fontsize;
  __pyx_t_10basictypes_int32 precision;
  PyObject *float_format;
  bool show_weight_one;
};

/* "pywrapfst.pxd":258
 *   cpdef StateIterator states(self)
 * 
 *   cpdef string text(self, _SymbolTable isymbols=?, _SymbolTable osymbols=?,             # <<<<<<<<<<<<<<
 *                     _SymbolTable ssymbols=?, bool acceptor=?,
 *                     bool show_weight_one=?, missing_sym=?)
 */
struct __pyx_opt_args_9pywrapfst_4_Fst_text {
  int __pyx_n;
  struct __pyx_obj_9pywrapfst__SymbolTable *isymbols;
  struct __pyx_obj_9pywrapfst__SymbolTable *osymbols;
  struct __pyx_obj_9pywrapfst__SymbolTable *ssymbols;
  bool acceptor;
  bool show_weight_one;
  PyObject *missing_sym;
};

/* "pywrapfst.pxd":281
 *   cpdef int64 add_state(self) except *
 * 
 *   cdef void _arcsort(self, sort_type=?) except *             # <<<<<<<<<<<<<<
 * 
 *   cdef void _closure(self, bool closure_plus=?) except *
 */
struct __pyx_opt_args_9pywrapfst_11_MutableFst__arcsort {
  int __pyx_n;
  PyObject *sort_type;
};

/* "pywrapfst.pxd":283
 *   cdef void _arcsort(self, sort_type=?) except *
 * 
 *   cdef void _closure(self, bool closure_plus=?) except *             # <<<<<<<<<<<<<<
 * 
 *   cdef void _concat(self, _Fst ifst) except *
 */
struct __pyx_opt_args_9pywrapfst_11_MutableFst__closure {
  int __pyx_n;
  bool closure_plus;
};

/* "pywrapfst.pxd":291
 *   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_9pywrapfst_11_MutableFst__delete_arcs {
  int __pyx_n;
  size_t n;
};

/* "pywrapfst.pxd":293
 *   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_9pywrapfst_11_MutableFst__delete_states {
  int __pyx_n;
  PyObject *states;
};

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

/* "pywrapfst.pxd":305
 *   cpdef int64 num_states(self)
 * 
 *   cdef void _project(self, bool project_output=?) except *             # <<<<<<<<<<<<<<
 * 
 *   cdef void _prune(self, float delta=?, int64 nstate=?, weight=?) except *
 */
struct __pyx_opt_args_9pywrapfst_11_MutableFst__project {
  int __pyx_n;
  bool project_output;
};

/* "pywrapfst.pxd":307
 *   cdef void _project(self, bool project_output=?) except *
 * 
 *   cdef void _prune(self, float delta=?, int64 nstate=?, weight=?) except *             # <<<<<<<<<<<<<<
 * 
 *   cdef void _push(self, float delta=?, bool remove_total_weight=?,
 */
struct __pyx_opt_args_9pywrapfst_11_MutableFst__prune {
  int __pyx_n;
  float delta;
  __pyx_t_10basictypes_int64 nstate;
  PyObject *weight;
};

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

/* "pywrapfst.pxd":312
 *                   bool to_final=?) except *
 * 
 *   cdef void _relabel_pairs(self, ipairs=?, opairs=?) except *             # <<<<<<<<<<<<<<
 * 
 *   cdef void _relabel_tables(self, _SymbolTable old_isymbols=?,
 */
struct __pyx_opt_args_9pywrapfst_11_MutableFst__relabel_pairs {
  int __pyx_n;
  PyObject *ipairs;
  PyObject *opairs;
};

/* "pywrapfst.pxd":314
 *   cdef void _relabel_pairs(self, ipairs=?, opairs=?) except *
 * 
 *   cdef void _relabel_tables(self, _SymbolTable old_isymbols=?,             # <<<<<<<<<<<<<<
 *       _SymbolTable new_isymbols=?, unknown_isymbol=?,
 *       bool attach_new_isymbols=?,
 */
struct __pyx_opt_args_9pywrapfst_11_MutableFst__relabel_tables {
  int __pyx_n;
  struct __pyx_obj_9pywrapfst__SymbolTable *old_isymbols;
  struct __pyx_obj_9pywrapfst__SymbolTable *new_isymbols;
  PyObject *unknown_isymbol;
  bool attach_new_isymbols;
  struct __pyx_obj_9pywrapfst__SymbolTable *old_osymbols;
  struct __pyx_obj_9pywrapfst__SymbolTable *new_osymbols;
  PyObject *unknown_osymbol;
  bool attach_new_osymbols;
};

/* "pywrapfst.pxd":324
 *   cdef void _reserve_states(self, int64 n) except *
 * 
 *   cdef void _reweight(self, potentials, bool to_final=?) except *             # <<<<<<<<<<<<<<
 * 
 *   cdef void _rmepsilon(self, queue_type=?, bool connect=?, weight=?,
 */
struct __pyx_opt_args_9pywrapfst_11_MutableFst__reweight {
  int __pyx_n;
  bool to_final;
};

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

/* "pywrapfst.pxd":329
 *                        int64 nstate=?, float delta=?) except *
 * 
 *   cdef void _set_final(self, int64 state, weight=?) except *             # <<<<<<<<<<<<<<
 * 
 *   cdef void _set_properties(self, uint64 props, uint64 mask)
 */
struct __pyx_opt_args_9pywrapfst_11_MutableFst__set_final {
  int __pyx_n;
  PyObject *weight;
};

/* "pywrapfst.pxd":353
 * cdef _Fst _init_XFst(FstClass_ptr tfst)
 * 
 * cdef _MutableFst _create_Fst(arc_type=?)             # <<<<<<<<<<<<<<
 * 
 * cpdef _Fst _read(filename)
 */
struct __pyx_opt_args_9pywrapfst__create_Fst {
  int __pyx_n;
  PyObject *arc_type;
};

/* "pywrapfst.pxd":436
 * 
 * 
 * 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_9pywrapfst__map {
  int __pyx_n;
  float delta;
  PyObject *map_type;
  double power;
  PyObject *weight;
};

/* "pywrapfst.pxd":438
 * 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, _Fst ifst2, compose_filter=?,
 */
struct __pyx_opt_args_9pywrapfst_arcmap {
  int __pyx_n;
  float delta;
  PyObject *map_type;
  double power;
  PyObject *weight;
};

/* "pywrapfst.pxd":440
 * cpdef _Fst arcmap(_Fst ifst, float delta=?, map_type=?, double power=?, weight=?)
 * 
 * cpdef _MutableFst compose(_Fst ifst1, _Fst ifst2, compose_filter=?,             # <<<<<<<<<<<<<<
 *                           bool connect=?)
 * 
 */
struct __pyx_opt_args_9pywrapfst_compose {
  int __pyx_n;
  PyObject *compose_filter;
  bool connect;
};

/* "pywrapfst.pxd":443
 *                           bool connect=?)
 * 
 * cpdef _Fst convert(_Fst ifst, fst_type=?)             # <<<<<<<<<<<<<<
 * 
 * cpdef _MutableFst determinize(_Fst ifst, float delta=?, det_type=?,
 */
struct __pyx_opt_args_9pywrapfst_convert {
  int __pyx_n;
  PyObject *fst_type;
};

/* "pywrapfst.pxd":445
 * cpdef _Fst convert(_Fst ifst, fst_type=?)
 * 
 * cpdef _MutableFst determinize(_Fst ifst, float delta=?, det_type=?,             # <<<<<<<<<<<<<<
 *                               int64 nstate=?, int64 subsequential_label=?,
 *                               weight=?, bool increment_subsequential_label=?)
 */
struct __pyx_opt_args_9pywrapfst_determinize {
  int __pyx_n;
  float delta;
  PyObject *det_type;
  __pyx_t_10basictypes_int64 nstate;
  __pyx_t_10basictypes_int64 subsequential_label;
  PyObject *weight;
  bool increment_subsequential_label;
};

/* "pywrapfst.pxd":449
 *                               weight=?, bool increment_subsequential_label=?)
 * 
 * cpdef _MutableFst difference(_Fst ifst1, _Fst ifst2, compose_filter=?,             # <<<<<<<<<<<<<<
 *                              bool connect=?)
 * 
 */
struct __pyx_opt_args_9pywrapfst_difference {
  int __pyx_n;
  PyObject *compose_filter;
  bool connect;
};

/* "pywrapfst.pxd":452
 *                              bool connect=?)
 * 
 * cpdef _MutableFst disambiguate(_Fst ifst, float delta=?, int64 nstate=?,             # <<<<<<<<<<<<<<
 *                                int64 subsequential_label=?, weight=?)
 * 
 */
struct __pyx_opt_args_9pywrapfst_disambiguate {
  int __pyx_n;
  float delta;
  __pyx_t_10basictypes_int64 nstate;
  __pyx_t_10basictypes_int64 subsequential_label;
  PyObject *weight;
};

/* "pywrapfst.pxd":455
 *                                int64 subsequential_label=?, weight=?)
 * 
 * cpdef _MutableFst epsnormalize(_Fst ifst, bool eps_norm_output=?)             # <<<<<<<<<<<<<<
 * 
 * cpdef bool equal(_Fst ifst1, _Fst ifst2, float delta=?)
 */
struct __pyx_opt_args_9pywrapfst_epsnormalize {
  int __pyx_n;
  bool eps_norm_output;
};

/* "pywrapfst.pxd":457
 * 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_9pywrapfst_equal {
  int __pyx_n;
  float delta;
};

/* "pywrapfst.pxd":459
 * cpdef bool equal(_Fst ifst1, _Fst ifst2, float delta=?)
 * 
 * cpdef bool equivalent(_Fst ifst1, _Fst ifst2, float delta=?) except *             # <<<<<<<<<<<<<<
 * 
 * cpdef _MutableFst intersect(_Fst ifst1, _Fst ifst2, compose_filter=?,
 */
struct __pyx_opt_args_9pywrapfst_equivalent {
  int __pyx_n;
  float delta;
};

/* "pywrapfst.pxd":461
 * cpdef bool equivalent(_Fst ifst1, _Fst ifst2, float delta=?) except *
 * 
 * cpdef _MutableFst intersect(_Fst ifst1, _Fst ifst2, compose_filter=?,             # <<<<<<<<<<<<<<
 *                             bool connect=?)
 * 
 */
struct __pyx_opt_args_9pywrapfst_intersect {
  int __pyx_n;
  PyObject *compose_filter;
  bool connect;
};

/* "pywrapfst.pxd":464
 *                             bool connect=?)
 * 
 * cpdef bool isomorphic(_Fst ifst1, _Fst ifst2, float delta=?)             # <<<<<<<<<<<<<<
 * 
 * cpdef _MutableFst prune(_Fst ifst, float delta=?, int64 nstate=?,
 */
struct __pyx_opt_args_9pywrapfst_isomorphic {
  int __pyx_n;
  float delta;
};

/* "pywrapfst.pxd":466
 * cpdef bool isomorphic(_Fst ifst1, _Fst ifst2, float delta=?)
 * 
 * cpdef _MutableFst prune(_Fst ifst, float delta=?, int64 nstate=?,             # <<<<<<<<<<<<<<
 *                         weight=?)
 * 
 */
struct __pyx_opt_args_9pywrapfst_prune {
  int __pyx_n;
  float delta;
  __pyx_t_10basictypes_int64 nstate;
  PyObject *weight;
};

/* "pywrapfst.pxd":469
 *                         weight=?)
 * 
 * cpdef _MutableFst push(_Fst ifst, float delta=?, bool push_weights=?,             # <<<<<<<<<<<<<<
 *                        bool push_labels=?, bool remove_common_affix=?,
 *                        bool remove_total_weight=?, bool to_final=?)
 */
struct __pyx_opt_args_9pywrapfst_push {
  int __pyx_n;
  float delta;
  bool push_weights;
  bool push_labels;
  bool remove_common_affix;
  bool remove_total_weight;
  bool to_final;
};

/* "pywrapfst.pxd":473
 *                        bool remove_total_weight=?, bool to_final=?)
 * 
 * cpdef bool randequivalent(_Fst ifst1, _Fst ifst2, int32 npath=?,             # <<<<<<<<<<<<<<
 *                           float delta=?, time_t seed=?, select=?,
 *                           int32 max_length=?) except *
 */
struct __pyx_opt_args_9pywrapfst_randequivalent {
  int __pyx_n;
  __pyx_t_10basictypes_int32 npath;
  float delta;
  time_t seed;
  PyObject *select;
  __pyx_t_10basictypes_int32 max_length;
};

/* "pywrapfst.pxd":477
 *                           int32 max_length=?) except *
 * 
 * cpdef _MutableFst randgen(_Fst ifst, int32 npath=?, time_t seed=?,             # <<<<<<<<<<<<<<
 *                           select=?, int32 max_length=?,
 *                           bool remove_total_weight=?, bool weighted=?)
 */
struct __pyx_opt_args_9pywrapfst_randgen {
  int __pyx_n;
  __pyx_t_10basictypes_int32 npath;
  time_t seed;
  PyObject *select;
  __pyx_t_10basictypes_int32 max_length;
  bool remove_total_weight;
  bool weighted;
};

/* "pywrapfst.pxd":484
 *     bool epsilon_on_replace) except *
 * 
 * cpdef _MutableFst replace(pairs, call_arc_labeling=?, return_arc_labeling=?,             # <<<<<<<<<<<<<<
 *                           bool epsilon_on_replace=?, int64 return_label=?)
 * 
 */
struct __pyx_opt_args_9pywrapfst_replace {
  int __pyx_n;
  PyObject *call_arc_labeling;
  PyObject *return_arc_labeling;
  bool epsilon_on_replace;
  __pyx_t_10basictypes_int64 return_label;
};

/* "pywrapfst.pxd":487
 *                           bool epsilon_on_replace=?, int64 return_label=?)
 * 
 * cpdef _MutableFst reverse(_Fst ifst, bool require_superinitial=?)             # <<<<<<<<<<<<<<
 * 
 * cdef vector[fst.WeightClass] *_shortestdistance(_Fst ifst, float delta=?,
 */
struct __pyx_opt_args_9pywrapfst_reverse {
  int __pyx_n;
  bool require_superinitial;
};

/* "pywrapfst.pxd":489
 * cpdef _MutableFst reverse(_Fst ifst, bool require_superinitial=?)
 * 
 * cdef vector[fst.WeightClass] *_shortestdistance(_Fst ifst, float delta=?,             # <<<<<<<<<<<<<<
 *                                                 int64 nstate=?, queue_type=?,
 *                                                 bool reverse=?) except *
 */
struct __pyx_opt_args_9pywrapfst__shortestdistance {
  int __pyx_n;
  float delta;
  __pyx_t_10basictypes_int64 nstate;
  PyObject *queue_type;
  bool reverse;
};

/* "pywrapfst.pxd":493
 *                                                 bool reverse=?) except *
 * 
 * cpdef _MutableFst shortestpath(_Fst ifst, float delta=?, int32 nshortest=?,             # <<<<<<<<<<<<<<
 *                                int64 nstate=?, queue_type=?, bool unique=?,
 *                                weight=?)
 */
struct __pyx_opt_args_9pywrapfst_shortestpath {
  int __pyx_n;
  float delta;
  __pyx_t_10basictypes_int32 nshortest;
  __pyx_t_10basictypes_int64 nstate;
  PyObject *queue_type;
  bool unique;
  PyObject *weight;
};

/* "pywrapfst.pxd":69
 * 
 * 
 * cdef class Weight(object):             # <<<<<<<<<<<<<<
 * 
 *   cdef unique_ptr[fst.WeightClass] _weight
 */
struct __pyx_obj_9pywrapfst_Weight {
  PyObject_HEAD
  struct __pyx_vtabstruct_9pywrapfst_Weight *__pyx_vtab;
  std::unique_ptr<fst::script::WeightClass>  _weight;
};


/* "pywrapfst.pxd":102
 * 
 * 
 * cdef class _SymbolTable(object):             # <<<<<<<<<<<<<<
 * 
 *   cdef fst.SymbolTable *_table
 */
struct __pyx_obj_9pywrapfst__SymbolTable {
  PyObject_HEAD
  struct __pyx_vtabstruct_9pywrapfst__SymbolTable *__pyx_vtab;
  fst::SymbolTable *_table;
};


/* "pywrapfst.pxd":127
 * 
 * 
 * cdef class _EncodeMapperSymbolTable(_SymbolTable):             # <<<<<<<<<<<<<<
 * 
 *   cdef shared_ptr[fst.EncodeMapperClass] _encoder
 */
struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTable {
  struct __pyx_obj_9pywrapfst__SymbolTable __pyx_base;
  std::shared_ptr<fst::script::EncodeMapperClass>  _encoder;
};


/* "pywrapfst.pxd":132
 * 
 * 
 * cdef class _FstSymbolTable(_SymbolTable):             # <<<<<<<<<<<<<<
 * 
 *   cdef shared_ptr[fst.FstClass] _fst
 */
struct __pyx_obj_9pywrapfst__FstSymbolTable {
  struct __pyx_obj_9pywrapfst__SymbolTable __pyx_base;
  std::shared_ptr<fst::script::FstClass>  _fst;
};


/* "pywrapfst.pxd":137
 * 
 * 
 * cdef class _MutableSymbolTable(_SymbolTable):             # <<<<<<<<<<<<<<
 * 
 *   cpdef int64 add_symbol(self, symbol, int64 key=?)
 */
struct __pyx_obj_9pywrapfst__MutableSymbolTable {
  struct __pyx_obj_9pywrapfst__SymbolTable __pyx_base;
};


/* "pywrapfst.pxd":146
 * 
 * 
 * cdef class _MutableFstSymbolTable(_MutableSymbolTable):             # <<<<<<<<<<<<<<
 * 
 *   cdef shared_ptr[fst.MutableFstClass] _mfst
 */
struct __pyx_obj_9pywrapfst__MutableFstSymbolTable {
  struct __pyx_obj_9pywrapfst__MutableSymbolTable __pyx_base;
  std::shared_ptr<fst::script::MutableFstClass>  _mfst;
};


/* "pywrapfst.pxd":151
 * 
 * 
 * cdef class SymbolTable(_MutableSymbolTable):             # <<<<<<<<<<<<<<
 * 
 *   cdef unique_ptr[fst.SymbolTable] _smart_table
 */
struct __pyx_obj_9pywrapfst_SymbolTable {
  struct __pyx_obj_9pywrapfst__MutableSymbolTable __pyx_base;
  std::unique_ptr<fst::SymbolTable>  _smart_table;
};


/* "pywrapfst.pxd":172
 * 
 * 
 * cdef class SymbolTableIterator(object):             # <<<<<<<<<<<<<<
 * 
 *   cdef shared_ptr[fst.SymbolTable] _table
 */
struct __pyx_obj_9pywrapfst_SymbolTableIterator {
  PyObject_HEAD
  struct __pyx_vtabstruct_9pywrapfst_SymbolTableIterator *__pyx_vtab;
  std::shared_ptr<fst::SymbolTable>  _table;
  std::unique_ptr<fst::SymbolTableIterator>  _siter;
};


/* "pywrapfst.pxd":191
 * 
 * 
 * cdef class EncodeMapper(object):             # <<<<<<<<<<<<<<
 * 
 *   cdef shared_ptr[fst.EncodeMapperClass] _encoder
 */
struct __pyx_obj_9pywrapfst_EncodeMapper {
  PyObject_HEAD
  struct __pyx_vtabstruct_9pywrapfst_EncodeMapper *__pyx_vtab;
  std::shared_ptr<fst::script::EncodeMapperClass>  _encoder;
};


/* "pywrapfst.pxd":220
 * 
 * 
 * cdef class _Fst(object):             # <<<<<<<<<<<<<<
 * 
 *   cdef shared_ptr[fst.FstClass] _fst
 */
struct __pyx_obj_9pywrapfst__Fst {
  PyObject_HEAD
  struct __pyx_vtabstruct_9pywrapfst__Fst *__pyx_vtab;
  std::shared_ptr<fst::script::FstClass>  _fst;
};


/* "pywrapfst.pxd":271
 * 
 * 
 * cdef class _MutableFst(_Fst):             # <<<<<<<<<<<<<<
 * 
 *   cdef shared_ptr[fst.MutableFstClass] _mfst
 */
struct __pyx_obj_9pywrapfst__MutableFst {
  struct __pyx_obj_9pywrapfst__Fst __pyx_base;
  std::shared_ptr<fst::script::MutableFstClass>  _mfst;
};


/* "pywrapfst.pxd":363
 * 
 * 
 * cdef class Arc(object):             # <<<<<<<<<<<<<<
 * 
 *   cdef unique_ptr[fst.ArcClass] _arc
 */
struct __pyx_obj_9pywrapfst_Arc {
  PyObject_HEAD
  struct __pyx_vtabstruct_9pywrapfst_Arc *__pyx_vtab;
  std::unique_ptr<fst::script::ArcClass>  _arc;
};


/* "pywrapfst.pxd":373
 * 
 * 
 * cdef class ArcIterator(object):             # <<<<<<<<<<<<<<
 * 
 *   cdef shared_ptr[fst.FstClass] _fst
 */
struct __pyx_obj_9pywrapfst_ArcIterator {
  PyObject_HEAD
  struct __pyx_vtabstruct_9pywrapfst_ArcIterator *__pyx_vtab;
  std::shared_ptr<fst::script::FstClass>  _fst;
  std::unique_ptr<fst::script::ArcIteratorClass>  _aiter;
};


/* "pywrapfst.pxd":395
 * 
 * 
 * cdef class MutableArcIterator(object):             # <<<<<<<<<<<<<<
 * 
 *   cdef shared_ptr[fst.MutableFstClass] _mfst
 */
struct __pyx_obj_9pywrapfst_MutableArcIterator {
  PyObject_HEAD
  struct __pyx_vtabstruct_9pywrapfst_MutableArcIterator *__pyx_vtab;
  std::shared_ptr<fst::script::MutableFstClass>  _mfst;
  std::unique_ptr<fst::script::MutableArcIteratorClass>  _aiter;
};


/* "pywrapfst.pxd":419
 * 
 * 
 * cdef class StateIterator(object):             # <<<<<<<<<<<<<<
 * 
 *   cdef shared_ptr[fst.FstClass] _fst
 */
struct __pyx_obj_9pywrapfst_StateIterator {
  PyObject_HEAD
  struct __pyx_vtabstruct_9pywrapfst_StateIterator *__pyx_vtab;
  std::shared_ptr<fst::script::FstClass>  _fst;
  std::unique_ptr<fst::script::StateIteratorClass>  _siter;
};


/* "pywrapfst.pxd":505
 * 
 * 
 * cdef class Compiler(object):             # <<<<<<<<<<<<<<
 * 
 *   cdef unique_ptr[stringstream] _sstrm
 */
struct __pyx_obj_9pywrapfst_Compiler {
  PyObject_HEAD
  struct __pyx_vtabstruct_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;
};


/* "pywrapfst.pxd":526
 * # FarReader.
 * 
 * cdef class FarReader(object):             # <<<<<<<<<<<<<<
 * 
 *   cdef unique_ptr[fst.FarReaderClass] _reader
 */
struct __pyx_obj_9pywrapfst_FarReader {
  PyObject_HEAD
  struct __pyx_vtabstruct_9pywrapfst_FarReader *__pyx_vtab;
  std::unique_ptr<fst::script::FarReaderClass>  _reader;
};


/* "pywrapfst.pxd":551
 * # FarWriter.
 * 
 * cdef class FarWriter(object):             # <<<<<<<<<<<<<<
 * 
 *   cdef unique_ptr[fst.FarWriterClass] _writer
 */
struct __pyx_obj_9pywrapfst_FarWriter {
  PyObject_HEAD
  struct __pyx_vtabstruct_9pywrapfst_FarWriter *__pyx_vtab;
  std::unique_ptr<fst::script::FarWriterClass>  _writer;
};



/* "pywrapfst.pyx":348
 * 
 * 
 * cdef class Weight(object):             # <<<<<<<<<<<<<<
 * 
 *   """
 */

struct __pyx_vtabstruct_9pywrapfst_Weight {
  void (*_check_weight)(struct __pyx_obj_9pywrapfst_Weight *);
  struct __pyx_obj_9pywrapfst_Weight *(*copy)(struct __pyx_obj_9pywrapfst_Weight *, int __pyx_skip_dispatch);
  std::string (*to_string)(struct __pyx_obj_9pywrapfst_Weight *, int __pyx_skip_dispatch);
  std::string (*type)(struct __pyx_obj_9pywrapfst_Weight *, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_9pywrapfst_Weight *__pyx_vtabptr_9pywrapfst_Weight;


/* "pywrapfst.pyx":675
 * 
 * 
 * cdef class _SymbolTable(object):             # <<<<<<<<<<<<<<
 * 
 *   """
 */

struct __pyx_vtabstruct_9pywrapfst__SymbolTable {
  __pyx_t_10basictypes_int64 (*available_key)(struct __pyx_obj_9pywrapfst__SymbolTable *, int __pyx_skip_dispatch);
  std::string (*checksum)(struct __pyx_obj_9pywrapfst__SymbolTable *, int __pyx_skip_dispatch);
  struct __pyx_obj_9pywrapfst_SymbolTable *(*copy)(struct __pyx_obj_9pywrapfst__SymbolTable *, int __pyx_skip_dispatch);
  __pyx_t_10basictypes_int64 (*get_nth_key)(struct __pyx_obj_9pywrapfst__SymbolTable *, Py_ssize_t, int __pyx_skip_dispatch);
  std::string (*labeled_checksum)(struct __pyx_obj_9pywrapfst__SymbolTable *, int __pyx_skip_dispatch);
  bool (*member)(struct __pyx_obj_9pywrapfst__SymbolTable *, PyObject *, int __pyx_skip_dispatch);
  std::string (*name)(struct __pyx_obj_9pywrapfst__SymbolTable *, int __pyx_skip_dispatch);
  size_t (*num_symbols)(struct __pyx_obj_9pywrapfst__SymbolTable *, int __pyx_skip_dispatch);
  void (*write)(struct __pyx_obj_9pywrapfst__SymbolTable *, PyObject *, int __pyx_skip_dispatch);
  void (*write_text)(struct __pyx_obj_9pywrapfst__SymbolTable *, PyObject *, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_9pywrapfst__SymbolTable *__pyx_vtabptr_9pywrapfst__SymbolTable;


/* "pywrapfst.pyx":839
 * 
 * 
 * cdef class _EncodeMapperSymbolTable(_SymbolTable):             # <<<<<<<<<<<<<<
 * 
 *   """
 */

struct __pyx_vtabstruct_9pywrapfst__EncodeMapperSymbolTable {
  struct __pyx_vtabstruct_9pywrapfst__SymbolTable __pyx_base;
};
static struct __pyx_vtabstruct_9pywrapfst__EncodeMapperSymbolTable *__pyx_vtabptr_9pywrapfst__EncodeMapperSymbolTable;


/* "pywrapfst.pyx":859
 * 
 * 
 * cdef class _FstSymbolTable(_SymbolTable):             # <<<<<<<<<<<<<<
 * 
 *   """
 */

struct __pyx_vtabstruct_9pywrapfst__FstSymbolTable {
  struct __pyx_vtabstruct_9pywrapfst__SymbolTable __pyx_base;
};
static struct __pyx_vtabstruct_9pywrapfst__FstSymbolTable *__pyx_vtabptr_9pywrapfst__FstSymbolTable;


/* "pywrapfst.pyx":878
 * 
 * 
 * cdef class _MutableSymbolTable(_SymbolTable):             # <<<<<<<<<<<<<<
 * 
 *   """
 */

struct __pyx_vtabstruct_9pywrapfst__MutableSymbolTable {
  struct __pyx_vtabstruct_9pywrapfst__SymbolTable __pyx_base;
  __pyx_t_10basictypes_int64 (*add_symbol)(struct __pyx_obj_9pywrapfst__MutableSymbolTable *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_19_MutableSymbolTable_add_symbol *__pyx_optional_args);
  void (*add_table)(struct __pyx_obj_9pywrapfst__MutableSymbolTable *, struct __pyx_obj_9pywrapfst__SymbolTable *, int __pyx_skip_dispatch);
  void (*set_name)(struct __pyx_obj_9pywrapfst__MutableSymbolTable *, PyObject *, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_9pywrapfst__MutableSymbolTable *__pyx_vtabptr_9pywrapfst__MutableSymbolTable;


/* "pywrapfst.pyx":930
 * 
 * 
 * cdef class _MutableFstSymbolTable(_MutableSymbolTable):             # <<<<<<<<<<<<<<
 *   """
 *   (No constructor.)
 */

struct __pyx_vtabstruct_9pywrapfst__MutableFstSymbolTable {
  struct __pyx_vtabstruct_9pywrapfst__MutableSymbolTable __pyx_base;
};
static struct __pyx_vtabstruct_9pywrapfst__MutableFstSymbolTable *__pyx_vtabptr_9pywrapfst__MutableFstSymbolTable;


/* "pywrapfst.pyx":941
 * 
 * 
 * cdef class SymbolTable(_MutableSymbolTable):             # <<<<<<<<<<<<<<
 * 
 *   """
 */

struct __pyx_vtabstruct_9pywrapfst_SymbolTable {
  struct __pyx_vtabstruct_9pywrapfst__MutableSymbolTable __pyx_base;
};
static struct __pyx_vtabstruct_9pywrapfst_SymbolTable *__pyx_vtabptr_9pywrapfst_SymbolTable;


/* "pywrapfst.pyx":1124
 * 
 * 
 * cdef class SymbolTableIterator(object):             # <<<<<<<<<<<<<<
 * 
 *   """
 */

struct __pyx_vtabstruct_9pywrapfst_SymbolTableIterator {
  bool (*done)(struct __pyx_obj_9pywrapfst_SymbolTableIterator *, int __pyx_skip_dispatch);
  void (*next)(struct __pyx_obj_9pywrapfst_SymbolTableIterator *, int __pyx_skip_dispatch);
  void (*reset)(struct __pyx_obj_9pywrapfst_SymbolTableIterator *, int __pyx_skip_dispatch);
  std::string (*symbol)(struct __pyx_obj_9pywrapfst_SymbolTableIterator *, int __pyx_skip_dispatch);
  __pyx_t_10basictypes_int64 (*value)(struct __pyx_obj_9pywrapfst_SymbolTableIterator *, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_9pywrapfst_SymbolTableIterator *__pyx_vtabptr_9pywrapfst_SymbolTableIterator;


/* "pywrapfst.pyx":1206
 * 
 * 
 * cdef class EncodeMapper(object):             # <<<<<<<<<<<<<<
 * 
 *   """
 */

struct __pyx_vtabstruct_9pywrapfst_EncodeMapper {
  std::string (*arc_type)(struct __pyx_obj_9pywrapfst_EncodeMapper *, int __pyx_skip_dispatch);
  __pyx_t_10basictypes_uint32 (*flags)(struct __pyx_obj_9pywrapfst_EncodeMapper *, int __pyx_skip_dispatch);
  struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTable *(*input_symbols)(struct __pyx_obj_9pywrapfst_EncodeMapper *, int __pyx_skip_dispatch);
  struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTable *(*output_symbols)(struct __pyx_obj_9pywrapfst_EncodeMapper *, int __pyx_skip_dispatch);
  __pyx_t_10basictypes_uint64 (*properties)(struct __pyx_obj_9pywrapfst_EncodeMapper *, __pyx_t_10basictypes_uint64, int __pyx_skip_dispatch);
  void (*set_input_symbols)(struct __pyx_obj_9pywrapfst_EncodeMapper *, struct __pyx_obj_9pywrapfst__SymbolTable *, int __pyx_skip_dispatch);
  void (*set_output_symbols)(struct __pyx_obj_9pywrapfst_EncodeMapper *, struct __pyx_obj_9pywrapfst__SymbolTable *, int __pyx_skip_dispatch);
  std::string (*weight_type)(struct __pyx_obj_9pywrapfst_EncodeMapper *, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_9pywrapfst_EncodeMapper *__pyx_vtabptr_9pywrapfst_EncodeMapper;


/* "pywrapfst.pyx":1362
 * 
 * 
 * cdef class _Fst(object):             # <<<<<<<<<<<<<<
 * 
 *   """
 */

struct __pyx_vtabstruct_9pywrapfst__Fst {
  std::string (*arc_type)(struct __pyx_obj_9pywrapfst__Fst *, int __pyx_skip_dispatch);
  struct __pyx_obj_9pywrapfst_ArcIterator *(*arcs)(struct __pyx_obj_9pywrapfst__Fst *, __pyx_t_10basictypes_int64, int __pyx_skip_dispatch);
  struct __pyx_obj_9pywrapfst__Fst *(*copy)(struct __pyx_obj_9pywrapfst__Fst *, int __pyx_skip_dispatch);
  void (*draw)(struct __pyx_obj_9pywrapfst__Fst *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_4_Fst_draw *__pyx_optional_args);
  struct __pyx_obj_9pywrapfst_Weight *(*final)(struct __pyx_obj_9pywrapfst__Fst *, __pyx_t_10basictypes_int64, int __pyx_skip_dispatch);
  std::string (*fst_type)(struct __pyx_obj_9pywrapfst__Fst *, int __pyx_skip_dispatch);
  struct __pyx_obj_9pywrapfst__FstSymbolTable *(*input_symbols)(struct __pyx_obj_9pywrapfst__Fst *, int __pyx_skip_dispatch);
  size_t (*num_arcs)(struct __pyx_obj_9pywrapfst__Fst *, __pyx_t_10basictypes_int64, int __pyx_skip_dispatch);
  size_t (*num_input_epsilons)(struct __pyx_obj_9pywrapfst__Fst *, __pyx_t_10basictypes_int64, int __pyx_skip_dispatch);
  size_t (*num_output_epsilons)(struct __pyx_obj_9pywrapfst__Fst *, __pyx_t_10basictypes_int64, int __pyx_skip_dispatch);
  struct __pyx_obj_9pywrapfst__FstSymbolTable *(*output_symbols)(struct __pyx_obj_9pywrapfst__Fst *, int __pyx_skip_dispatch);
  __pyx_t_10basictypes_uint64 (*properties)(struct __pyx_obj_9pywrapfst__Fst *, __pyx_t_10basictypes_uint64, bool, int __pyx_skip_dispatch);
  __pyx_t_10basictypes_int64 (*start)(struct __pyx_obj_9pywrapfst__Fst *, int __pyx_skip_dispatch);
  struct __pyx_obj_9pywrapfst_StateIterator *(*states)(struct __pyx_obj_9pywrapfst__Fst *, int __pyx_skip_dispatch);
  std::string (*text)(struct __pyx_obj_9pywrapfst__Fst *, int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_4_Fst_text *__pyx_optional_args);
  bool (*verify)(struct __pyx_obj_9pywrapfst__Fst *, int __pyx_skip_dispatch);
  std::string (*weight_type)(struct __pyx_obj_9pywrapfst__Fst *, int __pyx_skip_dispatch);
  void (*write)(struct __pyx_obj_9pywrapfst__Fst *, PyObject *, int __pyx_skip_dispatch);
  std::string (*write_to_string)(struct __pyx_obj_9pywrapfst__Fst *, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_9pywrapfst__Fst *__pyx_vtabptr_9pywrapfst__Fst;


/* "pywrapfst.pyx":1774
 * 
 * 
 * cdef class _MutableFst(_Fst):             # <<<<<<<<<<<<<<
 * 
 *   """
 */

struct __pyx_vtabstruct_9pywrapfst__MutableFst {
  struct __pyx_vtabstruct_9pywrapfst__Fst __pyx_base;
  void (*_check_mutating_imethod)(struct __pyx_obj_9pywrapfst__MutableFst *);
  void (*_add_arc)(struct __pyx_obj_9pywrapfst__MutableFst *, __pyx_t_10basictypes_int64, struct __pyx_obj_9pywrapfst_Arc *);
  __pyx_t_10basictypes_int64 (*add_state)(struct __pyx_obj_9pywrapfst__MutableFst *, int __pyx_skip_dispatch);
  void (*_arcsort)(struct __pyx_obj_9pywrapfst__MutableFst *, struct __pyx_opt_args_9pywrapfst_11_MutableFst__arcsort *__pyx_optional_args);
  void (*_closure)(struct __pyx_obj_9pywrapfst__MutableFst *, struct __pyx_opt_args_9pywrapfst_11_MutableFst__closure *__pyx_optional_args);
  void (*_concat)(struct __pyx_obj_9pywrapfst__MutableFst *, struct __pyx_obj_9pywrapfst__Fst *);
  void (*_connect)(struct __pyx_obj_9pywrapfst__MutableFst *);
  void (*_decode)(struct __pyx_obj_9pywrapfst__MutableFst *, struct __pyx_obj_9pywrapfst_EncodeMapper *);
  void (*_delete_arcs)(struct __pyx_obj_9pywrapfst__MutableFst *, __pyx_t_10basictypes_int64, struct __pyx_opt_args_9pywrapfst_11_MutableFst__delete_arcs *__pyx_optional_args);
  void (*_delete_states)(struct __pyx_obj_9pywrapfst__MutableFst *, struct __pyx_opt_args_9pywrapfst_11_MutableFst__delete_states *__pyx_optional_args);
  void (*_encode)(struct __pyx_obj_9pywrapfst__MutableFst *, struct __pyx_obj_9pywrapfst_EncodeMapper *);
  void (*_invert)(struct __pyx_obj_9pywrapfst__MutableFst *);
  void (*_minimize)(struct __pyx_obj_9pywrapfst__MutableFst *, struct __pyx_opt_args_9pywrapfst_11_MutableFst__minimize *__pyx_optional_args);
  struct __pyx_obj_9pywrapfst_MutableArcIterator *(*mutable_arcs)(struct __pyx_obj_9pywrapfst__MutableFst *, __pyx_t_10basictypes_int64, int __pyx_skip_dispatch);
  __pyx_t_10basictypes_int64 (*num_states)(struct __pyx_obj_9pywrapfst__MutableFst *, int __pyx_skip_dispatch);
  void (*_project)(struct __pyx_obj_9pywrapfst__MutableFst *, struct __pyx_opt_args_9pywrapfst_11_MutableFst__project *__pyx_optional_args);
  void (*_prune)(struct __pyx_obj_9pywrapfst__MutableFst *, struct __pyx_opt_args_9pywrapfst_11_MutableFst__prune *__pyx_optional_args);
  void (*_push)(struct __pyx_obj_9pywrapfst__MutableFst *, struct __pyx_opt_args_9pywrapfst_11_MutableFst__push *__pyx_optional_args);
  void (*_relabel_pairs)(struct __pyx_obj_9pywrapfst__MutableFst *, struct __pyx_opt_args_9pywrapfst_11_MutableFst__relabel_pairs *__pyx_optional_args);
  void (*_relabel_tables)(struct __pyx_obj_9pywrapfst__MutableFst *, struct __pyx_opt_args_9pywrapfst_11_MutableFst__relabel_tables *__pyx_optional_args);
  void (*_reserve_arcs)(struct __pyx_obj_9pywrapfst__MutableFst *, __pyx_t_10basictypes_int64, size_t);
  void (*_reserve_states)(struct __pyx_obj_9pywrapfst__MutableFst *, __pyx_t_10basictypes_int64);
  void (*_reweight)(struct __pyx_obj_9pywrapfst__MutableFst *, PyObject *, struct __pyx_opt_args_9pywrapfst_11_MutableFst__reweight *__pyx_optional_args);
  void (*_rmepsilon)(struct __pyx_obj_9pywrapfst__MutableFst *, struct __pyx_opt_args_9pywrapfst_11_MutableFst__rmepsilon *__pyx_optional_args);
  void (*_set_final)(struct __pyx_obj_9pywrapfst__MutableFst *, __pyx_t_10basictypes_int64, struct __pyx_opt_args_9pywrapfst_11_MutableFst__set_final *__pyx_optional_args);
  void (*_set_properties)(struct __pyx_obj_9pywrapfst__MutableFst *, __pyx_t_10basictypes_uint64, __pyx_t_10basictypes_uint64);
  void (*_set_start)(struct __pyx_obj_9pywrapfst__MutableFst *, __pyx_t_10basictypes_int64);
  void (*_set_input_symbols)(struct __pyx_obj_9pywrapfst__MutableFst *, struct __pyx_obj_9pywrapfst__SymbolTable *);
  void (*_set_output_symbols)(struct __pyx_obj_9pywrapfst__MutableFst *, struct __pyx_obj_9pywrapfst__SymbolTable *);
  void (*_topsort)(struct __pyx_obj_9pywrapfst__MutableFst *);
  void (*_union)(struct __pyx_obj_9pywrapfst__MutableFst *, struct __pyx_obj_9pywrapfst__Fst *);
};
static struct __pyx_vtabstruct_9pywrapfst__MutableFst *__pyx_vtabptr_9pywrapfst__MutableFst;


/* "pywrapfst.pyx":2898
 * 
 * 
 * cdef class Arc(object):             # <<<<<<<<<<<<<<
 * 
 *   """
 */

struct __pyx_vtabstruct_9pywrapfst_Arc {
  struct __pyx_obj_9pywrapfst_Arc *(*copy)(struct __pyx_obj_9pywrapfst_Arc *, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_9pywrapfst_Arc *__pyx_vtabptr_9pywrapfst_Arc;


/* "pywrapfst.pyx":2965
 * 
 * 
 * cdef class ArcIterator(object):             # <<<<<<<<<<<<<<
 * 
 *   """
 */

struct __pyx_vtabstruct_9pywrapfst_ArcIterator {
  bool (*done)(struct __pyx_obj_9pywrapfst_ArcIterator *, int __pyx_skip_dispatch);
  __pyx_t_10basictypes_uint32 (*flags)(struct __pyx_obj_9pywrapfst_ArcIterator *, int __pyx_skip_dispatch);
  void (*next)(struct __pyx_obj_9pywrapfst_ArcIterator *, int __pyx_skip_dispatch);
  size_t (*position)(struct __pyx_obj_9pywrapfst_ArcIterator *, int __pyx_skip_dispatch);
  void (*reset)(struct __pyx_obj_9pywrapfst_ArcIterator *, int __pyx_skip_dispatch);
  void (*seek)(struct __pyx_obj_9pywrapfst_ArcIterator *, size_t, int __pyx_skip_dispatch);
  void (*set_flags)(struct __pyx_obj_9pywrapfst_ArcIterator *, __pyx_t_10basictypes_uint32, __pyx_t_10basictypes_uint32, int __pyx_skip_dispatch);
  PyObject *(*value)(struct __pyx_obj_9pywrapfst_ArcIterator *, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_9pywrapfst_ArcIterator *__pyx_vtabptr_9pywrapfst_ArcIterator;


/* "pywrapfst.pyx":3076
 * 
 * 
 * cdef class MutableArcIterator(object):             # <<<<<<<<<<<<<<
 * 
 *   """
 */

struct __pyx_vtabstruct_9pywrapfst_MutableArcIterator {
  bool (*done)(struct __pyx_obj_9pywrapfst_MutableArcIterator *, int __pyx_skip_dispatch);
  __pyx_t_10basictypes_uint32 (*flags)(struct __pyx_obj_9pywrapfst_MutableArcIterator *, int __pyx_skip_dispatch);
  void (*next)(struct __pyx_obj_9pywrapfst_MutableArcIterator *, int __pyx_skip_dispatch);
  size_t (*position)(struct __pyx_obj_9pywrapfst_MutableArcIterator *, int __pyx_skip_dispatch);
  void (*reset)(struct __pyx_obj_9pywrapfst_MutableArcIterator *, int __pyx_skip_dispatch);
  void (*seek)(struct __pyx_obj_9pywrapfst_MutableArcIterator *, size_t, int __pyx_skip_dispatch);
  void (*set_flags)(struct __pyx_obj_9pywrapfst_MutableArcIterator *, __pyx_t_10basictypes_uint32, __pyx_t_10basictypes_uint32, int __pyx_skip_dispatch);
  void (*set_value)(struct __pyx_obj_9pywrapfst_MutableArcIterator *, struct __pyx_obj_9pywrapfst_Arc *, int __pyx_skip_dispatch);
  PyObject *(*value)(struct __pyx_obj_9pywrapfst_MutableArcIterator *, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_9pywrapfst_MutableArcIterator *__pyx_vtabptr_9pywrapfst_MutableArcIterator;


/* "pywrapfst.pyx":3190
 * 
 * 
 * cdef class StateIterator(object):             # <<<<<<<<<<<<<<
 * 
 *   """
 */

struct __pyx_vtabstruct_9pywrapfst_StateIterator {
  bool (*done)(struct __pyx_obj_9pywrapfst_StateIterator *, int __pyx_skip_dispatch);
  void (*next)(struct __pyx_obj_9pywrapfst_StateIterator *, int __pyx_skip_dispatch);
  void (*reset)(struct __pyx_obj_9pywrapfst_StateIterator *, int __pyx_skip_dispatch);
  __pyx_t_10basictypes_int64 (*value)(struct __pyx_obj_9pywrapfst_StateIterator *, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_9pywrapfst_StateIterator *__pyx_vtabptr_9pywrapfst_StateIterator;


/* "pywrapfst.pyx":4088
 * 
 * 
 * cdef class Compiler(object):             # <<<<<<<<<<<<<<
 * 
 *   """
 */

struct __pyx_vtabstruct_9pywrapfst_Compiler {
  struct __pyx_obj_9pywrapfst__Fst *(*compile)(struct __pyx_obj_9pywrapfst_Compiler *, int __pyx_skip_dispatch);
  void (*write)(struct __pyx_obj_9pywrapfst_Compiler *, PyObject *, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_9pywrapfst_Compiler *__pyx_vtabptr_9pywrapfst_Compiler;


/* "pywrapfst.pyx":4215
 * 
 * 
 * cdef class FarReader(object):             # <<<<<<<<<<<<<<
 * 
 *   """
 */

struct __pyx_vtabstruct_9pywrapfst_FarReader {
  std::string (*arc_type)(struct __pyx_obj_9pywrapfst_FarReader *, int __pyx_skip_dispatch);
  bool (*done)(struct __pyx_obj_9pywrapfst_FarReader *, int __pyx_skip_dispatch);
  bool (*error)(struct __pyx_obj_9pywrapfst_FarReader *, int __pyx_skip_dispatch);
  std::string (*far_type)(struct __pyx_obj_9pywrapfst_FarReader *, int __pyx_skip_dispatch);
  bool (*find)(struct __pyx_obj_9pywrapfst_FarReader *, PyObject *, int __pyx_skip_dispatch);
  struct __pyx_obj_9pywrapfst__Fst *(*get_fst)(struct __pyx_obj_9pywrapfst_FarReader *, int __pyx_skip_dispatch);
  std::string (*get_key)(struct __pyx_obj_9pywrapfst_FarReader *, int __pyx_skip_dispatch);
  void (*next)(struct __pyx_obj_9pywrapfst_FarReader *, int __pyx_skip_dispatch);
  void (*reset)(struct __pyx_obj_9pywrapfst_FarReader *, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_9pywrapfst_FarReader *__pyx_vtabptr_9pywrapfst_FarReader;


/* "pywrapfst.pyx":4360
 * 
 * 
 * cdef class FarWriter(object):             # <<<<<<<<<<<<<<
 * 
 *   """
 */

struct __pyx_vtabstruct_9pywrapfst_FarWriter {
  std::string (*arc_type)(struct __pyx_obj_9pywrapfst_FarWriter *, int __pyx_skip_dispatch);
  void (*close)(struct __pyx_obj_9pywrapfst_FarWriter *);
  void (*add)(struct __pyx_obj_9pywrapfst_FarWriter *, PyObject *, struct __pyx_obj_9pywrapfst__Fst *, int __pyx_skip_dispatch);
  bool (*error)(struct __pyx_obj_9pywrapfst_FarWriter *, int __pyx_skip_dispatch);
  std::string (*far_type)(struct __pyx_obj_9pywrapfst_FarWriter *, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_9pywrapfst_FarWriter *__pyx_vtabptr_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) {
    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);
}
#else
#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
#endif

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

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

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

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

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

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

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

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

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

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

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

/* SetVTable.proto */
static int __Pyx_SetVtable(PyObject *dict, void *vtable);

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

/* GetNameInClass.proto */
static PyObject *__Pyx_GetNameInClass(PyObject *nmspace, PyObject *name);

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

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

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

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

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

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

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value);

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

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

/* 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 uint64_t __Pyx_PyInt_As_uint64_t(PyObject *);

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

/* CIntFromPy.proto */
static CYTHON_INLINE uint32_t __Pyx_PyInt_As_uint32_t(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE time_t __Pyx_PyInt_As_time_t(PyObject *);

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

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

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

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

/* 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_9pywrapfst_6Weight__check_weight(struct __pyx_obj_9pywrapfst_Weight *__pyx_v_self); /* proto*/
static struct __pyx_obj_9pywrapfst_Weight *__pyx_f_9pywrapfst_6Weight_copy(struct __pyx_obj_9pywrapfst_Weight *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static std::string __pyx_f_9pywrapfst_6Weight_to_string(struct __pyx_obj_9pywrapfst_Weight *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static std::string __pyx_f_9pywrapfst_6Weight_type(struct __pyx_obj_9pywrapfst_Weight *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static __pyx_t_10basictypes_int64 __pyx_f_9pywrapfst_12_SymbolTable_available_key(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static std::string __pyx_f_9pywrapfst_12_SymbolTable_checksum(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_9pywrapfst_SymbolTable *__pyx_f_9pywrapfst_12_SymbolTable_copy(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static __pyx_t_10basictypes_int64 __pyx_f_9pywrapfst_12_SymbolTable_get_nth_key(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self, Py_ssize_t __pyx_v_pos, int __pyx_skip_dispatch); /* proto*/
static std::string __pyx_f_9pywrapfst_12_SymbolTable_labeled_checksum(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static bool __pyx_f_9pywrapfst_12_SymbolTable_member(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch); /* proto*/
static std::string __pyx_f_9pywrapfst_12_SymbolTable_name(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static size_t __pyx_f_9pywrapfst_12_SymbolTable_num_symbols(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_9pywrapfst_12_SymbolTable_write(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self, PyObject *__pyx_v_filename, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_9pywrapfst_12_SymbolTable_write_text(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self, PyObject *__pyx_v_filename, int __pyx_skip_dispatch); /* proto*/
static __pyx_t_10basictypes_int64 __pyx_f_9pywrapfst_19_MutableSymbolTable_add_symbol(struct __pyx_obj_9pywrapfst__MutableSymbolTable *__pyx_v_self, PyObject *__pyx_v_symbol, int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_19_MutableSymbolTable_add_symbol *__pyx_optional_args); /* proto*/
static void __pyx_f_9pywrapfst_19_MutableSymbolTable_add_table(struct __pyx_obj_9pywrapfst__MutableSymbolTable *__pyx_v_self, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_syms, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_9pywrapfst_19_MutableSymbolTable_set_name(struct __pyx_obj_9pywrapfst__MutableSymbolTable *__pyx_v_self, PyObject *__pyx_v_new_name, int __pyx_skip_dispatch); /* proto*/
static bool __pyx_f_9pywrapfst_19SymbolTableIterator_done(struct __pyx_obj_9pywrapfst_SymbolTableIterator *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_9pywrapfst_19SymbolTableIterator_next(struct __pyx_obj_9pywrapfst_SymbolTableIterator *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_9pywrapfst_19SymbolTableIterator_reset(struct __pyx_obj_9pywrapfst_SymbolTableIterator *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static std::string __pyx_f_9pywrapfst_19SymbolTableIterator_symbol(struct __pyx_obj_9pywrapfst_SymbolTableIterator *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static __pyx_t_10basictypes_int64 __pyx_f_9pywrapfst_19SymbolTableIterator_value(struct __pyx_obj_9pywrapfst_SymbolTableIterator *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static std::string __pyx_f_9pywrapfst_12EncodeMapper_arc_type(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static __pyx_t_10basictypes_uint32 __pyx_f_9pywrapfst_12EncodeMapper_flags(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTable *__pyx_f_9pywrapfst_12EncodeMapper_input_symbols(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTable *__pyx_f_9pywrapfst_12EncodeMapper_output_symbols(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static __pyx_t_10basictypes_uint64 __pyx_f_9pywrapfst_12EncodeMapper_properties(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self, __pyx_t_10basictypes_uint64 __pyx_v_mask, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_9pywrapfst_12EncodeMapper_set_input_symbols(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_syms, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_9pywrapfst_12EncodeMapper_set_output_symbols(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_syms, int __pyx_skip_dispatch); /* proto*/
static std::string __pyx_f_9pywrapfst_12EncodeMapper_weight_type(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static std::string __pyx_f_9pywrapfst_4_Fst_arc_type(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_9pywrapfst_ArcIterator *__pyx_f_9pywrapfst_4_Fst_arcs(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_self, __pyx_t_10basictypes_int64 __pyx_v_state, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst_4_Fst_copy(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_9pywrapfst_4_Fst_draw(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_self, PyObject *__pyx_v_filename, int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_4_Fst_draw *__pyx_optional_args); /* proto*/
static struct __pyx_obj_9pywrapfst_Weight *__pyx_f_9pywrapfst_4_Fst_final(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_self, __pyx_t_10basictypes_int64 __pyx_v_state, int __pyx_skip_dispatch); /* proto*/
static std::string __pyx_f_9pywrapfst_4_Fst_fst_type(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_9pywrapfst__FstSymbolTable *__pyx_f_9pywrapfst_4_Fst_input_symbols(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static size_t __pyx_f_9pywrapfst_4_Fst_num_arcs(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_self, __pyx_t_10basictypes_int64 __pyx_v_state, int __pyx_skip_dispatch); /* proto*/
static size_t __pyx_f_9pywrapfst_4_Fst_num_input_epsilons(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_self, __pyx_t_10basictypes_int64 __pyx_v_state, int __pyx_skip_dispatch); /* proto*/
static size_t __pyx_f_9pywrapfst_4_Fst_num_output_epsilons(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_self, __pyx_t_10basictypes_int64 __pyx_v_state, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_9pywrapfst__FstSymbolTable *__pyx_f_9pywrapfst_4_Fst_output_symbols(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static __pyx_t_10basictypes_uint64 __pyx_f_9pywrapfst_4_Fst_properties(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_self, __pyx_t_10basictypes_uint64 __pyx_v_mask, bool __pyx_v_test, int __pyx_skip_dispatch); /* proto*/
static __pyx_t_10basictypes_int64 __pyx_f_9pywrapfst_4_Fst_start(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_9pywrapfst_StateIterator *__pyx_f_9pywrapfst_4_Fst_states(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static std::string __pyx_f_9pywrapfst_4_Fst_text(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_4_Fst_text *__pyx_optional_args); /* proto*/
static bool __pyx_f_9pywrapfst_4_Fst_verify(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static std::string __pyx_f_9pywrapfst_4_Fst_weight_type(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_9pywrapfst_4_Fst_write(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_self, PyObject *__pyx_v_filename, int __pyx_skip_dispatch); /* proto*/
static std::string __pyx_f_9pywrapfst_4_Fst_write_to_string(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_9pywrapfst_11_MutableFst__check_mutating_imethod(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self); /* proto*/
static void __pyx_f_9pywrapfst_11_MutableFst__add_arc(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, __pyx_t_10basictypes_int64 __pyx_v_state, struct __pyx_obj_9pywrapfst_Arc *__pyx_v_arc); /* proto*/
static __pyx_t_10basictypes_int64 __pyx_f_9pywrapfst_11_MutableFst_add_state(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_9pywrapfst_11_MutableFst__arcsort(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, struct __pyx_opt_args_9pywrapfst_11_MutableFst__arcsort *__pyx_optional_args); /* proto*/
static void __pyx_f_9pywrapfst_11_MutableFst__closure(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, struct __pyx_opt_args_9pywrapfst_11_MutableFst__closure *__pyx_optional_args); /* proto*/
static void __pyx_f_9pywrapfst_11_MutableFst__concat(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst); /* proto*/
static void __pyx_f_9pywrapfst_11_MutableFst__connect(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self); /* proto*/
static void __pyx_f_9pywrapfst_11_MutableFst__decode(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_encoder); /* proto*/
static void __pyx_f_9pywrapfst_11_MutableFst__delete_arcs(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, __pyx_t_10basictypes_int64 __pyx_v_state, struct __pyx_opt_args_9pywrapfst_11_MutableFst__delete_arcs *__pyx_optional_args); /* proto*/
static void __pyx_f_9pywrapfst_11_MutableFst__delete_states(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, struct __pyx_opt_args_9pywrapfst_11_MutableFst__delete_states *__pyx_optional_args); /* proto*/
static void __pyx_f_9pywrapfst_11_MutableFst__encode(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_encoder); /* proto*/
static void __pyx_f_9pywrapfst_11_MutableFst__invert(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self); /* proto*/
static void __pyx_f_9pywrapfst_11_MutableFst__minimize(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, struct __pyx_opt_args_9pywrapfst_11_MutableFst__minimize *__pyx_optional_args); /* proto*/
static struct __pyx_obj_9pywrapfst_MutableArcIterator *__pyx_f_9pywrapfst_11_MutableFst_mutable_arcs(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, __pyx_t_10basictypes_int64 __pyx_v_state, int __pyx_skip_dispatch); /* proto*/
static __pyx_t_10basictypes_int64 __pyx_f_9pywrapfst_11_MutableFst_num_states(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_9pywrapfst_11_MutableFst__project(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, struct __pyx_opt_args_9pywrapfst_11_MutableFst__project *__pyx_optional_args); /* proto*/
static void __pyx_f_9pywrapfst_11_MutableFst__prune(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, struct __pyx_opt_args_9pywrapfst_11_MutableFst__prune *__pyx_optional_args); /* proto*/
static void __pyx_f_9pywrapfst_11_MutableFst__push(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, struct __pyx_opt_args_9pywrapfst_11_MutableFst__push *__pyx_optional_args); /* proto*/
static void __pyx_f_9pywrapfst_11_MutableFst__relabel_pairs(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, struct __pyx_opt_args_9pywrapfst_11_MutableFst__relabel_pairs *__pyx_optional_args); /* proto*/
static void __pyx_f_9pywrapfst_11_MutableFst__relabel_tables(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, struct __pyx_opt_args_9pywrapfst_11_MutableFst__relabel_tables *__pyx_optional_args); /* proto*/
static void __pyx_f_9pywrapfst_11_MutableFst__reserve_arcs(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, __pyx_t_10basictypes_int64 __pyx_v_state, size_t __pyx_v_n); /* proto*/
static void __pyx_f_9pywrapfst_11_MutableFst__reserve_states(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, __pyx_t_10basictypes_int64 __pyx_v_n); /* proto*/
static void __pyx_f_9pywrapfst_11_MutableFst__reweight(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, PyObject *__pyx_v_potentials, struct __pyx_opt_args_9pywrapfst_11_MutableFst__reweight *__pyx_optional_args); /* proto*/
static void __pyx_f_9pywrapfst_11_MutableFst__rmepsilon(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, struct __pyx_opt_args_9pywrapfst_11_MutableFst__rmepsilon *__pyx_optional_args); /* proto*/
static void __pyx_f_9pywrapfst_11_MutableFst__set_final(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, __pyx_t_10basictypes_int64 __pyx_v_state, struct __pyx_opt_args_9pywrapfst_11_MutableFst__set_final *__pyx_optional_args); /* proto*/
static void __pyx_f_9pywrapfst_11_MutableFst__set_input_symbols(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_syms); /* proto*/
static void __pyx_f_9pywrapfst_11_MutableFst__set_output_symbols(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_syms); /* proto*/
static void __pyx_f_9pywrapfst_11_MutableFst__set_properties(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, __pyx_t_10basictypes_uint64 __pyx_v_props, __pyx_t_10basictypes_uint64 __pyx_v_mask); /* proto*/
static void __pyx_f_9pywrapfst_11_MutableFst__set_start(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, __pyx_t_10basictypes_int64 __pyx_v_state); /* proto*/
static void __pyx_f_9pywrapfst_11_MutableFst__topsort(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self); /* proto*/
static void __pyx_f_9pywrapfst_11_MutableFst__union(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst); /* proto*/
static struct __pyx_obj_9pywrapfst_Arc *__pyx_f_9pywrapfst_3Arc_copy(struct __pyx_obj_9pywrapfst_Arc *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static bool __pyx_f_9pywrapfst_11ArcIterator_done(struct __pyx_obj_9pywrapfst_ArcIterator *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static __pyx_t_10basictypes_uint32 __pyx_f_9pywrapfst_11ArcIterator_flags(struct __pyx_obj_9pywrapfst_ArcIterator *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_9pywrapfst_11ArcIterator_next(struct __pyx_obj_9pywrapfst_ArcIterator *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static size_t __pyx_f_9pywrapfst_11ArcIterator_position(struct __pyx_obj_9pywrapfst_ArcIterator *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_9pywrapfst_11ArcIterator_reset(struct __pyx_obj_9pywrapfst_ArcIterator *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_9pywrapfst_11ArcIterator_seek(struct __pyx_obj_9pywrapfst_ArcIterator *__pyx_v_self, size_t __pyx_v_a, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_9pywrapfst_11ArcIterator_set_flags(struct __pyx_obj_9pywrapfst_ArcIterator *__pyx_v_self, __pyx_t_10basictypes_uint32 __pyx_v_flags, __pyx_t_10basictypes_uint32 __pyx_v_mask, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_9pywrapfst_11ArcIterator_value(struct __pyx_obj_9pywrapfst_ArcIterator *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static bool __pyx_f_9pywrapfst_18MutableArcIterator_done(struct __pyx_obj_9pywrapfst_MutableArcIterator *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static __pyx_t_10basictypes_uint32 __pyx_f_9pywrapfst_18MutableArcIterator_flags(struct __pyx_obj_9pywrapfst_MutableArcIterator *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_9pywrapfst_18MutableArcIterator_next(struct __pyx_obj_9pywrapfst_MutableArcIterator *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static size_t __pyx_f_9pywrapfst_18MutableArcIterator_position(struct __pyx_obj_9pywrapfst_MutableArcIterator *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_9pywrapfst_18MutableArcIterator_reset(struct __pyx_obj_9pywrapfst_MutableArcIterator *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_9pywrapfst_18MutableArcIterator_seek(struct __pyx_obj_9pywrapfst_MutableArcIterator *__pyx_v_self, size_t __pyx_v_a, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_9pywrapfst_18MutableArcIterator_set_flags(struct __pyx_obj_9pywrapfst_MutableArcIterator *__pyx_v_self, __pyx_t_10basictypes_uint32 __pyx_v_flags, __pyx_t_10basictypes_uint32 __pyx_v_mask, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_9pywrapfst_18MutableArcIterator_set_value(struct __pyx_obj_9pywrapfst_MutableArcIterator *__pyx_v_self, struct __pyx_obj_9pywrapfst_Arc *__pyx_v_arc, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_9pywrapfst_18MutableArcIterator_value(struct __pyx_obj_9pywrapfst_MutableArcIterator *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static bool __pyx_f_9pywrapfst_13StateIterator_done(struct __pyx_obj_9pywrapfst_StateIterator *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_9pywrapfst_13StateIterator_next(struct __pyx_obj_9pywrapfst_StateIterator *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_9pywrapfst_13StateIterator_reset(struct __pyx_obj_9pywrapfst_StateIterator *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static __pyx_t_10basictypes_int64 __pyx_f_9pywrapfst_13StateIterator_value(struct __pyx_obj_9pywrapfst_StateIterator *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst_8Compiler_compile(struct __pyx_obj_9pywrapfst_Compiler *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_9pywrapfst_8Compiler_write(struct __pyx_obj_9pywrapfst_Compiler *__pyx_v_self, PyObject *__pyx_v_expression, int __pyx_skip_dispatch); /* proto*/
static std::string __pyx_f_9pywrapfst_9FarReader_arc_type(struct __pyx_obj_9pywrapfst_FarReader *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static bool __pyx_f_9pywrapfst_9FarReader_done(struct __pyx_obj_9pywrapfst_FarReader *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static bool __pyx_f_9pywrapfst_9FarReader_error(struct __pyx_obj_9pywrapfst_FarReader *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static std::string __pyx_f_9pywrapfst_9FarReader_far_type(struct __pyx_obj_9pywrapfst_FarReader *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static bool __pyx_f_9pywrapfst_9FarReader_find(struct __pyx_obj_9pywrapfst_FarReader *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst_9FarReader_get_fst(struct __pyx_obj_9pywrapfst_FarReader *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static std::string __pyx_f_9pywrapfst_9FarReader_get_key(struct __pyx_obj_9pywrapfst_FarReader *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_9pywrapfst_9FarReader_next(struct __pyx_obj_9pywrapfst_FarReader *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_9pywrapfst_9FarReader_reset(struct __pyx_obj_9pywrapfst_FarReader *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_9pywrapfst_9FarWriter_close(struct __pyx_obj_9pywrapfst_FarWriter *__pyx_v_self); /* proto*/
static void __pyx_f_9pywrapfst_9FarWriter_add(struct __pyx_obj_9pywrapfst_FarWriter *__pyx_v_self, PyObject *__pyx_v_key, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst, int __pyx_skip_dispatch); /* proto*/
static std::string __pyx_f_9pywrapfst_9FarWriter_arc_type(struct __pyx_obj_9pywrapfst_FarWriter *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static bool __pyx_f_9pywrapfst_9FarWriter_error(struct __pyx_obj_9pywrapfst_FarWriter *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static std::string __pyx_f_9pywrapfst_9FarWriter_far_type(struct __pyx_obj_9pywrapfst_FarWriter *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/

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

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

/* Module declarations from 'libcpp' */

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

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

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

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

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

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

/* Module declarations from 'basictypes' */

/* Module declarations from 'ios' */

/* Module declarations from 'fst' */

/* Module declarations from 'posix.types' */

/* Module declarations from 'posix.unistd' */

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

/* Module declarations from 'memory' */

/* Module declarations from 'pywrapfst' */
static PyTypeObject *__pyx_ptype_9pywrapfst_Weight = 0;
static PyTypeObject *__pyx_ptype_9pywrapfst__SymbolTable = 0;
static PyTypeObject *__pyx_ptype_9pywrapfst__EncodeMapperSymbolTable = 0;
static PyTypeObject *__pyx_ptype_9pywrapfst__FstSymbolTable = 0;
static PyTypeObject *__pyx_ptype_9pywrapfst__MutableSymbolTable = 0;
static PyTypeObject *__pyx_ptype_9pywrapfst__MutableFstSymbolTable = 0;
static PyTypeObject *__pyx_ptype_9pywrapfst_SymbolTable = 0;
static PyTypeObject *__pyx_ptype_9pywrapfst_SymbolTableIterator = 0;
static PyTypeObject *__pyx_ptype_9pywrapfst_EncodeMapper = 0;
static PyTypeObject *__pyx_ptype_9pywrapfst__Fst = 0;
static PyTypeObject *__pyx_ptype_9pywrapfst__MutableFst = 0;
static PyTypeObject *__pyx_ptype_9pywrapfst_Arc = 0;
static PyTypeObject *__pyx_ptype_9pywrapfst_ArcIterator = 0;
static PyTypeObject *__pyx_ptype_9pywrapfst_MutableArcIterator = 0;
static PyTypeObject *__pyx_ptype_9pywrapfst_StateIterator = 0;
static PyTypeObject *__pyx_ptype_9pywrapfst_Compiler = 0;
static PyTypeObject *__pyx_ptype_9pywrapfst_FarReader = 0;
static PyTypeObject *__pyx_ptype_9pywrapfst_FarWriter = 0;
static std::string __pyx_f_9pywrapfst_tostring(PyObject *, struct __pyx_opt_args_9pywrapfst_tostring *__pyx_optional_args); /*proto*/
static std::string __pyx_f_9pywrapfst_weight_tostring(PyObject *, struct __pyx_opt_args_9pywrapfst_weight_tostring *__pyx_optional_args); /*proto*/
static enum fst::ComposeFilter __pyx_f_9pywrapfst__get_compose_filter(std::string const &); /*proto*/
static enum fst::QueueType __pyx_f_9pywrapfst__get_queue_type(std::string const &); /*proto*/
static enum fst::script::RandArcSelection __pyx_f_9pywrapfst__get_rand_arc_selection(std::string const &); /*proto*/
static enum fst::ReplaceLabelType __pyx_f_9pywrapfst__get_replace_label_type(std::string const &, bool); /*proto*/
static fst::script::WeightClass __pyx_f_9pywrapfst__get_WeightClass_or_One(std::string const &, PyObject *); /*proto*/
static fst::script::WeightClass __pyx_f_9pywrapfst__get_WeightClass_or_Zero(std::string const &, PyObject *); /*proto*/
static struct __pyx_obj_9pywrapfst_Weight *__pyx_f_9pywrapfst__Zero(PyObject *); /*proto*/
static struct __pyx_obj_9pywrapfst_Weight *__pyx_f_9pywrapfst__One(PyObject *); /*proto*/
static struct __pyx_obj_9pywrapfst_Weight *__pyx_f_9pywrapfst__NoWeight(PyObject *); /*proto*/
static struct __pyx_obj_9pywrapfst_Weight *__pyx_f_9pywrapfst__plus(struct __pyx_obj_9pywrapfst_Weight *, struct __pyx_obj_9pywrapfst_Weight *); /*proto*/
static struct __pyx_obj_9pywrapfst_Weight *__pyx_f_9pywrapfst__times(struct __pyx_obj_9pywrapfst_Weight *, struct __pyx_obj_9pywrapfst_Weight *); /*proto*/
static struct __pyx_obj_9pywrapfst_Weight *__pyx_f_9pywrapfst__divide(struct __pyx_obj_9pywrapfst_Weight *, struct __pyx_obj_9pywrapfst_Weight *); /*proto*/
static struct __pyx_obj_9pywrapfst_Weight *__pyx_f_9pywrapfst__power(struct __pyx_obj_9pywrapfst_Weight *, size_t); /*proto*/
static struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTable *__pyx_f_9pywrapfst__init_EncodeMapperSymbolTable(fst::SymbolTable *, std::shared_ptr<fst::script::EncodeMapperClass> ); /*proto*/
static struct __pyx_obj_9pywrapfst__FstSymbolTable *__pyx_f_9pywrapfst__init_FstSymbolTable(fst::SymbolTable *, std::shared_ptr<fst::script::FstClass> ); /*proto*/
static struct __pyx_obj_9pywrapfst__MutableFstSymbolTable *__pyx_f_9pywrapfst__init_MutableFstSymbolTable(fst::SymbolTable *, std::shared_ptr<fst::script::MutableFstClass> ); /*proto*/
static struct __pyx_obj_9pywrapfst_SymbolTable *__pyx_f_9pywrapfst__init_SymbolTable(fst::SymbolTable *); /*proto*/
static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst__init_Fst(__pyx_t_9pywrapfst_FstClass_ptr); /*proto*/
static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst__init_MutableFst(__pyx_t_9pywrapfst_MutableFstClass_ptr); /*proto*/
static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst__init_XFst(__pyx_t_9pywrapfst_FstClass_ptr); /*proto*/
static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst__create_Fst(struct __pyx_opt_args_9pywrapfst__create_Fst *__pyx_optional_args); /*proto*/
static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst__read(PyObject *, int __pyx_skip_dispatch); /*proto*/
static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst__read_from_string(PyObject *, int __pyx_skip_dispatch); /*proto*/
static struct __pyx_obj_9pywrapfst_Arc *__pyx_f_9pywrapfst__init_Arc(fst::script::ArcClass const &); /*proto*/
static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst__map(struct __pyx_obj_9pywrapfst__Fst *, struct __pyx_opt_args_9pywrapfst__map *__pyx_optional_args); /*proto*/
static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst_arcmap(struct __pyx_obj_9pywrapfst__Fst *, int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_arcmap *__pyx_optional_args); /*proto*/
static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_compose(struct __pyx_obj_9pywrapfst__Fst *, struct __pyx_obj_9pywrapfst__Fst *, int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_compose *__pyx_optional_args); /*proto*/
static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst_convert(struct __pyx_obj_9pywrapfst__Fst *, int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_convert *__pyx_optional_args); /*proto*/
static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_determinize(struct __pyx_obj_9pywrapfst__Fst *, int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_determinize *__pyx_optional_args); /*proto*/
static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_difference(struct __pyx_obj_9pywrapfst__Fst *, struct __pyx_obj_9pywrapfst__Fst *, int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_difference *__pyx_optional_args); /*proto*/
static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_disambiguate(struct __pyx_obj_9pywrapfst__Fst *, int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_disambiguate *__pyx_optional_args); /*proto*/
static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_epsnormalize(struct __pyx_obj_9pywrapfst__Fst *, int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_epsnormalize *__pyx_optional_args); /*proto*/
static bool __pyx_f_9pywrapfst_equal(struct __pyx_obj_9pywrapfst__Fst *, struct __pyx_obj_9pywrapfst__Fst *, int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_equal *__pyx_optional_args); /*proto*/
static bool __pyx_f_9pywrapfst_equivalent(struct __pyx_obj_9pywrapfst__Fst *, struct __pyx_obj_9pywrapfst__Fst *, int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_equivalent *__pyx_optional_args); /*proto*/
static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_intersect(struct __pyx_obj_9pywrapfst__Fst *, struct __pyx_obj_9pywrapfst__Fst *, int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_intersect *__pyx_optional_args); /*proto*/
static bool __pyx_f_9pywrapfst_isomorphic(struct __pyx_obj_9pywrapfst__Fst *, struct __pyx_obj_9pywrapfst__Fst *, int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_isomorphic *__pyx_optional_args); /*proto*/
static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_prune(struct __pyx_obj_9pywrapfst__Fst *, int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_prune *__pyx_optional_args); /*proto*/
static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_push(struct __pyx_obj_9pywrapfst__Fst *, int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_push *__pyx_optional_args); /*proto*/
static bool __pyx_f_9pywrapfst_randequivalent(struct __pyx_obj_9pywrapfst__Fst *, struct __pyx_obj_9pywrapfst__Fst *, int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_randequivalent *__pyx_optional_args); /*proto*/
static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_randgen(struct __pyx_obj_9pywrapfst__Fst *, int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_randgen *__pyx_optional_args); /*proto*/
static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_replace(PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_replace *__pyx_optional_args); /*proto*/
static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_reverse(struct __pyx_obj_9pywrapfst__Fst *, int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_reverse *__pyx_optional_args); /*proto*/
static std::vector<fst::script::WeightClass>  *__pyx_f_9pywrapfst__shortestdistance(struct __pyx_obj_9pywrapfst__Fst *, struct __pyx_opt_args_9pywrapfst__shortestdistance *__pyx_optional_args); /*proto*/
static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_shortestpath(struct __pyx_obj_9pywrapfst__Fst *, int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_shortestpath *__pyx_optional_args); /*proto*/
static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst_statemap(struct __pyx_obj_9pywrapfst__Fst *, PyObject *, int __pyx_skip_dispatch); /*proto*/
static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_synchronize(struct __pyx_obj_9pywrapfst__Fst *, int __pyx_skip_dispatch); /*proto*/
static struct __pyx_obj_9pywrapfst_SymbolTable *__pyx_f_9pywrapfst_compact_symbol_table(struct __pyx_obj_9pywrapfst__SymbolTable *, int __pyx_skip_dispatch); /*proto*/
static struct __pyx_obj_9pywrapfst_SymbolTable *__pyx_f_9pywrapfst_merge_symbol_table(struct __pyx_obj_9pywrapfst__SymbolTable *, struct __pyx_obj_9pywrapfst__SymbolTable *, 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<__pyx_t_10basictypes_int64>  __pyx_convert_vector_from_py___pyx_t_10basictypes_int64(PyObject *); /*proto*/
static std::vector<std::string>  __pyx_convert_vector_from_py_std_3a__3a_string(PyObject *); /*proto*/
#define __Pyx_MODULE_NAME "pywrapfst"
extern int __pyx_module_is_main_pywrapfst;
int __pyx_module_is_main_pywrapfst = 0;

/* Implementation of 'pywrapfst' */
static PyObject *__pyx_builtin_ValueError;
static PyObject *__pyx_builtin_RuntimeError;
static PyObject *__pyx_builtin_IndexError;
static PyObject *__pyx_builtin_IOError;
static PyObject *__pyx_builtin_object;
static PyObject *__pyx_builtin_staticmethod;
static PyObject *__pyx_builtin_id;
static PyObject *__pyx_builtin_TypeError;
static PyObject *__pyx_builtin_StopIteration;
static PyObject *__pyx_builtin_KeyError;
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_id[] = "id";
static const char __pyx_k_Fst[] = "Fst";
static const char __pyx_k_One[] = "One";
static const char __pyx_k__24[] = "";
static const char __pyx_k_add[] = "add";
static const char __pyx_k_arc[] = "arc";
static const char __pyx_k_cls[] = "cls";
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_new[] = "__new__";
static const char __pyx_k_rhs[] = "rhs";
static const char __pyx_k_PIPE[] = "PIPE";
static const char __pyx_k_Tsvg[] = "-Tsvg";
static const char __pyx_k_Zero[] = "Zero";
static const char __pyx_k_arcs[] = "arcs";
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_find[] = "find";
static const char __pyx_k_ifst[] = "ifst";
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_syms[] = "syms";
static const char __pyx_k_test[] = "test";
static const char __pyx_k_text[] = "text";
static const char __pyx_k_type[] = "type";
static const char __pyx_k_utf8[] = "utf8";
static const char __pyx_k_ERROR[] = "ERROR";
static const char __pyx_k_Popen[] = "Popen";
static const char __pyx_k_class[] = "__class__";
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_npath[] = "npath";
static const char __pyx_k_pairs[] = "pairs";
static const char __pyx_k_power[] = "power";
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_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_atexit[] = "atexit";
static const char __pyx_k_create[] = "create";
static const char __pyx_k_decode[] = "decode";
static const char __pyx_k_divide[] = "divide";
static const char __pyx_k_encode[] = "encode";
static const char __pyx_k_format[] = "format";
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_object[] = "object";
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_result[] = "result";
static const char __pyx_k_select[] = "select";
static const char __pyx_k_states[] = "states";
static const char __pyx_k_stderr[] = "stderr";
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_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_IOError[] = "IOError";
static const char __pyx_k_MUTABLE[] = "MUTABLE";
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_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_uniform[] = "uniform";
static const char __pyx_k_warning[] = "warning";
static const char __pyx_k_ACCEPTOR[] = "ACCEPTOR";
static const char __pyx_k_DOT_TSVG[] = "_DOT_TSVG";
static const char __pyx_k_EPSILONS[] = "EPSILONS";
static const char __pyx_k_EXPANDED[] = "EXPANDED";
static const char __pyx_k_FstError[] = "FstError";
static const char __pyx_k_Fst_read[] = "Fst.read";
static const char __pyx_k_KeyError[] = "KeyError";
static const char __pyx_k_NO_LABEL[] = "NO_LABEL";
static const char __pyx_k_NoWeight[] = "NoWeight";
static const char __pyx_k_WEIGHTED[] = "WEIGHTED";
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_filename[] = "filename";
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_register[] = "register";
static const char __pyx_k_repr_svg[] = "_repr_svg";
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_weighted[] = "weighted";
static const char __pyx_k_ARC_FLAGS[] = "ARC_FLAGS";
static const char __pyx_k_Fst___new[] = "Fst.__new__";
static const char __pyx_k_NO_SYMBOL[] = "NO_SYMBOL";
static const char __pyx_k_TypeError[] = "TypeError";
static const char __pyx_k_add_state[] = "add_state";
static const char __pyx_k_add_table[] = "add_table";
static const char __pyx_k_kNoSymbol[] = "kNoSymbol";
static const char __pyx_k_metaclass[] = "__metaclass__";
static const char __pyx_k_nextstate[] = "nextstate";
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_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_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_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_properties[] = "properties";
static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
static const char __pyx_k_queue_type[] = "queue_type";
static const char __pyx_k_returncode[] = "returncode";
static const char __pyx_k_subprocess[] = "subprocess";
static const char __pyx_k_write_text[] = "write_text";
static const char __pyx_k_Arc_at_0x_x[] = "<Arc at 0x{:x}>";
static const char __pyx_k_FstArgError[] = "FstArgError";
static const char __pyx_k_Fst_at_0x_x[] = "<{} Fst at 0x{:x}>";
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_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_pywrapfst_2[] = "pywrapfst";
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_NOT_ACCEPTOR[] = "NOT_ACCEPTOR";
static const char __pyx_k_RuntimeError[] = "RuntimeError";
static const char __pyx_k_allow_nondet[] = "allow_nondet";
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_ENCODE_LABELS[] = "ENCODE_LABELS";
static const char __pyx_k_FstIndexError[] = "FstIndexError";
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_Open_failed_r[] = "Open failed: {!r}";
static const char __pyx_k_Read_failed_r[] = "Read failed: {!r}";
static const char __pyx_k_StopIteration[] = "StopIteration";
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_pywrapfst_pyx[] = "pywrapfst.pyx";
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_Weight_at_0x_x[] = "<{} Weight {} at 0x{:x}>";
static const char __pyx_k_Write_failed_r[] = "Write failed: {!r}";
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_project_output[] = "project_output";
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_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_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_Key_out_of_order[] = "Key out of order";
static const char __pyx_k_NOT_COACCESSIBLE[] = "NOT_COACCESSIBLE";
static const char __pyx_k_Operation_failed[] = "Operation failed";
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_BINARY_PROPERTIES[] = "BINARY_PROPERTIES";
static const char __pyx_k_FarReader_at_0x_x[] = "<{} FarReader at 0x{:x}>";
static const char __pyx_k_FarWriter_at_0x_x[] = "<{} FarWriter at 0x{:x}>";
static const char __pyx_k_FstBadWeightError[] = "FstBadWeightError";
static const char __pyx_k_UNWEIGHTED_CYCLES[] = "UNWEIGHTED_CYCLES";
static const char __pyx_k_call_arc_labeling[] = "call_arc_labeling";
static const char __pyx_k_set_input_symbols[] = "set_input_symbols";
static const char __pyx_k_ADD_ARC_PROPERTIES[] = "ADD_ARC_PROPERTIES";
static const char __pyx_k_CalledProcessError[] = "CalledProcessError";
static const char __pyx_k_Compilation_failed[] = "Compilation failed";
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_Read_failed_string[] = "Read failed: <string>";
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_arc_type_r[] = "Unknown arc type: {!r}";
static const char __pyx_k_Unknown_map_type_r[] = "Unknown map type: {!r}";
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_read_from_string_2[] = "read_from_string";
static const char __pyx_k_set_output_symbols[] = "set_output_symbols";
static const char __pyx_k_ARC_SORT_PROPERTIES[] = "ARC_SORT_PROPERTIES";
static const char __pyx_k_ArcIterator_at_0x_x[] = "<ArcIterator at 0x{:x}>";
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_Unknown_sort_type_r[] = "Unknown sort type {!r}";
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_fst_error_fatal_old[] = "_fst_error_fatal_old";
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_EncodeMapper_at_0x_x[] = "<EncodeMapper at 0x{:x}>";
static const char __pyx_k_Fst_read_from_string[] = "Fst.read_from_string";
static const char __pyx_k_INTRINSIC_PROPERTIES[] = "INTRINSIC_PROPERTIES";
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_Unknown_queue_type_r[] = "Unknown queue type: {!r}";
static const char __pyx_k_keep_state_numbering[] = "keep_state_numbering";
static const char __pyx_k_require_superinitial[] = "require_superinitial";
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_StateIterator_at_0x_x[] = "<StateIterator at 0x{:x}>";
static const char __pyx_k_SymbolTable_r_at_0x_x[] = "<SymbolTable {!r} at 0x{:x}>";
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_reset_fst_error_fatal[] = "_reset_fst_error_fatal";
static const char __pyx_k_Conversion_to_r_failed[] = "Conversion to {!r} failed";
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_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_encode_as_string_r[] = "Cannot encode as string: {!r}";
static const char __pyx_k_Cannot_topsort_cyclic_FST[] = "Cannot topsort cyclic FST.";
static const char __pyx_k_Fst_SymbolTable_r_at_0x_x[] = "<Fst SymbolTable {!r} at 0x{:x}>";
static const char __pyx_k_FstDeletedConstructorError[] = "FstDeletedConstructorError";
static const char __pyx_k_MutableArcIterator_at_0x_x[] = "<MutableArcIterator at 0x{:x}>";
static const char __pyx_k_SymbolTableIterator_at_0x_x[] = "<SymbolTableIterator at 0x{:x}>";
static const char __pyx_k_WEIGHT_INVARIANT_PROPERTIES[] = "WEIGHT_INVARIANT_PROPERTIES";
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_Unknown_replace_label_type_r[] = "Unknown replace label type: {!r}";
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_Unknown_compose_filter_type_r[] = "Unknown compose filter type: {!r}";
static const char __pyx_k_increment_subsequential_label[] = "increment_subsequential_label";
static const char __pyx_k_Incompatible_or_invalid_weight[] = "Incompatible or invalid weight";
static const char __pyx_k_Unknown_determinization_type_r[] = "Unknown determinization type: {!r}";
static const char __pyx_k_const_EncodeMapper_SymbolTable[] = "<const EncodeMapper SymbolTable {!r} at 0x{:x}>";
static const char __pyx_k_Fst_arc_type_standard_Construct[] = "\n   Fst(arc_type=\"standard\")\n\n   Constructs an empty FST.\n\n   Args:\n     arc_type: A string indicating the arc type.\n\n   Raises:\n     FstError: Unknown arc type.\n\n   Raises:\n     FstOpError: operation failed.\n   ";
static const char __pyx_k_const_Fst_SymbolTable_r_at_0x_x[] = "<const Fst SymbolTable {!r} at 0x{:x}>";
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__fst_self__table_cannot_be[] = "self._fst,self._table cannot be converted to a Python object for pickling";
static const char __pyx_k_self__table_cannot_be_converted[] = "self._table cannot be converted to a Python object for pickling";
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: {!r}";
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__encoder_cannot_be_converte[] = "self._encoder cannot be converted to a Python object for pickling";
static const char __pyx_k_self__encoder_self__table_cannot[] = "self._encoder,self._table cannot be converted to a Python object for pickling";
static const char __pyx_k_self__mfst_self__table_cannot_be[] = "self._mfst,self._table 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__siter_self__table_cannot_b[] = "self._siter,self._table cannot be converted to a Python object for pickling";
static const char __pyx_k_self__smart_table_self__table_ca[] = "self._smart_table,self._table 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 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_kp_s_ArcIterator_at_0x_x;
static PyObject *__pyx_kp_s_Arc_at_0x_x;
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_n_s_CalledProcessError;
static PyObject *__pyx_kp_s_Cannot_construct;
static PyObject *__pyx_kp_s_Cannot_encode_as_string_r;
static PyObject *__pyx_kp_s_Cannot_topsort_cyclic_FST;
static PyObject *__pyx_kp_s_Compilation_failed;
static PyObject *__pyx_kp_s_Conversion_to_r_failed;
static PyObject *__pyx_n_s_DELETE_ARC_PROPERTIES;
static PyObject *__pyx_n_s_DELETE_STATE_PROPERTIES;
static PyObject *__pyx_n_s_DOT_TSVG;
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_kp_s_EncodeMapper_at_0x_x;
static PyObject *__pyx_n_s_FST_PROPERTIES;
static PyObject *__pyx_kp_s_FarReader_at_0x_x;
static PyObject *__pyx_kp_s_FarWriter_at_0x_x;
static PyObject *__pyx_n_s_Fst;
static PyObject *__pyx_n_s_FstArgError;
static PyObject *__pyx_n_s_FstBadWeightError;
static PyObject *__pyx_n_s_FstDeletedConstructorError;
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_kp_s_Fst_SymbolTable_r_at_0x_x;
static PyObject *__pyx_n_s_Fst___new;
static PyObject *__pyx_kp_s_Fst_arc_type_standard_Construct;
static PyObject *__pyx_kp_s_Fst_at_0x_x;
static PyObject *__pyx_n_s_Fst_read;
static PyObject *__pyx_n_s_Fst_read_from_string;
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_s_Incompatible_or_invalid_arc_type;
static PyObject *__pyx_kp_s_Incompatible_or_invalid_weight;
static PyObject *__pyx_kp_s_Incompatible_or_invalid_weight_t;
static PyObject *__pyx_n_s_IndexError;
static PyObject *__pyx_kp_s_Invalid_weight;
static PyObject *__pyx_n_s_KeyError;
static PyObject *__pyx_kp_s_Key_out_of_order;
static PyObject *__pyx_n_s_MUTABLE;
static PyObject *__pyx_kp_s_MutableArcIterator_at_0x_x;
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_n_s_NoWeight;
static PyObject *__pyx_kp_s_No_new_SymbolTables_specified;
static PyObject *__pyx_kp_s_No_relabeling_pairs_specified;
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_n_s_One;
static PyObject *__pyx_kp_s_Open_failed_r;
static PyObject *__pyx_kp_s_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_RM_SUPERFINAL_PROPERTIES;
static PyObject *__pyx_kp_s_Read_failed_r;
static PyObject *__pyx_kp_s_Read_failed_string;
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_kp_s_StateIterator_at_0x_x;
static PyObject *__pyx_kp_s_State_index_out_of_range;
static PyObject *__pyx_n_s_StopIteration;
static PyObject *__pyx_kp_s_SymbolTableIterator_at_0x_x;
static PyObject *__pyx_kp_s_SymbolTable_r_at_0x_x;
static PyObject *__pyx_n_s_TOP_SORTED;
static PyObject *__pyx_n_s_TRINARY_PROPERTIES;
static PyObject *__pyx_kp_s_Tsvg;
static PyObject *__pyx_n_s_TypeError;
static PyObject *__pyx_n_s_UNWEIGHTED;
static PyObject *__pyx_n_s_UNWEIGHTED_CYCLES;
static PyObject *__pyx_kp_s_Unknown_arc_type_r;
static PyObject *__pyx_kp_s_Unknown_compose_filter_type_r;
static PyObject *__pyx_kp_s_Unknown_determinization_type_r;
static PyObject *__pyx_kp_s_Unknown_map_type_r;
static PyObject *__pyx_kp_s_Unknown_queue_type_r;
static PyObject *__pyx_kp_s_Unknown_random_arc_selection_typ;
static PyObject *__pyx_kp_s_Unknown_replace_label_type_r;
static PyObject *__pyx_kp_s_Unknown_sort_type_r;
static PyObject *__pyx_n_s_ValueError;
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_s_Weight_at_0x_x;
static PyObject *__pyx_kp_s_Weight_type_not_found;
static PyObject *__pyx_kp_s_Write_failed_r;
static PyObject *__pyx_kp_s_Write_to_string_failed;
static PyObject *__pyx_n_s_Zero;
static PyObject *__pyx_kp_b__24;
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_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_atexit;
static PyObject *__pyx_n_s_attach_new_isymbols;
static PyObject *__pyx_n_s_attach_new_osymbols;
static PyObject *__pyx_n_b_auto;
static PyObject *__pyx_n_s_available_key;
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_cline_in_traceback;
static PyObject *__pyx_n_s_closure_plus;
static PyObject *__pyx_n_s_cls;
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_s_const_EncodeMapper_SymbolTable;
static PyObject *__pyx_kp_s_const_Fst_SymbolTable_r_at_0x_x;
static PyObject *__pyx_n_s_copy;
static PyObject *__pyx_n_s_create;
static PyObject *__pyx_n_s_decode;
static PyObject *__pyx_n_b_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_s_dot;
static PyObject *__pyx_n_s_draw;
static PyObject *__pyx_n_s_encode;
static PyObject *__pyx_n_s_encode_labels;
static PyObject *__pyx_n_s_encode_weights;
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_n_s_far_type;
static PyObject *__pyx_n_s_filename;
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_format;
static PyObject *__pyx_n_s_fst_error_fatal_old;
static PyObject *__pyx_n_s_fst_type;
static PyObject *__pyx_n_b_functional;
static PyObject *__pyx_n_b_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_b_identity;
static PyObject *__pyx_n_s_ifst;
static PyObject *__pyx_n_s_ifst1;
static PyObject *__pyx_n_s_ifst2;
static PyObject *__pyx_n_b_ilabel;
static PyObject *__pyx_n_s_ilabel;
static PyObject *__pyx_n_s_import;
static PyObject *__pyx_n_s_increment_subsequential_label;
static PyObject *__pyx_n_b_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_kNoSymbol;
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_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_b_neither;
static PyObject *__pyx_n_s_new;
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_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_object;
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_opairs;
static PyObject *__pyx_n_s_open;
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_project_output;
static PyObject *__pyx_n_s_properties;
static PyObject *__pyx_n_s_props;
static PyObject *__pyx_n_s_push_labels;
static PyObject *__pyx_n_s_push_weights;
static PyObject *__pyx_kp_b_pywrapfst;
static PyObject *__pyx_n_s_pywrapfst_2;
static PyObject *__pyx_kp_s_pywrapfst_pyx;
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_from_string;
static PyObject *__pyx_n_s_read_from_string_2;
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_register;
static PyObject *__pyx_n_s_remove_common_affix;
static PyObject *__pyx_n_s_remove_total_weight;
static PyObject *__pyx_n_b_repr_svg;
static PyObject *__pyx_n_s_require_superinitial;
static PyObject *__pyx_n_s_reset;
static PyObject *__pyx_n_s_reset_fst_error_fatal;
static PyObject *__pyx_n_s_result;
static PyObject *__pyx_n_s_return_arc_labeling;
static PyObject *__pyx_n_s_return_label;
static PyObject *__pyx_n_s_returncode;
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__encoder_cannot_be_converte;
static PyObject *__pyx_kp_s_self__encoder_self__table_cannot;
static PyObject *__pyx_kp_s_self__fst_self__siter_cannot_be;
static PyObject *__pyx_kp_s_self__fst_self__table_cannot_be;
static PyObject *__pyx_kp_s_self__mfst_self__table_cannot_be;
static PyObject *__pyx_kp_s_self__reader_cannot_be_converted;
static PyObject *__pyx_kp_s_self__siter_self__table_cannot_b;
static PyObject *__pyx_kp_s_self__smart_table_self__table_ca;
static PyObject *__pyx_kp_s_self__table_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_set_flags;
static PyObject *__pyx_n_s_set_input_symbols;
static PyObject *__pyx_n_s_set_name;
static PyObject *__pyx_n_s_set_output_symbols;
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_ssymbols;
static PyObject *__pyx_n_b_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_stderr;
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_syms;
static PyObject *__pyx_n_s_test;
static PyObject *__pyx_n_s_test_2;
static PyObject *__pyx_n_s_text;
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_b_tropical;
static PyObject *__pyx_n_s_type;
static PyObject *__pyx_n_b_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_b_unspecified;
static PyObject *__pyx_n_s_utf8;
static PyObject *__pyx_n_s_value;
static PyObject *__pyx_n_b_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_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_b_write_to_string;
static PyObject *__pyx_n_s_write_to_string;
static PyObject *__pyx_pf_9pywrapfst_6Weight___repr__(struct __pyx_obj_9pywrapfst_Weight *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_6Weight_2__str__(struct __pyx_obj_9pywrapfst_Weight *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_6Weight_4__float__(struct __pyx_obj_9pywrapfst_Weight *__pyx_v_self); /* proto */
static int __pyx_pf_9pywrapfst_6Weight_6__init__(struct __pyx_obj_9pywrapfst_Weight *__pyx_v_self, PyObject *__pyx_v_weight_type, PyObject *__pyx_v_weight); /* proto */
static PyObject *__pyx_pf_9pywrapfst_6Weight_8copy(struct __pyx_obj_9pywrapfst_Weight *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_6Weight_10Zero(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_weight_type); /* proto */
static PyObject *__pyx_pf_9pywrapfst_6Weight_12One(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_weight_type); /* proto */
static PyObject *__pyx_pf_9pywrapfst_6Weight_14NoWeight(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_weight_type); /* proto */
static PyObject *__pyx_pf_9pywrapfst_6Weight_16__eq__(struct __pyx_obj_9pywrapfst_Weight *__pyx_v_w1, struct __pyx_obj_9pywrapfst_Weight *__pyx_v_w2); /* proto */
static PyObject *__pyx_pf_9pywrapfst_6Weight_18__ne__(struct __pyx_obj_9pywrapfst_Weight *__pyx_v_w1, struct __pyx_obj_9pywrapfst_Weight *__pyx_v_w2); /* proto */
static PyObject *__pyx_pf_9pywrapfst_6Weight_20to_string(struct __pyx_obj_9pywrapfst_Weight *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_6Weight_22type(struct __pyx_obj_9pywrapfst_Weight *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_6Weight_24__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9pywrapfst_Weight *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_6Weight_26__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_9pywrapfst_Weight *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_9pywrapfst_plus(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst_Weight *__pyx_v_lhs, struct __pyx_obj_9pywrapfst_Weight *__pyx_v_rhs); /* proto */
static PyObject *__pyx_pf_9pywrapfst_2times(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst_Weight *__pyx_v_lhs, struct __pyx_obj_9pywrapfst_Weight *__pyx_v_rhs); /* proto */
static PyObject *__pyx_pf_9pywrapfst_4divide(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst_Weight *__pyx_v_lhs, struct __pyx_obj_9pywrapfst_Weight *__pyx_v_rhs); /* proto */
static PyObject *__pyx_pf_9pywrapfst_6power(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst_Weight *__pyx_v_w, size_t __pyx_v_n); /* proto */
static int __pyx_pf_9pywrapfst_12_SymbolTable___init__(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_12_SymbolTable_2__iter__(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_12_SymbolTable_4available_key(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_12_SymbolTable_6checksum(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_12_SymbolTable_8copy(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_12_SymbolTable_10find(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_9pywrapfst_12_SymbolTable_12get_nth_key(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self, Py_ssize_t __pyx_v_pos); /* proto */
static PyObject *__pyx_pf_9pywrapfst_12_SymbolTable_14labeled_checksum(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_12_SymbolTable_16member(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static int __pyx_pf_9pywrapfst_12_SymbolTable_18__contains__(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_9pywrapfst_12_SymbolTable_20name(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_12_SymbolTable_22num_symbols(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_12_SymbolTable_24write(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self, PyObject *__pyx_v_filename); /* proto */
static PyObject *__pyx_pf_9pywrapfst_12_SymbolTable_26write_text(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self, PyObject *__pyx_v_filename); /* proto */
static PyObject *__pyx_pf_9pywrapfst_12_SymbolTable_28__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_12_SymbolTable_30__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_9pywrapfst_24_EncodeMapperSymbolTable___repr__(struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTable *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_24_EncodeMapperSymbolTable_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTable *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_24_EncodeMapperSymbolTable_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTable *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_9pywrapfst_15_FstSymbolTable___repr__(struct __pyx_obj_9pywrapfst__FstSymbolTable *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_15_FstSymbolTable_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9pywrapfst__FstSymbolTable *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_15_FstSymbolTable_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_9pywrapfst__FstSymbolTable *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_9pywrapfst_19_MutableSymbolTable_add_symbol(struct __pyx_obj_9pywrapfst__MutableSymbolTable *__pyx_v_self, PyObject *__pyx_v_symbol, __pyx_t_10basictypes_int64 __pyx_v_key); /* proto */
static PyObject *__pyx_pf_9pywrapfst_19_MutableSymbolTable_2add_table(struct __pyx_obj_9pywrapfst__MutableSymbolTable *__pyx_v_self, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_syms); /* proto */
static PyObject *__pyx_pf_9pywrapfst_19_MutableSymbolTable_4set_name(struct __pyx_obj_9pywrapfst__MutableSymbolTable *__pyx_v_self, PyObject *__pyx_v_new_name); /* proto */
static PyObject *__pyx_pf_9pywrapfst_19_MutableSymbolTable_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9pywrapfst__MutableSymbolTable *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_19_MutableSymbolTable_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_9pywrapfst__MutableSymbolTable *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_9pywrapfst_22_MutableFstSymbolTable___repr__(struct __pyx_obj_9pywrapfst__MutableFstSymbolTable *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_22_MutableFstSymbolTable_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9pywrapfst__MutableFstSymbolTable *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_22_MutableFstSymbolTable_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_9pywrapfst__MutableFstSymbolTable *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_9pywrapfst_11SymbolTable___repr__(struct __pyx_obj_9pywrapfst_SymbolTable *__pyx_v_self); /* proto */
static int __pyx_pf_9pywrapfst_11SymbolTable_2__init__(struct __pyx_obj_9pywrapfst_SymbolTable *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_9pywrapfst_11SymbolTable_4read(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_filename); /* proto */
static PyObject *__pyx_pf_9pywrapfst_11SymbolTable_6read_text(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_filename, bool __pyx_v_allow_negative_labels); /* proto */
static PyObject *__pyx_pf_9pywrapfst_11SymbolTable_8read_fst(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_filename, bool __pyx_v_input_table); /* proto */
static PyObject *__pyx_pf_9pywrapfst_11SymbolTable_10__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9pywrapfst_SymbolTable *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_11SymbolTable_12__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_9pywrapfst_SymbolTable *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_9pywrapfst_8compact_symbol_table(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_syms); /* proto */
static PyObject *__pyx_pf_9pywrapfst_10merge_symbol_table(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_lhs, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_rhs); /* proto */
static PyObject *__pyx_pf_9pywrapfst_19SymbolTableIterator___repr__(struct __pyx_obj_9pywrapfst_SymbolTableIterator *__pyx_v_self); /* proto */
static int __pyx_pf_9pywrapfst_19SymbolTableIterator_2__init__(struct __pyx_obj_9pywrapfst_SymbolTableIterator *__pyx_v_self, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_syms); /* proto */
static PyObject *__pyx_pf_9pywrapfst_19SymbolTableIterator_4__iter__(struct __pyx_obj_9pywrapfst_SymbolTableIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_19SymbolTableIterator_6__next__(struct __pyx_obj_9pywrapfst_SymbolTableIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_19SymbolTableIterator_8done(struct __pyx_obj_9pywrapfst_SymbolTableIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_19SymbolTableIterator_10next(struct __pyx_obj_9pywrapfst_SymbolTableIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_19SymbolTableIterator_12reset(struct __pyx_obj_9pywrapfst_SymbolTableIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_19SymbolTableIterator_14symbol(struct __pyx_obj_9pywrapfst_SymbolTableIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_19SymbolTableIterator_16value(struct __pyx_obj_9pywrapfst_SymbolTableIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_19SymbolTableIterator_18__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9pywrapfst_SymbolTableIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_19SymbolTableIterator_20__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_9pywrapfst_SymbolTableIterator *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_9pywrapfst_12EncodeMapper___repr__(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self); /* proto */
static int __pyx_pf_9pywrapfst_12EncodeMapper_2__init__(struct __pyx_obj_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_9pywrapfst_12EncodeMapper_4arc_type(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_12EncodeMapper_6__call__(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self, struct __pyx_obj_9pywrapfst_Arc *__pyx_v_arc); /* proto */
static PyObject *__pyx_pf_9pywrapfst_12EncodeMapper_8flags(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_12EncodeMapper_10input_symbols(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_12EncodeMapper_12output_symbols(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_12EncodeMapper_14properties(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self, __pyx_t_10basictypes_uint64 __pyx_v_mask); /* proto */
static PyObject *__pyx_pf_9pywrapfst_12EncodeMapper_16set_input_symbols(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_syms); /* proto */
static PyObject *__pyx_pf_9pywrapfst_12EncodeMapper_18set_output_symbols(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_syms); /* proto */
static PyObject *__pyx_pf_9pywrapfst_12EncodeMapper_20weight_type(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_12EncodeMapper_22__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_12EncodeMapper_24__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_9pywrapfst_4_Fst__repr_svg_(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_4_Fst_2__repr__(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_self); /* proto */
static int __pyx_pf_9pywrapfst_4_Fst_4__init__(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_4_Fst_6__str__(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_4_Fst_8__reduce__(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_4_Fst_10arc_type(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_4_Fst_12arcs(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_self, __pyx_t_10basictypes_int64 __pyx_v_state); /* proto */
static PyObject *__pyx_pf_9pywrapfst_4_Fst_14copy(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_4_Fst_16draw(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_self, PyObject *__pyx_v_filename, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_isymbols, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_osymbols, struct __pyx_obj_9pywrapfst_SymbolTable *__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, __pyx_t_10basictypes_int32 __pyx_v_fontsize, __pyx_t_10basictypes_int32 __pyx_v_precision, PyObject *__pyx_v_float_format, bool __pyx_v_show_weight_one); /* proto */
static PyObject *__pyx_pf_9pywrapfst_4_Fst_18final(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_self, __pyx_t_10basictypes_int64 __pyx_v_state); /* proto */
static PyObject *__pyx_pf_9pywrapfst_4_Fst_20fst_type(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_4_Fst_22input_symbols(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_4_Fst_24num_arcs(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_self, __pyx_t_10basictypes_int64 __pyx_v_state); /* proto */
static PyObject *__pyx_pf_9pywrapfst_4_Fst_26num_input_epsilons(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_self, __pyx_t_10basictypes_int64 __pyx_v_state); /* proto */
static PyObject *__pyx_pf_9pywrapfst_4_Fst_28num_output_epsilons(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_self, __pyx_t_10basictypes_int64 __pyx_v_state); /* proto */
static PyObject *__pyx_pf_9pywrapfst_4_Fst_30output_symbols(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_4_Fst_32properties(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_self, __pyx_t_10basictypes_uint64 __pyx_v_mask, bool __pyx_v_test); /* proto */
static PyObject *__pyx_pf_9pywrapfst_4_Fst_34start(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_4_Fst_36states(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_4_Fst_38text(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_self, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_isymbols, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_osymbols, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_ssymbols, bool __pyx_v_acceptor, bool __pyx_v_show_weight_one, PyObject *__pyx_v_missing_sym); /* proto */
static PyObject *__pyx_pf_9pywrapfst_4_Fst_40verify(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_4_Fst_42weight_type(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_4_Fst_44write(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_self, PyObject *__pyx_v_filename); /* proto */
static PyObject *__pyx_pf_9pywrapfst_4_Fst_46write_to_string(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_add_arc(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, __pyx_t_10basictypes_int64 __pyx_v_state, struct __pyx_obj_9pywrapfst_Arc *__pyx_v_arc); /* proto */
static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_2add_state(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_4arcsort(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, PyObject *__pyx_v_sort_type); /* proto */
static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_6closure(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, bool __pyx_v_closure_plus); /* proto */
static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_8concat(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst); /* proto */
static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_10connect(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_12decode(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_encoder); /* proto */
static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_14delete_arcs(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, __pyx_t_10basictypes_int64 __pyx_v_state, size_t __pyx_v_n); /* proto */
static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_16delete_states(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, PyObject *__pyx_v_states); /* proto */
static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_18encode(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_encoder); /* proto */
static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_20invert(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_22minimize(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, float __pyx_v_delta, bool __pyx_v_allow_nondet); /* proto */
static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_24mutable_arcs(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, __pyx_t_10basictypes_int64 __pyx_v_state); /* proto */
static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_26mutable_input_symbols(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_28mutable_output_symbols(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_30num_states(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_32project(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, bool __pyx_v_project_output); /* proto */
static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_34prune(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, float __pyx_v_delta, __pyx_t_10basictypes_int64 __pyx_v_nstate, PyObject *__pyx_v_weight); /* proto */
static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_36push(struct __pyx_obj_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_9pywrapfst_11_MutableFst_38relabel_pairs(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, PyObject *__pyx_v_ipairs, PyObject *__pyx_v_opairs); /* proto */
static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_40relabel_tables(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_old_isymbols, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_new_isymbols, PyObject *__pyx_v_unknown_isymbol, bool __pyx_v_attach_new_isymbols, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_old_osymbols, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_new_osymbols, PyObject *__pyx_v_unknown_osymbol, bool __pyx_v_attach_new_osymbols); /* proto */
static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_42reserve_arcs(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, __pyx_t_10basictypes_int64 __pyx_v_state, size_t __pyx_v_n); /* proto */
static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_44reserve_states(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, __pyx_t_10basictypes_int64 __pyx_v_n); /* proto */
static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_46reweight(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, PyObject *__pyx_v_potentials, bool __pyx_v_to_final); /* proto */
static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_48rmepsilon(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, PyObject *__pyx_v_queue_type, bool __pyx_v_connect, PyObject *__pyx_v_weight, __pyx_t_10basictypes_int64 __pyx_v_nstate, float __pyx_v_delta); /* proto */
static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_50set_final(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, __pyx_t_10basictypes_int64 __pyx_v_state, PyObject *__pyx_v_weight); /* proto */
static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_52set_input_symbols(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_syms); /* proto */
static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_54set_output_symbols(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_syms); /* proto */
static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_56set_properties(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, __pyx_t_10basictypes_uint64 __pyx_v_props, __pyx_t_10basictypes_uint64 __pyx_v_mask); /* proto */
static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_58set_start(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, __pyx_t_10basictypes_int64 __pyx_v_state); /* proto */
static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_60topsort(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_62union(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst); /* proto */
static PyObject *__pyx_pf_9pywrapfst_12_read(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filename); /* proto */
static PyObject *__pyx_pf_9pywrapfst_14_read_from_string(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_state); /* proto */
static PyObject *__pyx_pf_9pywrapfst_3Fst___new__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_cls, PyObject *__pyx_v_arc_type); /* proto */
static PyObject *__pyx_pf_9pywrapfst_3Fst_2read(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filename); /* proto */
static PyObject *__pyx_pf_9pywrapfst_3Fst_4read_from_string(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_state); /* proto */
static PyObject *__pyx_pf_9pywrapfst_3Arc___repr__(struct __pyx_obj_9pywrapfst_Arc *__pyx_v_self); /* proto */
static int __pyx_pf_9pywrapfst_3Arc_2__init__(struct __pyx_obj_9pywrapfst_Arc *__pyx_v_self, __pyx_t_10basictypes_int64 __pyx_v_ilabel, __pyx_t_10basictypes_int64 __pyx_v_olabel, PyObject *__pyx_v_weight, __pyx_t_10basictypes_int64 __pyx_v_nextstate); /* proto */
static PyObject *__pyx_pf_9pywrapfst_3Arc_4copy(struct __pyx_obj_9pywrapfst_Arc *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_3Arc_6ilabel___get__(struct __pyx_obj_9pywrapfst_Arc *__pyx_v_self); /* proto */
static int __pyx_pf_9pywrapfst_3Arc_6ilabel_2__set__(struct __pyx_obj_9pywrapfst_Arc *__pyx_v_self, __pyx_t_10basictypes_int64 __pyx_v_value); /* proto */
static PyObject *__pyx_pf_9pywrapfst_3Arc_6olabel___get__(struct __pyx_obj_9pywrapfst_Arc *__pyx_v_self); /* proto */
static int __pyx_pf_9pywrapfst_3Arc_6olabel_2__set__(struct __pyx_obj_9pywrapfst_Arc *__pyx_v_self, __pyx_t_10basictypes_int64 __pyx_v_value); /* proto */
static PyObject *__pyx_pf_9pywrapfst_3Arc_6weight___get__(struct __pyx_obj_9pywrapfst_Arc *__pyx_v_self); /* proto */
static int __pyx_pf_9pywrapfst_3Arc_6weight_2__set__(struct __pyx_obj_9pywrapfst_Arc *__pyx_v_self, PyObject *__pyx_v_weight); /* proto */
static PyObject *__pyx_pf_9pywrapfst_3Arc_9nextstate___get__(struct __pyx_obj_9pywrapfst_Arc *__pyx_v_self); /* proto */
static int __pyx_pf_9pywrapfst_3Arc_9nextstate_2__set__(struct __pyx_obj_9pywrapfst_Arc *__pyx_v_self, __pyx_t_10basictypes_int64 __pyx_v_value); /* proto */
static PyObject *__pyx_pf_9pywrapfst_3Arc_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9pywrapfst_Arc *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_3Arc_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_9pywrapfst_Arc *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_9pywrapfst_11ArcIterator___repr__(struct __pyx_obj_9pywrapfst_ArcIterator *__pyx_v_self); /* proto */
static int __pyx_pf_9pywrapfst_11ArcIterator_2__init__(struct __pyx_obj_9pywrapfst_ArcIterator *__pyx_v_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst, __pyx_t_10basictypes_int64 __pyx_v_state); /* proto */
static PyObject *__pyx_pf_9pywrapfst_11ArcIterator_4__iter__(struct __pyx_obj_9pywrapfst_ArcIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_11ArcIterator_6__next__(struct __pyx_obj_9pywrapfst_ArcIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_11ArcIterator_8done(struct __pyx_obj_9pywrapfst_ArcIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_11ArcIterator_10flags(struct __pyx_obj_9pywrapfst_ArcIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_11ArcIterator_12next(struct __pyx_obj_9pywrapfst_ArcIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_11ArcIterator_14position(struct __pyx_obj_9pywrapfst_ArcIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_11ArcIterator_16reset(struct __pyx_obj_9pywrapfst_ArcIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_11ArcIterator_18seek(struct __pyx_obj_9pywrapfst_ArcIterator *__pyx_v_self, size_t __pyx_v_a); /* proto */
static PyObject *__pyx_pf_9pywrapfst_11ArcIterator_20set_flags(struct __pyx_obj_9pywrapfst_ArcIterator *__pyx_v_self, __pyx_t_10basictypes_uint32 __pyx_v_flags, __pyx_t_10basictypes_uint32 __pyx_v_mask); /* proto */
static PyObject *__pyx_pf_9pywrapfst_11ArcIterator_22value(struct __pyx_obj_9pywrapfst_ArcIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_11ArcIterator_24__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9pywrapfst_ArcIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_11ArcIterator_26__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_9pywrapfst_ArcIterator *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_9pywrapfst_18MutableArcIterator___repr__(struct __pyx_obj_9pywrapfst_MutableArcIterator *__pyx_v_self); /* proto */
static int __pyx_pf_9pywrapfst_18MutableArcIterator_2__init__(struct __pyx_obj_9pywrapfst_MutableArcIterator *__pyx_v_self, struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_ifst, __pyx_t_10basictypes_int64 __pyx_v_state); /* proto */
static PyObject *__pyx_pf_9pywrapfst_18MutableArcIterator_4done(struct __pyx_obj_9pywrapfst_MutableArcIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_18MutableArcIterator_6flags(struct __pyx_obj_9pywrapfst_MutableArcIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_18MutableArcIterator_8next(struct __pyx_obj_9pywrapfst_MutableArcIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_18MutableArcIterator_10position(struct __pyx_obj_9pywrapfst_MutableArcIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_18MutableArcIterator_12reset(struct __pyx_obj_9pywrapfst_MutableArcIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_18MutableArcIterator_14seek(struct __pyx_obj_9pywrapfst_MutableArcIterator *__pyx_v_self, size_t __pyx_v_a); /* proto */
static PyObject *__pyx_pf_9pywrapfst_18MutableArcIterator_16set_flags(struct __pyx_obj_9pywrapfst_MutableArcIterator *__pyx_v_self, __pyx_t_10basictypes_uint32 __pyx_v_flags, __pyx_t_10basictypes_uint32 __pyx_v_mask); /* proto */
static PyObject *__pyx_pf_9pywrapfst_18MutableArcIterator_18set_value(struct __pyx_obj_9pywrapfst_MutableArcIterator *__pyx_v_self, struct __pyx_obj_9pywrapfst_Arc *__pyx_v_arc); /* proto */
static PyObject *__pyx_pf_9pywrapfst_18MutableArcIterator_20value(struct __pyx_obj_9pywrapfst_MutableArcIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_18MutableArcIterator_22__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9pywrapfst_MutableArcIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_18MutableArcIterator_24__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_9pywrapfst_MutableArcIterator *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_9pywrapfst_13StateIterator___repr__(struct __pyx_obj_9pywrapfst_StateIterator *__pyx_v_self); /* proto */
static int __pyx_pf_9pywrapfst_13StateIterator_2__init__(struct __pyx_obj_9pywrapfst_StateIterator *__pyx_v_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst); /* proto */
static PyObject *__pyx_pf_9pywrapfst_13StateIterator_4__iter__(struct __pyx_obj_9pywrapfst_StateIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_13StateIterator_6__next__(struct __pyx_obj_9pywrapfst_StateIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_13StateIterator_8done(struct __pyx_obj_9pywrapfst_StateIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_13StateIterator_10next(struct __pyx_obj_9pywrapfst_StateIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_13StateIterator_12reset(struct __pyx_obj_9pywrapfst_StateIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_13StateIterator_14value(struct __pyx_obj_9pywrapfst_StateIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_13StateIterator_16__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9pywrapfst_StateIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_13StateIterator_18__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_9pywrapfst_StateIterator *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_9pywrapfst_16arcmap(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_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_9pywrapfst_18compose(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst1, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst2, PyObject *__pyx_v_compose_filter, bool __pyx_v_connect); /* proto */
static PyObject *__pyx_pf_9pywrapfst_20convert(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst, PyObject *__pyx_v_fst_type); /* proto */
static PyObject *__pyx_pf_9pywrapfst_22determinize(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst, float __pyx_v_delta, PyObject *__pyx_v_det_type, __pyx_t_10basictypes_int64 __pyx_v_nstate, __pyx_t_10basictypes_int64 __pyx_v_subsequential_label, PyObject *__pyx_v_weight, bool __pyx_v_increment_subsequential_label); /* proto */
static PyObject *__pyx_pf_9pywrapfst_24difference(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst1, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst2, PyObject *__pyx_v_compose_filter, bool __pyx_v_connect); /* proto */
static PyObject *__pyx_pf_9pywrapfst_26disambiguate(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst, float __pyx_v_delta, __pyx_t_10basictypes_int64 __pyx_v_nstate, __pyx_t_10basictypes_int64 __pyx_v_subsequential_label, PyObject *__pyx_v_weight); /* proto */
static PyObject *__pyx_pf_9pywrapfst_28epsnormalize(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst, bool __pyx_v_eps_norm_output); /* proto */
static PyObject *__pyx_pf_9pywrapfst_30equal(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst1, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst2, float __pyx_v_delta); /* proto */
static PyObject *__pyx_pf_9pywrapfst_32equivalent(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst1, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst2, float __pyx_v_delta); /* proto */
static PyObject *__pyx_pf_9pywrapfst_34intersect(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst1, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst2, PyObject *__pyx_v_compose_filter, bool __pyx_v_connect); /* proto */
static PyObject *__pyx_pf_9pywrapfst_36isomorphic(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst1, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst2, float __pyx_v_delta); /* proto */
static PyObject *__pyx_pf_9pywrapfst_38prune(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst, float __pyx_v_delta, __pyx_t_10basictypes_int64 __pyx_v_nstate, PyObject *__pyx_v_weight); /* proto */
static PyObject *__pyx_pf_9pywrapfst_40push(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_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_9pywrapfst_42randequivalent(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst1, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst2, __pyx_t_10basictypes_int32 __pyx_v_npath, float __pyx_v_delta, time_t __pyx_v_seed, PyObject *__pyx_v_select, __pyx_t_10basictypes_int32 __pyx_v_max_length); /* proto */
static PyObject *__pyx_pf_9pywrapfst_44randgen(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst, __pyx_t_10basictypes_int32 __pyx_v_npath, time_t __pyx_v_seed, PyObject *__pyx_v_select, __pyx_t_10basictypes_int32 __pyx_v_max_length, bool __pyx_v_weighted, bool __pyx_v_remove_total_weight); /* proto */
static PyObject *__pyx_pf_9pywrapfst_46replace(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, __pyx_t_10basictypes_int64 __pyx_v_return_label); /* proto */
static PyObject *__pyx_pf_9pywrapfst_48reverse(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst, bool __pyx_v_require_superinitial); /* proto */
static PyObject *__pyx_pf_9pywrapfst_50shortestdistance(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst, float __pyx_v_delta, __pyx_t_10basictypes_int64 __pyx_v_nstate, PyObject *__pyx_v_queue_type, bool __pyx_v_reverse); /* proto */
static PyObject *__pyx_pf_9pywrapfst_52shortestpath(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst, float __pyx_v_delta, __pyx_t_10basictypes_int32 __pyx_v_nshortest, __pyx_t_10basictypes_int64 __pyx_v_nstate, PyObject *__pyx_v_queue_type, bool __pyx_v_unique, PyObject *__pyx_v_weight); /* proto */
static PyObject *__pyx_pf_9pywrapfst_54statemap(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst, PyObject *__pyx_v_map_type); /* proto */
static PyObject *__pyx_pf_9pywrapfst_56synchronize(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst); /* proto */
static int __pyx_pf_9pywrapfst_8Compiler___cinit__(struct __pyx_obj_9pywrapfst_Compiler *__pyx_v_self, std::string __pyx_v_fst_type, std::string __pyx_v_arc_type, struct __pyx_obj_9pywrapfst_SymbolTable *__pyx_v_isymbols, struct __pyx_obj_9pywrapfst_SymbolTable *__pyx_v_osymbols, struct __pyx_obj_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_9pywrapfst_8Compiler_2compile(struct __pyx_obj_9pywrapfst_Compiler *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_8Compiler_4write(struct __pyx_obj_9pywrapfst_Compiler *__pyx_v_self, PyObject *__pyx_v_expression); /* proto */
static PyObject *__pyx_pf_9pywrapfst_8Compiler_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9pywrapfst_Compiler *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_8Compiler_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_9pywrapfst_Compiler *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_9pywrapfst_9FarReader___init__(struct __pyx_obj_9pywrapfst_FarReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_9FarReader_2__repr__(struct __pyx_obj_9pywrapfst_FarReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_9FarReader_4open(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_filenames); /* proto */
static PyObject *__pyx_pf_9pywrapfst_9FarReader_6arc_type(struct __pyx_obj_9pywrapfst_FarReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_9FarReader_8done(struct __pyx_obj_9pywrapfst_FarReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_9FarReader_10error(struct __pyx_obj_9pywrapfst_FarReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_9FarReader_12far_type(struct __pyx_obj_9pywrapfst_FarReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_9FarReader_14find(struct __pyx_obj_9pywrapfst_FarReader *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_9pywrapfst_9FarReader_16get_fst(struct __pyx_obj_9pywrapfst_FarReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_9FarReader_18get_key(struct __pyx_obj_9pywrapfst_FarReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_9FarReader_20next(struct __pyx_obj_9pywrapfst_FarReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_9FarReader_22reset(struct __pyx_obj_9pywrapfst_FarReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_9FarReader_24__getitem__(struct __pyx_obj_9pywrapfst_FarReader *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_9pywrapfst_9FarReader_26__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9pywrapfst_FarReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_9FarReader_28__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_9pywrapfst_FarReader *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_9pywrapfst_9FarWriter___init__(struct __pyx_obj_9pywrapfst_FarWriter *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_9FarWriter_2__repr__(struct __pyx_obj_9pywrapfst_FarWriter *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_9FarWriter_4create(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_filename, PyObject *__pyx_v_arc_type, PyObject *__pyx_v_far_type); /* proto */
static PyObject *__pyx_pf_9pywrapfst_9FarWriter_6add(struct __pyx_obj_9pywrapfst_FarWriter *__pyx_v_self, PyObject *__pyx_v_key, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst); /* proto */
static PyObject *__pyx_pf_9pywrapfst_9FarWriter_8arc_type(struct __pyx_obj_9pywrapfst_FarWriter *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_9FarWriter_10error(struct __pyx_obj_9pywrapfst_FarWriter *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_9FarWriter_12far_type(struct __pyx_obj_9pywrapfst_FarWriter *__pyx_v_self); /* proto */
static int __pyx_pf_9pywrapfst_9FarWriter_14__setitem__(struct __pyx_obj_9pywrapfst_FarWriter *__pyx_v_self, PyObject *__pyx_v_key, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_fst); /* proto */
static PyObject *__pyx_pf_9pywrapfst_9FarWriter_16__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9pywrapfst_FarWriter *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_9FarWriter_18__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_9pywrapfst_FarWriter *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_9pywrapfst_58_reset_fst_error_fatal(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_tp_new_9pywrapfst_Weight(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_9pywrapfst__SymbolTable(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_9pywrapfst__EncodeMapperSymbolTable(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_9pywrapfst__FstSymbolTable(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_9pywrapfst__MutableSymbolTable(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_9pywrapfst__MutableFstSymbolTable(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_9pywrapfst_SymbolTable(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_9pywrapfst_SymbolTableIterator(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_9pywrapfst_EncodeMapper(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_9pywrapfst__Fst(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_9pywrapfst__MutableFst(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_9pywrapfst_Arc(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_9pywrapfst_ArcIterator(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_9pywrapfst_MutableArcIterator(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_9pywrapfst_StateIterator(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_9pywrapfst_Compiler(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_9pywrapfst_FarReader(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_9pywrapfst_FarWriter(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_int_0;
static PyObject *__pyx_int_neg_1;
static __pyx_t_10basictypes_int64 __pyx_k__13;
static float __pyx_k__35;
static float __pyx_k__36;
static float __pyx_k__37;
static __pyx_t_10basictypes_int64 __pyx_k__38;
static float __pyx_k__39;
static __pyx_t_10basictypes_int64 __pyx_k__40;
static float __pyx_k__41;
static float __pyx_k__42;
static __pyx_t_10basictypes_int64 __pyx_k__46;
static float __pyx_k__47;
static __pyx_t_10basictypes_int64 __pyx_k__48;
static float __pyx_k__49;
static float __pyx_k__67;
static float __pyx_k__68;
static float __pyx_k__69;
static __pyx_t_10basictypes_int64 __pyx_k__70;
static float __pyx_k__71;
static __pyx_t_10basictypes_int64 __pyx_k__72;
static float __pyx_k__73;
static float __pyx_k__74;
static float __pyx_k__75;
static float __pyx_k__76;
static __pyx_t_10basictypes_int64 __pyx_k__77;
static float __pyx_k__78;
static float __pyx_k__79;
static __pyx_t_10basictypes_int32 __pyx_k__80;
static __pyx_t_10basictypes_int32 __pyx_k__81;
static float __pyx_k__82;
static __pyx_t_10basictypes_int64 __pyx_k__83;
static float __pyx_k__84;
static __pyx_t_10basictypes_int64 __pyx_k__85;
static float __pyx_k__86;
static __pyx_t_10basictypes_int64 __pyx_k__87;
static std::string __pyx_k__88;
static std::string __pyx_k__89;
static PyObject *__pyx_tuple_;
static PyObject *__pyx_tuple__2;
static PyObject *__pyx_tuple__3;
static PyObject *__pyx_tuple__4;
static PyObject *__pyx_tuple__5;
static PyObject *__pyx_tuple__6;
static PyObject *__pyx_tuple__7;
static PyObject *__pyx_tuple__8;
static PyObject *__pyx_tuple__9;
static PyObject *__pyx_tuple__10;
static PyObject *__pyx_tuple__11;
static PyObject *__pyx_tuple__12;
static PyObject *__pyx_tuple__14;
static PyObject *__pyx_tuple__15;
static PyObject *__pyx_tuple__16;
static PyObject *__pyx_tuple__17;
static PyObject *__pyx_tuple__18;
static PyObject *__pyx_tuple__19;
static PyObject *__pyx_tuple__20;
static PyObject *__pyx_tuple__21;
static PyObject *__pyx_tuple__22;
static PyObject *__pyx_tuple__23;
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__32;
static PyObject *__pyx_tuple__33;
static PyObject *__pyx_tuple__34;
static PyObject *__pyx_tuple__43;
static PyObject *__pyx_tuple__44;
static PyObject *__pyx_tuple__45;
static PyObject *__pyx_tuple__50;
static PyObject *__pyx_tuple__51;
static PyObject *__pyx_tuple__52;
static PyObject *__pyx_tuple__53;
static PyObject *__pyx_tuple__54;
static PyObject *__pyx_tuple__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__60;
static PyObject *__pyx_tuple__61;
static PyObject *__pyx_tuple__62;
static PyObject *__pyx_tuple__63;
static PyObject *__pyx_tuple__64;
static PyObject *__pyx_tuple__65;
static PyObject *__pyx_tuple__66;
static PyObject *__pyx_tuple__90;
static PyObject *__pyx_tuple__91;
static PyObject *__pyx_tuple__92;
static PyObject *__pyx_tuple__93;
static PyObject *__pyx_tuple__94;
static PyObject *__pyx_tuple__95;
static PyObject *__pyx_tuple__96;
static PyObject *__pyx_tuple__97;
static PyObject *__pyx_tuple__98;
static PyObject *__pyx_tuple__99;
static PyObject *__pyx_tuple__101;
static PyObject *__pyx_tuple__103;
static PyObject *__pyx_tuple__105;
static PyObject *__pyx_tuple__107;
static PyObject *__pyx_tuple__108;
static PyObject *__pyx_tuple__110;
static PyObject *__pyx_tuple__111;
static PyObject *__pyx_tuple__113;
static PyObject *__pyx_tuple__115;
static PyObject *__pyx_codeobj__100;
static PyObject *__pyx_codeobj__102;
static PyObject *__pyx_codeobj__104;
static PyObject *__pyx_codeobj__106;
static PyObject *__pyx_codeobj__109;
static PyObject *__pyx_codeobj__112;
static PyObject *__pyx_codeobj__114;
static PyObject *__pyx_codeobj__116;
static PyObject *__pyx_codeobj__117;

/* "pywrapfst.pyx":159
 * 
 * 
 * cdef string tostring(data, encoding="utf8") except *:             # <<<<<<<<<<<<<<
 *   """Converts strings to bytestrings.
 * 
 */

static std::string __pyx_f_9pywrapfst_tostring(PyObject *__pyx_v_data, struct __pyx_opt_args_9pywrapfst_tostring *__pyx_optional_args) {
  PyObject *__pyx_v_encoding = ((PyObject *)__pyx_n_s_utf8);
  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;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  __Pyx_RefNannySetupContext("tostring", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_encoding = __pyx_optional_args->encoding;
    }
  }

  /* "pywrapfst.pyx":180
 *   """
 *   # A Python bytestring can be implicitly cast to a C++ string.
 *   if isinstance(data, bytes):             # <<<<<<<<<<<<<<
 *     return data
 *   elif isinstance(data, unicode):
 */
  __pyx_t_1 = PyBytes_Check(__pyx_v_data); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pywrapfst.pyx":181
 *   # A Python bytestring can be implicitly cast to a C++ string.
 *   if isinstance(data, bytes):
 *     return data             # <<<<<<<<<<<<<<
 *   elif isinstance(data, unicode):
 *     return data.encode(encoding)
 */
    __pyx_t_3 = __pyx_convert_string_from_py_std__in_string(__pyx_v_data); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 181, __pyx_L1_error)
    __pyx_r = __pyx_t_3;
    goto __pyx_L0;

    /* "pywrapfst.pyx":180
 *   """
 *   # A Python bytestring can be implicitly cast to a C++ string.
 *   if isinstance(data, bytes):             # <<<<<<<<<<<<<<
 *     return data
 *   elif isinstance(data, unicode):
 */
  }

  /* "pywrapfst.pyx":182
 *   if isinstance(data, bytes):
 *     return data
 *   elif isinstance(data, unicode):             # <<<<<<<<<<<<<<
 *     return data.encode(encoding)
 *   raise FstArgError("Cannot encode as string: {!r}".format(data))
 */
  __pyx_t_2 = PyUnicode_Check(__pyx_v_data); 
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "pywrapfst.pyx":183
 *     return data
 *   elif isinstance(data, unicode):
 *     return data.encode(encoding)             # <<<<<<<<<<<<<<
 *   raise FstArgError("Cannot encode as string: {!r}".format(data))
 * 
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 183, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    if (!__pyx_t_6) {
      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_encoding); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 183, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_5)) {
        PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v_encoding};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 183, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
        PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v_encoding};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 183, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 183, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL;
        __Pyx_INCREF(__pyx_v_encoding);
        __Pyx_GIVEREF(__pyx_v_encoding);
        PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_encoding);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 183, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_3 = __pyx_convert_string_from_py_std__in_string(__pyx_t_4); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 183, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_3;
    goto __pyx_L0;

    /* "pywrapfst.pyx":182
 *   if isinstance(data, bytes):
 *     return data
 *   elif isinstance(data, unicode):             # <<<<<<<<<<<<<<
 *     return data.encode(encoding)
 *   raise FstArgError("Cannot encode as string: {!r}".format(data))
 */
  }

  /* "pywrapfst.pyx":184
 *   elif isinstance(data, unicode):
 *     return data.encode(encoding)
 *   raise FstArgError("Cannot encode as string: {!r}".format(data))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstArgError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 184, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Cannot_encode_as_string_r, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 184, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_8 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  if (!__pyx_t_8) {
    __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_data); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 184, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_6)) {
      PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_data};
      __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 184, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_GOTREF(__pyx_t_7);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
      PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_data};
      __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 184, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_GOTREF(__pyx_t_7);
    } else
    #endif
    {
      __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 184, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
      __Pyx_INCREF(__pyx_v_data);
      __Pyx_GIVEREF(__pyx_v_data);
      PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_v_data);
      __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 184, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  if (!__pyx_t_6) {
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 184, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_GOTREF(__pyx_t_4);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_7};
      __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 184, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_7};
      __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 184, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    } else
    #endif
    {
      __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 184, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6); __pyx_t_6 = NULL;
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_7);
      __pyx_t_7 = 0;
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 184, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __PYX_ERR(0, 184, __pyx_L1_error)

  /* "pywrapfst.pyx":159
 * 
 * 
 * cdef string tostring(data, encoding="utf8") except *:             # <<<<<<<<<<<<<<
 *   """Converts strings to bytestrings.
 * 
 */

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

/* "pywrapfst.pyx":187
 * 
 * 
 * cdef string weight_tostring(data, encoding="utf8") except *:             # <<<<<<<<<<<<<<
 *   """Converts strings or numerics to bytestrings.
 * 
 */

static std::string __pyx_f_9pywrapfst_weight_tostring(PyObject *__pyx_v_data, struct __pyx_opt_args_9pywrapfst_weight_tostring *__pyx_optional_args) {
  PyObject *__pyx_v_encoding = ((PyObject *)__pyx_n_s_utf8);
  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;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  __Pyx_RefNannySetupContext("weight_tostring", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_encoding = __pyx_optional_args->encoding;
    }
  }

  /* "pywrapfst.pyx":211
 *   """
 *   # A Python bytestring can be implicitly cast to a C++ string.
 *   if isinstance(data, bytes):             # <<<<<<<<<<<<<<
 *     return data
 *   elif isinstance(data, unicode):
 */
  __pyx_t_1 = PyBytes_Check(__pyx_v_data); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pywrapfst.pyx":212
 *   # A Python bytestring can be implicitly cast to a C++ string.
 *   if isinstance(data, bytes):
 *     return data             # <<<<<<<<<<<<<<
 *   elif isinstance(data, unicode):
 *     return data.encode(encoding)
 */
    __pyx_t_3 = __pyx_convert_string_from_py_std__in_string(__pyx_v_data); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 212, __pyx_L1_error)
    __pyx_r = __pyx_t_3;
    goto __pyx_L0;

    /* "pywrapfst.pyx":211
 *   """
 *   # A Python bytestring can be implicitly cast to a C++ string.
 *   if isinstance(data, bytes):             # <<<<<<<<<<<<<<
 *     return data
 *   elif isinstance(data, unicode):
 */
  }

  /* "pywrapfst.pyx":213
 *   if isinstance(data, bytes):
 *     return data
 *   elif isinstance(data, unicode):             # <<<<<<<<<<<<<<
 *     return data.encode(encoding)
 *   elif isinstance(data, numbers.Number):
 */
  __pyx_t_2 = PyUnicode_Check(__pyx_v_data); 
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "pywrapfst.pyx":214
 *     return data
 *   elif isinstance(data, unicode):
 *     return data.encode(encoding)             # <<<<<<<<<<<<<<
 *   elif isinstance(data, numbers.Number):
 *     return str(data).encode(encoding)
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 214, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    if (!__pyx_t_6) {
      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_encoding); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 214, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_5)) {
        PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v_encoding};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 214, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
        PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v_encoding};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 214, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 214, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL;
        __Pyx_INCREF(__pyx_v_encoding);
        __Pyx_GIVEREF(__pyx_v_encoding);
        PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_encoding);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 214, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_3 = __pyx_convert_string_from_py_std__in_string(__pyx_t_4); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 214, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_3;
    goto __pyx_L0;

    /* "pywrapfst.pyx":213
 *   if isinstance(data, bytes):
 *     return data
 *   elif isinstance(data, unicode):             # <<<<<<<<<<<<<<
 *     return data.encode(encoding)
 *   elif isinstance(data, numbers.Number):
 */
  }

  /* "pywrapfst.pyx":215
 *   elif isinstance(data, unicode):
 *     return data.encode(encoding)
 *   elif isinstance(data, numbers.Number):             # <<<<<<<<<<<<<<
 *     return str(data).encode(encoding)
 *   raise FstArgError("Cannot encode as string: {!r}".format(data))
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numbers); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 215, __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, 215, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_1 = PyObject_IsInstance(__pyx_v_data, __pyx_t_5); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 215, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pywrapfst.pyx":216
 *     return data.encode(encoding)
 *   elif isinstance(data, numbers.Number):
 *     return str(data).encode(encoding)             # <<<<<<<<<<<<<<
 *   raise FstArgError("Cannot encode as string: {!r}".format(data))
 * 
 */
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 216, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_data);
    __Pyx_GIVEREF(__pyx_v_data);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_data);
    __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_4, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 216, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 216, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (!__pyx_t_7) {
      __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_encoding); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 216, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_encoding};
        __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 216, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_GOTREF(__pyx_t_5);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_encoding};
        __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 216, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_GOTREF(__pyx_t_5);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 216, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); __pyx_t_7 = NULL;
        __Pyx_INCREF(__pyx_v_encoding);
        __Pyx_GIVEREF(__pyx_v_encoding);
        PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_encoding);
        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 216, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_3 = __pyx_convert_string_from_py_std__in_string(__pyx_t_5); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 216, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_r = __pyx_t_3;
    goto __pyx_L0;

    /* "pywrapfst.pyx":215
 *   elif isinstance(data, unicode):
 *     return data.encode(encoding)
 *   elif isinstance(data, numbers.Number):             # <<<<<<<<<<<<<<
 *     return str(data).encode(encoding)
 *   raise FstArgError("Cannot encode as string: {!r}".format(data))
 */
  }

  /* "pywrapfst.pyx":217
 *   elif isinstance(data, numbers.Number):
 *     return str(data).encode(encoding)
 *   raise FstArgError("Cannot encode as string: {!r}".format(data))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstArgError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 217, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Cannot_encode_as_string_r, __pyx_n_s_format); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 217, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_7, function);
    }
  }
  if (!__pyx_t_8) {
    __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_data); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 217, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_7)) {
      PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_data};
      __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 217, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_GOTREF(__pyx_t_6);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
      PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_data};
      __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 217, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_GOTREF(__pyx_t_6);
    } else
    #endif
    {
      __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 217, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
      __Pyx_INCREF(__pyx_v_data);
      __Pyx_GIVEREF(__pyx_v_data);
      PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_v_data);
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 217, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (!__pyx_t_7) {
    __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 217, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_GOTREF(__pyx_t_5);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6};
      __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 217, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6};
      __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 217, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    } else
    #endif
    {
      __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 217, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_6);
      __pyx_t_6 = 0;
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 217, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    }
  }
  __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, 217, __pyx_L1_error)

  /* "pywrapfst.pyx":187
 * 
 * 
 * cdef string weight_tostring(data, encoding="utf8") 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_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("pywrapfst.weight_tostring", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":220
 * 
 * 
 * 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_9pywrapfst__get_compose_filter(std::string const &__pyx_v_compose_filter) {
  enum fst::ComposeFilter __pyx_v_compose_filter_enum;
  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;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("_get_compose_filter", 0);

  /* "pywrapfst.pyx":241
 *   """
 *   cdef fst.ComposeFilter compose_filter_enum
 *   if not fst.GetComposeFilter(compose_filter, addr(compose_filter_enum)):             # <<<<<<<<<<<<<<
 *     raise FstArgError("Unknown compose filter type: {!r}".format(
 *         compose_filter))
 */
  __pyx_t_1 = ((!(fst::script::GetComposeFilter(__pyx_v_compose_filter, (&__pyx_v_compose_filter_enum)) != 0)) != 0);
  if (__pyx_t_1) {

    /* "pywrapfst.pyx":242
 *   cdef fst.ComposeFilter compose_filter_enum
 *   if not fst.GetComposeFilter(compose_filter, addr(compose_filter_enum)):
 *     raise FstArgError("Unknown compose filter type: {!r}".format(             # <<<<<<<<<<<<<<
 *         compose_filter))
 *   return compose_filter_enum
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstArgError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 242, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Unknown_compose_filter_type_r, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 242, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);

    /* "pywrapfst.pyx":243
 *   if not fst.GetComposeFilter(compose_filter, addr(compose_filter_enum)):
 *     raise FstArgError("Unknown compose filter type: {!r}".format(
 *         compose_filter))             # <<<<<<<<<<<<<<
 *   return compose_filter_enum
 * 
 */
    __pyx_t_6 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_compose_filter); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 243, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    if (!__pyx_t_7) {
      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 242, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_4);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_5)) {
        PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 242, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
        PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 242, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else
      #endif
      {
        __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 242, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
        __Pyx_GIVEREF(__pyx_t_6);
        PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_6);
        __pyx_t_6 = 0;
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 242, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 242, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 242, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 242, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else
      #endif
      {
        __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 242, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
        __Pyx_GIVEREF(__pyx_t_4);
        PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_4);
        __pyx_t_4 = 0;
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 242, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 242, __pyx_L1_error)

    /* "pywrapfst.pyx":241
 *   """
 *   cdef fst.ComposeFilter compose_filter_enum
 *   if not fst.GetComposeFilter(compose_filter, addr(compose_filter_enum)):             # <<<<<<<<<<<<<<
 *     raise FstArgError("Unknown compose filter type: {!r}".format(
 *         compose_filter))
 */
  }

  /* "pywrapfst.pyx":244
 *     raise FstArgError("Unknown compose filter type: {!r}".format(
 *         compose_filter))
 *   return compose_filter_enum             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_compose_filter_enum;
  goto __pyx_L0;

  /* "pywrapfst.pyx":220
 * 
 * 
 * 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_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("pywrapfst._get_compose_filter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = (enum fst::ComposeFilter) 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":247
 * 
 * 
 * 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_9pywrapfst__get_determinize_type(std::string const &__pyx_v_det_type) {
  enum fst::DeterminizeType __pyx_v_det_type_enum;
  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;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("_get_determinize_type", 0);

  /* "pywrapfst.pyx":263
 *   """
 *   cdef fst.DeterminizeType det_type_enum
 *   if not fst.GetDeterminizeType(det_type, addr(det_type_enum)):             # <<<<<<<<<<<<<<
 *     raise FstArgError("Unknown determinization type: {!r}".format(det_type))
 *   return det_type_enum
 */
  __pyx_t_1 = ((!(fst::script::GetDeterminizeType(__pyx_v_det_type, (&__pyx_v_det_type_enum)) != 0)) != 0);
  if (__pyx_t_1) {

    /* "pywrapfst.pyx":264
 *   cdef fst.DeterminizeType det_type_enum
 *   if not fst.GetDeterminizeType(det_type, addr(det_type_enum)):
 *     raise FstArgError("Unknown determinization type: {!r}".format(det_type))             # <<<<<<<<<<<<<<
 *   return det_type_enum
 * 
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstArgError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 264, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Unknown_determinization_type_r, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 264, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_det_type); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 264, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    if (!__pyx_t_7) {
      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 264, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_4);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_5)) {
        PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 264, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
        PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 264, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else
      #endif
      {
        __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 264, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
        __Pyx_GIVEREF(__pyx_t_6);
        PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_6);
        __pyx_t_6 = 0;
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 264, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 264, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 264, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 264, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else
      #endif
      {
        __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 264, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
        __Pyx_GIVEREF(__pyx_t_4);
        PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_4);
        __pyx_t_4 = 0;
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 264, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 264, __pyx_L1_error)

    /* "pywrapfst.pyx":263
 *   """
 *   cdef fst.DeterminizeType det_type_enum
 *   if not fst.GetDeterminizeType(det_type, addr(det_type_enum)):             # <<<<<<<<<<<<<<
 *     raise FstArgError("Unknown determinization type: {!r}".format(det_type))
 *   return det_type_enum
 */
  }

  /* "pywrapfst.pyx":265
 *   if not fst.GetDeterminizeType(det_type, addr(det_type_enum)):
 *     raise FstArgError("Unknown determinization type: {!r}".format(det_type))
 *   return det_type_enum             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_det_type_enum;
  goto __pyx_L0;

  /* "pywrapfst.pyx":247
 * 
 * 
 * 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_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("pywrapfst._get_determinize_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = (enum fst::DeterminizeType) 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":268
 * 
 * 
 * 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_9pywrapfst__get_queue_type(std::string const &__pyx_v_queue_type) {
  enum fst::QueueType __pyx_v_queue_type_enum;
  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;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("_get_queue_type", 0);

  /* "pywrapfst.pyx":287
 *   """
 *   cdef fst.QueueType queue_type_enum
 *   if not fst.GetQueueType(queue_type, addr(queue_type_enum)):             # <<<<<<<<<<<<<<
 *     raise FstArgError("Unknown queue type: {!r}".format(queue_type))
 *   return queue_type_enum
 */
  __pyx_t_1 = ((!(fst::script::GetQueueType(__pyx_v_queue_type, (&__pyx_v_queue_type_enum)) != 0)) != 0);
  if (__pyx_t_1) {

    /* "pywrapfst.pyx":288
 *   cdef fst.QueueType queue_type_enum
 *   if not fst.GetQueueType(queue_type, addr(queue_type_enum)):
 *     raise FstArgError("Unknown queue type: {!r}".format(queue_type))             # <<<<<<<<<<<<<<
 *   return queue_type_enum
 * 
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstArgError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 288, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Unknown_queue_type_r, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 288, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_queue_type); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 288, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    if (!__pyx_t_7) {
      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 288, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_4);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_5)) {
        PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 288, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
        PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 288, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else
      #endif
      {
        __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 288, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
        __Pyx_GIVEREF(__pyx_t_6);
        PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_6);
        __pyx_t_6 = 0;
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 288, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 288, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 288, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 288, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else
      #endif
      {
        __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 288, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
        __Pyx_GIVEREF(__pyx_t_4);
        PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_4);
        __pyx_t_4 = 0;
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 288, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 288, __pyx_L1_error)

    /* "pywrapfst.pyx":287
 *   """
 *   cdef fst.QueueType queue_type_enum
 *   if not fst.GetQueueType(queue_type, addr(queue_type_enum)):             # <<<<<<<<<<<<<<
 *     raise FstArgError("Unknown queue type: {!r}".format(queue_type))
 *   return queue_type_enum
 */
  }

  /* "pywrapfst.pyx":289
 *   if not fst.GetQueueType(queue_type, addr(queue_type_enum)):
 *     raise FstArgError("Unknown queue type: {!r}".format(queue_type))
 *   return queue_type_enum             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_queue_type_enum;
  goto __pyx_L0;

  /* "pywrapfst.pyx":268
 * 
 * 
 * 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_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("pywrapfst._get_queue_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = (enum fst::QueueType) 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static enum fst::script::RandArcSelection __pyx_f_9pywrapfst__get_rand_arc_selection(std::string const &__pyx_v_select) {
  enum fst::script::RandArcSelection __pyx_v_select_enum;
  enum 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;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("_get_rand_arc_selection", 0);

  /* "pywrapfst.pyx":312
 *   """
 *   cdef fst.RandArcSelection select_enum
 *   if not fst.GetRandArcSelection(select, addr(select_enum)):             # <<<<<<<<<<<<<<
 *     raise FstArgError("Unknown random arc selection type: {!r}".format(select))
 *   return select_enum
 */
  __pyx_t_1 = ((!(fst::script::GetRandArcSelection(__pyx_v_select, (&__pyx_v_select_enum)) != 0)) != 0);
  if (__pyx_t_1) {

    /* "pywrapfst.pyx":313
 *   cdef fst.RandArcSelection select_enum
 *   if not fst.GetRandArcSelection(select, addr(select_enum)):
 *     raise FstArgError("Unknown random arc selection type: {!r}".format(select))             # <<<<<<<<<<<<<<
 *   return select_enum
 * 
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstArgError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 313, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Unknown_random_arc_selection_typ, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 313, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_select); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 313, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    if (!__pyx_t_7) {
      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 313, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_4);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_5)) {
        PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 313, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
        PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 313, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else
      #endif
      {
        __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 313, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
        __Pyx_GIVEREF(__pyx_t_6);
        PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_6);
        __pyx_t_6 = 0;
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 313, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 313, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 313, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 313, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else
      #endif
      {
        __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 313, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
        __Pyx_GIVEREF(__pyx_t_4);
        PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_4);
        __pyx_t_4 = 0;
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 313, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 313, __pyx_L1_error)

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

  /* "pywrapfst.pyx":314
 *   if not fst.GetRandArcSelection(select, addr(select_enum)):
 *     raise FstArgError("Unknown random arc selection type: {!r}".format(select))
 *   return select_enum             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_select_enum;
  goto __pyx_L0;

  /* "pywrapfst.pyx":292
 * 
 * 
 * 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_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("pywrapfst._get_rand_arc_selection", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = (enum fst::script::RandArcSelection) 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":317
 * 
 * 
 * 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_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;
  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;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("_get_replace_label_type", 0);

  /* "pywrapfst.pyx":338
 *   """
 *   cdef fst.ReplaceLabelType replace_label_type_enum
 *   if not fst.GetReplaceLabelType(replace_label_type, epsilon_on_replace,             # <<<<<<<<<<<<<<
 *                                  addr(replace_label_type_enum)):
 *     raise FstArgError("Unknown replace label type: {!r}".format(
 */
  __pyx_t_1 = ((!(fst::script::GetReplaceLabelType(__pyx_v_replace_label_type, __pyx_v_epsilon_on_replace, (&__pyx_v_replace_label_type_enum)) != 0)) != 0);
  if (__pyx_t_1) {

    /* "pywrapfst.pyx":340
 *   if not fst.GetReplaceLabelType(replace_label_type, epsilon_on_replace,
 *                                  addr(replace_label_type_enum)):
 *     raise FstArgError("Unknown replace label type: {!r}".format(             # <<<<<<<<<<<<<<
 *                       replace_label_type))
 *   return replace_label_type_enum
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstArgError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 340, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Unknown_replace_label_type_r, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 340, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);

    /* "pywrapfst.pyx":341
 *                                  addr(replace_label_type_enum)):
 *     raise FstArgError("Unknown replace label type: {!r}".format(
 *                       replace_label_type))             # <<<<<<<<<<<<<<
 *   return replace_label_type_enum
 * 
 */
    __pyx_t_6 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_replace_label_type); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 341, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    if (!__pyx_t_7) {
      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 340, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_4);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_5)) {
        PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 340, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
        PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 340, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else
      #endif
      {
        __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 340, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
        __Pyx_GIVEREF(__pyx_t_6);
        PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_6);
        __pyx_t_6 = 0;
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 340, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 340, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 340, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 340, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else
      #endif
      {
        __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 340, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
        __Pyx_GIVEREF(__pyx_t_4);
        PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_4);
        __pyx_t_4 = 0;
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 340, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 340, __pyx_L1_error)

    /* "pywrapfst.pyx":338
 *   """
 *   cdef fst.ReplaceLabelType replace_label_type_enum
 *   if not fst.GetReplaceLabelType(replace_label_type, epsilon_on_replace,             # <<<<<<<<<<<<<<
 *                                  addr(replace_label_type_enum)):
 *     raise FstArgError("Unknown replace label type: {!r}".format(
 */
  }

  /* "pywrapfst.pyx":342
 *     raise FstArgError("Unknown replace label type: {!r}".format(
 *                       replace_label_type))
 *   return replace_label_type_enum             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_replace_label_type_enum;
  goto __pyx_L0;

  /* "pywrapfst.pyx":317
 * 
 * 
 * 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_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("pywrapfst._get_replace_label_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = (enum fst::ReplaceLabelType) 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":368
 *   """
 * 
 *   def __repr__(self):             # <<<<<<<<<<<<<<
 *     return "<{} Weight {} at 0x{:x}>".format(self.type(), self.to_string(),
 *                                              id(self))
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_6Weight_1__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9pywrapfst_6Weight_1__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9pywrapfst_6Weight___repr__(((struct __pyx_obj_9pywrapfst_Weight *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_6Weight___repr__(struct __pyx_obj_9pywrapfst_Weight *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "pywrapfst.pyx":369
 * 
 *   def __repr__(self):
 *     return "<{} Weight {} at 0x{:x}>".format(self.type(), self.to_string(),             # <<<<<<<<<<<<<<
 *                                              id(self))
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Weight_at_0x_x, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 369, __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'", "type");
    __PYX_ERR(0, 369, __pyx_L1_error)
  }
  __pyx_t_3 = __pyx_convert_PyBytes_string_to_py_std__in_string(((struct __pyx_vtabstruct_9pywrapfst_Weight *)__pyx_v_self->__pyx_vtab)->type(__pyx_v_self, 0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 369, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "to_string");
    __PYX_ERR(0, 369, __pyx_L1_error)
  }
  __pyx_t_4 = __pyx_convert_PyBytes_string_to_py_std__in_string(((struct __pyx_vtabstruct_9pywrapfst_Weight *)__pyx_v_self->__pyx_vtab)->to_string(__pyx_v_self, 0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 369, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "pywrapfst.pyx":370
 *   def __repr__(self):
 *     return "<{} Weight {} at 0x{:x}>".format(self.type(), self.to_string(),
 *                                              id(self))             # <<<<<<<<<<<<<<
 * 
 *   def __str__(self):
 */
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 370, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_self));
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 370, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_7 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_t_3, __pyx_t_4, __pyx_t_6};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 369, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_t_3, __pyx_t_4, __pyx_t_6};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 369, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  } else
  #endif
  {
    __pyx_t_8 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 369, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    if (__pyx_t_5) {
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
    }
    __Pyx_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_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_7, __pyx_t_6);
    __pyx_t_3 = 0;
    __pyx_t_4 = 0;
    __pyx_t_6 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 369, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":368
 *   """
 * 
 *   def __repr__(self):             # <<<<<<<<<<<<<<
 *     return "<{} Weight {} at 0x{:x}>".format(self.type(), self.to_string(),
 *                                              id(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_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("pywrapfst.Weight.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":372
 *                                              id(self))
 * 
 *   def __str__(self):             # <<<<<<<<<<<<<<
 *     return self.to_string()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_6Weight_3__str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9pywrapfst_6Weight_3__str__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9pywrapfst_6Weight_2__str__(((struct __pyx_obj_9pywrapfst_Weight *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_6Weight_2__str__(struct __pyx_obj_9pywrapfst_Weight *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__str__", 0);

  /* "pywrapfst.pyx":373
 * 
 *   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, 373, __pyx_L1_error)
  }
  __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(((struct __pyx_vtabstruct_9pywrapfst_Weight *)__pyx_v_self->__pyx_vtab)->to_string(__pyx_v_self, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 373, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":372
 *                                              id(self))
 * 
 *   def __str__(self):             # <<<<<<<<<<<<<<
 *     return self.to_string()
 * 
 */

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

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

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_6Weight_5__float__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9pywrapfst_6Weight_5__float__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__float__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9pywrapfst_6Weight_4__float__(((struct __pyx_obj_9pywrapfst_Weight *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_6Weight_4__float__(struct __pyx_obj_9pywrapfst_Weight *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__float__", 0);

  /* "pywrapfst.pyx":379
 * 
 *   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, 379, __pyx_L1_error)
  }
  __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(((struct __pyx_vtabstruct_9pywrapfst_Weight *)__pyx_v_self->__pyx_vtab)->to_string(__pyx_v_self, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 379, __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, 379, __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;

  /* "pywrapfst.pyx":378
 *   # 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("pywrapfst.Weight.__float__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":381
 *     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_9pywrapfst_6Weight_7__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_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_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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_weight_type)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_weight)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 381, __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, 381, __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, 381, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pywrapfst.Weight.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pywrapfst_6Weight_6__init__(((struct __pyx_obj_9pywrapfst_Weight *)__pyx_v_self), __pyx_v_weight_type, __pyx_v_weight);

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

static int __pyx_pf_9pywrapfst_6Weight_6__init__(struct __pyx_obj_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;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pywrapfst.pyx":382
 * 
 *   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, 382, __pyx_L1_error)
  }
  __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_weight_type, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 382, __pyx_L1_error)

  /* "pywrapfst.pyx":383
 *   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_9pywrapfst_weight_tostring(__pyx_v_weight, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 383, __pyx_L1_error)

  /* "pywrapfst.pyx":382
 * 
 *   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));

  /* "pywrapfst.pyx":384
 *     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, 384, __pyx_L1_error)
  }
  ((struct __pyx_vtabstruct_9pywrapfst_Weight *)__pyx_v_self->__pyx_vtab)->_check_weight(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 384, __pyx_L1_error)

  /* "pywrapfst.pyx":381
 *     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("pywrapfst.Weight.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static void __pyx_f_9pywrapfst_6Weight__check_weight(struct __pyx_obj_9pywrapfst_Weight *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("_check_weight", 0);

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

    /* "pywrapfst.pyx":388
 *   cdef void _check_weight(self) except *:
 *     if self.type() == b"none":
 *       raise FstArgError("Weight type not found")             # <<<<<<<<<<<<<<
 *     if self.to_string() == b"BadNumber":
 *       raise FstBadWeightError("Invalid weight")
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstArgError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 388, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 388, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 388, __pyx_L1_error)

    /* "pywrapfst.pyx":387
 * 
 *   cdef void _check_weight(self) except *:
 *     if self.type() == b"none":             # <<<<<<<<<<<<<<
 *       raise FstArgError("Weight type not found")
 *     if self.to_string() == b"BadNumber":
 */
  }

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

    /* "pywrapfst.pyx":390
 *       raise FstArgError("Weight type not found")
 *     if self.to_string() == b"BadNumber":
 *       raise FstBadWeightError("Invalid weight")             # <<<<<<<<<<<<<<
 * 
 *   cpdef Weight copy(self):
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstBadWeightError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 390, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 390, __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, 390, __pyx_L1_error)

    /* "pywrapfst.pyx":389
 *     if self.type() == b"none":
 *       raise FstArgError("Weight type not found")
 *     if self.to_string() == b"BadNumber":             # <<<<<<<<<<<<<<
 *       raise FstBadWeightError("Invalid weight")
 * 
 */
  }

  /* "pywrapfst.pyx":386
 *     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_AddTraceback("pywrapfst.Weight._check_weight", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

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

static PyObject *__pyx_pw_9pywrapfst_6Weight_9copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static struct __pyx_obj_9pywrapfst_Weight *__pyx_f_9pywrapfst_6Weight_copy(struct __pyx_obj_9pywrapfst_Weight *__pyx_v_self, int __pyx_skip_dispatch) {
  struct __pyx_obj_9pywrapfst_Weight *__pyx_v_result = 0;
  struct __pyx_obj_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;
  __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)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_copy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 392, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_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);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 392, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 392, __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_9pywrapfst_Weight))))) __PYX_ERR(0, 392, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pywrapfst.pyx":398
 *     Returns a copy of the Weight.
 *     """
 *     cdef Weight result = Weight.__new__(Weight)             # <<<<<<<<<<<<<<
 *     result._weight.reset(new fst.WeightClass(deref(self._weight)))
 *     return result
 */
  __pyx_t_1 = __pyx_tp_new_9pywrapfst_Weight(((PyTypeObject *)__pyx_ptype_9pywrapfst_Weight), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 398, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_9pywrapfst_Weight)))) __PYX_ERR(0, 398, __pyx_L1_error)
  __pyx_v_result = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pywrapfst.pyx":399
 *     """
 *     cdef Weight result = Weight.__new__(Weight)
 *     result._weight.reset(new fst.WeightClass(deref(self._weight)))             # <<<<<<<<<<<<<<
 *     return result
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_result) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_weight");
    __PYX_ERR(0, 399, __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, 399, __pyx_L1_error)
  }
  __pyx_v_result->_weight.reset(new fst::script::WeightClass((*__pyx_v_self->_weight)));

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

  /* "pywrapfst.pyx":392
 *       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("pywrapfst.Weight.copy", __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;
}

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_6Weight_9copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_9pywrapfst_6Weight_8copy[] = "\n    copy(self)\n\n    Returns a copy of the Weight.\n    ";
static PyObject *__pyx_pw_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_9pywrapfst_6Weight_8copy(((struct __pyx_obj_9pywrapfst_Weight *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_6Weight_8copy(struct __pyx_obj_9pywrapfst_Weight *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("copy", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_6Weight_copy(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 392, __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("pywrapfst.Weight.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":406
 * 
 *   @classmethod
 *   def Zero(cls, weight_type):             # <<<<<<<<<<<<<<
 *     """
 *     Weight.Zero(weight_type)
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_6Weight_11Zero(PyObject *__pyx_v_cls, PyObject *__pyx_v_weight_type); /*proto*/
static char __pyx_doc_9pywrapfst_6Weight_10Zero[] = "\n    Weight.Zero(weight_type)\n\n    Constructs semiring zero.\n    ";
static PyObject *__pyx_pw_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_9pywrapfst_6Weight_10Zero(((PyTypeObject*)__pyx_v_cls), ((PyObject *)__pyx_v_weight_type));

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

static PyObject *__pyx_pf_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;
  __Pyx_RefNannySetupContext("Zero", 0);

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

  /* "pywrapfst.pyx":406
 * 
 *   @classmethod
 *   def Zero(cls, weight_type):             # <<<<<<<<<<<<<<
 *     """
 *     Weight.Zero(weight_type)
 */

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

/* "pywrapfst.pyx":415
 * 
 *   @classmethod
 *   def One(cls, weight_type):             # <<<<<<<<<<<<<<
 *     """
 *     Weight.One(weight_type)
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_6Weight_13One(PyObject *__pyx_v_cls, PyObject *__pyx_v_weight_type); /*proto*/
static char __pyx_doc_9pywrapfst_6Weight_12One[] = "\n    Weight.One(weight_type)\n\n    Constructs semiring One.\n    ";
static PyObject *__pyx_pw_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_9pywrapfst_6Weight_12One(((PyTypeObject*)__pyx_v_cls), ((PyObject *)__pyx_v_weight_type));

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

static PyObject *__pyx_pf_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;
  __Pyx_RefNannySetupContext("One", 0);

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

  /* "pywrapfst.pyx":415
 * 
 *   @classmethod
 *   def One(cls, weight_type):             # <<<<<<<<<<<<<<
 *     """
 *     Weight.One(weight_type)
 */

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

/* "pywrapfst.pyx":424
 * 
 *   @classmethod
 *   def NoWeight(cls, weight_type):             # <<<<<<<<<<<<<<
 *     """
 *     Weight.NoWeight(weight_type)
 */

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

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

static PyObject *__pyx_pf_9pywrapfst_6Weight_14NoWeight(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_weight_type) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("NoWeight", 0);

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

  /* "pywrapfst.pyx":424
 * 
 *   @classmethod
 *   def NoWeight(cls, weight_type):             # <<<<<<<<<<<<<<
 *     """
 *     Weight.NoWeight(weight_type)
 */

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

/* "pywrapfst.pyx":432
 *     return _NoWeight(weight_type)
 * 
 *   def __eq__(Weight w1, Weight w2):             # <<<<<<<<<<<<<<
 *     return fst.Eq(deref(w1._weight), deref(w2._weight))
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_6Weight_17__eq__(PyObject *__pyx_v_w1, PyObject *__pyx_v_w2); /*proto*/
static PyObject *__pyx_pw_9pywrapfst_6Weight_17__eq__(PyObject *__pyx_v_w1, PyObject *__pyx_v_w2) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__eq__ (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_w2), __pyx_ptype_9pywrapfst_Weight, 1, "w2", 0))) __PYX_ERR(0, 432, __pyx_L1_error)
  __pyx_r = __pyx_pf_9pywrapfst_6Weight_16__eq__(((struct __pyx_obj_9pywrapfst_Weight *)__pyx_v_w1), ((struct __pyx_obj_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_9pywrapfst_6Weight_16__eq__(struct __pyx_obj_9pywrapfst_Weight *__pyx_v_w1, struct __pyx_obj_9pywrapfst_Weight *__pyx_v_w2) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__eq__", 0);

  /* "pywrapfst.pyx":433
 * 
 *   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, 433, __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, 433, __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, 433, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":432
 *     return _NoWeight(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("pywrapfst.Weight.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":435
 *     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_9pywrapfst_6Weight_19__ne__(PyObject *__pyx_v_w1, PyObject *__pyx_v_w2); /*proto*/
static PyObject *__pyx_pw_9pywrapfst_6Weight_19__ne__(PyObject *__pyx_v_w1, PyObject *__pyx_v_w2) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__ne__ (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_w2), __pyx_ptype_9pywrapfst_Weight, 1, "w2", 0))) __PYX_ERR(0, 435, __pyx_L1_error)
  __pyx_r = __pyx_pf_9pywrapfst_6Weight_18__ne__(((struct __pyx_obj_9pywrapfst_Weight *)__pyx_v_w1), ((struct __pyx_obj_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_9pywrapfst_6Weight_18__ne__(struct __pyx_obj_9pywrapfst_Weight *__pyx_v_w1, struct __pyx_obj_9pywrapfst_Weight *__pyx_v_w2) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("__ne__", 0);

  /* "pywrapfst.pyx":436
 * 
 *   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, 436, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 436, __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, 436, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":435
 *     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("pywrapfst.Weight.__ne__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pw_9pywrapfst_6Weight_21to_string(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static std::string __pyx_f_9pywrapfst_6Weight_to_string(struct __pyx_obj_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;
  __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)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_to_string); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 438, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_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);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 438, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 438, __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, 438, __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;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pywrapfst.pyx":439
 * 
 *   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, 439, __pyx_L1_error)
  }
  __pyx_r = __pyx_v_self->_weight.get()->ToString();
  goto __pyx_L0;

  /* "pywrapfst.pyx":438
 *     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("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_9pywrapfst_6Weight_21to_string(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_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_9pywrapfst_6Weight_20to_string(((struct __pyx_obj_9pywrapfst_Weight *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_6Weight_20to_string(struct __pyx_obj_9pywrapfst_Weight *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("to_string", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_f_9pywrapfst_6Weight_to_string(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 438, __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("pywrapfst.Weight.to_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pw_9pywrapfst_6Weight_23type(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static std::string __pyx_f_9pywrapfst_6Weight_type(struct __pyx_obj_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;
  __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)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 441, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_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);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 441, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 441, __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, 441, __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;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

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

  /* "pywrapfst.pyx":441
 *     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("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_9pywrapfst_6Weight_23type(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_9pywrapfst_6Weight_22type[] = "type(self)\n\n    Returns a string indicating the weight type.\n    ";
static PyObject *__pyx_pw_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_9pywrapfst_6Weight_22type(((struct __pyx_obj_9pywrapfst_Weight *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_6Weight_22type(struct __pyx_obj_9pywrapfst_Weight *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("type", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_f_9pywrapfst_6Weight_type(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 441, __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("pywrapfst.Weight.type", __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_9pywrapfst_6Weight_25__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_9pywrapfst_6Weight_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_9pywrapfst_6Weight_24__reduce_cython__(((struct __pyx_obj_9pywrapfst_Weight *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_6Weight_24__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9pywrapfst_Weight *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __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__3, 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("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_9pywrapfst_6Weight_27__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static PyObject *__pyx_pw_9pywrapfst_6Weight_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_9pywrapfst_6Weight_26__setstate_cython__(((struct __pyx_obj_9pywrapfst_Weight *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

static PyObject *__pyx_pf_9pywrapfst_6Weight_26__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_9pywrapfst_Weight *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __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__4, 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("pywrapfst.Weight.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static struct __pyx_obj_9pywrapfst_Weight *__pyx_f_9pywrapfst__plus(struct __pyx_obj_9pywrapfst_Weight *__pyx_v_lhs, struct __pyx_obj_9pywrapfst_Weight *__pyx_v_rhs) {
  struct __pyx_obj_9pywrapfst_Weight *__pyx_v_result = 0;
  struct __pyx_obj_9pywrapfst_Weight *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("_plus", 0);

  /* "pywrapfst.pyx":450
 * 
 * cdef Weight _plus(Weight lhs, Weight rhs):
 *   cdef Weight result = Weight.__new__(Weight)             # <<<<<<<<<<<<<<
 *   result._weight.reset(new fst.WeightClass(fst.Plus(deref(lhs._weight),
 *                                                     deref(rhs._weight))))
 */
  __pyx_t_1 = __pyx_tp_new_9pywrapfst_Weight(((PyTypeObject *)__pyx_ptype_9pywrapfst_Weight), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 450, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_9pywrapfst_Weight)))) __PYX_ERR(0, 450, __pyx_L1_error)
  __pyx_v_result = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pywrapfst.pyx":451
 * cdef Weight _plus(Weight lhs, Weight rhs):
 *   cdef Weight result = Weight.__new__(Weight)
 *   result._weight.reset(new fst.WeightClass(fst.Plus(deref(lhs._weight),             # <<<<<<<<<<<<<<
 *                                                     deref(rhs._weight))))
 *   return result
 */
  if (unlikely(((PyObject *)__pyx_v_result) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_weight");
    __PYX_ERR(0, 451, __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, 451, __pyx_L1_error)
  }

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

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

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

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pywrapfst._plus", __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;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_1plus(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_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_9pywrapfst_1plus = {"plus", (PyCFunction)__pyx_pw_9pywrapfst_1plus, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_plus};
static PyObject *__pyx_pw_9pywrapfst_1plus(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_9pywrapfst_Weight *__pyx_v_lhs = 0;
  struct __pyx_obj_9pywrapfst_Weight *__pyx_v_rhs = 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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_lhs)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rhs)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("plus", 1, 2, 2, 1); __PYX_ERR(0, 456, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "plus") < 0)) __PYX_ERR(0, 456, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_lhs = ((struct __pyx_obj_9pywrapfst_Weight *)values[0]);
    __pyx_v_rhs = ((struct __pyx_obj_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, 456, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("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_9pywrapfst_Weight, 1, "lhs", 0))) __PYX_ERR(0, 456, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rhs), __pyx_ptype_9pywrapfst_Weight, 1, "rhs", 0))) __PYX_ERR(0, 456, __pyx_L1_error)
  __pyx_r = __pyx_pf_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_9pywrapfst_plus(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst_Weight *__pyx_v_lhs, struct __pyx_obj_9pywrapfst_Weight *__pyx_v_rhs) {
  struct __pyx_obj_9pywrapfst_Weight *__pyx_v_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("plus", 0);

  /* "pywrapfst.pyx":476
 *     FstBadWeightError: invalid weight.
 *   """
 *   cdef Weight result = _plus(lhs, rhs)             # <<<<<<<<<<<<<<
 *   result._check_weight()
 *   return result
 */
  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__plus(__pyx_v_lhs, __pyx_v_rhs)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 476, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_1);
  __pyx_t_1 = 0;

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

  /* "pywrapfst.pyx":478
 *   cdef Weight result = _plus(lhs, rhs)
 *   result._check_weight()
 *   return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

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

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

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

static struct __pyx_obj_9pywrapfst_Weight *__pyx_f_9pywrapfst__times(struct __pyx_obj_9pywrapfst_Weight *__pyx_v_lhs, struct __pyx_obj_9pywrapfst_Weight *__pyx_v_rhs) {
  struct __pyx_obj_9pywrapfst_Weight *__pyx_v_result = 0;
  struct __pyx_obj_9pywrapfst_Weight *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("_times", 0);

  /* "pywrapfst.pyx":482
 * 
 * cdef Weight _times(Weight lhs, Weight rhs):
 *   cdef Weight result = Weight.__new__(Weight)             # <<<<<<<<<<<<<<
 *   result._weight.reset(new fst.WeightClass(fst.Times(deref(lhs._weight),
 *                                                      deref(rhs._weight))))
 */
  __pyx_t_1 = __pyx_tp_new_9pywrapfst_Weight(((PyTypeObject *)__pyx_ptype_9pywrapfst_Weight), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 482, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_9pywrapfst_Weight)))) __PYX_ERR(0, 482, __pyx_L1_error)
  __pyx_v_result = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pywrapfst.pyx":483
 * cdef Weight _times(Weight lhs, Weight rhs):
 *   cdef Weight result = Weight.__new__(Weight)
 *   result._weight.reset(new fst.WeightClass(fst.Times(deref(lhs._weight),             # <<<<<<<<<<<<<<
 *                                                      deref(rhs._weight))))
 *   return result
 */
  if (unlikely(((PyObject *)__pyx_v_result) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_weight");
    __PYX_ERR(0, 483, __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, 483, __pyx_L1_error)
  }

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

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

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

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pywrapfst._times", __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;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_3times(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_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_9pywrapfst_3times = {"times", (PyCFunction)__pyx_pw_9pywrapfst_3times, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_2times};
static PyObject *__pyx_pw_9pywrapfst_3times(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_9pywrapfst_Weight *__pyx_v_lhs = 0;
  struct __pyx_obj_9pywrapfst_Weight *__pyx_v_rhs = 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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_lhs)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rhs)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("times", 1, 2, 2, 1); __PYX_ERR(0, 488, __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, 488, __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_9pywrapfst_Weight *)values[0]);
    __pyx_v_rhs = ((struct __pyx_obj_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, 488, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("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_9pywrapfst_Weight, 1, "lhs", 0))) __PYX_ERR(0, 488, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rhs), __pyx_ptype_9pywrapfst_Weight, 1, "rhs", 0))) __PYX_ERR(0, 488, __pyx_L1_error)
  __pyx_r = __pyx_pf_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_9pywrapfst_2times(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst_Weight *__pyx_v_lhs, struct __pyx_obj_9pywrapfst_Weight *__pyx_v_rhs) {
  struct __pyx_obj_9pywrapfst_Weight *__pyx_v_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("times", 0);

  /* "pywrapfst.pyx":508
 *     FstBadWeightError: Invalid weight.
 *   """
 *   cdef Weight result = _times(lhs, rhs)             # <<<<<<<<<<<<<<
 *   result._check_weight()
 *   return result
 */
  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__times(__pyx_v_lhs, __pyx_v_rhs)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 508, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_1);
  __pyx_t_1 = 0;

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

  /* "pywrapfst.pyx":510
 *   cdef Weight result = _times(lhs, rhs)
 *   result._check_weight()
 *   return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

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

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

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

static struct __pyx_obj_9pywrapfst_Weight *__pyx_f_9pywrapfst__divide(struct __pyx_obj_9pywrapfst_Weight *__pyx_v_lhs, struct __pyx_obj_9pywrapfst_Weight *__pyx_v_rhs) {
  struct __pyx_obj_9pywrapfst_Weight *__pyx_v_result = 0;
  struct __pyx_obj_9pywrapfst_Weight *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("_divide", 0);

  /* "pywrapfst.pyx":514
 * 
 * cdef Weight _divide(Weight lhs, Weight rhs):
 *   cdef Weight result = Weight.__new__(Weight)             # <<<<<<<<<<<<<<
 *   result._weight.reset(new fst.WeightClass(fst.Divide(deref(lhs._weight),
 *                                                       deref(rhs._weight))))
 */
  __pyx_t_1 = __pyx_tp_new_9pywrapfst_Weight(((PyTypeObject *)__pyx_ptype_9pywrapfst_Weight), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 514, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_9pywrapfst_Weight)))) __PYX_ERR(0, 514, __pyx_L1_error)
  __pyx_v_result = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pywrapfst.pyx":515
 * cdef Weight _divide(Weight lhs, Weight rhs):
 *   cdef Weight result = Weight.__new__(Weight)
 *   result._weight.reset(new fst.WeightClass(fst.Divide(deref(lhs._weight),             # <<<<<<<<<<<<<<
 *                                                       deref(rhs._weight))))
 *   return result
 */
  if (unlikely(((PyObject *)__pyx_v_result) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_weight");
    __PYX_ERR(0, 515, __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, 515, __pyx_L1_error)
  }

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

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

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

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pywrapfst._divide", __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;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_5divide(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_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_9pywrapfst_5divide = {"divide", (PyCFunction)__pyx_pw_9pywrapfst_5divide, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_4divide};
static PyObject *__pyx_pw_9pywrapfst_5divide(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_9pywrapfst_Weight *__pyx_v_lhs = 0;
  struct __pyx_obj_9pywrapfst_Weight *__pyx_v_rhs = 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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_lhs)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rhs)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("divide", 1, 2, 2, 1); __PYX_ERR(0, 520, __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, 520, __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_9pywrapfst_Weight *)values[0]);
    __pyx_v_rhs = ((struct __pyx_obj_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, 520, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("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_9pywrapfst_Weight, 1, "lhs", 0))) __PYX_ERR(0, 520, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rhs), __pyx_ptype_9pywrapfst_Weight, 1, "rhs", 0))) __PYX_ERR(0, 520, __pyx_L1_error)
  __pyx_r = __pyx_pf_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_9pywrapfst_4divide(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst_Weight *__pyx_v_lhs, struct __pyx_obj_9pywrapfst_Weight *__pyx_v_rhs) {
  struct __pyx_obj_9pywrapfst_Weight *__pyx_v_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("divide", 0);

  /* "pywrapfst.pyx":542
 *     FstBadWeightError: Invalid weight.
 *   """
 *   cdef Weight result = _divide(lhs, rhs)             # <<<<<<<<<<<<<<
 *   result._check_weight()
 *   return result
 */
  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__divide(__pyx_v_lhs, __pyx_v_rhs)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 542, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_1);
  __pyx_t_1 = 0;

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

  /* "pywrapfst.pyx":544
 *   cdef Weight result = _divide(lhs, rhs)
 *   result._check_weight()
 *   return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

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

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

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

static struct __pyx_obj_9pywrapfst_Weight *__pyx_f_9pywrapfst__power(struct __pyx_obj_9pywrapfst_Weight *__pyx_v_w, size_t __pyx_v_n) {
  struct __pyx_obj_9pywrapfst_Weight *__pyx_v_result = 0;
  struct __pyx_obj_9pywrapfst_Weight *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("_power", 0);

  /* "pywrapfst.pyx":548
 * 
 * cdef Weight _power(Weight w, size_t n):
 *   cdef Weight result = Weight.__new__(Weight)             # <<<<<<<<<<<<<<
 *   result._weight.reset(new fst.WeightClass(fst.Power(deref(w._weight), n)))
 *   return result
 */
  __pyx_t_1 = __pyx_tp_new_9pywrapfst_Weight(((PyTypeObject *)__pyx_ptype_9pywrapfst_Weight), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 548, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_9pywrapfst_Weight)))) __PYX_ERR(0, 548, __pyx_L1_error)
  __pyx_v_result = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_1);
  __pyx_t_1 = 0;

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

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

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pywrapfst._power", __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;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_7power(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_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_9pywrapfst_7power = {"power", (PyCFunction)__pyx_pw_9pywrapfst_7power, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_6power};
static PyObject *__pyx_pw_9pywrapfst_7power(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_9pywrapfst_Weight *__pyx_v_w = 0;
  size_t __pyx_v_n;
  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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_w)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("power", 1, 2, 2, 1); __PYX_ERR(0, 553, __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, 553, __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_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, 553, __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, 553, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("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_9pywrapfst_Weight, 1, "w", 0))) __PYX_ERR(0, 553, __pyx_L1_error)
  __pyx_r = __pyx_pf_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_9pywrapfst_6power(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst_Weight *__pyx_v_w, size_t __pyx_v_n) {
  struct __pyx_obj_9pywrapfst_Weight *__pyx_v_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("power", 0);

  /* "pywrapfst.pyx":570
 *     FstBadWeightError: Invalid weight.
 *   """
 *   cdef Weight result = _power(w, n)             # <<<<<<<<<<<<<<
 *   result._check_weight()
 *   return result
 */
  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__power(__pyx_v_w, __pyx_v_n)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 570, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_1);
  __pyx_t_1 = 0;

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

  /* "pywrapfst.pyx":572
 *   cdef Weight result = _power(w, n)
 *   result._check_weight()
 *   return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

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

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

/* "pywrapfst.pyx":575
 * 
 * 
 * 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_9pywrapfst__get_WeightClass_or_Zero(std::string const &__pyx_v_weight_type, PyObject *__pyx_v_weight) {
  fst::script::WeightClass __pyx_v_result;
  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;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("_get_WeightClass_or_Zero", 0);

  /* "pywrapfst.pyx":593
 *   """
 *   cdef fst.WeightClass result
 *   if weight is None:             # <<<<<<<<<<<<<<
 *     result = 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) {

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

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

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

    /* "pywrapfst.pyx":596
 *     result = fst.WeightClass.Zero(weight_type)
 *   elif isinstance(weight, Weight):
 *     result = deref(<fst.WeightClass *> (<Weight> weight)._weight.get())             # <<<<<<<<<<<<<<
 *   else:
 *     result = 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, 596, __pyx_L1_error)
    }
    __pyx_v_result = (*((fst::script::WeightClass *)((struct __pyx_obj_9pywrapfst_Weight *)__pyx_v_weight)->_weight.get()));

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

  /* "pywrapfst.pyx":598
 *     result = deref(<fst.WeightClass *> (<Weight> weight)._weight.get())
 *   else:
 *     result = fst.WeightClass(weight_type, weight_tostring(weight))             # <<<<<<<<<<<<<<
 *     if result.ToString() == b"BadNumber":
 *       raise FstBadWeightError(weight_tostring(weight))
 */
  /*else*/ {
    __pyx_t_3 = __pyx_f_9pywrapfst_weight_tostring(__pyx_v_weight, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 598, __pyx_L1_error)
    __pyx_v_result = fst::script::WeightClass(__pyx_v_weight_type, __pyx_t_3);

    /* "pywrapfst.pyx":599
 *   else:
 *     result = fst.WeightClass(weight_type, weight_tostring(weight))
 *     if result.ToString() == b"BadNumber":             # <<<<<<<<<<<<<<
 *       raise FstBadWeightError(weight_tostring(weight))
 *   return result
 */
    __pyx_t_1 = ((__pyx_v_result.ToString() == ((char *)"BadNumber")) != 0);
    if (__pyx_t_1) {

      /* "pywrapfst.pyx":600
 *     result = fst.WeightClass(weight_type, weight_tostring(weight))
 *     if result.ToString() == b"BadNumber":
 *       raise FstBadWeightError(weight_tostring(weight))             # <<<<<<<<<<<<<<
 *   return result
 * 
 */
      __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstBadWeightError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 600, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = __pyx_f_9pywrapfst_weight_tostring(__pyx_v_weight, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 600, __pyx_L1_error)
      __pyx_t_6 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 600, __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);
        }
      }
      if (!__pyx_t_7) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 600, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_5)) {
          PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6};
          __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 600, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
          PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6};
          __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 600, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        } else
        #endif
        {
          __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 600, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
          __Pyx_GIVEREF(__pyx_t_6);
          PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_6);
          __pyx_t_6 = 0;
          __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 600, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __PYX_ERR(0, 600, __pyx_L1_error)

      /* "pywrapfst.pyx":599
 *   else:
 *     result = fst.WeightClass(weight_type, weight_tostring(weight))
 *     if result.ToString() == b"BadNumber":             # <<<<<<<<<<<<<<
 *       raise FstBadWeightError(weight_tostring(weight))
 *   return result
 */
    }
  }
  __pyx_L3:;

  /* "pywrapfst.pyx":601
 *     if result.ToString() == b"BadNumber":
 *       raise FstBadWeightError(weight_tostring(weight))
 *   return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "pywrapfst.pyx":575
 * 
 * 
 * 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_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("pywrapfst._get_WeightClass_or_Zero", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":604
 * 
 * 
 * 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_9pywrapfst__get_WeightClass_or_One(std::string const &__pyx_v_weight_type, PyObject *__pyx_v_weight) {
  fst::script::WeightClass __pyx_v_result;
  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;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("_get_WeightClass_or_One", 0);

  /* "pywrapfst.pyx":622
 *   """
 *   cdef fst.WeightClass result
 *   if weight is None:             # <<<<<<<<<<<<<<
 *     result = 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) {

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

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

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

    /* "pywrapfst.pyx":625
 *     result = fst.WeightClass.One(weight_type)
 *   elif isinstance(weight, Weight):
 *     result = deref(<fst.WeightClass *> (<Weight> weight)._weight.get())             # <<<<<<<<<<<<<<
 *   else:
 *     result = 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, 625, __pyx_L1_error)
    }
    __pyx_v_result = (*((fst::script::WeightClass *)((struct __pyx_obj_9pywrapfst_Weight *)__pyx_v_weight)->_weight.get()));

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

  /* "pywrapfst.pyx":627
 *     result = deref(<fst.WeightClass *> (<Weight> weight)._weight.get())
 *   else:
 *     result = fst.WeightClass(weight_type, weight_tostring(weight))             # <<<<<<<<<<<<<<
 *     if result.ToString() == b"BadNumber":
 *       raise FstBadWeightError(weight_tostring(weight))
 */
  /*else*/ {
    __pyx_t_3 = __pyx_f_9pywrapfst_weight_tostring(__pyx_v_weight, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 627, __pyx_L1_error)
    __pyx_v_result = fst::script::WeightClass(__pyx_v_weight_type, __pyx_t_3);

    /* "pywrapfst.pyx":628
 *   else:
 *     result = fst.WeightClass(weight_type, weight_tostring(weight))
 *     if result.ToString() == b"BadNumber":             # <<<<<<<<<<<<<<
 *       raise FstBadWeightError(weight_tostring(weight))
 *   return result
 */
    __pyx_t_1 = ((__pyx_v_result.ToString() == ((char *)"BadNumber")) != 0);
    if (__pyx_t_1) {

      /* "pywrapfst.pyx":629
 *     result = fst.WeightClass(weight_type, weight_tostring(weight))
 *     if result.ToString() == b"BadNumber":
 *       raise FstBadWeightError(weight_tostring(weight))             # <<<<<<<<<<<<<<
 *   return result
 * 
 */
      __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstBadWeightError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 629, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = __pyx_f_9pywrapfst_weight_tostring(__pyx_v_weight, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 629, __pyx_L1_error)
      __pyx_t_6 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 629, __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);
        }
      }
      if (!__pyx_t_7) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 629, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_5)) {
          PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6};
          __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 629, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
          PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6};
          __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 629, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        } else
        #endif
        {
          __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 629, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
          __Pyx_GIVEREF(__pyx_t_6);
          PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_6);
          __pyx_t_6 = 0;
          __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 629, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __PYX_ERR(0, 629, __pyx_L1_error)

      /* "pywrapfst.pyx":628
 *   else:
 *     result = fst.WeightClass(weight_type, weight_tostring(weight))
 *     if result.ToString() == b"BadNumber":             # <<<<<<<<<<<<<<
 *       raise FstBadWeightError(weight_tostring(weight))
 *   return result
 */
    }
  }
  __pyx_L3:;

  /* "pywrapfst.pyx":630
 *     if result.ToString() == b"BadNumber":
 *       raise FstBadWeightError(weight_tostring(weight))
 *   return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "pywrapfst.pyx":604
 * 
 * 
 * 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_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("pywrapfst._get_WeightClass_or_One", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":633
 * 
 * 
 * cdef Weight _Zero(weight_type):             # <<<<<<<<<<<<<<
 *   cdef Weight result = Weight.__new__(Weight)
 *   result._weight.reset(new fst.WeightClass(fst.WeightClass.Zero(
 */

static struct __pyx_obj_9pywrapfst_Weight *__pyx_f_9pywrapfst__Zero(PyObject *__pyx_v_weight_type) {
  struct __pyx_obj_9pywrapfst_Weight *__pyx_v_result = 0;
  struct __pyx_obj_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;
  __Pyx_RefNannySetupContext("_Zero", 0);

  /* "pywrapfst.pyx":634
 * 
 * cdef Weight _Zero(weight_type):
 *   cdef Weight result = Weight.__new__(Weight)             # <<<<<<<<<<<<<<
 *   result._weight.reset(new fst.WeightClass(fst.WeightClass.Zero(
 *       tostring(weight_type))))
 */
  __pyx_t_1 = __pyx_tp_new_9pywrapfst_Weight(((PyTypeObject *)__pyx_ptype_9pywrapfst_Weight), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 634, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_9pywrapfst_Weight)))) __PYX_ERR(0, 634, __pyx_L1_error)
  __pyx_v_result = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_1);
  __pyx_t_1 = 0;

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

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

  /* "pywrapfst.pyx":635
 * cdef Weight _Zero(weight_type):
 *   cdef Weight result = Weight.__new__(Weight)
 *   result._weight.reset(new fst.WeightClass(fst.WeightClass.Zero(             # <<<<<<<<<<<<<<
 *       tostring(weight_type))))
 *   if result._weight.get().Type() == b"none":
 */
  __pyx_v_result->_weight.reset(new fst::script::WeightClass(fst::script::WeightClass::Zero(__pyx_t_2)));

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

    /* "pywrapfst.pyx":638
 *       tostring(weight_type))))
 *   if result._weight.get().Type() == b"none":
 *     raise FstArgError("Weight type not found")             # <<<<<<<<<<<<<<
 *   return result
 * 
 */
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstArgError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 638, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 638, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(0, 638, __pyx_L1_error)

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

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

  /* "pywrapfst.pyx":633
 * 
 * 
 * cdef Weight _Zero(weight_type):             # <<<<<<<<<<<<<<
 *   cdef Weight result = Weight.__new__(Weight)
 *   result._weight.reset(new fst.WeightClass(fst.WeightClass.Zero(
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pywrapfst._Zero", __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;
}

/* "pywrapfst.pyx":642
 * 
 * 
 * cdef Weight _One(weight_type):             # <<<<<<<<<<<<<<
 *   cdef Weight result = Weight.__new__(Weight)
 *   result._weight.reset(new fst.WeightClass(
 */

static struct __pyx_obj_9pywrapfst_Weight *__pyx_f_9pywrapfst__One(PyObject *__pyx_v_weight_type) {
  struct __pyx_obj_9pywrapfst_Weight *__pyx_v_result = 0;
  struct __pyx_obj_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;
  __Pyx_RefNannySetupContext("_One", 0);

  /* "pywrapfst.pyx":643
 * 
 * cdef Weight _One(weight_type):
 *   cdef Weight result = Weight.__new__(Weight)             # <<<<<<<<<<<<<<
 *   result._weight.reset(new fst.WeightClass(
 *         fst.WeightClass.One(tostring(weight_type))))
 */
  __pyx_t_1 = __pyx_tp_new_9pywrapfst_Weight(((PyTypeObject *)__pyx_ptype_9pywrapfst_Weight), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 643, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_9pywrapfst_Weight)))) __PYX_ERR(0, 643, __pyx_L1_error)
  __pyx_v_result = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_1);
  __pyx_t_1 = 0;

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

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

  /* "pywrapfst.pyx":644
 * cdef Weight _One(weight_type):
 *   cdef Weight result = Weight.__new__(Weight)
 *   result._weight.reset(new fst.WeightClass(             # <<<<<<<<<<<<<<
 *         fst.WeightClass.One(tostring(weight_type))))
 *   if result._weight.get().Type() == b"none":
 */
  __pyx_v_result->_weight.reset(new fst::script::WeightClass(fst::script::WeightClass::One(__pyx_t_2)));

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

    /* "pywrapfst.pyx":647
 *         fst.WeightClass.One(tostring(weight_type))))
 *   if result._weight.get().Type() == b"none":
 *     raise FstArgError("Weight type not found")             # <<<<<<<<<<<<<<
 *   return result
 * 
 */
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstArgError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 647, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 647, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(0, 647, __pyx_L1_error)

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

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

  /* "pywrapfst.pyx":642
 * 
 * 
 * cdef Weight _One(weight_type):             # <<<<<<<<<<<<<<
 *   cdef Weight result = Weight.__new__(Weight)
 *   result._weight.reset(new fst.WeightClass(
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pywrapfst._One", __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;
}

/* "pywrapfst.pyx":651
 * 
 * 
 * cdef Weight _NoWeight(weight_type):             # <<<<<<<<<<<<<<
 *   cdef Weight result = Weight.__new__(Weight)
 *   result._weight.reset(new fst.WeightClass(
 */

static struct __pyx_obj_9pywrapfst_Weight *__pyx_f_9pywrapfst__NoWeight(PyObject *__pyx_v_weight_type) {
  struct __pyx_obj_9pywrapfst_Weight *__pyx_v_result = 0;
  struct __pyx_obj_9pywrapfst_Weight *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  std::string __pyx_t_2;
  __Pyx_RefNannySetupContext("_NoWeight", 0);

  /* "pywrapfst.pyx":652
 * 
 * cdef Weight _NoWeight(weight_type):
 *   cdef Weight result = Weight.__new__(Weight)             # <<<<<<<<<<<<<<
 *   result._weight.reset(new fst.WeightClass(
 *         fst.WeightClass.NoWeight(tostring(weight_type))))
 */
  __pyx_t_1 = __pyx_tp_new_9pywrapfst_Weight(((PyTypeObject *)__pyx_ptype_9pywrapfst_Weight), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 652, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_9pywrapfst_Weight)))) __PYX_ERR(0, 652, __pyx_L1_error)
  __pyx_v_result = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_1);
  __pyx_t_1 = 0;

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

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

  /* "pywrapfst.pyx":653
 * cdef Weight _NoWeight(weight_type):
 *   cdef Weight result = Weight.__new__(Weight)
 *   result._weight.reset(new fst.WeightClass(             # <<<<<<<<<<<<<<
 *         fst.WeightClass.NoWeight(tostring(weight_type))))
 *   return result
 */
  __pyx_v_result->_weight.reset(new fst::script::WeightClass(fst::script::WeightClass::NoWeight(__pyx_t_2)));

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

  /* "pywrapfst.pyx":651
 * 
 * 
 * cdef Weight _NoWeight(weight_type):             # <<<<<<<<<<<<<<
 *   cdef Weight result = Weight.__new__(Weight)
 *   result._weight.reset(new fst.WeightClass(
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pywrapfst._NoWeight", __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;
}

/* "pywrapfst.pyx":689
 *   # Doing so will allow undefined behavior.
 * 
 *   def __init__(self):             # <<<<<<<<<<<<<<
 *     raise FstDeletedConstructorError(
 *         "Cannot construct {}".format(self.__class__.__name__))
 */

/* Python wrapper */
static int __pyx_pw_9pywrapfst_12_SymbolTable_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_9pywrapfst_12_SymbolTable_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_9pywrapfst_12_SymbolTable___init__(((struct __pyx_obj_9pywrapfst__SymbolTable *)__pyx_v_self));

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

static int __pyx_pf_9pywrapfst_12_SymbolTable___init__(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pywrapfst.pyx":690
 * 
 *   def __init__(self):
 *     raise FstDeletedConstructorError(             # <<<<<<<<<<<<<<
 *         "Cannot construct {}".format(self.__class__.__name__))
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstDeletedConstructorError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 690, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "pywrapfst.pyx":691
 *   def __init__(self):
 *     raise FstDeletedConstructorError(
 *         "Cannot construct {}".format(self.__class__.__name__))             # <<<<<<<<<<<<<<
 * 
 *   def __iter__(self):
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Cannot_construct, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 691, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 691, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_name); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 691, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (!__pyx_t_5) {
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 691, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_GOTREF(__pyx_t_3);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_6};
      __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 691, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_6};
      __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 691, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    } else
    #endif
    {
      __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 691, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_6);
      __pyx_t_6 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 691, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 690, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_3};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 690, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_3};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 690, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    } else
    #endif
    {
      __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 690, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL;
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 690, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
  }
  __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, 690, __pyx_L1_error)

  /* "pywrapfst.pyx":689
 *   # Doing so will allow undefined behavior.
 * 
 *   def __init__(self):             # <<<<<<<<<<<<<<
 *     raise FstDeletedConstructorError(
 *         "Cannot construct {}".format(self.__class__.__name__))
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pywrapfst._SymbolTable.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":693
 *         "Cannot construct {}".format(self.__class__.__name__))
 * 
 *   def __iter__(self):             # <<<<<<<<<<<<<<
 *     return SymbolTableIterator(self)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_12_SymbolTable_3__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9pywrapfst_12_SymbolTable_3__iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9pywrapfst_12_SymbolTable_2__iter__(((struct __pyx_obj_9pywrapfst__SymbolTable *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_12_SymbolTable_2__iter__(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__iter__", 0);

  /* "pywrapfst.pyx":694
 * 
 *   def __iter__(self):
 *     return SymbolTableIterator(self)             # <<<<<<<<<<<<<<
 * 
 *   cpdef int64 available_key(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 694, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self));
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_9pywrapfst_SymbolTableIterator), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 694, __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;

  /* "pywrapfst.pyx":693
 *         "Cannot construct {}".format(self.__class__.__name__))
 * 
 *   def __iter__(self):             # <<<<<<<<<<<<<<
 *     return SymbolTableIterator(self)
 * 
 */

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

/* "pywrapfst.pyx":696
 *     return SymbolTableIterator(self)
 * 
 *   cpdef int64 available_key(self):             # <<<<<<<<<<<<<<
 *     """
 *     available_key(self)
 */

static PyObject *__pyx_pw_9pywrapfst_12_SymbolTable_5available_key(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static __pyx_t_10basictypes_int64 __pyx_f_9pywrapfst_12_SymbolTable_available_key(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self, int __pyx_skip_dispatch) {
  __pyx_t_10basictypes_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;
  __pyx_t_10basictypes_int64 __pyx_t_5;
  __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)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_available_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 696, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_12_SymbolTable_5available_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);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 696, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 696, __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_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 696, __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;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

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

  /* "pywrapfst.pyx":696
 *     return SymbolTableIterator(self)
 * 
 *   cpdef int64 available_key(self):             # <<<<<<<<<<<<<<
 *     """
 *     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_WriteUnraisable("pywrapfst._SymbolTable.available_key", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_12_SymbolTable_5available_key(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_9pywrapfst_12_SymbolTable_4available_key[] = "\n    available_key(self)\n\n    Returns an integer indicating the next available key index in the table.\n    ";
static PyObject *__pyx_pw_9pywrapfst_12_SymbolTable_5available_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_9pywrapfst_12_SymbolTable_4available_key(((struct __pyx_obj_9pywrapfst__SymbolTable *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_12_SymbolTable_4available_key(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("available_key", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_f_9pywrapfst_12_SymbolTable_available_key(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 696, __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("pywrapfst._SymbolTable.available_key", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":704
 *     return self._table.AvailableKey()
 * 
 *   cpdef string checksum(self):             # <<<<<<<<<<<<<<
 *     """
 *     checksum(self)
 */

static PyObject *__pyx_pw_9pywrapfst_12_SymbolTable_7checksum(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static std::string __pyx_f_9pywrapfst_12_SymbolTable_checksum(struct __pyx_obj_9pywrapfst__SymbolTable *__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;
  __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)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 704, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_12_SymbolTable_7checksum)) {
      __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);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 704, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 704, __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, 704, __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;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pywrapfst.pyx":710
 *     Returns a string indicating the label-agnostic MD5 checksum for the table.
 *     """
 *     return self._table.CheckSum()             # <<<<<<<<<<<<<<
 * 
 *   cpdef SymbolTable copy(self):
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_table");
    __PYX_ERR(0, 710, __pyx_L1_error)
  }
  __pyx_r = __pyx_v_self->_table->CheckSum();
  goto __pyx_L0;

  /* "pywrapfst.pyx":704
 *     return self._table.AvailableKey()
 * 
 *   cpdef string 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_WriteUnraisable("pywrapfst._SymbolTable.checksum", __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_9pywrapfst_12_SymbolTable_7checksum(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_9pywrapfst_12_SymbolTable_6checksum[] = "\n    checksum(self)\n\n    Returns a string indicating the label-agnostic MD5 checksum for the table.\n    ";
static PyObject *__pyx_pw_9pywrapfst_12_SymbolTable_7checksum(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("checksum (wrapper)", 0);
  __pyx_r = __pyx_pf_9pywrapfst_12_SymbolTable_6checksum(((struct __pyx_obj_9pywrapfst__SymbolTable *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_12_SymbolTable_6checksum(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("checksum", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_f_9pywrapfst_12_SymbolTable_checksum(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 704, __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("pywrapfst._SymbolTable.checksum", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":712
 *     return self._table.CheckSum()
 * 
 *   cpdef SymbolTable copy(self):             # <<<<<<<<<<<<<<
 *     """
 *     copy(self)
 */

static PyObject *__pyx_pw_9pywrapfst_12_SymbolTable_9copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static struct __pyx_obj_9pywrapfst_SymbolTable *__pyx_f_9pywrapfst_12_SymbolTable_copy(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self, int __pyx_skip_dispatch) {
  struct __pyx_obj_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;
  __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)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_copy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 712, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_12_SymbolTable_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);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 712, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 712, __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_9pywrapfst_SymbolTable))))) __PYX_ERR(0, 712, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_9pywrapfst_SymbolTable *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pywrapfst.pyx":718
 *     Returns a mutable copy of the SymbolTable.
 *     """
 *     return _init_SymbolTable(self._table.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'", "_table");
    __PYX_ERR(0, 718, __pyx_L1_error)
  }
  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_SymbolTable(__pyx_v_self->_table->Copy())); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 718, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_9pywrapfst_SymbolTable *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":712
 *     return self._table.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("pywrapfst._SymbolTable.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_9pywrapfst_12_SymbolTable_9copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_9pywrapfst_12_SymbolTable_8copy[] = "\n    copy(self)\n\n    Returns a mutable copy of the SymbolTable.\n    ";
static PyObject *__pyx_pw_9pywrapfst_12_SymbolTable_9copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("copy (wrapper)", 0);
  __pyx_r = __pyx_pf_9pywrapfst_12_SymbolTable_8copy(((struct __pyx_obj_9pywrapfst__SymbolTable *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_12_SymbolTable_8copy(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("copy", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_12_SymbolTable_copy(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 712, __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("pywrapfst._SymbolTable.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":720
 *     return _init_SymbolTable(self._table.Copy())
 * 
 *   def find(self, key):             # <<<<<<<<<<<<<<
 *     """
 *     find(self, key)
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_12_SymbolTable_11find(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static char __pyx_doc_9pywrapfst_12_SymbolTable_10find[] = "\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_9pywrapfst_12_SymbolTable_11find(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("find (wrapper)", 0);
  __pyx_r = __pyx_pf_9pywrapfst_12_SymbolTable_10find(((struct __pyx_obj_9pywrapfst__SymbolTable *)__pyx_v_self), ((PyObject *)__pyx_v_key));

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

static PyObject *__pyx_pf_9pywrapfst_12_SymbolTable_10find(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  std::string __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  __pyx_t_10basictypes_int64 __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  __Pyx_RefNannySetupContext("find", 0);

  /* "pywrapfst.pyx":737
 *           not found.
 *     """
 *     try:             # <<<<<<<<<<<<<<
 *       return self._table.FindIndex(tostring(key))
 *     except FstArgError:
 */
  {
    __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:*/ {

      /* "pywrapfst.pyx":738
 *     """
 *     try:
 *       return self._table.FindIndex(tostring(key))             # <<<<<<<<<<<<<<
 *     except FstArgError:
 *       return self._table.FindSymbol(key)
 */
      __Pyx_XDECREF(__pyx_r);
      if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_table");
        __PYX_ERR(0, 738, __pyx_L3_error)
      }
      __pyx_t_4 = __pyx_f_9pywrapfst_tostring(__pyx_v_key, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 738, __pyx_L3_error)
      __pyx_t_5 = __Pyx_PyInt_From_int64_t(__pyx_v_self->_table->Find(__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 738, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_r = __pyx_t_5;
      __pyx_t_5 = 0;
      goto __pyx_L7_try_return;

      /* "pywrapfst.pyx":737
 *           not found.
 *     """
 *     try:             # <<<<<<<<<<<<<<
 *       return self._table.FindIndex(tostring(key))
 *     except FstArgError:
 */
    }
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "pywrapfst.pyx":739
 *     try:
 *       return self._table.FindIndex(tostring(key))
 *     except FstArgError:             # <<<<<<<<<<<<<<
 *       return self._table.FindSymbol(key)
 * 
 */
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstArgError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 739, __pyx_L5_except_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_6) {
      __Pyx_AddTraceback("pywrapfst._SymbolTable.find", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(0, 739, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_8);

      /* "pywrapfst.pyx":740
 *       return self._table.FindIndex(tostring(key))
 *     except FstArgError:
 *       return self._table.FindSymbol(key)             # <<<<<<<<<<<<<<
 * 
 *   cpdef int64 get_nth_key(self, ssize_t pos) except *:
 */
      __Pyx_XDECREF(__pyx_r);
      if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_table");
        __PYX_ERR(0, 740, __pyx_L5_except_error)
      }
      __pyx_t_9 = __Pyx_PyInt_As_int64_t(__pyx_v_key); if (unlikely((__pyx_t_9 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 740, __pyx_L5_except_error)
      __pyx_t_10 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_self->_table->Find(__pyx_t_9)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 740, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_r = __pyx_t_10;
      __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      goto __pyx_L6_except_return;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "pywrapfst.pyx":737
 *           not found.
 *     """
 *     try:             # <<<<<<<<<<<<<<
 *       return self._table.FindIndex(tostring(key))
 *     except FstArgError:
 */
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L7_try_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
    __pyx_L6_except_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
  }

  /* "pywrapfst.pyx":720
 *     return _init_SymbolTable(self._table.Copy())
 * 
 *   def find(self, key):             # <<<<<<<<<<<<<<
 *     """
 *     find(self, key)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("pywrapfst._SymbolTable.find", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":742
 *       return self._table.FindSymbol(key)
 * 
 *   cpdef int64 get_nth_key(self, ssize_t pos) except *:             # <<<<<<<<<<<<<<
 *     """
 *     get_nth_key(self, pos)
 */

static PyObject *__pyx_pw_9pywrapfst_12_SymbolTable_13get_nth_key(PyObject *__pyx_v_self, PyObject *__pyx_arg_pos); /*proto*/
static __pyx_t_10basictypes_int64 __pyx_f_9pywrapfst_12_SymbolTable_get_nth_key(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self, Py_ssize_t __pyx_v_pos, int __pyx_skip_dispatch) {
  __pyx_t_10basictypes_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;
  PyObject *__pyx_t_6 = NULL;
  __pyx_t_10basictypes_int64 __pyx_t_7;
  __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)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_nth_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 742, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_12_SymbolTable_13get_nth_key)) {
      __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_pos); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 742, __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);
        }
      }
      if (!__pyx_t_5) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 742, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_4)) {
          PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 742, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
          PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 742, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        } else
        #endif
        {
          __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 742, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
          __Pyx_GIVEREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3);
          __pyx_t_3 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 742, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_7 = __Pyx_PyInt_As_int64_t(__pyx_t_2); if (unlikely((__pyx_t_7 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 742, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_7;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

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

  /* "pywrapfst.pyx":742
 *       return self._table.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_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pywrapfst._SymbolTable.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_9pywrapfst_12_SymbolTable_13get_nth_key(PyObject *__pyx_v_self, PyObject *__pyx_arg_pos); /*proto*/
static char __pyx_doc_9pywrapfst_12_SymbolTable_12get_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_9pywrapfst_12_SymbolTable_13get_nth_key(PyObject *__pyx_v_self, PyObject *__pyx_arg_pos) {
  Py_ssize_t __pyx_v_pos;
  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, 742, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pywrapfst._SymbolTable.get_nth_key", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pywrapfst_12_SymbolTable_12get_nth_key(((struct __pyx_obj_9pywrapfst__SymbolTable *)__pyx_v_self), ((Py_ssize_t)__pyx_v_pos));

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

static PyObject *__pyx_pf_9pywrapfst_12_SymbolTable_12get_nth_key(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self, Py_ssize_t __pyx_v_pos) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __pyx_t_10basictypes_int64 __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("get_nth_key", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_9pywrapfst_12_SymbolTable_get_nth_key(__pyx_v_self, __pyx_v_pos, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 742, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 742, __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("pywrapfst._SymbolTable.get_nth_key", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":756
 *     return self._table.GetNthKey(pos)
 * 
 *   cpdef string labeled_checksum(self):             # <<<<<<<<<<<<<<
 *     """
 *     labeled_checksum(self)
 */

static PyObject *__pyx_pw_9pywrapfst_12_SymbolTable_15labeled_checksum(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static std::string __pyx_f_9pywrapfst_12_SymbolTable_labeled_checksum(struct __pyx_obj_9pywrapfst__SymbolTable *__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;
  __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)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_labeled_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 756, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_12_SymbolTable_15labeled_checksum)) {
      __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);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 756, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 756, __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, 756, __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;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pywrapfst.pyx":762
 *     Returns a string indicating the label-dependent MD5 checksum for the table.
 *     """
 *     return self._table.LabeledCheckSum()             # <<<<<<<<<<<<<<
 * 
 *   cpdef bool member(self, key):
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_table");
    __PYX_ERR(0, 762, __pyx_L1_error)
  }
  __pyx_r = __pyx_v_self->_table->LabeledCheckSum();
  goto __pyx_L0;

  /* "pywrapfst.pyx":756
 *     return self._table.GetNthKey(pos)
 * 
 *   cpdef string 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_WriteUnraisable("pywrapfst._SymbolTable.labeled_checksum", __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_9pywrapfst_12_SymbolTable_15labeled_checksum(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_9pywrapfst_12_SymbolTable_14labeled_checksum[] = "\n    labeled_checksum(self)\n\n    Returns a string indicating the label-dependent MD5 checksum for the table.\n    ";
static PyObject *__pyx_pw_9pywrapfst_12_SymbolTable_15labeled_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_9pywrapfst_12_SymbolTable_14labeled_checksum(((struct __pyx_obj_9pywrapfst__SymbolTable *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_12_SymbolTable_14labeled_checksum(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("labeled_checksum", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_f_9pywrapfst_12_SymbolTable_labeled_checksum(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 756, __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("pywrapfst._SymbolTable.labeled_checksum", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":764
 *     return self._table.LabeledCheckSum()
 * 
 *   cpdef bool member(self, key):             # <<<<<<<<<<<<<<
 *     """
 *     member(self, key)
 */

static PyObject *__pyx_pw_9pywrapfst_12_SymbolTable_17member(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static bool __pyx_f_9pywrapfst_12_SymbolTable_member(struct __pyx_obj_9pywrapfst__SymbolTable *__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;
  PyObject *__pyx_t_5 = NULL;
  bool __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;
  __pyx_t_10basictypes_int64 __pyx_t_12;
  __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)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_member); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 764, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_12_SymbolTable_17member)) {
      __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);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 764, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 764, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 764, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 764, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_key);
          __Pyx_GIVEREF(__pyx_v_key);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_key);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 764, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 764, __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;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pywrapfst.pyx":780
 *       Whether or not the key is present (as a string or a index) in the table.
 *     """
 *     try:             # <<<<<<<<<<<<<<
 *       return self._table.MemberSymbol(tostring(key))
 *     except FstArgError:
 */
  {
    __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:*/ {

      /* "pywrapfst.pyx":781
 *     """
 *     try:
 *       return self._table.MemberSymbol(tostring(key))             # <<<<<<<<<<<<<<
 *     except FstArgError:
 *       return self._table.MemberIndex(key)
 */
      if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_table");
        __PYX_ERR(0, 781, __pyx_L3_error)
      }
      __pyx_t_10 = __pyx_f_9pywrapfst_tostring(__pyx_v_key, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 781, __pyx_L3_error)
      __pyx_r = __pyx_v_self->_table->Member(__pyx_t_10);
      goto __pyx_L7_try_return;

      /* "pywrapfst.pyx":780
 *       Whether or not the key is present (as a string or a index) in the table.
 *     """
 *     try:             # <<<<<<<<<<<<<<
 *       return self._table.MemberSymbol(tostring(key))
 *     except FstArgError:
 */
    }
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pywrapfst.pyx":782
 *     try:
 *       return self._table.MemberSymbol(tostring(key))
 *     except FstArgError:             # <<<<<<<<<<<<<<
 *       return self._table.MemberIndex(key)
 * 
 */
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstArgError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 782, __pyx_L5_except_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_11 = __Pyx_PyErr_ExceptionMatches(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_11) {
      __Pyx_AddTraceback("pywrapfst._SymbolTable.member", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3) < 0) __PYX_ERR(0, 782, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_t_3);

      /* "pywrapfst.pyx":783
 *       return self._table.MemberSymbol(tostring(key))
 *     except FstArgError:
 *       return self._table.MemberIndex(key)             # <<<<<<<<<<<<<<
 * 
 *   def __contains__(self, key):
 */
      if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_table");
        __PYX_ERR(0, 783, __pyx_L5_except_error)
      }
      __pyx_t_12 = __Pyx_PyInt_As_int64_t(__pyx_v_key); if (unlikely((__pyx_t_12 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 783, __pyx_L5_except_error)
      __pyx_r = __pyx_v_self->_table->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:;

    /* "pywrapfst.pyx":780
 *       Whether or not the key is present (as a string or a index) in the table.
 *     """
 *     try:             # <<<<<<<<<<<<<<
 *       return self._table.MemberSymbol(tostring(key))
 *     except FstArgError:
 */
    __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;
  }

  /* "pywrapfst.pyx":764
 *     return self._table.LabeledCheckSum()
 * 
 *   cpdef bool member(self, key):             # <<<<<<<<<<<<<<
 *     """
 *     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_XDECREF(__pyx_t_5);
  __Pyx_WriteUnraisable("pywrapfst._SymbolTable.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_9pywrapfst_12_SymbolTable_17member(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static char __pyx_doc_9pywrapfst_12_SymbolTable_16member[] = "\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_9pywrapfst_12_SymbolTable_17member(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("member (wrapper)", 0);
  __pyx_r = __pyx_pf_9pywrapfst_12_SymbolTable_16member(((struct __pyx_obj_9pywrapfst__SymbolTable *)__pyx_v_self), ((PyObject *)__pyx_v_key));

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

static PyObject *__pyx_pf_9pywrapfst_12_SymbolTable_16member(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("member", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_9pywrapfst_12_SymbolTable_member(__pyx_v_self, __pyx_v_key, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 764, __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("pywrapfst._SymbolTable.member", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":785
 *       return self._table.MemberIndex(key)
 * 
 *   def __contains__(self, key):             # <<<<<<<<<<<<<<
 *     return self.member(key)
 * 
 */

/* Python wrapper */
static int __pyx_pw_9pywrapfst_12_SymbolTable_19__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static int __pyx_pw_9pywrapfst_12_SymbolTable_19__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__contains__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9pywrapfst_12_SymbolTable_18__contains__(((struct __pyx_obj_9pywrapfst__SymbolTable *)__pyx_v_self), ((PyObject *)__pyx_v_key));

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

static int __pyx_pf_9pywrapfst_12_SymbolTable_18__contains__(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self, PyObject *__pyx_v_key) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__contains__", 0);

  /* "pywrapfst.pyx":786
 * 
 *   def __contains__(self, key):
 *     return self.member(key)             # <<<<<<<<<<<<<<
 * 
 *   cpdef string name(self):
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "member");
    __PYX_ERR(0, 786, __pyx_L1_error)
  }
  __pyx_r = ((struct __pyx_vtabstruct_9pywrapfst__SymbolTable *)__pyx_v_self->__pyx_vtab)->member(__pyx_v_self, __pyx_v_key, 0);
  goto __pyx_L0;

  /* "pywrapfst.pyx":785
 *       return self._table.MemberIndex(key)
 * 
 *   def __contains__(self, key):             # <<<<<<<<<<<<<<
 *     return self.member(key)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pywrapfst._SymbolTable.__contains__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":788
 *     return self.member(key)
 * 
 *   cpdef string name(self):             # <<<<<<<<<<<<<<
 *     """
 *     name(self)
 */

static PyObject *__pyx_pw_9pywrapfst_12_SymbolTable_21name(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static std::string __pyx_f_9pywrapfst_12_SymbolTable_name(struct __pyx_obj_9pywrapfst__SymbolTable *__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;
  __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)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 788, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_12_SymbolTable_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);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 788, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 788, __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, 788, __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;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

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

  /* "pywrapfst.pyx":788
 *     return self.member(key)
 * 
 *   cpdef string name(self):             # <<<<<<<<<<<<<<
 *     """
 *     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_WriteUnraisable("pywrapfst._SymbolTable.name", __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_9pywrapfst_12_SymbolTable_21name(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_9pywrapfst_12_SymbolTable_20name[] = "\n    name(self)\n\n    Returns the symbol table's name.\n    ";
static PyObject *__pyx_pw_9pywrapfst_12_SymbolTable_21name(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("name (wrapper)", 0);
  __pyx_r = __pyx_pf_9pywrapfst_12_SymbolTable_20name(((struct __pyx_obj_9pywrapfst__SymbolTable *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_12_SymbolTable_20name(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("name", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_f_9pywrapfst_12_SymbolTable_name(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 788, __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("pywrapfst._SymbolTable.name", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":796
 *     return self._table.Name()
 * 
 *   cpdef size_t num_symbols(self):             # <<<<<<<<<<<<<<
 *     """
 *     num_symbols(self)
 */

static PyObject *__pyx_pw_9pywrapfst_12_SymbolTable_23num_symbols(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static size_t __pyx_f_9pywrapfst_12_SymbolTable_num_symbols(struct __pyx_obj_9pywrapfst__SymbolTable *__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;
  __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)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_symbols); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 796, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_12_SymbolTable_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);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 796, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 796, __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, 796, __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;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

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

  /* "pywrapfst.pyx":796
 *     return self._table.Name()
 * 
 *   cpdef size_t num_symbols(self):             # <<<<<<<<<<<<<<
 *     """
 *     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_WriteUnraisable("pywrapfst._SymbolTable.num_symbols", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_12_SymbolTable_23num_symbols(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_9pywrapfst_12_SymbolTable_22num_symbols[] = "\n    num_symbols(self)\n\n    Returns the number of symbols in the symbol table.\n    ";
static PyObject *__pyx_pw_9pywrapfst_12_SymbolTable_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_9pywrapfst_12_SymbolTable_22num_symbols(((struct __pyx_obj_9pywrapfst__SymbolTable *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_12_SymbolTable_22num_symbols(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("num_symbols", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_f_9pywrapfst_12_SymbolTable_num_symbols(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 796, __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("pywrapfst._SymbolTable.num_symbols", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":804
 *     return self._table.NumSymbols()
 * 
 *   cpdef void write(self, filename) except *:             # <<<<<<<<<<<<<<
 *     """
 *     write(self, filename)
 */

static PyObject *__pyx_pw_9pywrapfst_12_SymbolTable_25write(PyObject *__pyx_v_self, PyObject *__pyx_v_filename); /*proto*/
static void __pyx_f_9pywrapfst_12_SymbolTable_write(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self, PyObject *__pyx_v_filename, 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;
  std::string __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  __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)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_write); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 804, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_12_SymbolTable_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);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_filename); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 804, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_filename};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 804, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_filename};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 804, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 804, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_filename);
          __Pyx_GIVEREF(__pyx_v_filename);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_filename);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 804, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pywrapfst.pyx":818
 *       FstIOError: Write failed.
 *     """
 *     if not self._table.Write(tostring(filename)):             # <<<<<<<<<<<<<<
 *       raise FstIOError("Write failed: {!r}".format(filename))
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_table");
    __PYX_ERR(0, 818, __pyx_L1_error)
  }
  __pyx_t_6 = __pyx_f_9pywrapfst_tostring(__pyx_v_filename, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 818, __pyx_L1_error)
  __pyx_t_7 = ((!(__pyx_v_self->_table->Write(__pyx_t_6) != 0)) != 0);
  if (__pyx_t_7) {

    /* "pywrapfst.pyx":819
 *     """
 *     if not self._table.Write(tostring(filename)):
 *       raise FstIOError("Write failed: {!r}".format(filename))             # <<<<<<<<<<<<<<
 * 
 *   cpdef void write_text(self, filename) except *:
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIOError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 819, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Write_failed_r, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 819, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    if (!__pyx_t_4) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_filename); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 819, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_5)) {
        PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_filename};
        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 819, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
        PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_filename};
        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 819, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else
      #endif
      {
        __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 819, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_4); __pyx_t_4 = NULL;
        __Pyx_INCREF(__pyx_v_filename);
        __Pyx_GIVEREF(__pyx_v_filename);
        PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_v_filename);
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 819, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __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);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 819, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_2)) {
        PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
        __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 819, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
        PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
        __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 819, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      } else
      #endif
      {
        __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 819, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
        __Pyx_GIVEREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_3);
        __pyx_t_3 = 0;
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 819, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
    }
    __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, 819, __pyx_L1_error)

    /* "pywrapfst.pyx":818
 *       FstIOError: Write failed.
 *     """
 *     if not self._table.Write(tostring(filename)):             # <<<<<<<<<<<<<<
 *       raise FstIOError("Write failed: {!r}".format(filename))
 * 
 */
  }

  /* "pywrapfst.pyx":804
 *     return self._table.NumSymbols()
 * 
 *   cpdef void write(self, filename) except *:             # <<<<<<<<<<<<<<
 *     """
 *     write(self, filename)
 */

  /* 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_8);
  __Pyx_AddTraceback("pywrapfst._SymbolTable.write", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_12_SymbolTable_25write(PyObject *__pyx_v_self, PyObject *__pyx_v_filename); /*proto*/
static char __pyx_doc_9pywrapfst_12_SymbolTable_24write[] = "\n    write(self, filename)\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      filename: The string location of the output file.\n\n    Raises:\n      FstIOError: Write failed.\n    ";
static PyObject *__pyx_pw_9pywrapfst_12_SymbolTable_25write(PyObject *__pyx_v_self, PyObject *__pyx_v_filename) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("write (wrapper)", 0);
  __pyx_r = __pyx_pf_9pywrapfst_12_SymbolTable_24write(((struct __pyx_obj_9pywrapfst__SymbolTable *)__pyx_v_self), ((PyObject *)__pyx_v_filename));

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

static PyObject *__pyx_pf_9pywrapfst_12_SymbolTable_24write(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self, PyObject *__pyx_v_filename) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("write", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_9pywrapfst_12_SymbolTable_write(__pyx_v_self, __pyx_v_filename, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 804, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 804, __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("pywrapfst._SymbolTable.write", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":821
 *       raise FstIOError("Write failed: {!r}".format(filename))
 * 
 *   cpdef void write_text(self, filename) except *:             # <<<<<<<<<<<<<<
 *     """
 *     write_text(self, filename)
 */

static PyObject *__pyx_pw_9pywrapfst_12_SymbolTable_27write_text(PyObject *__pyx_v_self, PyObject *__pyx_v_filename); /*proto*/
static void __pyx_f_9pywrapfst_12_SymbolTable_write_text(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self, PyObject *__pyx_v_filename, 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;
  std::string __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  __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)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_write_text); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 821, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_12_SymbolTable_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);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_filename); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 821, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_filename};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 821, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_filename};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 821, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 821, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_filename);
          __Pyx_GIVEREF(__pyx_v_filename);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_filename);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 821, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pywrapfst.pyx":835
 *       FstIOError: Write failed.
 *     """
 *     if not self._table.WriteText(tostring(filename)):             # <<<<<<<<<<<<<<
 *       raise FstIOError("Write failed: {!r}".format(filename))
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_table");
    __PYX_ERR(0, 835, __pyx_L1_error)
  }
  __pyx_t_6 = __pyx_f_9pywrapfst_tostring(__pyx_v_filename, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 835, __pyx_L1_error)
  __pyx_t_7 = ((!(__pyx_v_self->_table->WriteText(__pyx_t_6) != 0)) != 0);
  if (__pyx_t_7) {

    /* "pywrapfst.pyx":836
 *     """
 *     if not self._table.WriteText(tostring(filename)):
 *       raise FstIOError("Write failed: {!r}".format(filename))             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIOError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 836, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Write_failed_r, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 836, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    if (!__pyx_t_4) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_filename); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 836, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_5)) {
        PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_filename};
        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 836, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
        PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_filename};
        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 836, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else
      #endif
      {
        __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 836, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_4); __pyx_t_4 = NULL;
        __Pyx_INCREF(__pyx_v_filename);
        __Pyx_GIVEREF(__pyx_v_filename);
        PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_v_filename);
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 836, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __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);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 836, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_2)) {
        PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
        __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 836, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
        PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
        __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 836, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      } else
      #endif
      {
        __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 836, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
        __Pyx_GIVEREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_3);
        __pyx_t_3 = 0;
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 836, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
    }
    __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, 836, __pyx_L1_error)

    /* "pywrapfst.pyx":835
 *       FstIOError: Write failed.
 *     """
 *     if not self._table.WriteText(tostring(filename)):             # <<<<<<<<<<<<<<
 *       raise FstIOError("Write failed: {!r}".format(filename))
 * 
 */
  }

  /* "pywrapfst.pyx":821
 *       raise FstIOError("Write failed: {!r}".format(filename))
 * 
 *   cpdef void write_text(self, filename) except *:             # <<<<<<<<<<<<<<
 *     """
 *     write_text(self, filename)
 */

  /* 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_8);
  __Pyx_AddTraceback("pywrapfst._SymbolTable.write_text", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_12_SymbolTable_27write_text(PyObject *__pyx_v_self, PyObject *__pyx_v_filename); /*proto*/
static char __pyx_doc_9pywrapfst_12_SymbolTable_26write_text[] = "\n    write_text(self, filename)\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      filename: The string location of the output file.\n\n    Raises:\n      FstIOError: Write failed.\n    ";
static PyObject *__pyx_pw_9pywrapfst_12_SymbolTable_27write_text(PyObject *__pyx_v_self, PyObject *__pyx_v_filename) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("write_text (wrapper)", 0);
  __pyx_r = __pyx_pf_9pywrapfst_12_SymbolTable_26write_text(((struct __pyx_obj_9pywrapfst__SymbolTable *)__pyx_v_self), ((PyObject *)__pyx_v_filename));

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

static PyObject *__pyx_pf_9pywrapfst_12_SymbolTable_26write_text(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self, PyObject *__pyx_v_filename) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("write_text", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_9pywrapfst_12_SymbolTable_write_text(__pyx_v_self, __pyx_v_filename, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 821, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 821, __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("pywrapfst._SymbolTable.write_text", __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._table cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_12_SymbolTable_29__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_9pywrapfst_12_SymbolTable_29__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_9pywrapfst_12_SymbolTable_28__reduce_cython__(((struct __pyx_obj_9pywrapfst__SymbolTable *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_12_SymbolTable_28__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self._table cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self._table 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._table 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("pywrapfst._SymbolTable.__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._table cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self._table cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_12_SymbolTable_31__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static PyObject *__pyx_pw_9pywrapfst_12_SymbolTable_31__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_9pywrapfst_12_SymbolTable_30__setstate_cython__(((struct __pyx_obj_9pywrapfst__SymbolTable *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

static PyObject *__pyx_pf_9pywrapfst_12_SymbolTable_30__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self._table cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self._table 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._table cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self._table cannot be converted to a Python object for pickling")
 */

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

/* "pywrapfst.pyx":854
 *   # Doing so will allow undefined behavior.
 * 
 *   def __repr__(self):             # <<<<<<<<<<<<<<
 *     return "<const EncodeMapper SymbolTable {!r} at 0x{:x}>".format(self.name(),
 *                                                                     id(self))
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_24_EncodeMapperSymbolTable_1__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9pywrapfst_24_EncodeMapperSymbolTable_1__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9pywrapfst_24_EncodeMapperSymbolTable___repr__(((struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTable *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_24_EncodeMapperSymbolTable___repr__(struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTable *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "pywrapfst.pyx":855
 * 
 *   def __repr__(self):
 *     return "<const EncodeMapper SymbolTable {!r} at 0x{:x}>".format(self.name(),             # <<<<<<<<<<<<<<
 *                                                                     id(self))
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_const_EncodeMapper_SymbolTable, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 855, __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'", "name");
    __PYX_ERR(0, 855, __pyx_L1_error)
  }
  __pyx_t_3 = __pyx_convert_PyBytes_string_to_py_std__in_string(((struct __pyx_vtabstruct_9pywrapfst__EncodeMapperSymbolTable *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.name(((struct __pyx_obj_9pywrapfst__SymbolTable *)__pyx_v_self), 0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 855, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "pywrapfst.pyx":856
 *   def __repr__(self):
 *     return "<const EncodeMapper SymbolTable {!r} at 0x{:x}>".format(self.name(),
 *                                                                     id(self))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 856, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_self));
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 856, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_6 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 855, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 855, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else
  #endif
  {
    __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 855, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__pyx_t_4) {
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_5);
    __pyx_t_3 = 0;
    __pyx_t_5 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 855, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":854
 *   # Doing so will allow undefined behavior.
 * 
 *   def __repr__(self):             # <<<<<<<<<<<<<<
 *     return "<const EncodeMapper SymbolTable {!r} at 0x{:x}>".format(self.name(),
 *                                                                     id(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_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pywrapfst._EncodeMapperSymbolTable.__repr__", __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._encoder,self._table cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_24_EncodeMapperSymbolTable_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_9pywrapfst_24_EncodeMapperSymbolTable_3__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_9pywrapfst_24_EncodeMapperSymbolTable_2__reduce_cython__(((struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTable *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_24_EncodeMapperSymbolTable_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTable *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self._encoder,self._table cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self._encoder,self._table cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__9, 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._encoder,self._table 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("pywrapfst._EncodeMapperSymbolTable.__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._encoder,self._table cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self._encoder,self._table cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_24_EncodeMapperSymbolTable_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static PyObject *__pyx_pw_9pywrapfst_24_EncodeMapperSymbolTable_5__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_9pywrapfst_24_EncodeMapperSymbolTable_4__setstate_cython__(((struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTable *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

static PyObject *__pyx_pf_9pywrapfst_24_EncodeMapperSymbolTable_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTable *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self._encoder,self._table cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self._encoder,self._table cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__10, 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._encoder,self._table cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self._encoder,self._table cannot be converted to a Python object for pickling")
 */

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

/* "pywrapfst.pyx":873
 *   # Doing so will allow undefined behavior.
 * 
 *   def __repr__(self):             # <<<<<<<<<<<<<<
 *     return "<const Fst SymbolTable {!r} at 0x{:x}>".format(self.name(),
 *                                                            id(self))
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_15_FstSymbolTable_1__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9pywrapfst_15_FstSymbolTable_1__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9pywrapfst_15_FstSymbolTable___repr__(((struct __pyx_obj_9pywrapfst__FstSymbolTable *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_15_FstSymbolTable___repr__(struct __pyx_obj_9pywrapfst__FstSymbolTable *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "pywrapfst.pyx":874
 * 
 *   def __repr__(self):
 *     return "<const Fst SymbolTable {!r} at 0x{:x}>".format(self.name(),             # <<<<<<<<<<<<<<
 *                                                            id(self))
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_const_Fst_SymbolTable_r_at_0x_x, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 874, __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'", "name");
    __PYX_ERR(0, 874, __pyx_L1_error)
  }
  __pyx_t_3 = __pyx_convert_PyBytes_string_to_py_std__in_string(((struct __pyx_vtabstruct_9pywrapfst__FstSymbolTable *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.name(((struct __pyx_obj_9pywrapfst__SymbolTable *)__pyx_v_self), 0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 874, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "pywrapfst.pyx":875
 *   def __repr__(self):
 *     return "<const Fst SymbolTable {!r} at 0x{:x}>".format(self.name(),
 *                                                            id(self))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 875, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_self));
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 875, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_6 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 874, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 874, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else
  #endif
  {
    __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 874, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__pyx_t_4) {
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_5);
    __pyx_t_3 = 0;
    __pyx_t_5 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 874, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":873
 *   # Doing so will allow undefined behavior.
 * 
 *   def __repr__(self):             # <<<<<<<<<<<<<<
 *     return "<const Fst SymbolTable {!r} at 0x{:x}>".format(self.name(),
 *                                                            id(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_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pywrapfst._FstSymbolTable.__repr__", __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._table cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_15_FstSymbolTable_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_9pywrapfst_15_FstSymbolTable_3__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_9pywrapfst_15_FstSymbolTable_2__reduce_cython__(((struct __pyx_obj_9pywrapfst__FstSymbolTable *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_15_FstSymbolTable_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9pywrapfst__FstSymbolTable *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self._fst,self._table cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self._fst,self._table cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__11, 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._table 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("pywrapfst._FstSymbolTable.__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._table cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self._fst,self._table cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_15_FstSymbolTable_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static PyObject *__pyx_pw_9pywrapfst_15_FstSymbolTable_5__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_9pywrapfst_15_FstSymbolTable_4__setstate_cython__(((struct __pyx_obj_9pywrapfst__FstSymbolTable *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

static PyObject *__pyx_pf_9pywrapfst_15_FstSymbolTable_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_9pywrapfst__FstSymbolTable *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self._fst,self._table cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self._fst,self._table cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__12, 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._table cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self._fst,self._table cannot be converted to a Python object for pickling")
 */

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

/* "pywrapfst.pyx":889
 *   """
 * 
 *   cpdef int64 add_symbol(self, symbol, int64 key=kNoSymbol):             # <<<<<<<<<<<<<<
 *     """
 *     add_symbol(self, symbol, key=NO_SYMBOL)
 */

static PyObject *__pyx_pw_9pywrapfst_19_MutableSymbolTable_1add_symbol(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static __pyx_t_10basictypes_int64 __pyx_f_9pywrapfst_19_MutableSymbolTable_add_symbol(struct __pyx_obj_9pywrapfst__MutableSymbolTable *__pyx_v_self, PyObject *__pyx_v_symbol, int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_19_MutableSymbolTable_add_symbol *__pyx_optional_args) {
  __pyx_t_10basictypes_int64 __pyx_v_key = __pyx_k__13;
  std::string __pyx_v_symbol_string;
  __pyx_t_10basictypes_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;
  __pyx_t_10basictypes_int64 __pyx_t_8;
  std::string __pyx_t_9;
  int __pyx_t_10;
  __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)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_symbol); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 889, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_19_MutableSymbolTable_1add_symbol)) {
      __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_v_key); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 889, __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, 889, __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, 889, __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, 889, __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, 889, __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_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 889, __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;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pywrapfst.pyx":906
 *       The integer key of the new symbol.
 *     """
 *     cdef string symbol_string = tostring(symbol)             # <<<<<<<<<<<<<<
 *     if key != kNoSymbol:
 *       return self._table.AddSymbol(symbol_string, key)
 */
  __pyx_t_9 = __pyx_f_9pywrapfst_tostring(__pyx_v_symbol, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 906, __pyx_L1_error)
  __pyx_v_symbol_string = __pyx_t_9;

  /* "pywrapfst.pyx":907
 *     """
 *     cdef string symbol_string = tostring(symbol)
 *     if key != kNoSymbol:             # <<<<<<<<<<<<<<
 *       return self._table.AddSymbol(symbol_string, key)
 *     else:
 */
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 907, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_kNoSymbol); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 907, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 907, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 907, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_10) {

    /* "pywrapfst.pyx":908
 *     cdef string symbol_string = tostring(symbol)
 *     if key != kNoSymbol:
 *       return self._table.AddSymbol(symbol_string, key)             # <<<<<<<<<<<<<<
 *     else:
 *       return self._table.AddSymbol(symbol_string)
 */
    if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_table");
      __PYX_ERR(0, 908, __pyx_L1_error)
    }
    __pyx_r = __pyx_v_self->__pyx_base._table->AddSymbol(__pyx_v_symbol_string, __pyx_v_key);
    goto __pyx_L0;

    /* "pywrapfst.pyx":907
 *     """
 *     cdef string symbol_string = tostring(symbol)
 *     if key != kNoSymbol:             # <<<<<<<<<<<<<<
 *       return self._table.AddSymbol(symbol_string, key)
 *     else:
 */
  }

  /* "pywrapfst.pyx":910
 *       return self._table.AddSymbol(symbol_string, key)
 *     else:
 *       return self._table.AddSymbol(symbol_string)             # <<<<<<<<<<<<<<
 * 
 *   cpdef void add_table(self, _SymbolTable syms):
 */
  /*else*/ {
    if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_table");
      __PYX_ERR(0, 910, __pyx_L1_error)
    }
    __pyx_r = __pyx_v_self->__pyx_base._table->AddSymbol(__pyx_v_symbol_string);
    goto __pyx_L0;
  }

  /* "pywrapfst.pyx":889
 *   """
 * 
 *   cpdef int64 add_symbol(self, symbol, int64 key=kNoSymbol):             # <<<<<<<<<<<<<<
 *     """
 *     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_WriteUnraisable("pywrapfst._MutableSymbolTable.add_symbol", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_19_MutableSymbolTable_1add_symbol(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_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_9pywrapfst_19_MutableSymbolTable_1add_symbol(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_symbol = 0;
  __pyx_t_10basictypes_int64 __pyx_v_key;
  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] = PyDict_GetItem(__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 = PyDict_GetItem(__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, 889, __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_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 889, __pyx_L3_error)
    } else {
      __pyx_v_key = __pyx_k__13;
    }
  }
  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, 889, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pywrapfst._MutableSymbolTable.add_symbol", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pywrapfst_19_MutableSymbolTable_add_symbol(((struct __pyx_obj_9pywrapfst__MutableSymbolTable *)__pyx_v_self), __pyx_v_symbol, __pyx_v_key);

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

static PyObject *__pyx_pf_9pywrapfst_19_MutableSymbolTable_add_symbol(struct __pyx_obj_9pywrapfst__MutableSymbolTable *__pyx_v_self, PyObject *__pyx_v_symbol, __pyx_t_10basictypes_int64 __pyx_v_key) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __pyx_t_10basictypes_int64 __pyx_t_1;
  struct __pyx_opt_args_9pywrapfst_19_MutableSymbolTable_add_symbol __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __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_9pywrapfst__MutableSymbolTable->add_symbol(__pyx_v_self, __pyx_v_symbol, 1, &__pyx_t_2); 
  __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 889, __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("pywrapfst._MutableSymbolTable.add_symbol", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":912
 *       return self._table.AddSymbol(symbol_string)
 * 
 *   cpdef void add_table(self, _SymbolTable syms):             # <<<<<<<<<<<<<<
 *     """
 *     add_table(self, syms)
 */

static PyObject *__pyx_pw_9pywrapfst_19_MutableSymbolTable_3add_table(PyObject *__pyx_v_self, PyObject *__pyx_v_syms); /*proto*/
static void __pyx_f_9pywrapfst_19_MutableSymbolTable_add_table(struct __pyx_obj_9pywrapfst__MutableSymbolTable *__pyx_v_self, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_syms, 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;
  __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)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_table); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 912, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_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);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_syms)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 912, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_syms)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 912, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_syms)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 912, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 912, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(((PyObject *)__pyx_v_syms));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_syms));
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_syms));
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 912, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pywrapfst.pyx":924
 *       syms: A SymbolTable to be merged with the current table.
 *     """
 *     self._table.AddTable(deref(syms._table))             # <<<<<<<<<<<<<<
 * 
 *   cpdef void set_name(self, new_name) except *:
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_table");
    __PYX_ERR(0, 924, __pyx_L1_error)
  }
  if (unlikely(((PyObject *)__pyx_v_syms) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_table");
    __PYX_ERR(0, 924, __pyx_L1_error)
  }
  __pyx_v_self->__pyx_base._table->AddTable((*__pyx_v_syms->_table));

  /* "pywrapfst.pyx":912
 *       return self._table.AddSymbol(symbol_string)
 * 
 *   cpdef void add_table(self, _SymbolTable syms):             # <<<<<<<<<<<<<<
 *     """
 *     add_table(self, syms)
 */

  /* 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("pywrapfst._MutableSymbolTable.add_table", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_19_MutableSymbolTable_3add_table(PyObject *__pyx_v_self, PyObject *__pyx_v_syms); /*proto*/
static char __pyx_doc_9pywrapfst_19_MutableSymbolTable_2add_table[] = "\n    add_table(self, syms)\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      syms: A SymbolTable to be merged with the current table.\n    ";
static PyObject *__pyx_pw_9pywrapfst_19_MutableSymbolTable_3add_table(PyObject *__pyx_v_self, PyObject *__pyx_v_syms) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("add_table (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_syms), __pyx_ptype_9pywrapfst__SymbolTable, 1, "syms", 0))) __PYX_ERR(0, 912, __pyx_L1_error)
  __pyx_r = __pyx_pf_9pywrapfst_19_MutableSymbolTable_2add_table(((struct __pyx_obj_9pywrapfst__MutableSymbolTable *)__pyx_v_self), ((struct __pyx_obj_9pywrapfst__SymbolTable *)__pyx_v_syms));

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

static PyObject *__pyx_pf_9pywrapfst_19_MutableSymbolTable_2add_table(struct __pyx_obj_9pywrapfst__MutableSymbolTable *__pyx_v_self, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_syms) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("add_table", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_9pywrapfst_19_MutableSymbolTable_add_table(__pyx_v_self, __pyx_v_syms, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 912, __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("pywrapfst._MutableSymbolTable.add_table", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":926
 *     self._table.AddTable(deref(syms._table))
 * 
 *   cpdef void set_name(self, new_name) except *:             # <<<<<<<<<<<<<<
 *     self._table.SetName(tostring(new_name))
 * 
 */

static PyObject *__pyx_pw_9pywrapfst_19_MutableSymbolTable_5set_name(PyObject *__pyx_v_self, PyObject *__pyx_v_new_name); /*proto*/
static void __pyx_f_9pywrapfst_19_MutableSymbolTable_set_name(struct __pyx_obj_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;
  PyObject *__pyx_t_5 = NULL;
  std::string __pyx_t_6;
  __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)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 926, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_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);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_new_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 926, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_new_name};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 926, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_new_name};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 926, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 926, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_new_name);
          __Pyx_GIVEREF(__pyx_v_new_name);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_new_name);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 926, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pywrapfst.pyx":927
 * 
 *   cpdef void set_name(self, new_name) except *:
 *     self._table.SetName(tostring(new_name))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_table");
    __PYX_ERR(0, 927, __pyx_L1_error)
  }
  __pyx_t_6 = __pyx_f_9pywrapfst_tostring(__pyx_v_new_name, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 927, __pyx_L1_error)
  __pyx_v_self->__pyx_base._table->SetName(__pyx_t_6);

  /* "pywrapfst.pyx":926
 *     self._table.AddTable(deref(syms._table))
 * 
 *   cpdef void set_name(self, new_name) except *:             # <<<<<<<<<<<<<<
 *     self._table.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_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pywrapfst._MutableSymbolTable.set_name", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_19_MutableSymbolTable_5set_name(PyObject *__pyx_v_self, PyObject *__pyx_v_new_name); /*proto*/
static PyObject *__pyx_pw_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_9pywrapfst_19_MutableSymbolTable_4set_name(((struct __pyx_obj_9pywrapfst__MutableSymbolTable *)__pyx_v_self), ((PyObject *)__pyx_v_new_name));

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

static PyObject *__pyx_pf_9pywrapfst_19_MutableSymbolTable_4set_name(struct __pyx_obj_9pywrapfst__MutableSymbolTable *__pyx_v_self, PyObject *__pyx_v_new_name) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("set_name", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_9pywrapfst_19_MutableSymbolTable_set_name(__pyx_v_self, __pyx_v_new_name, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 926, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 926, __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("pywrapfst._MutableSymbolTable.set_name", __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._table cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_19_MutableSymbolTable_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_9pywrapfst_19_MutableSymbolTable_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_9pywrapfst_19_MutableSymbolTable_6__reduce_cython__(((struct __pyx_obj_9pywrapfst__MutableSymbolTable *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_19_MutableSymbolTable_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9pywrapfst__MutableSymbolTable *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self._table cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self._table cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__14, 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._table 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("pywrapfst._MutableSymbolTable.__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._table cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self._table cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_19_MutableSymbolTable_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static PyObject *__pyx_pw_9pywrapfst_19_MutableSymbolTable_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_9pywrapfst_19_MutableSymbolTable_8__setstate_cython__(((struct __pyx_obj_9pywrapfst__MutableSymbolTable *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

static PyObject *__pyx_pf_9pywrapfst_19_MutableSymbolTable_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_9pywrapfst__MutableSymbolTable *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self._table cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self._table cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__15, 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._table cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self._table cannot be converted to a Python object for pickling")
 */

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

/* "pywrapfst.pyx":937
 *   """
 * 
 *   def __repr__(self):             # <<<<<<<<<<<<<<
 *     return "<Fst SymbolTable {!r} at 0x{:x}>".format(self.name(), id(self))
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_22_MutableFstSymbolTable_1__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9pywrapfst_22_MutableFstSymbolTable_1__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9pywrapfst_22_MutableFstSymbolTable___repr__(((struct __pyx_obj_9pywrapfst__MutableFstSymbolTable *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_22_MutableFstSymbolTable___repr__(struct __pyx_obj_9pywrapfst__MutableFstSymbolTable *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "pywrapfst.pyx":938
 * 
 *   def __repr__(self):
 *     return "<Fst SymbolTable {!r} at 0x{:x}>".format(self.name(), id(self))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Fst_SymbolTable_r_at_0x_x, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 938, __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'", "name");
    __PYX_ERR(0, 938, __pyx_L1_error)
  }
  __pyx_t_3 = __pyx_convert_PyBytes_string_to_py_std__in_string(((struct __pyx_vtabstruct_9pywrapfst__MutableFstSymbolTable *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.name(((struct __pyx_obj_9pywrapfst__SymbolTable *)__pyx_v_self), 0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 938, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 938, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_self));
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 938, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_6 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 938, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 938, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else
  #endif
  {
    __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 938, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__pyx_t_4) {
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_5);
    __pyx_t_3 = 0;
    __pyx_t_5 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 938, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":937
 *   """
 * 
 *   def __repr__(self):             # <<<<<<<<<<<<<<
 *     return "<Fst SymbolTable {!r} at 0x{:x}>".format(self.name(), id(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_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pywrapfst._MutableFstSymbolTable.__repr__", __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._mfst,self._table cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_22_MutableFstSymbolTable_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_9pywrapfst_22_MutableFstSymbolTable_3__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_9pywrapfst_22_MutableFstSymbolTable_2__reduce_cython__(((struct __pyx_obj_9pywrapfst__MutableFstSymbolTable *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_22_MutableFstSymbolTable_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9pywrapfst__MutableFstSymbolTable *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self._mfst,self._table cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self._mfst,self._table cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__16, 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._mfst,self._table 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("pywrapfst._MutableFstSymbolTable.__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._mfst,self._table cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self._mfst,self._table cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_22_MutableFstSymbolTable_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static PyObject *__pyx_pw_9pywrapfst_22_MutableFstSymbolTable_5__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_9pywrapfst_22_MutableFstSymbolTable_4__setstate_cython__(((struct __pyx_obj_9pywrapfst__MutableFstSymbolTable *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

static PyObject *__pyx_pf_9pywrapfst_22_MutableFstSymbolTable_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_9pywrapfst__MutableFstSymbolTable *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self._mfst,self._table cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self._mfst,self._table cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__17, 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._mfst,self._table cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self._mfst,self._table cannot be converted to a Python object for pickling")
 */

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

/* "pywrapfst.pyx":958
 *   """
 * 
 *   def __repr__(self):             # <<<<<<<<<<<<<<
 *     return "<SymbolTable {!r} at 0x{:x}>".format(self.name(), id(self))
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_11SymbolTable_1__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9pywrapfst_11SymbolTable_1__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9pywrapfst_11SymbolTable___repr__(((struct __pyx_obj_9pywrapfst_SymbolTable *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_11SymbolTable___repr__(struct __pyx_obj_9pywrapfst_SymbolTable *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "pywrapfst.pyx":959
 * 
 *   def __repr__(self):
 *     return "<SymbolTable {!r} at 0x{:x}>".format(self.name(), id(self))             # <<<<<<<<<<<<<<
 * 
 *   def __init__(self, name=b"<unspecified>"):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_SymbolTable_r_at_0x_x, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 959, __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'", "name");
    __PYX_ERR(0, 959, __pyx_L1_error)
  }
  __pyx_t_3 = __pyx_convert_PyBytes_string_to_py_std__in_string(((struct __pyx_vtabstruct_9pywrapfst_SymbolTable *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.name(((struct __pyx_obj_9pywrapfst__SymbolTable *)__pyx_v_self), 0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 959, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 959, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_self));
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 959, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_6 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 959, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 959, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else
  #endif
  {
    __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 959, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__pyx_t_4) {
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_5);
    __pyx_t_3 = 0;
    __pyx_t_5 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 959, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":958
 *   """
 * 
 *   def __repr__(self):             # <<<<<<<<<<<<<<
 *     return "<SymbolTable {!r} at 0x{:x}>".format(self.name(), id(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_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pywrapfst.SymbolTable.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":961
 *     return "<SymbolTable {!r} at 0x{:x}>".format(self.name(), id(self))
 * 
 *   def __init__(self, name=b"<unspecified>"):             # <<<<<<<<<<<<<<
 *     self._table = new fst.SymbolTable(tostring(name))
 *     self._smart_table.reset(self._table)
 */

/* Python wrapper */
static int __pyx_pw_9pywrapfst_11SymbolTable_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_9pywrapfst_11SymbolTable_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_name = 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_b_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 = PyDict_GetItem(__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, 961, __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, 961, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pywrapfst.SymbolTable.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pywrapfst_11SymbolTable_2__init__(((struct __pyx_obj_9pywrapfst_SymbolTable *)__pyx_v_self), __pyx_v_name);

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

static int __pyx_pf_9pywrapfst_11SymbolTable_2__init__(struct __pyx_obj_9pywrapfst_SymbolTable *__pyx_v_self, PyObject *__pyx_v_name) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pywrapfst.pyx":962
 * 
 *   def __init__(self, name=b"<unspecified>"):
 *     self._table = new fst.SymbolTable(tostring(name))             # <<<<<<<<<<<<<<
 *     self._smart_table.reset(self._table)
 * 
 */
  __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_name, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 962, __pyx_L1_error)
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_table");
    __PYX_ERR(0, 962, __pyx_L1_error)
  }
  __pyx_v_self->__pyx_base.__pyx_base._table = new fst::SymbolTable(__pyx_t_1);

  /* "pywrapfst.pyx":963
 *   def __init__(self, name=b"<unspecified>"):
 *     self._table = new fst.SymbolTable(tostring(name))
 *     self._smart_table.reset(self._table)             # <<<<<<<<<<<<<<
 * 
 *   @classmethod
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_smart_table");
    __PYX_ERR(0, 963, __pyx_L1_error)
  }
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_table");
    __PYX_ERR(0, 963, __pyx_L1_error)
  }
  __pyx_v_self->_smart_table.reset(__pyx_v_self->__pyx_base.__pyx_base._table);

  /* "pywrapfst.pyx":961
 *     return "<SymbolTable {!r} at 0x{:x}>".format(self.name(), id(self))
 * 
 *   def __init__(self, name=b"<unspecified>"):             # <<<<<<<<<<<<<<
 *     self._table = new fst.SymbolTable(tostring(name))
 *     self._smart_table.reset(self._table)
 */

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

/* "pywrapfst.pyx":966
 * 
 *   @classmethod
 *   def read(cls, filename):             # <<<<<<<<<<<<<<
 *     """
 *     SymbolTable.read(filename)
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_11SymbolTable_5read(PyObject *__pyx_v_cls, PyObject *__pyx_v_filename); /*proto*/
static char __pyx_doc_9pywrapfst_11SymbolTable_4read[] = "\n    SymbolTable.read(filename)\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      filename: The string location of the input binary file.\n\n    Returns:\n      A new SymbolTable instance.\n\n    See also: `SymbolTable.read_fst`, `SymbolTable.read_text`.\n    ";
static PyObject *__pyx_pw_9pywrapfst_11SymbolTable_5read(PyObject *__pyx_v_cls, PyObject *__pyx_v_filename) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("read (wrapper)", 0);
  __pyx_r = __pyx_pf_9pywrapfst_11SymbolTable_4read(((PyTypeObject*)__pyx_v_cls), ((PyObject *)__pyx_v_filename));

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

static PyObject *__pyx_pf_9pywrapfst_11SymbolTable_4read(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_filename) {
  fst::SymbolTable *__pyx_v_tsyms;
  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;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("read", 0);

  /* "pywrapfst.pyx":982
 *     See also: `SymbolTable.read_fst`, `SymbolTable.read_text`.
 *     """
 *     cdef fst.SymbolTable *tsyms = fst.SymbolTable.Read(tostring(filename))             # <<<<<<<<<<<<<<
 *     if tsyms == NULL:
 *       raise FstIOError("Read failed: {!r}".format(filename))
 */
  __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_filename, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 982, __pyx_L1_error)
  __pyx_v_tsyms = fst::SymbolTable::Read(__pyx_t_1);

  /* "pywrapfst.pyx":983
 *     """
 *     cdef fst.SymbolTable *tsyms = fst.SymbolTable.Read(tostring(filename))
 *     if tsyms == NULL:             # <<<<<<<<<<<<<<
 *       raise FstIOError("Read failed: {!r}".format(filename))
 *     return _init_SymbolTable(tsyms)
 */
  __pyx_t_2 = ((__pyx_v_tsyms == NULL) != 0);
  if (__pyx_t_2) {

    /* "pywrapfst.pyx":984
 *     cdef fst.SymbolTable *tsyms = fst.SymbolTable.Read(tostring(filename))
 *     if tsyms == NULL:
 *       raise FstIOError("Read failed: {!r}".format(filename))             # <<<<<<<<<<<<<<
 *     return _init_SymbolTable(tsyms)
 * 
 */
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIOError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 984, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Read_failed_r, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 984, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    if (!__pyx_t_7) {
      __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_filename); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 984, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_filename};
        __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 984, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_GOTREF(__pyx_t_5);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_filename};
        __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 984, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_GOTREF(__pyx_t_5);
      } else
      #endif
      {
        __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 984, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
        __Pyx_INCREF(__pyx_v_filename);
        __Pyx_GIVEREF(__pyx_v_filename);
        PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_v_filename);
        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 984, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (!__pyx_t_6) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 984, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 984, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 984, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      } else
      #endif
      {
        __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 984, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
        __Pyx_GIVEREF(__pyx_t_5);
        PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_5);
        __pyx_t_5 = 0;
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 984, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 984, __pyx_L1_error)

    /* "pywrapfst.pyx":983
 *     """
 *     cdef fst.SymbolTable *tsyms = fst.SymbolTable.Read(tostring(filename))
 *     if tsyms == NULL:             # <<<<<<<<<<<<<<
 *       raise FstIOError("Read failed: {!r}".format(filename))
 *     return _init_SymbolTable(tsyms)
 */
  }

  /* "pywrapfst.pyx":985
 *     if tsyms == NULL:
 *       raise FstIOError("Read failed: {!r}".format(filename))
 *     return _init_SymbolTable(tsyms)             # <<<<<<<<<<<<<<
 * 
 *   @classmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = ((PyObject *)__pyx_f_9pywrapfst__init_SymbolTable(__pyx_v_tsyms)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 985, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":966
 * 
 *   @classmethod
 *   def read(cls, filename):             # <<<<<<<<<<<<<<
 *     """
 *     SymbolTable.read(filename)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("pywrapfst.SymbolTable.read", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":988
 * 
 *   @classmethod
 *   def read_text(cls, filename, bool allow_negative_labels=False):             # <<<<<<<<<<<<<<
 *     """
 *     SymbolTable.read_text(filename)
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_11SymbolTable_7read_text(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9pywrapfst_11SymbolTable_6read_text[] = "\n    SymbolTable.read_text(filename)\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      filename: 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\n    See also: `SymbolTable.read`, `SymbolTable.read_fst`.\n    ";
static PyObject *__pyx_pw_9pywrapfst_11SymbolTable_7read_text(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_filename = 0;
  bool __pyx_v_allow_negative_labels;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("read_text (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_filename,&__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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_filename)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__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, 988, __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_filename = 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, 988, __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, 988, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pywrapfst.SymbolTable.read_text", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pywrapfst_11SymbolTable_6read_text(((PyTypeObject*)__pyx_v_cls), __pyx_v_filename, __pyx_v_allow_negative_labels);

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

static PyObject *__pyx_pf_9pywrapfst_11SymbolTable_6read_text(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_filename, bool __pyx_v_allow_negative_labels) {
  std::unique_ptr<fst::SymbolTableTextOptions>  __pyx_v_opts;
  fst::SymbolTable *__pyx_v_tsyms;
  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;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("read_text", 0);

  /* "pywrapfst.pyx":1007
 *     """
 *     cdef unique_ptr[fst.SymbolTableTextOptions] opts
 *     opts.reset(new fst.SymbolTableTextOptions(allow_negative_labels))             # <<<<<<<<<<<<<<
 *     cdef fst.SymbolTable *tsyms = fst.SymbolTable.ReadText(tostring(filename),
 *                                                            deref(opts))
 */
  __pyx_v_opts.reset(new fst::SymbolTableTextOptions(__pyx_v_allow_negative_labels));

  /* "pywrapfst.pyx":1008
 *     cdef unique_ptr[fst.SymbolTableTextOptions] opts
 *     opts.reset(new fst.SymbolTableTextOptions(allow_negative_labels))
 *     cdef fst.SymbolTable *tsyms = fst.SymbolTable.ReadText(tostring(filename),             # <<<<<<<<<<<<<<
 *                                                            deref(opts))
 *     if tsyms == NULL:
 */
  __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_filename, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1008, __pyx_L1_error)

  /* "pywrapfst.pyx":1009
 *     opts.reset(new fst.SymbolTableTextOptions(allow_negative_labels))
 *     cdef fst.SymbolTable *tsyms = fst.SymbolTable.ReadText(tostring(filename),
 *                                                            deref(opts))             # <<<<<<<<<<<<<<
 *     if tsyms == NULL:
 *       raise FstIOError("Read failed: {!r}".format(filename))
 */
  __pyx_v_tsyms = fst::SymbolTable::ReadText(__pyx_t_1, (*__pyx_v_opts));

  /* "pywrapfst.pyx":1010
 *     cdef fst.SymbolTable *tsyms = fst.SymbolTable.ReadText(tostring(filename),
 *                                                            deref(opts))
 *     if tsyms == NULL:             # <<<<<<<<<<<<<<
 *       raise FstIOError("Read failed: {!r}".format(filename))
 *     return _init_SymbolTable(tsyms)
 */
  __pyx_t_2 = ((__pyx_v_tsyms == NULL) != 0);
  if (__pyx_t_2) {

    /* "pywrapfst.pyx":1011
 *                                                            deref(opts))
 *     if tsyms == NULL:
 *       raise FstIOError("Read failed: {!r}".format(filename))             # <<<<<<<<<<<<<<
 *     return _init_SymbolTable(tsyms)
 * 
 */
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIOError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1011, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Read_failed_r, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1011, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    if (!__pyx_t_7) {
      __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_filename); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1011, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_filename};
        __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1011, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_GOTREF(__pyx_t_5);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_filename};
        __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1011, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_GOTREF(__pyx_t_5);
      } else
      #endif
      {
        __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1011, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
        __Pyx_INCREF(__pyx_v_filename);
        __Pyx_GIVEREF(__pyx_v_filename);
        PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_v_filename);
        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1011, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (!__pyx_t_6) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1011, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1011, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1011, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      } else
      #endif
      {
        __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1011, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
        __Pyx_GIVEREF(__pyx_t_5);
        PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_5);
        __pyx_t_5 = 0;
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1011, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 1011, __pyx_L1_error)

    /* "pywrapfst.pyx":1010
 *     cdef fst.SymbolTable *tsyms = fst.SymbolTable.ReadText(tostring(filename),
 *                                                            deref(opts))
 *     if tsyms == NULL:             # <<<<<<<<<<<<<<
 *       raise FstIOError("Read failed: {!r}".format(filename))
 *     return _init_SymbolTable(tsyms)
 */
  }

  /* "pywrapfst.pyx":1012
 *     if tsyms == NULL:
 *       raise FstIOError("Read failed: {!r}".format(filename))
 *     return _init_SymbolTable(tsyms)             # <<<<<<<<<<<<<<
 * 
 *   @classmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = ((PyObject *)__pyx_f_9pywrapfst__init_SymbolTable(__pyx_v_tsyms)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1012, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":988
 * 
 *   @classmethod
 *   def read_text(cls, filename, bool allow_negative_labels=False):             # <<<<<<<<<<<<<<
 *     """
 *     SymbolTable.read_text(filename)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("pywrapfst.SymbolTable.read_text", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":1015
 * 
 *   @classmethod
 *   def read_fst(cls, filename, bool input_table):             # <<<<<<<<<<<<<<
 *     """
 *     SymbolTable.read_fst(filename, input_table)
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_11SymbolTable_9read_fst(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9pywrapfst_11SymbolTable_8read_fst[] = "\n    SymbolTable.read_fst(filename, 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      filename: 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\n    See also: `SymbolTable.read`, `SymbolTable.read_text`.\n    ";
static PyObject *__pyx_pw_9pywrapfst_11SymbolTable_9read_fst(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_filename = 0;
  bool __pyx_v_input_table;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("read_fst (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_filename,&__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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_filename)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_input_table)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("read_fst", 1, 2, 2, 1); __PYX_ERR(0, 1015, __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, 1015, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_filename = values[0];
    __pyx_v_input_table = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_input_table == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1015, __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, 1015, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pywrapfst.SymbolTable.read_fst", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pywrapfst_11SymbolTable_8read_fst(((PyTypeObject*)__pyx_v_cls), __pyx_v_filename, __pyx_v_input_table);

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

static PyObject *__pyx_pf_9pywrapfst_11SymbolTable_8read_fst(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_filename, bool __pyx_v_input_table) {
  fst::SymbolTable *__pyx_v_tsyms;
  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;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("read_fst", 0);

  /* "pywrapfst.pyx":1037
 *     See also: `SymbolTable.read`, `SymbolTable.read_text`.
 *     """
 *     cdef fst.SymbolTable *tsyms = fst.FstReadSymbols(filename, input_table)             # <<<<<<<<<<<<<<
 *     if tsyms == NULL:
 *       raise FstIOError("Read failed: {!r}".format(filename))
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_v_filename); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1037, __pyx_L1_error)
  __pyx_v_tsyms = fst::FstReadSymbols(__pyx_t_1, __pyx_v_input_table);

  /* "pywrapfst.pyx":1038
 *     """
 *     cdef fst.SymbolTable *tsyms = fst.FstReadSymbols(filename, input_table)
 *     if tsyms == NULL:             # <<<<<<<<<<<<<<
 *       raise FstIOError("Read failed: {!r}".format(filename))
 *     return _init_SymbolTable(tsyms)
 */
  __pyx_t_2 = ((__pyx_v_tsyms == NULL) != 0);
  if (__pyx_t_2) {

    /* "pywrapfst.pyx":1039
 *     cdef fst.SymbolTable *tsyms = fst.FstReadSymbols(filename, input_table)
 *     if tsyms == NULL:
 *       raise FstIOError("Read failed: {!r}".format(filename))             # <<<<<<<<<<<<<<
 *     return _init_SymbolTable(tsyms)
 * 
 */
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIOError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1039, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Read_failed_r, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1039, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    if (!__pyx_t_7) {
      __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_filename); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1039, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_filename};
        __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1039, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_GOTREF(__pyx_t_5);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_filename};
        __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1039, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_GOTREF(__pyx_t_5);
      } else
      #endif
      {
        __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1039, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
        __Pyx_INCREF(__pyx_v_filename);
        __Pyx_GIVEREF(__pyx_v_filename);
        PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_v_filename);
        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1039, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (!__pyx_t_6) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1039, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1039, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1039, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      } else
      #endif
      {
        __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1039, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
        __Pyx_GIVEREF(__pyx_t_5);
        PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_5);
        __pyx_t_5 = 0;
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1039, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 1039, __pyx_L1_error)

    /* "pywrapfst.pyx":1038
 *     """
 *     cdef fst.SymbolTable *tsyms = fst.FstReadSymbols(filename, input_table)
 *     if tsyms == NULL:             # <<<<<<<<<<<<<<
 *       raise FstIOError("Read failed: {!r}".format(filename))
 *     return _init_SymbolTable(tsyms)
 */
  }

  /* "pywrapfst.pyx":1040
 *     if tsyms == NULL:
 *       raise FstIOError("Read failed: {!r}".format(filename))
 *     return _init_SymbolTable(tsyms)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = ((PyObject *)__pyx_f_9pywrapfst__init_SymbolTable(__pyx_v_tsyms)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1040, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":1015
 * 
 *   @classmethod
 *   def read_fst(cls, filename, bool input_table):             # <<<<<<<<<<<<<<
 *     """
 *     SymbolTable.read_fst(filename, 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_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("pywrapfst.SymbolTable.read_fst", __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._smart_table,self._table cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_11SymbolTable_11__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_9pywrapfst_11SymbolTable_11__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_9pywrapfst_11SymbolTable_10__reduce_cython__(((struct __pyx_obj_9pywrapfst_SymbolTable *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_11SymbolTable_10__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9pywrapfst_SymbolTable *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self._smart_table,self._table cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self._smart_table,self._table cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__18, 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._smart_table,self._table 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("pywrapfst.SymbolTable.__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._smart_table,self._table cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self._smart_table,self._table cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_11SymbolTable_13__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static PyObject *__pyx_pw_9pywrapfst_11SymbolTable_13__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_9pywrapfst_11SymbolTable_12__setstate_cython__(((struct __pyx_obj_9pywrapfst_SymbolTable *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

static PyObject *__pyx_pf_9pywrapfst_11SymbolTable_12__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_9pywrapfst_SymbolTable *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self._smart_table,self._table cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self._smart_table,self._table cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__19, 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._smart_table,self._table cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self._smart_table,self._table cannot be converted to a Python object for pickling")
 */

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

/* "pywrapfst.pyx":1043
 * 
 * 
 * cdef _EncodeMapperSymbolTable _init_EncodeMapperSymbolTable(             # <<<<<<<<<<<<<<
 *     fst.SymbolTable *table, shared_ptr[fst.EncodeMapperClass] encoder):
 *   cdef _EncodeMapperSymbolTable result = (
 */

static struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTable *__pyx_f_9pywrapfst__init_EncodeMapperSymbolTable(fst::SymbolTable *__pyx_v_table, std::shared_ptr<fst::script::EncodeMapperClass>  __pyx_v_encoder) {
  struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTable *__pyx_v_result = 0;
  struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTable *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("_init_EncodeMapperSymbolTable", 0);

  /* "pywrapfst.pyx":1046
 *     fst.SymbolTable *table, shared_ptr[fst.EncodeMapperClass] encoder):
 *   cdef _EncodeMapperSymbolTable result = (
 *       _EncodeMapperSymbolTable.__new__(_EncodeMapperSymbolTable))             # <<<<<<<<<<<<<<
 *   result._table = table
 *   result._encoder = encoder
 */
  __pyx_t_1 = __pyx_tp_new_9pywrapfst__EncodeMapperSymbolTable(((PyTypeObject *)__pyx_ptype_9pywrapfst__EncodeMapperSymbolTable), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1046, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_9pywrapfst__EncodeMapperSymbolTable)))) __PYX_ERR(0, 1046, __pyx_L1_error)
  __pyx_v_result = ((struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTable *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pywrapfst.pyx":1047
 *   cdef _EncodeMapperSymbolTable result = (
 *       _EncodeMapperSymbolTable.__new__(_EncodeMapperSymbolTable))
 *   result._table = table             # <<<<<<<<<<<<<<
 *   result._encoder = encoder
 *   return result
 */
  if (unlikely(((PyObject *)__pyx_v_result) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_table");
    __PYX_ERR(0, 1047, __pyx_L1_error)
  }
  __pyx_v_result->__pyx_base._table = __pyx_v_table;

  /* "pywrapfst.pyx":1048
 *       _EncodeMapperSymbolTable.__new__(_EncodeMapperSymbolTable))
 *   result._table = table
 *   result._encoder = encoder             # <<<<<<<<<<<<<<
 *   return result
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_result) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_encoder");
    __PYX_ERR(0, 1048, __pyx_L1_error)
  }
  __pyx_v_result->_encoder = __pyx_v_encoder;

  /* "pywrapfst.pyx":1049
 *   result._table = table
 *   result._encoder = encoder
 *   return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "pywrapfst.pyx":1043
 * 
 * 
 * cdef _EncodeMapperSymbolTable _init_EncodeMapperSymbolTable(             # <<<<<<<<<<<<<<
 *     fst.SymbolTable *table, shared_ptr[fst.EncodeMapperClass] encoder):
 *   cdef _EncodeMapperSymbolTable result = (
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pywrapfst._init_EncodeMapperSymbolTable", __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;
}

/* "pywrapfst.pyx":1052
 * 
 * 
 * cdef _FstSymbolTable _init_FstSymbolTable(fst.SymbolTable *table,             # <<<<<<<<<<<<<<
 *                                           shared_ptr[fst.FstClass] ifst):
 *   cdef _FstSymbolTable result = _FstSymbolTable.__new__(_FstSymbolTable)
 */

static struct __pyx_obj_9pywrapfst__FstSymbolTable *__pyx_f_9pywrapfst__init_FstSymbolTable(fst::SymbolTable *__pyx_v_table, std::shared_ptr<fst::script::FstClass>  __pyx_v_ifst) {
  struct __pyx_obj_9pywrapfst__FstSymbolTable *__pyx_v_result = 0;
  struct __pyx_obj_9pywrapfst__FstSymbolTable *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("_init_FstSymbolTable", 0);

  /* "pywrapfst.pyx":1054
 * cdef _FstSymbolTable _init_FstSymbolTable(fst.SymbolTable *table,
 *                                           shared_ptr[fst.FstClass] ifst):
 *   cdef _FstSymbolTable result = _FstSymbolTable.__new__(_FstSymbolTable)             # <<<<<<<<<<<<<<
 *   result._table = table
 *   result._fst = ifst
 */
  __pyx_t_1 = __pyx_tp_new_9pywrapfst__FstSymbolTable(((PyTypeObject *)__pyx_ptype_9pywrapfst__FstSymbolTable), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1054, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_9pywrapfst__FstSymbolTable)))) __PYX_ERR(0, 1054, __pyx_L1_error)
  __pyx_v_result = ((struct __pyx_obj_9pywrapfst__FstSymbolTable *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pywrapfst.pyx":1055
 *                                           shared_ptr[fst.FstClass] ifst):
 *   cdef _FstSymbolTable result = _FstSymbolTable.__new__(_FstSymbolTable)
 *   result._table = table             # <<<<<<<<<<<<<<
 *   result._fst = ifst
 *   return result
 */
  if (unlikely(((PyObject *)__pyx_v_result) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_table");
    __PYX_ERR(0, 1055, __pyx_L1_error)
  }
  __pyx_v_result->__pyx_base._table = __pyx_v_table;

  /* "pywrapfst.pyx":1056
 *   cdef _FstSymbolTable result = _FstSymbolTable.__new__(_FstSymbolTable)
 *   result._table = table
 *   result._fst = ifst             # <<<<<<<<<<<<<<
 *   return result
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_result) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 1056, __pyx_L1_error)
  }
  __pyx_v_result->_fst = __pyx_v_ifst;

  /* "pywrapfst.pyx":1057
 *   result._table = table
 *   result._fst = ifst
 *   return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "pywrapfst.pyx":1052
 * 
 * 
 * cdef _FstSymbolTable _init_FstSymbolTable(fst.SymbolTable *table,             # <<<<<<<<<<<<<<
 *                                           shared_ptr[fst.FstClass] ifst):
 *   cdef _FstSymbolTable result = _FstSymbolTable.__new__(_FstSymbolTable)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pywrapfst._init_FstSymbolTable", __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;
}

/* "pywrapfst.pyx":1060
 * 
 * 
 * cdef _MutableFstSymbolTable _init_MutableFstSymbolTable(fst.SymbolTable *table,             # <<<<<<<<<<<<<<
 *     shared_ptr[fst.MutableFstClass] ifst):
 *   cdef _MutableFstSymbolTable result = (
 */

static struct __pyx_obj_9pywrapfst__MutableFstSymbolTable *__pyx_f_9pywrapfst__init_MutableFstSymbolTable(fst::SymbolTable *__pyx_v_table, std::shared_ptr<fst::script::MutableFstClass>  __pyx_v_ifst) {
  struct __pyx_obj_9pywrapfst__MutableFstSymbolTable *__pyx_v_result = 0;
  struct __pyx_obj_9pywrapfst__MutableFstSymbolTable *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("_init_MutableFstSymbolTable", 0);

  /* "pywrapfst.pyx":1063
 *     shared_ptr[fst.MutableFstClass] ifst):
 *   cdef _MutableFstSymbolTable result = (
 *       _MutableFstSymbolTable.__new__(_MutableFstSymbolTable))             # <<<<<<<<<<<<<<
 *   result._table = table
 *   result._mfst = ifst
 */
  __pyx_t_1 = __pyx_tp_new_9pywrapfst__MutableFstSymbolTable(((PyTypeObject *)__pyx_ptype_9pywrapfst__MutableFstSymbolTable), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1063, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_9pywrapfst__MutableFstSymbolTable)))) __PYX_ERR(0, 1063, __pyx_L1_error)
  __pyx_v_result = ((struct __pyx_obj_9pywrapfst__MutableFstSymbolTable *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pywrapfst.pyx":1064
 *   cdef _MutableFstSymbolTable result = (
 *       _MutableFstSymbolTable.__new__(_MutableFstSymbolTable))
 *   result._table = table             # <<<<<<<<<<<<<<
 *   result._mfst = ifst
 *   return result
 */
  if (unlikely(((PyObject *)__pyx_v_result) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_table");
    __PYX_ERR(0, 1064, __pyx_L1_error)
  }
  __pyx_v_result->__pyx_base.__pyx_base._table = __pyx_v_table;

  /* "pywrapfst.pyx":1065
 *       _MutableFstSymbolTable.__new__(_MutableFstSymbolTable))
 *   result._table = table
 *   result._mfst = ifst             # <<<<<<<<<<<<<<
 *   return result
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_result) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
    __PYX_ERR(0, 1065, __pyx_L1_error)
  }
  __pyx_v_result->_mfst = __pyx_v_ifst;

  /* "pywrapfst.pyx":1066
 *   result._table = table
 *   result._mfst = ifst
 *   return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "pywrapfst.pyx":1060
 * 
 * 
 * cdef _MutableFstSymbolTable _init_MutableFstSymbolTable(fst.SymbolTable *table,             # <<<<<<<<<<<<<<
 *     shared_ptr[fst.MutableFstClass] ifst):
 *   cdef _MutableFstSymbolTable result = (
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pywrapfst._init_MutableFstSymbolTable", __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;
}

/* "pywrapfst.pyx":1069
 * 
 * 
 * cdef SymbolTable _init_SymbolTable(fst.SymbolTable *table):             # <<<<<<<<<<<<<<
 *   cdef SymbolTable result = SymbolTable.__new__(SymbolTable)
 *   result._table = table
 */

static struct __pyx_obj_9pywrapfst_SymbolTable *__pyx_f_9pywrapfst__init_SymbolTable(fst::SymbolTable *__pyx_v_table) {
  struct __pyx_obj_9pywrapfst_SymbolTable *__pyx_v_result = 0;
  struct __pyx_obj_9pywrapfst_SymbolTable *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("_init_SymbolTable", 0);

  /* "pywrapfst.pyx":1070
 * 
 * cdef SymbolTable _init_SymbolTable(fst.SymbolTable *table):
 *   cdef SymbolTable result = SymbolTable.__new__(SymbolTable)             # <<<<<<<<<<<<<<
 *   result._table = table
 *   return result
 */
  __pyx_t_1 = __pyx_tp_new_9pywrapfst_SymbolTable(((PyTypeObject *)__pyx_ptype_9pywrapfst_SymbolTable), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1070, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_9pywrapfst_SymbolTable)))) __PYX_ERR(0, 1070, __pyx_L1_error)
  __pyx_v_result = ((struct __pyx_obj_9pywrapfst_SymbolTable *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pywrapfst.pyx":1071
 * cdef SymbolTable _init_SymbolTable(fst.SymbolTable *table):
 *   cdef SymbolTable result = SymbolTable.__new__(SymbolTable)
 *   result._table = table             # <<<<<<<<<<<<<<
 *   return result
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_result) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_table");
    __PYX_ERR(0, 1071, __pyx_L1_error)
  }
  __pyx_v_result->__pyx_base.__pyx_base._table = __pyx_v_table;

  /* "pywrapfst.pyx":1072
 *   cdef SymbolTable result = SymbolTable.__new__(SymbolTable)
 *   result._table = table
 *   return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "pywrapfst.pyx":1069
 * 
 * 
 * cdef SymbolTable _init_SymbolTable(fst.SymbolTable *table):             # <<<<<<<<<<<<<<
 *   cdef SymbolTable result = SymbolTable.__new__(SymbolTable)
 *   result._table = table
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pywrapfst._init_SymbolTable", __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;
}

/* "pywrapfst.pyx":1078
 * 
 * 
 * cpdef SymbolTable compact_symbol_table(_SymbolTable syms):             # <<<<<<<<<<<<<<
 *   """
 *   compact_symbol_table(syms)
 */

static PyObject *__pyx_pw_9pywrapfst_9compact_symbol_table(PyObject *__pyx_self, PyObject *__pyx_v_syms); /*proto*/
static struct __pyx_obj_9pywrapfst_SymbolTable *__pyx_f_9pywrapfst_compact_symbol_table(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_syms, CYTHON_UNUSED int __pyx_skip_dispatch) {
  struct __pyx_obj_9pywrapfst_SymbolTable *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("compact_symbol_table", 0);

  /* "pywrapfst.pyx":1090
 *     A new compacted SymbolTable.
 *   """
 *   return _init_SymbolTable(fst.CompactSymbolTable(deref(syms._table)))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  if (unlikely(((PyObject *)__pyx_v_syms) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_table");
    __PYX_ERR(0, 1090, __pyx_L1_error)
  }
  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_SymbolTable(fst::CompactSymbolTable((*__pyx_v_syms->_table)))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1090, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_9pywrapfst_SymbolTable *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":1078
 * 
 * 
 * cpdef SymbolTable compact_symbol_table(_SymbolTable syms):             # <<<<<<<<<<<<<<
 *   """
 *   compact_symbol_table(syms)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("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_9pywrapfst_9compact_symbol_table(PyObject *__pyx_self, PyObject *__pyx_v_syms); /*proto*/
static char __pyx_doc_9pywrapfst_8compact_symbol_table[] = "\n  compact_symbol_table(syms)\n\n  Constructively relabels a SymbolTable to make it a contiguous mapping.\n\n  Args:\n    syms: Input SymbolTable.\n\n  Returns:\n    A new compacted SymbolTable.\n  ";
static PyObject *__pyx_pw_9pywrapfst_9compact_symbol_table(PyObject *__pyx_self, PyObject *__pyx_v_syms) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("compact_symbol_table (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_syms), __pyx_ptype_9pywrapfst__SymbolTable, 1, "syms", 0))) __PYX_ERR(0, 1078, __pyx_L1_error)
  __pyx_r = __pyx_pf_9pywrapfst_8compact_symbol_table(__pyx_self, ((struct __pyx_obj_9pywrapfst__SymbolTable *)__pyx_v_syms));

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

static PyObject *__pyx_pf_9pywrapfst_8compact_symbol_table(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_syms) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("compact_symbol_table", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_compact_symbol_table(__pyx_v_syms, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1078, __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("pywrapfst.compact_symbol_table", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":1093
 * 
 * 
 * cpdef SymbolTable merge_symbol_table(_SymbolTable lhs, _SymbolTable rhs):             # <<<<<<<<<<<<<<
 *   """
 *   merge_symbol_table(lhs, rhs)
 */

static PyObject *__pyx_pw_9pywrapfst_11merge_symbol_table(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_9pywrapfst_SymbolTable *__pyx_f_9pywrapfst_merge_symbol_table(struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_lhs, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_rhs, CYTHON_UNUSED int __pyx_skip_dispatch) {
  struct __pyx_obj_9pywrapfst_SymbolTable *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("merge_symbol_table", 0);

  /* "pywrapfst.pyx":1117
 *   See also: `relabel_symbols`.
 *   """
 *   return _init_SymbolTable(fst.MergeSymbolTable(deref(lhs._table),             # <<<<<<<<<<<<<<
 *                                                 deref(rhs._table), NULL))
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  if (unlikely(((PyObject *)__pyx_v_lhs) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_table");
    __PYX_ERR(0, 1117, __pyx_L1_error)
  }

  /* "pywrapfst.pyx":1118
 *   """
 *   return _init_SymbolTable(fst.MergeSymbolTable(deref(lhs._table),
 *                                                 deref(rhs._table), NULL))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_rhs) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_table");
    __PYX_ERR(0, 1118, __pyx_L1_error)
  }

  /* "pywrapfst.pyx":1117
 *   See also: `relabel_symbols`.
 *   """
 *   return _init_SymbolTable(fst.MergeSymbolTable(deref(lhs._table),             # <<<<<<<<<<<<<<
 *                                                 deref(rhs._table), NULL))
 * 
 */
  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_SymbolTable(fst::MergeSymbolTable((*__pyx_v_lhs->_table), (*__pyx_v_rhs->_table), NULL))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_9pywrapfst_SymbolTable *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":1093
 * 
 * 
 * cpdef SymbolTable merge_symbol_table(_SymbolTable lhs, _SymbolTable rhs):             # <<<<<<<<<<<<<<
 *   """
 *   merge_symbol_table(lhs, rhs)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("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_9pywrapfst_11merge_symbol_table(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9pywrapfst_10merge_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\n  See also: `relabel_symbols`.\n  ";
static PyObject *__pyx_pw_9pywrapfst_11merge_symbol_table(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_lhs = 0;
  struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_rhs = 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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_lhs)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rhs)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("merge_symbol_table", 1, 2, 2, 1); __PYX_ERR(0, 1093, __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, 1093, __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_9pywrapfst__SymbolTable *)values[0]);
    __pyx_v_rhs = ((struct __pyx_obj_9pywrapfst__SymbolTable *)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, 1093, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("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_9pywrapfst__SymbolTable, 1, "lhs", 0))) __PYX_ERR(0, 1093, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rhs), __pyx_ptype_9pywrapfst__SymbolTable, 1, "rhs", 0))) __PYX_ERR(0, 1093, __pyx_L1_error)
  __pyx_r = __pyx_pf_9pywrapfst_10merge_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_9pywrapfst_10merge_symbol_table(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_lhs, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_rhs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("merge_symbol_table", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_merge_symbol_table(__pyx_v_lhs, __pyx_v_rhs, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1093, __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("pywrapfst.merge_symbol_table", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":1132
 *   """
 * 
 *   def __repr__(self):             # <<<<<<<<<<<<<<
 *     return "<SymbolTableIterator at 0x{:x}>".format(id(self))
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_19SymbolTableIterator_1__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9pywrapfst_19SymbolTableIterator_1__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9pywrapfst_19SymbolTableIterator___repr__(((struct __pyx_obj_9pywrapfst_SymbolTableIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_19SymbolTableIterator___repr__(struct __pyx_obj_9pywrapfst_SymbolTableIterator *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "pywrapfst.pyx":1133
 * 
 *   def __repr__(self):
 *     return "<SymbolTableIterator at 0x{:x}>".format(id(self))             # <<<<<<<<<<<<<<
 * 
 *   def __init__(self, _SymbolTable syms):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_SymbolTableIterator_at_0x_x, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1133, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1133, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1133, __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 && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1133, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_4};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1133, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_4};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1133, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else
    #endif
    {
      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1133, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1133, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":1132
 *   """
 * 
 *   def __repr__(self):             # <<<<<<<<<<<<<<
 *     return "<SymbolTableIterator at 0x{:x}>".format(id(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_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pywrapfst.SymbolTableIterator.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":1135
 *     return "<SymbolTableIterator at 0x{:x}>".format(id(self))
 * 
 *   def __init__(self, _SymbolTable syms):             # <<<<<<<<<<<<<<
 *     self._siter.reset(new fst.SymbolTableIterator(deref(syms._table)))
 * 
 */

/* Python wrapper */
static int __pyx_pw_9pywrapfst_19SymbolTableIterator_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_9pywrapfst_19SymbolTableIterator_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_syms = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_syms,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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_syms)) != 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, 1135, __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_syms = ((struct __pyx_obj_9pywrapfst__SymbolTable *)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, 1135, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("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_syms), __pyx_ptype_9pywrapfst__SymbolTable, 1, "syms", 0))) __PYX_ERR(0, 1135, __pyx_L1_error)
  __pyx_r = __pyx_pf_9pywrapfst_19SymbolTableIterator_2__init__(((struct __pyx_obj_9pywrapfst_SymbolTableIterator *)__pyx_v_self), __pyx_v_syms);

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

static int __pyx_pf_9pywrapfst_19SymbolTableIterator_2__init__(struct __pyx_obj_9pywrapfst_SymbolTableIterator *__pyx_v_self, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_syms) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pywrapfst.pyx":1136
 * 
 *   def __init__(self, _SymbolTable syms):
 *     self._siter.reset(new fst.SymbolTableIterator(deref(syms._table)))             # <<<<<<<<<<<<<<
 * 
 *   # 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, 1136, __pyx_L1_error)
  }
  if (unlikely(((PyObject *)__pyx_v_syms) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_table");
    __PYX_ERR(0, 1136, __pyx_L1_error)
  }
  __pyx_v_self->_siter.reset(new fst::SymbolTableIterator((*__pyx_v_syms->_table)));

  /* "pywrapfst.pyx":1135
 *     return "<SymbolTableIterator at 0x{:x}>".format(id(self))
 * 
 *   def __init__(self, _SymbolTable syms):             # <<<<<<<<<<<<<<
 *     self._siter.reset(new fst.SymbolTableIterator(deref(syms._table)))
 * 
 */

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

/* "pywrapfst.pyx":1139
 * 
 *   # This just registers this class as a possible iterator.
 *   def __iter__(self):             # <<<<<<<<<<<<<<
 *     return self
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_19SymbolTableIterator_5__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9pywrapfst_19SymbolTableIterator_5__iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9pywrapfst_19SymbolTableIterator_4__iter__(((struct __pyx_obj_9pywrapfst_SymbolTableIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_19SymbolTableIterator_4__iter__(struct __pyx_obj_9pywrapfst_SymbolTableIterator *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);

  /* "pywrapfst.pyx":1140
 *   # 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;

  /* "pywrapfst.pyx":1139
 * 
 *   # 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;
}

/* "pywrapfst.pyx":1143
 * 
 *   # 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_9pywrapfst_19SymbolTableIterator_7__next__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9pywrapfst_19SymbolTableIterator_7__next__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__next__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9pywrapfst_19SymbolTableIterator_6__next__(((struct __pyx_obj_9pywrapfst_SymbolTableIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_19SymbolTableIterator_6__next__(struct __pyx_obj_9pywrapfst_SymbolTableIterator *__pyx_v_self) {
  __pyx_t_10basictypes_int64 __pyx_v_value;
  std::string __pyx_v_symbol;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__next__", 0);

  /* "pywrapfst.pyx":1144
 *   # Magic method used to get a Pythonic API out of the C++ API.
 *   def __next__(self):
 *     if self.done():             # <<<<<<<<<<<<<<
 *       raise StopIteration
 *     cdef int64 value = self.value()
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "done");
    __PYX_ERR(0, 1144, __pyx_L1_error)
  }
  __pyx_t_1 = (((struct __pyx_vtabstruct_9pywrapfst_SymbolTableIterator *)__pyx_v_self->__pyx_vtab)->done(__pyx_v_self, 0) != 0);
  if (__pyx_t_1) {

    /* "pywrapfst.pyx":1145
 *   def __next__(self):
 *     if self.done():
 *       raise StopIteration             # <<<<<<<<<<<<<<
 *     cdef int64 value = self.value()
 *     cdef string symbol = self.symbol()
 */
    __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
    __PYX_ERR(0, 1145, __pyx_L1_error)

    /* "pywrapfst.pyx":1144
 *   # Magic method used to get a Pythonic API out of the C++ API.
 *   def __next__(self):
 *     if self.done():             # <<<<<<<<<<<<<<
 *       raise StopIteration
 *     cdef int64 value = self.value()
 */
  }

  /* "pywrapfst.pyx":1146
 *     if self.done():
 *       raise StopIteration
 *     cdef int64 value = self.value()             # <<<<<<<<<<<<<<
 *     cdef string symbol = self.symbol()
 *     self.next()
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "value");
    __PYX_ERR(0, 1146, __pyx_L1_error)
  }
  __pyx_v_value = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableIterator *)__pyx_v_self->__pyx_vtab)->value(__pyx_v_self, 0);

  /* "pywrapfst.pyx":1147
 *       raise StopIteration
 *     cdef int64 value = self.value()
 *     cdef string symbol = self.symbol()             # <<<<<<<<<<<<<<
 *     self.next()
 *     return (value, symbol)
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "symbol");
    __PYX_ERR(0, 1147, __pyx_L1_error)
  }
  __pyx_v_symbol = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableIterator *)__pyx_v_self->__pyx_vtab)->symbol(__pyx_v_self, 0);

  /* "pywrapfst.pyx":1148
 *     cdef int64 value = self.value()
 *     cdef string symbol = self.symbol()
 *     self.next()             # <<<<<<<<<<<<<<
 *     return (value, symbol)
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "next");
    __PYX_ERR(0, 1148, __pyx_L1_error)
  }
  ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableIterator *)__pyx_v_self->__pyx_vtab)->next(__pyx_v_self, 0);

  /* "pywrapfst.pyx":1149
 *     cdef string symbol = self.symbol()
 *     self.next()
 *     return (value, symbol)             # <<<<<<<<<<<<<<
 * 
 *   cpdef bool done(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1149, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_symbol); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1149, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1149, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":1143
 * 
 *   # 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_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pywrapfst.SymbolTableIterator.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":1151
 *     return (value, symbol)
 * 
 *   cpdef bool done(self):             # <<<<<<<<<<<<<<
 *     """
 *     done(self)
 */

static PyObject *__pyx_pw_9pywrapfst_19SymbolTableIterator_9done(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static bool __pyx_f_9pywrapfst_19SymbolTableIterator_done(struct __pyx_obj_9pywrapfst_SymbolTableIterator *__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;
  __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)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_done); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1151, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_19SymbolTableIterator_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);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1151, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1151, __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, 1151, __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;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pywrapfst.pyx":1160
 *       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, 1160, __pyx_L1_error)
  }
  __pyx_r = __pyx_v_self->_siter.get()->Done();
  goto __pyx_L0;

  /* "pywrapfst.pyx":1151
 *     return (value, symbol)
 * 
 *   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("pywrapfst.SymbolTableIterator.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_9pywrapfst_19SymbolTableIterator_9done(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_9pywrapfst_19SymbolTableIterator_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_9pywrapfst_19SymbolTableIterator_9done(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("done (wrapper)", 0);
  __pyx_r = __pyx_pf_9pywrapfst_19SymbolTableIterator_8done(((struct __pyx_obj_9pywrapfst_SymbolTableIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_19SymbolTableIterator_8done(struct __pyx_obj_9pywrapfst_SymbolTableIterator *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("done", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_9pywrapfst_19SymbolTableIterator_done(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1151, __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("pywrapfst.SymbolTableIterator.done", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":1162
 *     return self._siter.get().Done()
 * 
 *   cpdef void next(self):             # <<<<<<<<<<<<<<
 *     """
 *     next(self)
 */

static PyObject *__pyx_pw_9pywrapfst_19SymbolTableIterator_11next(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static void __pyx_f_9pywrapfst_19SymbolTableIterator_next(struct __pyx_obj_9pywrapfst_SymbolTableIterator *__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;
  __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)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_next); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1162, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_19SymbolTableIterator_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);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1162, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1162, __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;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pywrapfst.pyx":1168
 *     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, 1168, __pyx_L1_error)
  }
  __pyx_v_self->_siter.get()->Next();

  /* "pywrapfst.pyx":1162
 *     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("pywrapfst.SymbolTableIterator.next", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_19SymbolTableIterator_11next(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_9pywrapfst_19SymbolTableIterator_10next[] = "\n    next(self)\n\n    Advances the iterator.\n    ";
static PyObject *__pyx_pw_9pywrapfst_19SymbolTableIterator_11next(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("next (wrapper)", 0);
  __pyx_r = __pyx_pf_9pywrapfst_19SymbolTableIterator_10next(((struct __pyx_obj_9pywrapfst_SymbolTableIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_19SymbolTableIterator_10next(struct __pyx_obj_9pywrapfst_SymbolTableIterator *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("next", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_9pywrapfst_19SymbolTableIterator_next(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1162, __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("pywrapfst.SymbolTableIterator.next", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":1170
 *     self._siter.get().Next()
 * 
 *   cpdef void reset(self):             # <<<<<<<<<<<<<<
 *     """
 *     reset(self)
 */

static PyObject *__pyx_pw_9pywrapfst_19SymbolTableIterator_13reset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static void __pyx_f_9pywrapfst_19SymbolTableIterator_reset(struct __pyx_obj_9pywrapfst_SymbolTableIterator *__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;
  __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)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1170, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_19SymbolTableIterator_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);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1170, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1170, __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;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pywrapfst.pyx":1176
 *     Resets the iterator to the initial position.
 *     """
 *     self._siter.get().Reset()             # <<<<<<<<<<<<<<
 * 
 *   cpdef string symbol(self):
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_siter");
    __PYX_ERR(0, 1176, __pyx_L1_error)
  }
  __pyx_v_self->_siter.get()->Reset();

  /* "pywrapfst.pyx":1170
 *     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("pywrapfst.SymbolTableIterator.reset", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_19SymbolTableIterator_13reset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_9pywrapfst_19SymbolTableIterator_12reset[] = "\n    reset(self)\n\n    Resets the iterator to the initial position.\n    ";
static PyObject *__pyx_pw_9pywrapfst_19SymbolTableIterator_13reset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("reset (wrapper)", 0);
  __pyx_r = __pyx_pf_9pywrapfst_19SymbolTableIterator_12reset(((struct __pyx_obj_9pywrapfst_SymbolTableIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_19SymbolTableIterator_12reset(struct __pyx_obj_9pywrapfst_SymbolTableIterator *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("reset", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_9pywrapfst_19SymbolTableIterator_reset(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1170, __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("pywrapfst.SymbolTableIterator.reset", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":1178
 *     self._siter.get().Reset()
 * 
 *   cpdef string symbol(self):             # <<<<<<<<<<<<<<
 *     """
 *     symbol(self)
 */

static PyObject *__pyx_pw_9pywrapfst_19SymbolTableIterator_15symbol(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static std::string __pyx_f_9pywrapfst_19SymbolTableIterator_symbol(struct __pyx_obj_9pywrapfst_SymbolTableIterator *__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;
  __Pyx_RefNannySetupContext("symbol", 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)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_symbol); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1178, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_19SymbolTableIterator_15symbol)) {
      __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);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1178, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1178, __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, 1178, __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;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pywrapfst.pyx":1189
 *       A symbol string.
 *     """
 *     return self._siter.get().Symbol()             # <<<<<<<<<<<<<<
 * 
 *   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, 1189, __pyx_L1_error)
  }
  __pyx_r = __pyx_v_self->_siter.get()->Symbol();
  goto __pyx_L0;

  /* "pywrapfst.pyx":1178
 *     self._siter.get().Reset()
 * 
 *   cpdef string symbol(self):             # <<<<<<<<<<<<<<
 *     """
 *     symbol(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("pywrapfst.SymbolTableIterator.symbol", __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_9pywrapfst_19SymbolTableIterator_15symbol(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_9pywrapfst_19SymbolTableIterator_14symbol[] = "\n    symbol(self)\n\n    Returns the current symbol string.\n\n    This method returns the current symbol string at this point in the table.\n\n    Returns:\n      A symbol string.\n    ";
static PyObject *__pyx_pw_9pywrapfst_19SymbolTableIterator_15symbol(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("symbol (wrapper)", 0);
  __pyx_r = __pyx_pf_9pywrapfst_19SymbolTableIterator_14symbol(((struct __pyx_obj_9pywrapfst_SymbolTableIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_19SymbolTableIterator_14symbol(struct __pyx_obj_9pywrapfst_SymbolTableIterator *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("symbol", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_f_9pywrapfst_19SymbolTableIterator_symbol(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1178, __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("pywrapfst.SymbolTableIterator.symbol", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":1191
 *     return self._siter.get().Symbol()
 * 
 *   cpdef int64 value(self):             # <<<<<<<<<<<<<<
 *     """
 *     value(self)
 */

static PyObject *__pyx_pw_9pywrapfst_19SymbolTableIterator_17value(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static __pyx_t_10basictypes_int64 __pyx_f_9pywrapfst_19SymbolTableIterator_value(struct __pyx_obj_9pywrapfst_SymbolTableIterator *__pyx_v_self, int __pyx_skip_dispatch) {
  __pyx_t_10basictypes_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;
  __pyx_t_10basictypes_int64 __pyx_t_5;
  __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)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1191, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_19SymbolTableIterator_17value)) {
      __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);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1191, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1191, __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_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1191, __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;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pywrapfst.pyx":1200
 *       An integer 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, 1200, __pyx_L1_error)
  }
  __pyx_r = __pyx_v_self->_siter.get()->Value();
  goto __pyx_L0;

  /* "pywrapfst.pyx":1191
 *     return self._siter.get().Symbol()
 * 
 *   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("pywrapfst.SymbolTableIterator.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_9pywrapfst_19SymbolTableIterator_17value(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_9pywrapfst_19SymbolTableIterator_16value[] = "\n    value(self)\n\n    Returns the current integer index of the symbol.\n\n    Returns:\n      An integer index.\n    ";
static PyObject *__pyx_pw_9pywrapfst_19SymbolTableIterator_17value(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("value (wrapper)", 0);
  __pyx_r = __pyx_pf_9pywrapfst_19SymbolTableIterator_16value(((struct __pyx_obj_9pywrapfst_SymbolTableIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_19SymbolTableIterator_16value(struct __pyx_obj_9pywrapfst_SymbolTableIterator *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("value", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_f_9pywrapfst_19SymbolTableIterator_value(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1191, __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("pywrapfst.SymbolTableIterator.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._siter,self._table cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_19SymbolTableIterator_19__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_9pywrapfst_19SymbolTableIterator_19__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_9pywrapfst_19SymbolTableIterator_18__reduce_cython__(((struct __pyx_obj_9pywrapfst_SymbolTableIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_19SymbolTableIterator_18__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9pywrapfst_SymbolTableIterator *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self._siter,self._table cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self._siter,self._table cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__20, 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,self._table 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("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,self._table cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self._siter,self._table cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_19SymbolTableIterator_21__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static PyObject *__pyx_pw_9pywrapfst_19SymbolTableIterator_21__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_9pywrapfst_19SymbolTableIterator_20__setstate_cython__(((struct __pyx_obj_9pywrapfst_SymbolTableIterator *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

static PyObject *__pyx_pf_9pywrapfst_19SymbolTableIterator_20__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_9pywrapfst_SymbolTableIterator *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self._siter,self._table cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self._siter,self._table cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__21, 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,self._table cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self._siter,self._table cannot be converted to a Python object for pickling")
 */

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

/* "pywrapfst.pyx":1229
 *   """
 * 
 *   def __repr__(self):             # <<<<<<<<<<<<<<
 *     return "<EncodeMapper at 0x{:x}>".format(id(self))
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_12EncodeMapper_1__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9pywrapfst_12EncodeMapper_1__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9pywrapfst_12EncodeMapper___repr__(((struct __pyx_obj_9pywrapfst_EncodeMapper *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_12EncodeMapper___repr__(struct __pyx_obj_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;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "pywrapfst.pyx":1230
 * 
 *   def __repr__(self):
 *     return "<EncodeMapper at 0x{:x}>".format(id(self))             # <<<<<<<<<<<<<<
 * 
 *   def __init__(self,
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_EncodeMapper_at_0x_x, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1230, __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 && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1230, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_4};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1230, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_4};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1230, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else
    #endif
    {
      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1230, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1230, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":1229
 *   """
 * 
 *   def __repr__(self):             # <<<<<<<<<<<<<<
 *     return "<EncodeMapper at 0x{:x}>".format(id(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_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pywrapfst.EncodeMapper.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":1232
 *     return "<EncodeMapper at 0x{:x}>".format(id(self))
 * 
 *   def __init__(self,             # <<<<<<<<<<<<<<
 *                arc_type=b"standard",
 *                bool encode_labels=False,
 */

/* Python wrapper */
static int __pyx_pw_9pywrapfst_12EncodeMapper_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_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_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_b_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 = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arc_type);
          if (value) { values[0] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_encode_labels);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__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, 1232, __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, 1234, __pyx_L3_error)
    } else {

      /* "pywrapfst.pyx":1234
 *   def __init__(self,
 *                arc_type=b"standard",
 *                bool encode_labels=False,             # <<<<<<<<<<<<<<
 *                bool encode_weights=False):
 *     cdef uint32 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, 1235, __pyx_L3_error)
    } else {

      /* "pywrapfst.pyx":1235
 *                arc_type=b"standard",
 *                bool encode_labels=False,
 *                bool encode_weights=False):             # <<<<<<<<<<<<<<
 *     cdef uint32 flags = fst.GetEncodeFlags(encode_labels, encode_weights)
 *     self._encoder.reset(new fst.EncodeMapperClass(tostring(arc_type), flags,
 */
      __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, 1232, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pywrapfst.EncodeMapper.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pywrapfst_12EncodeMapper_2__init__(((struct __pyx_obj_9pywrapfst_EncodeMapper *)__pyx_v_self), __pyx_v_arc_type, __pyx_v_encode_labels, __pyx_v_encode_weights);

  /* "pywrapfst.pyx":1232
 *     return "<EncodeMapper at 0x{:x}>".format(id(self))
 * 
 *   def __init__(self,             # <<<<<<<<<<<<<<
 *                arc_type=b"standard",
 *                bool encode_labels=False,
 */

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

static int __pyx_pf_9pywrapfst_12EncodeMapper_2__init__(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self, PyObject *__pyx_v_arc_type, bool __pyx_v_encode_labels, bool __pyx_v_encode_weights) {
  __pyx_t_10basictypes_uint32 __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;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pywrapfst.pyx":1236
 *                bool encode_labels=False,
 *                bool encode_weights=False):
 *     cdef uint32 flags = fst.GetEncodeFlags(encode_labels, encode_weights)             # <<<<<<<<<<<<<<
 *     self._encoder.reset(new fst.EncodeMapperClass(tostring(arc_type), flags,
 *                                                   fst.ENCODE))
 */
  __pyx_v_flags = fst::script::GetEncodeFlags(__pyx_v_encode_labels, __pyx_v_encode_weights);

  /* "pywrapfst.pyx":1237
 *                bool encode_weights=False):
 *     cdef uint32 flags = fst.GetEncodeFlags(encode_labels, encode_weights)
 *     self._encoder.reset(new fst.EncodeMapperClass(tostring(arc_type), flags,             # <<<<<<<<<<<<<<
 *                                                   fst.ENCODE))
 *     if not self._encoder:
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_encoder");
    __PYX_ERR(0, 1237, __pyx_L1_error)
  }
  __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_arc_type, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1237, __pyx_L1_error)

  /* "pywrapfst.pyx":1238
 *     cdef uint32 flags = fst.GetEncodeFlags(encode_labels, encode_weights)
 *     self._encoder.reset(new fst.EncodeMapperClass(tostring(arc_type), flags,
 *                                                   fst.ENCODE))             # <<<<<<<<<<<<<<
 *     if not self._encoder:
 *       raise FstOpError("Unknown arc type: {!r}".format(arc_type))
 */
  __pyx_v_self->_encoder.reset(new fst::script::EncodeMapperClass(__pyx_t_1, __pyx_v_flags, fst::ENCODE));

  /* "pywrapfst.pyx":1239
 *     self._encoder.reset(new fst.EncodeMapperClass(tostring(arc_type), flags,
 *                                                   fst.ENCODE))
 *     if not self._encoder:             # <<<<<<<<<<<<<<
 *       raise FstOpError("Unknown arc type: {!r}".format(arc_type))
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_encoder");
    __PYX_ERR(0, 1239, __pyx_L1_error)
  }
  __pyx_t_2 = ((!__pyx_v_self->_encoder) != 0);
  if (__pyx_t_2) {

    /* "pywrapfst.pyx":1240
 *                                                   fst.ENCODE))
 *     if not self._encoder:
 *       raise FstOpError("Unknown arc type: {!r}".format(arc_type))             # <<<<<<<<<<<<<<
 * 
 *   cpdef string arc_type(self):
 */
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstOpError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1240, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Unknown_arc_type_r, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1240, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    if (!__pyx_t_7) {
      __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_arc_type); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1240, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_arc_type};
        __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1240, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_GOTREF(__pyx_t_5);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_arc_type};
        __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1240, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_GOTREF(__pyx_t_5);
      } else
      #endif
      {
        __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1240, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
        __Pyx_INCREF(__pyx_v_arc_type);
        __Pyx_GIVEREF(__pyx_v_arc_type);
        PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_v_arc_type);
        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1240, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (!__pyx_t_6) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1240, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1240, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1240, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      } else
      #endif
      {
        __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1240, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
        __Pyx_GIVEREF(__pyx_t_5);
        PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_5);
        __pyx_t_5 = 0;
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1240, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 1240, __pyx_L1_error)

    /* "pywrapfst.pyx":1239
 *     self._encoder.reset(new fst.EncodeMapperClass(tostring(arc_type), flags,
 *                                                   fst.ENCODE))
 *     if not self._encoder:             # <<<<<<<<<<<<<<
 *       raise FstOpError("Unknown arc type: {!r}".format(arc_type))
 * 
 */
  }

  /* "pywrapfst.pyx":1232
 *     return "<EncodeMapper at 0x{:x}>".format(id(self))
 * 
 *   def __init__(self,             # <<<<<<<<<<<<<<
 *                arc_type=b"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_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("pywrapfst.EncodeMapper.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":1242
 *       raise FstOpError("Unknown arc type: {!r}".format(arc_type))
 * 
 *   cpdef string arc_type(self):             # <<<<<<<<<<<<<<
 *     """
 *     arc_type(self)
 */

static PyObject *__pyx_pw_9pywrapfst_12EncodeMapper_5arc_type(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static std::string __pyx_f_9pywrapfst_12EncodeMapper_arc_type(struct __pyx_obj_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;
  __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)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_arc_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1242, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_12EncodeMapper_5arc_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);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1242, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1242, __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, 1242, __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;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pywrapfst.pyx":1248
 *     Returns a string indicating the arc type.
 *     """
 *     return self._encoder.get().ArcType()             # <<<<<<<<<<<<<<
 * 
 *   # Python's equivalent to operator().
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_encoder");
    __PYX_ERR(0, 1248, __pyx_L1_error)
  }
  __pyx_r = __pyx_v_self->_encoder.get()->ArcType();
  goto __pyx_L0;

  /* "pywrapfst.pyx":1242
 *       raise FstOpError("Unknown arc type: {!r}".format(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("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_9pywrapfst_12EncodeMapper_5arc_type(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_9pywrapfst_12EncodeMapper_4arc_type[] = "\n    arc_type(self)\n\n    Returns a string indicating the arc type.\n    ";
static PyObject *__pyx_pw_9pywrapfst_12EncodeMapper_5arc_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_9pywrapfst_12EncodeMapper_4arc_type(((struct __pyx_obj_9pywrapfst_EncodeMapper *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_12EncodeMapper_4arc_type(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("arc_type", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_f_9pywrapfst_12EncodeMapper_arc_type(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1242, __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("pywrapfst.EncodeMapper.arc_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":1252
 *   # Python's equivalent to operator().
 * 
 *   def __call__(self, Arc arc):             # <<<<<<<<<<<<<<
 *     """
 *     self(state, ilabel, olabel, weight, nextstate)
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_12EncodeMapper_7__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9pywrapfst_12EncodeMapper_6__call__[] = "\n    self(state, ilabel, olabel, weight, nextstate)\n\n    Uses the encoder 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_9pywrapfst_12EncodeMapper_6__call__;
#endif
static PyObject *__pyx_pw_9pywrapfst_12EncodeMapper_7__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_9pywrapfst_Arc *__pyx_v_arc = 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] = PyDict_GetItem(__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, 1252, __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_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, 1252, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("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_9pywrapfst_Arc, 1, "arc", 0))) __PYX_ERR(0, 1252, __pyx_L1_error)
  __pyx_r = __pyx_pf_9pywrapfst_12EncodeMapper_6__call__(((struct __pyx_obj_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_9pywrapfst_12EncodeMapper_6__call__(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self, struct __pyx_obj_9pywrapfst_Arc *__pyx_v_arc) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__call__", 0);

  /* "pywrapfst.pyx":1268
 *       FstOpError: Incompatible or invalid weight.
 *     """
 *     return _init_Arc(self._encoder.get().__call__(deref(arc._arc)))             # <<<<<<<<<<<<<<
 * 
 *   cpdef uint32 flags(self):
 */
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_encoder");
    __PYX_ERR(0, 1268, __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, 1268, __pyx_L1_error)
  }
  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_Arc(__pyx_v_self->_encoder.get()->operator()((*__pyx_v_arc->_arc)))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1268, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":1252
 *   # 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("pywrapfst.EncodeMapper.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":1270
 *     return _init_Arc(self._encoder.get().__call__(deref(arc._arc)))
 * 
 *   cpdef uint32 flags(self):             # <<<<<<<<<<<<<<
 *     """
 *     flags(self)
 */

static PyObject *__pyx_pw_9pywrapfst_12EncodeMapper_9flags(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static __pyx_t_10basictypes_uint32 __pyx_f_9pywrapfst_12EncodeMapper_flags(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self, int __pyx_skip_dispatch) {
  __pyx_t_10basictypes_uint32 __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __pyx_t_10basictypes_uint32 __pyx_t_5;
  __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)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1270, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_12EncodeMapper_9flags)) {
      __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);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1270, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1270, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_5 = __Pyx_PyInt_As_uint32_t(__pyx_t_2); if (unlikely((__pyx_t_5 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1270, __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;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pywrapfst.pyx":1276
 *     Returns the encoder's flags.
 *     """
 *     return self._encoder.get().Flags()             # <<<<<<<<<<<<<<
 * 
 *   cpdef _EncodeMapperSymbolTable input_symbols(self):
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_encoder");
    __PYX_ERR(0, 1276, __pyx_L1_error)
  }
  __pyx_r = __pyx_v_self->_encoder.get()->Flags();
  goto __pyx_L0;

  /* "pywrapfst.pyx":1270
 *     return _init_Arc(self._encoder.get().__call__(deref(arc._arc)))
 * 
 *   cpdef uint32 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("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_9pywrapfst_12EncodeMapper_9flags(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_9pywrapfst_12EncodeMapper_8flags[] = "\n    flags(self)\n\n    Returns the encoder's flags.\n    ";
static PyObject *__pyx_pw_9pywrapfst_12EncodeMapper_9flags(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("flags (wrapper)", 0);
  __pyx_r = __pyx_pf_9pywrapfst_12EncodeMapper_8flags(((struct __pyx_obj_9pywrapfst_EncodeMapper *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_12EncodeMapper_8flags(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("flags", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_uint32_t(__pyx_f_9pywrapfst_12EncodeMapper_flags(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1270, __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("pywrapfst.EncodeMapper.flags", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":1278
 *     return self._encoder.get().Flags()
 * 
 *   cpdef _EncodeMapperSymbolTable input_symbols(self):             # <<<<<<<<<<<<<<
 *     """
 *     input_symbols(self)
 */

static PyObject *__pyx_pw_9pywrapfst_12EncodeMapper_11input_symbols(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTable *__pyx_f_9pywrapfst_12EncodeMapper_input_symbols(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self, int __pyx_skip_dispatch) {
  fst::SymbolTable *__pyx_v_syms;
  struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTable *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("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)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_input_symbols); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1278, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_12EncodeMapper_11input_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);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1278, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1278, __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_9pywrapfst__EncodeMapperSymbolTable))))) __PYX_ERR(0, 1278, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTable *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pywrapfst.pyx":1285
 *     """
 *     cdef fst.SymbolTable *syms = const_cast[SymbolTable_ptr](
 *         self._encoder.get().InputSymbols())             # <<<<<<<<<<<<<<
 *     if syms == NULL:
 *       return
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_encoder");
    __PYX_ERR(0, 1285, __pyx_L1_error)
  }

  /* "pywrapfst.pyx":1284
 *     Returns the encoder's input symbol table, or None if none is present.
 *     """
 *     cdef fst.SymbolTable *syms = const_cast[SymbolTable_ptr](             # <<<<<<<<<<<<<<
 *         self._encoder.get().InputSymbols())
 *     if syms == NULL:
 */
  __pyx_v_syms = const_cast<__pyx_t_9pywrapfst_SymbolTable_ptr>(__pyx_v_self->_encoder.get()->InputSymbols());

  /* "pywrapfst.pyx":1286
 *     cdef fst.SymbolTable *syms = const_cast[SymbolTable_ptr](
 *         self._encoder.get().InputSymbols())
 *     if syms == NULL:             # <<<<<<<<<<<<<<
 *       return
 *     return _init_EncodeMapperSymbolTable(syms, self._encoder)
 */
  __pyx_t_5 = ((__pyx_v_syms == NULL) != 0);
  if (__pyx_t_5) {

    /* "pywrapfst.pyx":1287
 *         self._encoder.get().InputSymbols())
 *     if syms == NULL:
 *       return             # <<<<<<<<<<<<<<
 *     return _init_EncodeMapperSymbolTable(syms, self._encoder)
 * 
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_r = ((struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTable *)Py_None); __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "pywrapfst.pyx":1286
 *     cdef fst.SymbolTable *syms = const_cast[SymbolTable_ptr](
 *         self._encoder.get().InputSymbols())
 *     if syms == NULL:             # <<<<<<<<<<<<<<
 *       return
 *     return _init_EncodeMapperSymbolTable(syms, self._encoder)
 */
  }

  /* "pywrapfst.pyx":1288
 *     if syms == NULL:
 *       return
 *     return _init_EncodeMapperSymbolTable(syms, self._encoder)             # <<<<<<<<<<<<<<
 * 
 *   cpdef _EncodeMapperSymbolTable 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'", "_encoder");
    __PYX_ERR(0, 1288, __pyx_L1_error)
  }
  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_EncodeMapperSymbolTable(__pyx_v_syms, __pyx_v_self->_encoder)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1288, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTable *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":1278
 *     return self._encoder.get().Flags()
 * 
 *   cpdef _EncodeMapperSymbolTable 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("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_9pywrapfst_12EncodeMapper_11input_symbols(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_9pywrapfst_12EncodeMapper_10input_symbols[] = "\n    input_symbols(self)\n\n    Returns the encoder's input symbol table, or None if none is present.\n    ";
static PyObject *__pyx_pw_9pywrapfst_12EncodeMapper_11input_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_9pywrapfst_12EncodeMapper_10input_symbols(((struct __pyx_obj_9pywrapfst_EncodeMapper *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_12EncodeMapper_10input_symbols(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("input_symbols", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_12EncodeMapper_input_symbols(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1278, __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("pywrapfst.EncodeMapper.input_symbols", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":1290
 *     return _init_EncodeMapperSymbolTable(syms, self._encoder)
 * 
 *   cpdef _EncodeMapperSymbolTable output_symbols(self):             # <<<<<<<<<<<<<<
 *     """
 *     output_symbols(self)
 */

static PyObject *__pyx_pw_9pywrapfst_12EncodeMapper_13output_symbols(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTable *__pyx_f_9pywrapfst_12EncodeMapper_output_symbols(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self, int __pyx_skip_dispatch) {
  fst::SymbolTable *__pyx_v_syms;
  struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTable *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("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)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_output_symbols); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1290, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_12EncodeMapper_13output_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);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1290, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1290, __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_9pywrapfst__EncodeMapperSymbolTable))))) __PYX_ERR(0, 1290, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTable *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pywrapfst.pyx":1297
 *     """
 *     cdef fst.SymbolTable *syms = const_cast[SymbolTable_ptr](
 *         self._encoder.get().OutputSymbols())             # <<<<<<<<<<<<<<
 *     if syms == NULL:
 *       return
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_encoder");
    __PYX_ERR(0, 1297, __pyx_L1_error)
  }

  /* "pywrapfst.pyx":1296
 *     Returns the encoder's output symbol table, or None if none is present.
 *     """
 *     cdef fst.SymbolTable *syms = const_cast[SymbolTable_ptr](             # <<<<<<<<<<<<<<
 *         self._encoder.get().OutputSymbols())
 *     if syms == NULL:
 */
  __pyx_v_syms = const_cast<__pyx_t_9pywrapfst_SymbolTable_ptr>(__pyx_v_self->_encoder.get()->OutputSymbols());

  /* "pywrapfst.pyx":1298
 *     cdef fst.SymbolTable *syms = const_cast[SymbolTable_ptr](
 *         self._encoder.get().OutputSymbols())
 *     if syms == NULL:             # <<<<<<<<<<<<<<
 *       return
 *     return _init_EncodeMapperSymbolTable(syms, self._encoder)
 */
  __pyx_t_5 = ((__pyx_v_syms == NULL) != 0);
  if (__pyx_t_5) {

    /* "pywrapfst.pyx":1299
 *         self._encoder.get().OutputSymbols())
 *     if syms == NULL:
 *       return             # <<<<<<<<<<<<<<
 *     return _init_EncodeMapperSymbolTable(syms, self._encoder)
 * 
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_r = ((struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTable *)Py_None); __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "pywrapfst.pyx":1298
 *     cdef fst.SymbolTable *syms = const_cast[SymbolTable_ptr](
 *         self._encoder.get().OutputSymbols())
 *     if syms == NULL:             # <<<<<<<<<<<<<<
 *       return
 *     return _init_EncodeMapperSymbolTable(syms, self._encoder)
 */
  }

  /* "pywrapfst.pyx":1300
 *     if syms == NULL:
 *       return
 *     return _init_EncodeMapperSymbolTable(syms, self._encoder)             # <<<<<<<<<<<<<<
 * 
 *   cpdef uint64 properties(self, uint64 mask):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_encoder");
    __PYX_ERR(0, 1300, __pyx_L1_error)
  }
  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_EncodeMapperSymbolTable(__pyx_v_syms, __pyx_v_self->_encoder)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1300, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTable *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":1290
 *     return _init_EncodeMapperSymbolTable(syms, self._encoder)
 * 
 *   cpdef _EncodeMapperSymbolTable 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("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_9pywrapfst_12EncodeMapper_13output_symbols(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_9pywrapfst_12EncodeMapper_12output_symbols[] = "\n    output_symbols(self)\n\n    Returns the encoder's output symbol table, or None if none is present.\n    ";
static PyObject *__pyx_pw_9pywrapfst_12EncodeMapper_13output_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_9pywrapfst_12EncodeMapper_12output_symbols(((struct __pyx_obj_9pywrapfst_EncodeMapper *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_12EncodeMapper_12output_symbols(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("output_symbols", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_12EncodeMapper_output_symbols(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1290, __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("pywrapfst.EncodeMapper.output_symbols", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":1302
 *     return _init_EncodeMapperSymbolTable(syms, self._encoder)
 * 
 *   cpdef uint64 properties(self, uint64 mask):             # <<<<<<<<<<<<<<
 *     """
 *     properties(self, mask)
 */

static PyObject *__pyx_pw_9pywrapfst_12EncodeMapper_15properties(PyObject *__pyx_v_self, PyObject *__pyx_arg_mask); /*proto*/
static __pyx_t_10basictypes_uint64 __pyx_f_9pywrapfst_12EncodeMapper_properties(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self, __pyx_t_10basictypes_uint64 __pyx_v_mask, int __pyx_skip_dispatch) {
  __pyx_t_10basictypes_uint64 __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;
  __pyx_t_10basictypes_uint64 __pyx_t_7;
  __Pyx_RefNannySetupContext("properties", 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)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_properties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1302, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_12EncodeMapper_15properties)) {
      __pyx_t_3 = __Pyx_PyInt_From_uint64_t(__pyx_v_mask); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1302, __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);
        }
      }
      if (!__pyx_t_5) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1302, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_4)) {
          PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1302, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
          PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1302, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        } else
        #endif
        {
          __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1302, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
          __Pyx_GIVEREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3);
          __pyx_t_3 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1302, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_7 = __Pyx_PyInt_As_uint64_t(__pyx_t_2); if (unlikely((__pyx_t_7 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1302, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_7;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pywrapfst.pyx":1316
 *       A 64-bit bitmask representing the requested properties.
 *     """
 *     return self._encoder.get().Properties(mask)             # <<<<<<<<<<<<<<
 * 
 *   cpdef void set_input_symbols(self, _SymbolTable syms) except *:
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_encoder");
    __PYX_ERR(0, 1316, __pyx_L1_error)
  }
  __pyx_r = __pyx_v_self->_encoder.get()->Properties(__pyx_v_mask);
  goto __pyx_L0;

  /* "pywrapfst.pyx":1302
 *     return _init_EncodeMapperSymbolTable(syms, self._encoder)
 * 
 *   cpdef uint64 properties(self, uint64 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_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_WriteUnraisable("pywrapfst.EncodeMapper.properties", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_12EncodeMapper_15properties(PyObject *__pyx_v_self, PyObject *__pyx_arg_mask); /*proto*/
static char __pyx_doc_9pywrapfst_12EncodeMapper_14properties[] = "\n    properties(self, mask)\n\n    Provides property bits.\n\n    This method provides user access to the properties of the encoder.\n\n    Args:\n      mask: The property mask to be compared to the encoder's properties.\n\n    Returns:\n      A 64-bit bitmask representing the requested properties.\n    ";
static PyObject *__pyx_pw_9pywrapfst_12EncodeMapper_15properties(PyObject *__pyx_v_self, PyObject *__pyx_arg_mask) {
  __pyx_t_10basictypes_uint64 __pyx_v_mask;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("properties (wrapper)", 0);
  assert(__pyx_arg_mask); {
    __pyx_v_mask = __Pyx_PyInt_As_uint64_t(__pyx_arg_mask); if (unlikely((__pyx_v_mask == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1302, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pywrapfst.EncodeMapper.properties", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pywrapfst_12EncodeMapper_14properties(((struct __pyx_obj_9pywrapfst_EncodeMapper *)__pyx_v_self), ((__pyx_t_10basictypes_uint64)__pyx_v_mask));

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

static PyObject *__pyx_pf_9pywrapfst_12EncodeMapper_14properties(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self, __pyx_t_10basictypes_uint64 __pyx_v_mask) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("properties", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_uint64_t(__pyx_f_9pywrapfst_12EncodeMapper_properties(__pyx_v_self, __pyx_v_mask, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1302, __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("pywrapfst.EncodeMapper.properties", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":1318
 *     return self._encoder.get().Properties(mask)
 * 
 *   cpdef void set_input_symbols(self, _SymbolTable syms) except *:             # <<<<<<<<<<<<<<
 *     """
 *     set_input_symbols(self, syms)
 */

static PyObject *__pyx_pw_9pywrapfst_12EncodeMapper_17set_input_symbols(PyObject *__pyx_v_self, PyObject *__pyx_v_syms); /*proto*/
static void __pyx_f_9pywrapfst_12EncodeMapper_set_input_symbols(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_syms, 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;
  __Pyx_RefNannySetupContext("set_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)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_input_symbols); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1318, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_12EncodeMapper_17set_input_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);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_syms)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1318, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_syms)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1318, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_syms)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1318, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1318, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(((PyObject *)__pyx_v_syms));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_syms));
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_syms));
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1318, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pywrapfst.pyx":1329
 *     See also: `set_output_symbols`.
 *     """
 *     self._encoder.get().SetInputSymbols(syms._table)             # <<<<<<<<<<<<<<
 * 
 *   cpdef void set_output_symbols(self, _SymbolTable syms) except *:
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_encoder");
    __PYX_ERR(0, 1329, __pyx_L1_error)
  }
  if (unlikely(((PyObject *)__pyx_v_syms) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_table");
    __PYX_ERR(0, 1329, __pyx_L1_error)
  }
  __pyx_v_self->_encoder.get()->SetInputSymbols(__pyx_v_syms->_table);

  /* "pywrapfst.pyx":1318
 *     return self._encoder.get().Properties(mask)
 * 
 *   cpdef void set_input_symbols(self, _SymbolTable syms) except *:             # <<<<<<<<<<<<<<
 *     """
 *     set_input_symbols(self, syms)
 */

  /* 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_AddTraceback("pywrapfst.EncodeMapper.set_input_symbols", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_12EncodeMapper_17set_input_symbols(PyObject *__pyx_v_self, PyObject *__pyx_v_syms); /*proto*/
static char __pyx_doc_9pywrapfst_12EncodeMapper_16set_input_symbols[] = "\n    set_input_symbols(self, syms)\n\n    Sets the encoder's input symbol table.\n\n    Args:\n      syms: A SymbolTable.\n\n    See also: `set_output_symbols`.\n    ";
static PyObject *__pyx_pw_9pywrapfst_12EncodeMapper_17set_input_symbols(PyObject *__pyx_v_self, PyObject *__pyx_v_syms) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_input_symbols (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_syms), __pyx_ptype_9pywrapfst__SymbolTable, 1, "syms", 0))) __PYX_ERR(0, 1318, __pyx_L1_error)
  __pyx_r = __pyx_pf_9pywrapfst_12EncodeMapper_16set_input_symbols(((struct __pyx_obj_9pywrapfst_EncodeMapper *)__pyx_v_self), ((struct __pyx_obj_9pywrapfst__SymbolTable *)__pyx_v_syms));

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

static PyObject *__pyx_pf_9pywrapfst_12EncodeMapper_16set_input_symbols(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_syms) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("set_input_symbols", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_9pywrapfst_12EncodeMapper_set_input_symbols(__pyx_v_self, __pyx_v_syms, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1318, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1318, __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("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;
}

/* "pywrapfst.pyx":1331
 *     self._encoder.get().SetInputSymbols(syms._table)
 * 
 *   cpdef void set_output_symbols(self, _SymbolTable syms) except *:             # <<<<<<<<<<<<<<
 *     """
 *     set_output_symbols(self, syms)
 */

static PyObject *__pyx_pw_9pywrapfst_12EncodeMapper_19set_output_symbols(PyObject *__pyx_v_self, PyObject *__pyx_v_syms); /*proto*/
static void __pyx_f_9pywrapfst_12EncodeMapper_set_output_symbols(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_syms, 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;
  __Pyx_RefNannySetupContext("set_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)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_output_symbols); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1331, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_12EncodeMapper_19set_output_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);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_syms)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1331, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_syms)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1331, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_syms)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1331, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1331, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(((PyObject *)__pyx_v_syms));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_syms));
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_syms));
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1331, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pywrapfst.pyx":1342
 *     See also: `set_input_symbols`.
 *     """
 *     self._encoder.get().SetOutputSymbols(syms._table)             # <<<<<<<<<<<<<<
 * 
 *   cpdef string weight_type(self):
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_encoder");
    __PYX_ERR(0, 1342, __pyx_L1_error)
  }
  if (unlikely(((PyObject *)__pyx_v_syms) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_table");
    __PYX_ERR(0, 1342, __pyx_L1_error)
  }
  __pyx_v_self->_encoder.get()->SetOutputSymbols(__pyx_v_syms->_table);

  /* "pywrapfst.pyx":1331
 *     self._encoder.get().SetInputSymbols(syms._table)
 * 
 *   cpdef void set_output_symbols(self, _SymbolTable syms) except *:             # <<<<<<<<<<<<<<
 *     """
 *     set_output_symbols(self, syms)
 */

  /* 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_AddTraceback("pywrapfst.EncodeMapper.set_output_symbols", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_12EncodeMapper_19set_output_symbols(PyObject *__pyx_v_self, PyObject *__pyx_v_syms); /*proto*/
static char __pyx_doc_9pywrapfst_12EncodeMapper_18set_output_symbols[] = "\n    set_output_symbols(self, syms)\n\n    Sets the encoder's output symbol table.\n\n    Args:\n      syms: A SymbolTable.\n\n    See also: `set_input_symbols`.\n    ";
static PyObject *__pyx_pw_9pywrapfst_12EncodeMapper_19set_output_symbols(PyObject *__pyx_v_self, PyObject *__pyx_v_syms) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_output_symbols (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_syms), __pyx_ptype_9pywrapfst__SymbolTable, 1, "syms", 0))) __PYX_ERR(0, 1331, __pyx_L1_error)
  __pyx_r = __pyx_pf_9pywrapfst_12EncodeMapper_18set_output_symbols(((struct __pyx_obj_9pywrapfst_EncodeMapper *)__pyx_v_self), ((struct __pyx_obj_9pywrapfst__SymbolTable *)__pyx_v_syms));

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

static PyObject *__pyx_pf_9pywrapfst_12EncodeMapper_18set_output_symbols(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_syms) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("set_output_symbols", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_9pywrapfst_12EncodeMapper_set_output_symbols(__pyx_v_self, __pyx_v_syms, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1331, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1331, __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("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;
}

/* "pywrapfst.pyx":1344
 *     self._encoder.get().SetOutputSymbols(syms._table)
 * 
 *   cpdef string weight_type(self):             # <<<<<<<<<<<<<<
 *     """
 *     weight_type(self)
 */

static PyObject *__pyx_pw_9pywrapfst_12EncodeMapper_21weight_type(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static std::string __pyx_f_9pywrapfst_12EncodeMapper_weight_type(struct __pyx_obj_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;
  __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)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_weight_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1344, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_12EncodeMapper_21weight_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);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1344, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1344, __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, 1344, __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;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

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

  /* "pywrapfst.pyx":1344
 *     self._encoder.get().SetOutputSymbols(syms._table)
 * 
 *   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("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_9pywrapfst_12EncodeMapper_21weight_type(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_9pywrapfst_12EncodeMapper_20weight_type[] = "\n    weight_type(self)\n\n    Returns a string indicating the weight type.\n    ";
static PyObject *__pyx_pw_9pywrapfst_12EncodeMapper_21weight_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_9pywrapfst_12EncodeMapper_20weight_type(((struct __pyx_obj_9pywrapfst_EncodeMapper *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_12EncodeMapper_20weight_type(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("weight_type", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_f_9pywrapfst_12EncodeMapper_weight_type(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1344, __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("pywrapfst.EncodeMapper.weight_type", __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._encoder cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_12EncodeMapper_23__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_9pywrapfst_12EncodeMapper_23__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_9pywrapfst_12EncodeMapper_22__reduce_cython__(((struct __pyx_obj_9pywrapfst_EncodeMapper *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_12EncodeMapper_22__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self._encoder cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self._encoder cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__22, 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._encoder 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("pywrapfst.EncodeMapper.__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._encoder cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self._encoder cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_12EncodeMapper_25__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static PyObject *__pyx_pw_9pywrapfst_12EncodeMapper_25__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_9pywrapfst_12EncodeMapper_24__setstate_cython__(((struct __pyx_obj_9pywrapfst_EncodeMapper *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

static PyObject *__pyx_pf_9pywrapfst_12EncodeMapper_24__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self._encoder cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self._encoder cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__23, 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._encoder cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self._encoder cannot be converted to a Python object for pickling")
 */

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

/* "pywrapfst.pyx":1374
 * 
 *   # IPython notebook magic to produce an SVG of the FST.
 *   def _repr_svg_(self):             # <<<<<<<<<<<<<<
 *     """IPython notebook magic to produce an SVG of the FST using GraphViz.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_4_Fst_1_repr_svg_(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_9pywrapfst_4_Fst__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\n    Raises:\n      OSError: Cannot locate the `dot` executable.\n      subprocess.CalledProcessError: `dot` returned non-zero exit code.\n\n    See also: `draw`, `text`.\n    ";
static PyObject *__pyx_pw_9pywrapfst_4_Fst_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_9pywrapfst_4_Fst__repr_svg_(((struct __pyx_obj_9pywrapfst__Fst *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_4_Fst__repr_svg_(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_self) {
  PyObject *__pyx_v_proc = NULL;
  std::stringstream __pyx_v_sstrm;
  PyObject *__pyx_v_sout = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_serr = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  std::string __pyx_t_6;
  std::string __pyx_t_7;
  std::string __pyx_t_8;
  PyObject *(*__pyx_t_9)(PyObject *);
  int __pyx_t_10;
  int __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  __Pyx_RefNannySetupContext("_repr_svg_", 0);

  /* "pywrapfst.pyx":1388
 *     """
 *     # Throws OSError if the dot executable is not found.
 *     proc = subprocess.Popen(["dot", "-Tsvg"], stdin=subprocess.PIPE,             # <<<<<<<<<<<<<<
 *                             stdout=subprocess.PIPE, stderr=subprocess.PIPE)
 *     cdef stringstream sstrm
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_subprocess); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1388, __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, 1388, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1388, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_dot);
  __Pyx_GIVEREF(__pyx_n_s_dot);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_dot);
  __Pyx_INCREF(__pyx_kp_s_Tsvg);
  __Pyx_GIVEREF(__pyx_kp_s_Tsvg);
  PyList_SET_ITEM(__pyx_t_1, 1, __pyx_kp_s_Tsvg);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1388, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1388, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_subprocess); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1388, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_PIPE); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1388, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_stdin, __pyx_t_5) < 0) __PYX_ERR(0, 1388, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pywrapfst.pyx":1389
 *     # Throws OSError if the dot executable is not found.
 *     proc = subprocess.Popen(["dot", "-Tsvg"], stdin=subprocess.PIPE,
 *                             stdout=subprocess.PIPE, stderr=subprocess.PIPE)             # <<<<<<<<<<<<<<
 *     cdef stringstream sstrm
 *     fst.DrawFst(deref(self._fst), self._fst.get().InputSymbols(),
 */
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_subprocess); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1389, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_PIPE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1389, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_stdout, __pyx_t_4) < 0) __PYX_ERR(0, 1388, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_subprocess); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1389, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_PIPE); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1389, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_stderr, __pyx_t_5) < 0) __PYX_ERR(0, 1388, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pywrapfst.pyx":1388
 *     """
 *     # Throws OSError if the dot executable is not found.
 *     proc = subprocess.Popen(["dot", "-Tsvg"], stdin=subprocess.PIPE,             # <<<<<<<<<<<<<<
 *                             stdout=subprocess.PIPE, stderr=subprocess.PIPE)
 *     cdef stringstream sstrm
 */
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1388, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_proc = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "pywrapfst.pyx":1391
 *                             stdout=subprocess.PIPE, stderr=subprocess.PIPE)
 *     cdef stringstream sstrm
 *     fst.DrawFst(deref(self._fst), self._fst.get().InputSymbols(),             # <<<<<<<<<<<<<<
 *                 self._fst.get().OutputSymbols(), NULL,
 *                 self._fst.get().Properties(fst.kAcceptor, True) ==
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 1391, __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, 1391, __pyx_L1_error)
  }

  /* "pywrapfst.pyx":1392
 *     cdef stringstream sstrm
 *     fst.DrawFst(deref(self._fst), self._fst.get().InputSymbols(),
 *                 self._fst.get().OutputSymbols(), NULL,             # <<<<<<<<<<<<<<
 *                 self._fst.get().Properties(fst.kAcceptor, True) ==
 *                 fst.kAcceptor,
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 1392, __pyx_L1_error)
  }

  /* "pywrapfst.pyx":1393
 *     fst.DrawFst(deref(self._fst), self._fst.get().InputSymbols(),
 *                 self._fst.get().OutputSymbols(), NULL,
 *                 self._fst.get().Properties(fst.kAcceptor, True) ==             # <<<<<<<<<<<<<<
 *                 fst.kAcceptor,
 *                 b"", 8.5, 11, True, False, 0.4, 0.25, 14, 5, b"g", False,
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 1393, __pyx_L1_error)
  }

  /* "pywrapfst.pyx":1395
 *                 self._fst.get().Properties(fst.kAcceptor, True) ==
 *                 fst.kAcceptor,
 *                 b"", 8.5, 11, True, False, 0.4, 0.25, 14, 5, b"g", False,             # <<<<<<<<<<<<<<
 *                 addr(sstrm), b"_repr_svg")
 *     (sout, serr) = proc.communicate(sstrm.str())
 */
  __pyx_t_6 = __pyx_convert_string_from_py_std__in_string(__pyx_kp_b__24); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1395, __pyx_L1_error)
  __pyx_t_7 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_g); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1395, __pyx_L1_error)

  /* "pywrapfst.pyx":1396
 *                 fst.kAcceptor,
 *                 b"", 8.5, 11, True, False, 0.4, 0.25, 14, 5, b"g", False,
 *                 addr(sstrm), b"_repr_svg")             # <<<<<<<<<<<<<<
 *     (sout, serr) = proc.communicate(sstrm.str())
 *     if proc.returncode != 0:  # Just to be explicit.
 */
  __pyx_t_8 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_repr_svg); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1396, __pyx_L1_error)

  /* "pywrapfst.pyx":1391
 *                             stdout=subprocess.PIPE, stderr=subprocess.PIPE)
 *     cdef stringstream sstrm
 *     fst.DrawFst(deref(self._fst), self._fst.get().InputSymbols(),             # <<<<<<<<<<<<<<
 *                 self._fst.get().OutputSymbols(), NULL,
 *                 self._fst.get().Properties(fst.kAcceptor, True) ==
 */
  fst::script::DrawFst((*__pyx_v_self->_fst), __pyx_v_self->_fst.get()->InputSymbols(), __pyx_v_self->_fst.get()->OutputSymbols(), NULL, (__pyx_v_self->_fst.get()->Properties(fst::kAcceptor, 1) == fst::kAcceptor), __pyx_t_6, 8.5, 11.0, 1, 0, 0.4, 0.25, 14, 5, __pyx_t_7, 0, (&__pyx_v_sstrm), __pyx_t_8);

  /* "pywrapfst.pyx":1397
 *                 b"", 8.5, 11, True, False, 0.4, 0.25, 14, 5, b"g", False,
 *                 addr(sstrm), b"_repr_svg")
 *     (sout, serr) = proc.communicate(sstrm.str())             # <<<<<<<<<<<<<<
 *     if proc.returncode != 0:  # Just to be explicit.
 *       raise subprocess.CalledProcessError(proc.returncode, self._DOT_TSVG)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_proc, __pyx_n_s_communicate); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1397, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_sstrm.str()); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1397, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  if (!__pyx_t_2) {
    __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1397, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_5);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_3};
      __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1397, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_3};
      __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1397, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    } else
    #endif
    {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1397, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __pyx_t_2 = NULL;
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1397, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) {
    PyObject* sequence = __pyx_t_5;
    #if !CYTHON_COMPILING_IN_PYPY
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 1397, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_4 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_4);
    #else
    __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1397, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1397, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    #endif
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_3 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1397, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_9 = Py_TYPE(__pyx_t_3)->tp_iternext;
    index = 0; __pyx_t_1 = __pyx_t_9(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    index = 1; __pyx_t_4 = __pyx_t_9(__pyx_t_3); if (unlikely(!__pyx_t_4)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_4);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_3), 2) < 0) __PYX_ERR(0, 1397, __pyx_L1_error)
    __pyx_t_9 = NULL;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_9 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 1397, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  __pyx_v_sout = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_v_serr = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "pywrapfst.pyx":1398
 *                 addr(sstrm), b"_repr_svg")
 *     (sout, serr) = proc.communicate(sstrm.str())
 *     if proc.returncode != 0:  # Just to be explicit.             # <<<<<<<<<<<<<<
 *       raise subprocess.CalledProcessError(proc.returncode, self._DOT_TSVG)
 *     return sout.decode("utf8")
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_proc, __pyx_n_s_returncode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1398, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = PyObject_RichCompare(__pyx_t_5, __pyx_int_0, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1398, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 1398, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_10) {

    /* "pywrapfst.pyx":1399
 *     (sout, serr) = proc.communicate(sstrm.str())
 *     if proc.returncode != 0:  # Just to be explicit.
 *       raise subprocess.CalledProcessError(proc.returncode, self._DOT_TSVG)             # <<<<<<<<<<<<<<
 *     return sout.decode("utf8")
 * 
 */
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_subprocess); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1399, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_CalledProcessError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1399, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_proc, __pyx_n_s_returncode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1399, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_DOT_TSVG); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1399, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = NULL;
    __pyx_t_11 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(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_11 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_t_5, __pyx_t_3};
      __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1399, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_t_5, __pyx_t_3};
      __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1399, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    } else
    #endif
    {
      __pyx_t_12 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1399, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      if (__pyx_t_2) {
        __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_2); __pyx_t_2 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_11, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_11, __pyx_t_3);
      __pyx_t_5 = 0;
      __pyx_t_3 = 0;
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_12, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1399, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(0, 1399, __pyx_L1_error)

    /* "pywrapfst.pyx":1398
 *                 addr(sstrm), b"_repr_svg")
 *     (sout, serr) = proc.communicate(sstrm.str())
 *     if proc.returncode != 0:  # Just to be explicit.             # <<<<<<<<<<<<<<
 *       raise subprocess.CalledProcessError(proc.returncode, self._DOT_TSVG)
 *     return sout.decode("utf8")
 */
  }

  /* "pywrapfst.pyx":1400
 *     if proc.returncode != 0:  # Just to be explicit.
 *       raise subprocess.CalledProcessError(proc.returncode, self._DOT_TSVG)
 *     return sout.decode("utf8")             # <<<<<<<<<<<<<<
 * 
 *   def __repr__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_sout, __pyx_n_s_decode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1400, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1400, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":1374
 * 
 *   # IPython notebook magic to produce an SVG of the FST.
 *   def _repr_svg_(self):             # <<<<<<<<<<<<<<
 *     """IPython notebook magic to produce an SVG of the FST using GraphViz.
 * 
 */

  /* 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_12);
  __Pyx_AddTraceback("pywrapfst._Fst._repr_svg_", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_proc);
  __Pyx_XDECREF(__pyx_v_sout);
  __Pyx_XDECREF(__pyx_v_serr);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":1402
 *     return sout.decode("utf8")
 * 
 *   def __repr__(self):             # <<<<<<<<<<<<<<
 *     return "<{} Fst at 0x{:x}>".format(self.fst_type(), id(self))
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_4_Fst_3__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9pywrapfst_4_Fst_3__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9pywrapfst_4_Fst_2__repr__(((struct __pyx_obj_9pywrapfst__Fst *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_4_Fst_2__repr__(struct __pyx_obj_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;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "pywrapfst.pyx":1403
 * 
 *   def __repr__(self):
 *     return "<{} Fst at 0x{:x}>".format(self.fst_type(), id(self))             # <<<<<<<<<<<<<<
 * 
 *   def __init__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Fst_at_0x_x, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1403, __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_type");
    __PYX_ERR(0, 1403, __pyx_L1_error)
  }
  __pyx_t_3 = __pyx_convert_PyBytes_string_to_py_std__in_string(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_self->__pyx_vtab)->fst_type(__pyx_v_self, 0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1403, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1403, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_self));
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1403, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_6 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1403, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1403, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else
  #endif
  {
    __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1403, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__pyx_t_4) {
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_5);
    __pyx_t_3 = 0;
    __pyx_t_5 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1403, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":1402
 *     return sout.decode("utf8")
 * 
 *   def __repr__(self):             # <<<<<<<<<<<<<<
 *     return "<{} Fst at 0x{:x}>".format(self.fst_type(), id(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_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pywrapfst._Fst.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":1405
 *     return "<{} Fst at 0x{:x}>".format(self.fst_type(), id(self))
 * 
 *   def __init__(self):             # <<<<<<<<<<<<<<
 *     raise FstDeletedConstructorError(
 *         "Cannot construct {}".format(self.__class__.__name__))
 */

/* Python wrapper */
static int __pyx_pw_9pywrapfst_4_Fst_5__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_9pywrapfst_4_Fst_5__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_9pywrapfst_4_Fst_4__init__(((struct __pyx_obj_9pywrapfst__Fst *)__pyx_v_self));

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

static int __pyx_pf_9pywrapfst_4_Fst_4__init__(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pywrapfst.pyx":1406
 * 
 *   def __init__(self):
 *     raise FstDeletedConstructorError(             # <<<<<<<<<<<<<<
 *         "Cannot construct {}".format(self.__class__.__name__))
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstDeletedConstructorError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1406, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "pywrapfst.pyx":1407
 *   def __init__(self):
 *     raise FstDeletedConstructorError(
 *         "Cannot construct {}".format(self.__class__.__name__))             # <<<<<<<<<<<<<<
 * 
 *   def __str__(self):
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Cannot_construct, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1407, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1407, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_name); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1407, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (!__pyx_t_5) {
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1407, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_GOTREF(__pyx_t_3);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_6};
      __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1407, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_6};
      __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1407, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    } else
    #endif
    {
      __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1407, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_6);
      __pyx_t_6 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1407, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1406, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_3};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1406, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_3};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1406, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    } else
    #endif
    {
      __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1406, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL;
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1406, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
  }
  __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, 1406, __pyx_L1_error)

  /* "pywrapfst.pyx":1405
 *     return "<{} Fst at 0x{:x}>".format(self.fst_type(), id(self))
 * 
 *   def __init__(self):             # <<<<<<<<<<<<<<
 *     raise FstDeletedConstructorError(
 *         "Cannot construct {}".format(self.__class__.__name__))
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pywrapfst._Fst.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":1409
 *         "Cannot construct {}".format(self.__class__.__name__))
 * 
 *   def __str__(self):             # <<<<<<<<<<<<<<
 *     return self.text()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_4_Fst_7__str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9pywrapfst_4_Fst_7__str__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9pywrapfst_4_Fst_6__str__(((struct __pyx_obj_9pywrapfst__Fst *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_4_Fst_6__str__(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__str__", 0);

  /* "pywrapfst.pyx":1410
 * 
 *   def __str__(self):
 *     return self.text()             # <<<<<<<<<<<<<<
 * 
 *   # Registers the class for pickling; must be repeated in any subclass which
 */
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "text");
    __PYX_ERR(0, 1410, __pyx_L1_error)
  }
  __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_self->__pyx_vtab)->text(__pyx_v_self, 0, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1410, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":1409
 *         "Cannot construct {}".format(self.__class__.__name__))
 * 
 *   def __str__(self):             # <<<<<<<<<<<<<<
 *     return self.text()
 * 
 */

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

/* "pywrapfst.pyx":1415
 *   # can't be derived by _init_XFst.
 * 
 *   def __reduce__(self):             # <<<<<<<<<<<<<<
 *     return (_read_from_string, (self.write_to_string(),))
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_4_Fst_9__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_9pywrapfst_4_Fst_9__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9pywrapfst_4_Fst_8__reduce__(((struct __pyx_obj_9pywrapfst__Fst *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_4_Fst_8__reduce__(struct __pyx_obj_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;
  __Pyx_RefNannySetupContext("__reduce__", 0);

  /* "pywrapfst.pyx":1416
 * 
 *   def __reduce__(self):
 *     return (_read_from_string, (self.write_to_string(),))             # <<<<<<<<<<<<<<
 * 
 *   cpdef string arc_type(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_read_from_string); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1416, __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, 1416, __pyx_L1_error)
  }
  __pyx_t_2 = __pyx_convert_PyBytes_string_to_py_std__in_string(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_self->__pyx_vtab)->write_to_string(__pyx_v_self, 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1416, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1416, __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, 1416, __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;

  /* "pywrapfst.pyx":1415
 *   # can't be derived by _init_XFst.
 * 
 *   def __reduce__(self):             # <<<<<<<<<<<<<<
 *     return (_read_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("pywrapfst._Fst.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":1418
 *     return (_read_from_string, (self.write_to_string(),))
 * 
 *   cpdef string arc_type(self):             # <<<<<<<<<<<<<<
 *     """
 *     arc_type(self)
 */

static PyObject *__pyx_pw_9pywrapfst_4_Fst_11arc_type(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static std::string __pyx_f_9pywrapfst_4_Fst_arc_type(struct __pyx_obj_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;
  __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)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_arc_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1418, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_4_Fst_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);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1418, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1418, __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, 1418, __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;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pywrapfst.pyx":1424
 *     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, 1424, __pyx_L1_error)
  }
  __pyx_r = __pyx_v_self->_fst.get()->ArcType();
  goto __pyx_L0;

  /* "pywrapfst.pyx":1418
 *     return (_read_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("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_9pywrapfst_4_Fst_11arc_type(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_9pywrapfst_4_Fst_10arc_type[] = "\n    arc_type(self)\n\n    Returns a string indicating the arc type.\n    ";
static PyObject *__pyx_pw_9pywrapfst_4_Fst_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_9pywrapfst_4_Fst_10arc_type(((struct __pyx_obj_9pywrapfst__Fst *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_4_Fst_10arc_type(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("arc_type", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_f_9pywrapfst_4_Fst_arc_type(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1418, __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("pywrapfst._Fst.arc_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":1426
 *     return self._fst.get().ArcType()
 * 
 *   cpdef ArcIterator arcs(self, int64 state):             # <<<<<<<<<<<<<<
 *     """
 *     arcs(self, state)
 */

static PyObject *__pyx_pw_9pywrapfst_4_Fst_13arcs(PyObject *__pyx_v_self, PyObject *__pyx_arg_state); /*proto*/
static struct __pyx_obj_9pywrapfst_ArcIterator *__pyx_f_9pywrapfst_4_Fst_arcs(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_self, __pyx_t_10basictypes_int64 __pyx_v_state, int __pyx_skip_dispatch) {
  struct __pyx_obj_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;
  PyObject *__pyx_t_6 = NULL;
  __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)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_arcs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1426, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_4_Fst_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, 1426, __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);
        }
      }
      if (!__pyx_t_5) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1426, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_4)) {
          PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1426, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
          PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1426, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        } else
        #endif
        {
          __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1426, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
          __Pyx_GIVEREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3);
          __pyx_t_3 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1426, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_9pywrapfst_ArcIterator))))) __PYX_ERR(0, 1426, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_9pywrapfst_ArcIterator *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pywrapfst.pyx":1440
 *     See also: `mutable_arcs`, `states`.
 *     """
 *     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, 1440, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1440, __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_9pywrapfst_ArcIterator), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1440, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = ((struct __pyx_obj_9pywrapfst_ArcIterator *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":1426
 *     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_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("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_9pywrapfst_4_Fst_13arcs(PyObject *__pyx_v_self, PyObject *__pyx_arg_state); /*proto*/
static char __pyx_doc_9pywrapfst_4_Fst_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\n    See also: `mutable_arcs`, `states`.\n    ";
static PyObject *__pyx_pw_9pywrapfst_4_Fst_13arcs(PyObject *__pyx_v_self, PyObject *__pyx_arg_state) {
  __pyx_t_10basictypes_int64 __pyx_v_state;
  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_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1426, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pywrapfst._Fst.arcs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pywrapfst_4_Fst_12arcs(((struct __pyx_obj_9pywrapfst__Fst *)__pyx_v_self), ((__pyx_t_10basictypes_int64)__pyx_v_state));

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

static PyObject *__pyx_pf_9pywrapfst_4_Fst_12arcs(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_self, __pyx_t_10basictypes_int64 __pyx_v_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("arcs", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_4_Fst_arcs(__pyx_v_self, __pyx_v_state, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1426, __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("pywrapfst._Fst.arcs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":1442
 *     return ArcIterator(self, state)
 * 
 *   cpdef _Fst copy(self):             # <<<<<<<<<<<<<<
 *     """
 *     copy(self)
 */

static PyObject *__pyx_pw_9pywrapfst_4_Fst_15copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst_4_Fst_copy(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_self, int __pyx_skip_dispatch) {
  struct __pyx_obj_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;
  __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)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_copy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1442, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_4_Fst_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);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1442, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1442, __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_9pywrapfst__Fst))))) __PYX_ERR(0, 1442, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_9pywrapfst__Fst *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pywrapfst.pyx":1448
 *     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, 1448, __pyx_L1_error)
  }
  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_XFst(new fst::script::FstClass((*__pyx_v_self->_fst)))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1448, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_9pywrapfst__Fst *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":1442
 *     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("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_9pywrapfst_4_Fst_15copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_9pywrapfst_4_Fst_14copy[] = "\n    copy(self)\n\n    Makes a copy of the FST.\n    ";
static PyObject *__pyx_pw_9pywrapfst_4_Fst_15copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("copy (wrapper)", 0);
  __pyx_r = __pyx_pf_9pywrapfst_4_Fst_14copy(((struct __pyx_obj_9pywrapfst__Fst *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_4_Fst_14copy(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("copy", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_4_Fst_copy(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1442, __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("pywrapfst._Fst.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":1450
 *     return _init_XFst(new fst.FstClass(deref(self._fst)))
 * 
 *   cpdef void draw(self,             # <<<<<<<<<<<<<<
 *                   filename,
 *                   _SymbolTable isymbols=None,
 */

static PyObject *__pyx_pw_9pywrapfst_4_Fst_17draw(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static void __pyx_f_9pywrapfst_4_Fst_draw(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_self, PyObject *__pyx_v_filename, int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_4_Fst_draw *__pyx_optional_args) {

  /* "pywrapfst.pyx":1452
 *   cpdef void draw(self,
 *                   filename,
 *                   _SymbolTable isymbols=None,             # <<<<<<<<<<<<<<
 *                   _SymbolTable osymbols=None,
 *                   SymbolTable ssymbols=None,
 */
  struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_isymbols = ((struct __pyx_obj_9pywrapfst__SymbolTable *)Py_None);

  /* "pywrapfst.pyx":1453
 *                   filename,
 *                   _SymbolTable isymbols=None,
 *                   _SymbolTable osymbols=None,             # <<<<<<<<<<<<<<
 *                   SymbolTable ssymbols=None,
 *                   bool acceptor=False,
 */
  struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_osymbols = ((struct __pyx_obj_9pywrapfst__SymbolTable *)Py_None);

  /* "pywrapfst.pyx":1454
 *                   _SymbolTable isymbols=None,
 *                   _SymbolTable osymbols=None,
 *                   SymbolTable ssymbols=None,             # <<<<<<<<<<<<<<
 *                   bool acceptor=False,
 *                   title=b"",
 */
  struct __pyx_obj_9pywrapfst_SymbolTable *__pyx_v_ssymbols = ((struct __pyx_obj_9pywrapfst_SymbolTable *)Py_None);

  /* "pywrapfst.pyx":1455
 *                   _SymbolTable osymbols=None,
 *                   SymbolTable ssymbols=None,
 *                   bool acceptor=False,             # <<<<<<<<<<<<<<
 *                   title=b"",
 *                   double width=8.5,
 */
  bool __pyx_v_acceptor = ((bool)0);
  PyObject *__pyx_v_title = ((PyObject *)__pyx_kp_b__24);
  double __pyx_v_width = ((double)8.5);
  double __pyx_v_height = ((double)11.0);

  /* "pywrapfst.pyx":1459
 *                   double width=8.5,
 *                   double height=11,
 *                   bool portrait=False,             # <<<<<<<<<<<<<<
 *                   bool vertical=False,
 *                   double ranksep=0.4,
 */
  bool __pyx_v_portrait = ((bool)0);

  /* "pywrapfst.pyx":1460
 *                   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);
  __pyx_t_10basictypes_int32 __pyx_v_fontsize = ((__pyx_t_10basictypes_int32)14);
  __pyx_t_10basictypes_int32 __pyx_v_precision = ((__pyx_t_10basictypes_int32)5);
  PyObject *__pyx_v_float_format = ((PyObject *)__pyx_n_b_g);

  /* "pywrapfst.pyx":1466
 *                   int32 precision=5,
 *                   float_format=b"g",
 *                   bool show_weight_one=False):             # <<<<<<<<<<<<<<
 *     """
 *     draw(self, filename, isymbols=None, osymbols=None, ssymbols=None,
 */
  bool __pyx_v_show_weight_one = ((bool)0);
  std::string __pyx_v_filename_string;
  std::unique_ptr<std::ofstream>  __pyx_v_ostrm;
  fst::SymbolTable *__pyx_v_ssymbols_ptr;
  __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 *__pyx_t_20;
  fst::SymbolTable const *__pyx_t_21;
  fst::SymbolTable const *__pyx_t_22;
  std::string __pyx_t_23;
  __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;
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }

  /* "pywrapfst.pyx":1450
 *     return _init_XFst(new fst.FstClass(deref(self._fst)))
 * 
 *   cpdef void draw(self,             # <<<<<<<<<<<<<<
 *                   filename,
 *                   _SymbolTable 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)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_draw); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1450, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_4_Fst_17draw)) {
      __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_acceptor); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1450, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyFloat_FromDouble(__pyx_v_width); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1450, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = PyFloat_FromDouble(__pyx_v_height); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1450, __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, 1450, __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, 1450, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = PyFloat_FromDouble(__pyx_v_ranksep); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1450, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_9 = PyFloat_FromDouble(__pyx_v_nodesep); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1450, __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, 1450, __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, 1450, __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, 1450, __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_filename, ((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, 1450, __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_filename, ((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, 1450, __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, 1450, __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_filename);
        __Pyx_GIVEREF(__pyx_v_filename);
        PyTuple_SET_ITEM(__pyx_t_16, 0+__pyx_t_15, __pyx_v_filename);
        __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, 1450, __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;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pywrapfst.pyx":1500
 *     See also: `text`.
 *     """
 *     cdef string filename_string = tostring(filename)             # <<<<<<<<<<<<<<
 *     cdef unique_ptr[ofstream] ostrm
 *     ostrm.reset(new ofstream(filename_string))
 */
  __pyx_t_17 = __pyx_f_9pywrapfst_tostring(__pyx_v_filename, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1500, __pyx_L1_error)
  __pyx_v_filename_string = __pyx_t_17;

  /* "pywrapfst.pyx":1502
 *     cdef string filename_string = tostring(filename)
 *     cdef unique_ptr[ofstream] ostrm
 *     ostrm.reset(new ofstream(filename_string))             # <<<<<<<<<<<<<<
 *     cdef fst.SymbolTable *ssymbols_ptr = NULL
 *     if ssymbols is not None:
 */
  __pyx_v_ostrm.reset(new std::ofstream(__pyx_v_filename_string));

  /* "pywrapfst.pyx":1503
 *     cdef unique_ptr[ofstream] ostrm
 *     ostrm.reset(new ofstream(filename_string))
 *     cdef fst.SymbolTable *ssymbols_ptr = NULL             # <<<<<<<<<<<<<<
 *     if ssymbols is not None:
 *       ssymbols_ptr = ssymbols._table
 */
  __pyx_v_ssymbols_ptr = NULL;

  /* "pywrapfst.pyx":1504
 *     ostrm.reset(new ofstream(filename_string))
 *     cdef fst.SymbolTable *ssymbols_ptr = NULL
 *     if ssymbols is not None:             # <<<<<<<<<<<<<<
 *       ssymbols_ptr = ssymbols._table
 *     fst.DrawFst(deref(self._fst),
 */
  __pyx_t_18 = (((PyObject *)__pyx_v_ssymbols) != Py_None);
  __pyx_t_19 = (__pyx_t_18 != 0);
  if (__pyx_t_19) {

    /* "pywrapfst.pyx":1505
 *     cdef fst.SymbolTable *ssymbols_ptr = NULL
 *     if ssymbols is not None:
 *       ssymbols_ptr = ssymbols._table             # <<<<<<<<<<<<<<
 *     fst.DrawFst(deref(self._fst),
 *         self._fst.get().InputSymbols() if isymbols is None
 */
    if (unlikely(((PyObject *)__pyx_v_ssymbols) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_table");
      __PYX_ERR(0, 1505, __pyx_L1_error)
    }
    __pyx_t_20 = __pyx_v_ssymbols->__pyx_base.__pyx_base._table;
    __pyx_v_ssymbols_ptr = __pyx_t_20;

    /* "pywrapfst.pyx":1504
 *     ostrm.reset(new ofstream(filename_string))
 *     cdef fst.SymbolTable *ssymbols_ptr = NULL
 *     if ssymbols is not None:             # <<<<<<<<<<<<<<
 *       ssymbols_ptr = ssymbols._table
 *     fst.DrawFst(deref(self._fst),
 */
  }

  /* "pywrapfst.pyx":1506
 *     if ssymbols is not None:
 *       ssymbols_ptr = ssymbols._table
 *     fst.DrawFst(deref(self._fst),             # <<<<<<<<<<<<<<
 *         self._fst.get().InputSymbols() if isymbols is None
 *         else isymbols._table,
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 1506, __pyx_L1_error)
  }

  /* "pywrapfst.pyx":1507
 *       ssymbols_ptr = ssymbols._table
 *     fst.DrawFst(deref(self._fst),
 *         self._fst.get().InputSymbols() if isymbols is None             # <<<<<<<<<<<<<<
 *         else isymbols._table,
 *         self._fst.get().OutputSymbols() if osymbols is None
 */
  __pyx_t_19 = (((PyObject *)__pyx_v_isymbols) == Py_None);
  if ((__pyx_t_19 != 0)) {
    if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
      __PYX_ERR(0, 1507, __pyx_L1_error)
    }
    __pyx_t_21 = __pyx_v_self->_fst.get()->InputSymbols();
  } else {

    /* "pywrapfst.pyx":1508
 *     fst.DrawFst(deref(self._fst),
 *         self._fst.get().InputSymbols() if isymbols is None
 *         else isymbols._table,             # <<<<<<<<<<<<<<
 *         self._fst.get().OutputSymbols() if osymbols is None
 *         else osymbols._table,
 */
    if (unlikely(((PyObject *)__pyx_v_isymbols) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_table");
      __PYX_ERR(0, 1508, __pyx_L1_error)
    }
    __pyx_t_21 = __pyx_v_isymbols->_table;
  }

  /* "pywrapfst.pyx":1509
 *         self._fst.get().InputSymbols() if isymbols is None
 *         else isymbols._table,
 *         self._fst.get().OutputSymbols() if osymbols is None             # <<<<<<<<<<<<<<
 *         else osymbols._table,
 *         ssymbols_ptr, acceptor, tostring(title), width, height, portrait,
 */
  __pyx_t_19 = (((PyObject *)__pyx_v_osymbols) == Py_None);
  if ((__pyx_t_19 != 0)) {
    if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
      __PYX_ERR(0, 1509, __pyx_L1_error)
    }
    __pyx_t_22 = __pyx_v_self->_fst.get()->OutputSymbols();
  } else {

    /* "pywrapfst.pyx":1510
 *         else isymbols._table,
 *         self._fst.get().OutputSymbols() if osymbols is None
 *         else osymbols._table,             # <<<<<<<<<<<<<<
 *         ssymbols_ptr, acceptor, tostring(title), width, height, portrait,
 *         vertical, ranksep, nodesep, fontsize, precision,
 */
    if (unlikely(((PyObject *)__pyx_v_osymbols) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_table");
      __PYX_ERR(0, 1510, __pyx_L1_error)
    }
    __pyx_t_22 = __pyx_v_osymbols->_table;
  }

  /* "pywrapfst.pyx":1511
 *         self._fst.get().OutputSymbols() if osymbols is None
 *         else osymbols._table,
 *         ssymbols_ptr, acceptor, tostring(title), width, height, portrait,             # <<<<<<<<<<<<<<
 *         vertical, ranksep, nodesep, fontsize, precision,
 *         tostring(float_format), show_weight_one, ostrm.get(),
 */
  __pyx_t_17 = __pyx_f_9pywrapfst_tostring(__pyx_v_title, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1511, __pyx_L1_error)

  /* "pywrapfst.pyx":1513
 *         ssymbols_ptr, acceptor, tostring(title), width, height, portrait,
 *         vertical, ranksep, nodesep, fontsize, precision,
 *         tostring(float_format), show_weight_one, ostrm.get(),             # <<<<<<<<<<<<<<
 *         filename_string)
 * 
 */
  __pyx_t_23 = __pyx_f_9pywrapfst_tostring(__pyx_v_float_format, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1513, __pyx_L1_error)

  /* "pywrapfst.pyx":1506
 *     if ssymbols is not None:
 *       ssymbols_ptr = ssymbols._table
 *     fst.DrawFst(deref(self._fst),             # <<<<<<<<<<<<<<
 *         self._fst.get().InputSymbols() if isymbols is None
 *         else isymbols._table,
 */
  fst::script::DrawFst((*__pyx_v_self->_fst), __pyx_t_21, __pyx_t_22, __pyx_v_ssymbols_ptr, __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_23, __pyx_v_show_weight_one, __pyx_v_ostrm.get(), __pyx_v_filename_string);

  /* "pywrapfst.pyx":1450
 *     return _init_XFst(new fst.FstClass(deref(self._fst)))
 * 
 *   cpdef void draw(self,             # <<<<<<<<<<<<<<
 *                   filename,
 *                   _SymbolTable 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_WriteUnraisable("pywrapfst._Fst.draw", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_4_Fst_17draw(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9pywrapfst_4_Fst_16draw[] = "\n    draw(self, filename, 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      filename: 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\n    See also: `text`.\n    ";
static PyObject *__pyx_pw_9pywrapfst_4_Fst_17draw(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_filename = 0;
  struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_isymbols = 0;
  struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_osymbols = 0;
  struct __pyx_obj_9pywrapfst_SymbolTable *__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;
  __pyx_t_10basictypes_int32 __pyx_v_fontsize;
  __pyx_t_10basictypes_int32 __pyx_v_precision;
  PyObject *__pyx_v_float_format = 0;
  bool __pyx_v_show_weight_one;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("draw (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_filename,&__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};

    /* "pywrapfst.pyx":1452
 *   cpdef void draw(self,
 *                   filename,
 *                   _SymbolTable isymbols=None,             # <<<<<<<<<<<<<<
 *                   _SymbolTable osymbols=None,
 *                   SymbolTable ssymbols=None,
 */
    values[1] = (PyObject *)((struct __pyx_obj_9pywrapfst__SymbolTable *)Py_None);

    /* "pywrapfst.pyx":1453
 *                   filename,
 *                   _SymbolTable isymbols=None,
 *                   _SymbolTable osymbols=None,             # <<<<<<<<<<<<<<
 *                   SymbolTable ssymbols=None,
 *                   bool acceptor=False,
 */
    values[2] = (PyObject *)((struct __pyx_obj_9pywrapfst__SymbolTable *)Py_None);

    /* "pywrapfst.pyx":1454
 *                   _SymbolTable isymbols=None,
 *                   _SymbolTable osymbols=None,
 *                   SymbolTable ssymbols=None,             # <<<<<<<<<<<<<<
 *                   bool acceptor=False,
 *                   title=b"",
 */
    values[3] = (PyObject *)((struct __pyx_obj_9pywrapfst_SymbolTable *)Py_None);
    values[5] = ((PyObject *)__pyx_kp_b__24);
    values[14] = ((PyObject *)__pyx_n_b_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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_filename)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_isymbols);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_osymbols);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ssymbols);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_acceptor);
          if (value) { values[4] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_title);
          if (value) { values[5] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_width);
          if (value) { values[6] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_height);
          if (value) { values[7] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_portrait);
          if (value) { values[8] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_vertical);
          if (value) { values[9] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case 10:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ranksep);
          if (value) { values[10] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case 11:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nodesep);
          if (value) { values[11] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case 12:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fontsize);
          if (value) { values[12] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case 13:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_precision);
          if (value) { values[13] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case 14:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_float_format);
          if (value) { values[14] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case 15:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__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, 1450, __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_filename = values[0];
    __pyx_v_isymbols = ((struct __pyx_obj_9pywrapfst__SymbolTable *)values[1]);
    __pyx_v_osymbols = ((struct __pyx_obj_9pywrapfst__SymbolTable *)values[2]);
    __pyx_v_ssymbols = ((struct __pyx_obj_9pywrapfst_SymbolTable *)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, 1455, __pyx_L3_error)
    } else {

      /* "pywrapfst.pyx":1455
 *                   _SymbolTable osymbols=None,
 *                   SymbolTable ssymbols=None,
 *                   bool acceptor=False,             # <<<<<<<<<<<<<<
 *                   title=b"",
 *                   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, 1457, __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, 1458, __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, 1459, __pyx_L3_error)
    } else {

      /* "pywrapfst.pyx":1459
 *                   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, 1460, __pyx_L3_error)
    } else {

      /* "pywrapfst.pyx":1460
 *                   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, 1461, __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, 1462, __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_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1463, __pyx_L3_error)
    } else {
      __pyx_v_fontsize = ((__pyx_t_10basictypes_int32)14);
    }
    if (values[13]) {
      __pyx_v_precision = __Pyx_PyInt_As_int32_t(values[13]); if (unlikely((__pyx_v_precision == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1464, __pyx_L3_error)
    } else {
      __pyx_v_precision = ((__pyx_t_10basictypes_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, 1466, __pyx_L3_error)
    } else {

      /* "pywrapfst.pyx":1466
 *                   int32 precision=5,
 *                   float_format=b"g",
 *                   bool show_weight_one=False):             # <<<<<<<<<<<<<<
 *     """
 *     draw(self, filename, 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, 1450, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("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_9pywrapfst__SymbolTable, 1, "isymbols", 0))) __PYX_ERR(0, 1452, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_osymbols), __pyx_ptype_9pywrapfst__SymbolTable, 1, "osymbols", 0))) __PYX_ERR(0, 1453, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ssymbols), __pyx_ptype_9pywrapfst_SymbolTable, 1, "ssymbols", 0))) __PYX_ERR(0, 1454, __pyx_L1_error)
  __pyx_r = __pyx_pf_9pywrapfst_4_Fst_16draw(((struct __pyx_obj_9pywrapfst__Fst *)__pyx_v_self), __pyx_v_filename, __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);

  /* "pywrapfst.pyx":1450
 *     return _init_XFst(new fst.FstClass(deref(self._fst)))
 * 
 *   cpdef void draw(self,             # <<<<<<<<<<<<<<
 *                   filename,
 *                   _SymbolTable 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_9pywrapfst_4_Fst_16draw(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_self, PyObject *__pyx_v_filename, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_isymbols, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_osymbols, struct __pyx_obj_9pywrapfst_SymbolTable *__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, __pyx_t_10basictypes_int32 __pyx_v_fontsize, __pyx_t_10basictypes_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_9pywrapfst_4_Fst_draw __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __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_9pywrapfst__Fst->draw(__pyx_v_self, __pyx_v_filename, 1, &__pyx_t_1); 
  __pyx_t_2 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1450, __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("pywrapfst._Fst.draw", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":1516
 *         filename_string)
 * 
 *   cpdef Weight final(self, int64 state):             # <<<<<<<<<<<<<<
 *     """
 *     final(self, state)
 */

static PyObject *__pyx_pw_9pywrapfst_4_Fst_19final(PyObject *__pyx_v_self, PyObject *__pyx_arg_state); /*proto*/
static struct __pyx_obj_9pywrapfst_Weight *__pyx_f_9pywrapfst_4_Fst_final(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_self, __pyx_t_10basictypes_int64 __pyx_v_state, int __pyx_skip_dispatch) {
  struct __pyx_obj_9pywrapfst_Weight *__pyx_v_weight = 0;
  struct __pyx_obj_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;
  PyObject *__pyx_t_6 = NULL;
  __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)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_final); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1516, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_4_Fst_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, 1516, __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);
        }
      }
      if (!__pyx_t_5) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1516, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_4)) {
          PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1516, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
          PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1516, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        } else
        #endif
        {
          __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1516, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
          __Pyx_GIVEREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3);
          __pyx_t_3 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1516, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_9pywrapfst_Weight))))) __PYX_ERR(0, 1516, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pywrapfst.pyx":1531
 *       FstIndexError: State index out of range.
 *     """
 *     cdef Weight weight = Weight.__new__(Weight)             # <<<<<<<<<<<<<<
 *     weight._weight.reset(new fst.WeightClass(self._fst.get().Final(state)))
 *     return weight
 */
  __pyx_t_1 = __pyx_tp_new_9pywrapfst_Weight(((PyTypeObject *)__pyx_ptype_9pywrapfst_Weight), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1531, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_9pywrapfst_Weight)))) __PYX_ERR(0, 1531, __pyx_L1_error)
  __pyx_v_weight = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pywrapfst.pyx":1532
 *     """
 *     cdef Weight weight = Weight.__new__(Weight)
 *     weight._weight.reset(new fst.WeightClass(self._fst.get().Final(state)))             # <<<<<<<<<<<<<<
 *     return weight
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_weight) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_weight");
    __PYX_ERR(0, 1532, __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, 1532, __pyx_L1_error)
  }
  __pyx_v_weight->_weight.reset(new fst::script::WeightClass(__pyx_v_self->_fst.get()->Final(__pyx_v_state)));

  /* "pywrapfst.pyx":1533
 *     cdef Weight weight = Weight.__new__(Weight)
 *     weight._weight.reset(new fst.WeightClass(self._fst.get().Final(state)))
 *     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;

  /* "pywrapfst.pyx":1516
 *         filename_string)
 * 
 *   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_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("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_9pywrapfst_4_Fst_19final(PyObject *__pyx_v_self, PyObject *__pyx_arg_state); /*proto*/
static char __pyx_doc_9pywrapfst_4_Fst_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_9pywrapfst_4_Fst_19final(PyObject *__pyx_v_self, PyObject *__pyx_arg_state) {
  __pyx_t_10basictypes_int64 __pyx_v_state;
  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_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1516, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pywrapfst._Fst.final", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pywrapfst_4_Fst_18final(((struct __pyx_obj_9pywrapfst__Fst *)__pyx_v_self), ((__pyx_t_10basictypes_int64)__pyx_v_state));

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

static PyObject *__pyx_pf_9pywrapfst_4_Fst_18final(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_self, __pyx_t_10basictypes_int64 __pyx_v_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("final", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_4_Fst_final(__pyx_v_self, __pyx_v_state, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1516, __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("pywrapfst._Fst.final", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":1535
 *     return weight
 * 
 *   cpdef string fst_type(self):             # <<<<<<<<<<<<<<
 *     """
 *     fst_type(self)
 */

static PyObject *__pyx_pw_9pywrapfst_4_Fst_21fst_type(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static std::string __pyx_f_9pywrapfst_4_Fst_fst_type(struct __pyx_obj_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;
  __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)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_fst_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1535, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_4_Fst_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);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1535, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1535, __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, 1535, __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;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pywrapfst.pyx":1541
 *     Returns a string indicating the FST type.
 *     """
 *     return self._fst.get().FstType()             # <<<<<<<<<<<<<<
 * 
 *   cpdef _FstSymbolTable 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, 1541, __pyx_L1_error)
  }
  __pyx_r = __pyx_v_self->_fst.get()->FstType();
  goto __pyx_L0;

  /* "pywrapfst.pyx":1535
 *     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("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_9pywrapfst_4_Fst_21fst_type(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_9pywrapfst_4_Fst_20fst_type[] = "\n    fst_type(self)\n\n    Returns a string indicating the FST type.\n    ";
static PyObject *__pyx_pw_9pywrapfst_4_Fst_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_9pywrapfst_4_Fst_20fst_type(((struct __pyx_obj_9pywrapfst__Fst *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_4_Fst_20fst_type(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("fst_type", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_f_9pywrapfst_4_Fst_fst_type(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1535, __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("pywrapfst._Fst.fst_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":1543
 *     return self._fst.get().FstType()
 * 
 *   cpdef _FstSymbolTable input_symbols(self):             # <<<<<<<<<<<<<<
 *     """
 *     input_symbols(self)
 */

static PyObject *__pyx_pw_9pywrapfst_4_Fst_23input_symbols(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static struct __pyx_obj_9pywrapfst__FstSymbolTable *__pyx_f_9pywrapfst_4_Fst_input_symbols(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_self, int __pyx_skip_dispatch) {
  fst::SymbolTable *__pyx_v_syms;
  struct __pyx_obj_9pywrapfst__FstSymbolTable *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("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)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_input_symbols); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1543, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_4_Fst_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);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1543, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1543, __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_9pywrapfst__FstSymbolTable))))) __PYX_ERR(0, 1543, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_9pywrapfst__FstSymbolTable *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pywrapfst.pyx":1552
 *     """
 *     cdef fst.SymbolTable *syms = const_cast[SymbolTable_ptr](
 *       self._fst.get().InputSymbols())             # <<<<<<<<<<<<<<
 *     if syms == NULL:
 *       return
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 1552, __pyx_L1_error)
  }

  /* "pywrapfst.pyx":1551
 *     See also: `input_symbols`.
 *     """
 *     cdef fst.SymbolTable *syms = const_cast[SymbolTable_ptr](             # <<<<<<<<<<<<<<
 *       self._fst.get().InputSymbols())
 *     if syms == NULL:
 */
  __pyx_v_syms = const_cast<__pyx_t_9pywrapfst_SymbolTable_ptr>(__pyx_v_self->_fst.get()->InputSymbols());

  /* "pywrapfst.pyx":1553
 *     cdef fst.SymbolTable *syms = const_cast[SymbolTable_ptr](
 *       self._fst.get().InputSymbols())
 *     if syms == NULL:             # <<<<<<<<<<<<<<
 *       return
 *     return _init_FstSymbolTable(syms, self._fst)
 */
  __pyx_t_5 = ((__pyx_v_syms == NULL) != 0);
  if (__pyx_t_5) {

    /* "pywrapfst.pyx":1554
 *       self._fst.get().InputSymbols())
 *     if syms == NULL:
 *       return             # <<<<<<<<<<<<<<
 *     return _init_FstSymbolTable(syms, self._fst)
 * 
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_r = ((struct __pyx_obj_9pywrapfst__FstSymbolTable *)Py_None); __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "pywrapfst.pyx":1553
 *     cdef fst.SymbolTable *syms = const_cast[SymbolTable_ptr](
 *       self._fst.get().InputSymbols())
 *     if syms == NULL:             # <<<<<<<<<<<<<<
 *       return
 *     return _init_FstSymbolTable(syms, self._fst)
 */
  }

  /* "pywrapfst.pyx":1555
 *     if syms == NULL:
 *       return
 *     return _init_FstSymbolTable(syms, self._fst)             # <<<<<<<<<<<<<<
 * 
 *   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, 1555, __pyx_L1_error)
  }
  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_FstSymbolTable(__pyx_v_syms, __pyx_v_self->_fst)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1555, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_9pywrapfst__FstSymbolTable *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":1543
 *     return self._fst.get().FstType()
 * 
 *   cpdef _FstSymbolTable 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("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_9pywrapfst_4_Fst_23input_symbols(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_9pywrapfst_4_Fst_22input_symbols[] = "\n    input_symbols(self)\n\n    Returns the FST's input symbol table, or None if none is present.\n\n    See also: `input_symbols`.\n    ";
static PyObject *__pyx_pw_9pywrapfst_4_Fst_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_9pywrapfst_4_Fst_22input_symbols(((struct __pyx_obj_9pywrapfst__Fst *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_4_Fst_22input_symbols(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("input_symbols", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_4_Fst_input_symbols(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1543, __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("pywrapfst._Fst.input_symbols", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":1557
 *     return _init_FstSymbolTable(syms, self._fst)
 * 
 *   cpdef size_t num_arcs(self, int64 state) except *:             # <<<<<<<<<<<<<<
 *     """
 *     num_arcs(self, state)
 */

static PyObject *__pyx_pw_9pywrapfst_4_Fst_25num_arcs(PyObject *__pyx_v_self, PyObject *__pyx_arg_state); /*proto*/
static size_t __pyx_f_9pywrapfst_4_Fst_num_arcs(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_self, __pyx_t_10basictypes_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;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  int __pyx_t_8;
  __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)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_arcs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1557, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_4_Fst_25num_arcs)) {
      __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_v_state); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1557, __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);
        }
      }
      if (!__pyx_t_5) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1557, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_4)) {
          PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1557, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
          PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1557, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        } else
        #endif
        {
          __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1557, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
          __Pyx_GIVEREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3);
          __pyx_t_3 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1557, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_7 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1557, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_7;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pywrapfst.pyx":1574
 *     See also: `num_states`.
 *     """
 *     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, 1574, __pyx_L1_error)
  }
  __pyx_v_result = __pyx_v_self->_fst.get()->NumArcs(__pyx_v_state);

  /* "pywrapfst.pyx":1575
 *     """
 *     cdef size_t result = self._fst.get().NumArcs(state)
 *     if result == SIZE_MAX:             # <<<<<<<<<<<<<<
 *       raise FstIndexError("State index out of range")
 *     return result
 */
  __pyx_t_8 = ((__pyx_v_result == SIZE_MAX) != 0);
  if (__pyx_t_8) {

    /* "pywrapfst.pyx":1576
 *     cdef size_t result = self._fst.get().NumArcs(state)
 *     if result == SIZE_MAX:
 *       raise FstIndexError("State index out of range")             # <<<<<<<<<<<<<<
 *     return result
 * 
 */
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1576, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1576, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 1576, __pyx_L1_error)

    /* "pywrapfst.pyx":1575
 *     """
 *     cdef size_t result = self._fst.get().NumArcs(state)
 *     if result == SIZE_MAX:             # <<<<<<<<<<<<<<
 *       raise FstIndexError("State index out of range")
 *     return result
 */
  }

  /* "pywrapfst.pyx":1577
 *     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;

  /* "pywrapfst.pyx":1557
 *     return _init_FstSymbolTable(syms, self._fst)
 * 
 *   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_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("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_9pywrapfst_4_Fst_25num_arcs(PyObject *__pyx_v_self, PyObject *__pyx_arg_state); /*proto*/
static char __pyx_doc_9pywrapfst_4_Fst_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\n    See also: `num_states`.\n    ";
static PyObject *__pyx_pw_9pywrapfst_4_Fst_25num_arcs(PyObject *__pyx_v_self, PyObject *__pyx_arg_state) {
  __pyx_t_10basictypes_int64 __pyx_v_state;
  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_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1557, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pywrapfst._Fst.num_arcs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pywrapfst_4_Fst_24num_arcs(((struct __pyx_obj_9pywrapfst__Fst *)__pyx_v_self), ((__pyx_t_10basictypes_int64)__pyx_v_state));

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

static PyObject *__pyx_pf_9pywrapfst_4_Fst_24num_arcs(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_self, __pyx_t_10basictypes_int64 __pyx_v_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  size_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("num_arcs", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_9pywrapfst_4_Fst_num_arcs(__pyx_v_self, __pyx_v_state, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1557, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1557, __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("pywrapfst._Fst.num_arcs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":1579
 *     return result
 * 
 *   cpdef size_t num_input_epsilons(self, int64 state) except *:             # <<<<<<<<<<<<<<
 *     """
 *     num_input_epsilons(self, state)
 */

static PyObject *__pyx_pw_9pywrapfst_4_Fst_27num_input_epsilons(PyObject *__pyx_v_self, PyObject *__pyx_arg_state); /*proto*/
static size_t __pyx_f_9pywrapfst_4_Fst_num_input_epsilons(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_self, __pyx_t_10basictypes_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;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  int __pyx_t_8;
  __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)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_input_epsilons); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1579, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_4_Fst_27num_input_epsilons)) {
      __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_v_state); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1579, __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);
        }
      }
      if (!__pyx_t_5) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1579, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_4)) {
          PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1579, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
          PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1579, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        } else
        #endif
        {
          __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1579, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
          __Pyx_GIVEREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3);
          __pyx_t_3 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1579, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_7 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1579, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_7;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pywrapfst.pyx":1596
 *     See also: `num_output_epsilons`.
 *     """
 *     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, 1596, __pyx_L1_error)
  }
  __pyx_v_result = __pyx_v_self->_fst.get()->NumInputEpsilons(__pyx_v_state);

  /* "pywrapfst.pyx":1597
 *     """
 *     cdef size_t result = self._fst.get().NumInputEpsilons(state)
 *     if result == SIZE_MAX:             # <<<<<<<<<<<<<<
 *       raise FstIndexError("State index out of range")
 *     return result
 */
  __pyx_t_8 = ((__pyx_v_result == SIZE_MAX) != 0);
  if (__pyx_t_8) {

    /* "pywrapfst.pyx":1598
 *     cdef size_t result = self._fst.get().NumInputEpsilons(state)
 *     if result == SIZE_MAX:
 *       raise FstIndexError("State index out of range")             # <<<<<<<<<<<<<<
 *     return result
 * 
 */
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1598, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1598, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 1598, __pyx_L1_error)

    /* "pywrapfst.pyx":1597
 *     """
 *     cdef size_t result = self._fst.get().NumInputEpsilons(state)
 *     if result == SIZE_MAX:             # <<<<<<<<<<<<<<
 *       raise FstIndexError("State index out of range")
 *     return result
 */
  }

  /* "pywrapfst.pyx":1599
 *     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;

  /* "pywrapfst.pyx":1579
 *     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_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("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_9pywrapfst_4_Fst_27num_input_epsilons(PyObject *__pyx_v_self, PyObject *__pyx_arg_state); /*proto*/
static char __pyx_doc_9pywrapfst_4_Fst_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\n    See also: `num_output_epsilons`.\n    ";
static PyObject *__pyx_pw_9pywrapfst_4_Fst_27num_input_epsilons(PyObject *__pyx_v_self, PyObject *__pyx_arg_state) {
  __pyx_t_10basictypes_int64 __pyx_v_state;
  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_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1579, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pywrapfst._Fst.num_input_epsilons", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pywrapfst_4_Fst_26num_input_epsilons(((struct __pyx_obj_9pywrapfst__Fst *)__pyx_v_self), ((__pyx_t_10basictypes_int64)__pyx_v_state));

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

static PyObject *__pyx_pf_9pywrapfst_4_Fst_26num_input_epsilons(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_self, __pyx_t_10basictypes_int64 __pyx_v_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  size_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("num_input_epsilons", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_9pywrapfst_4_Fst_num_input_epsilons(__pyx_v_self, __pyx_v_state, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1579, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1579, __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("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;
}

/* "pywrapfst.pyx":1601
 *     return result
 * 
 *   cpdef size_t num_output_epsilons(self, int64 state) except *:             # <<<<<<<<<<<<<<
 *     """
 *     num_output_epsilons(self, state)
 */

static PyObject *__pyx_pw_9pywrapfst_4_Fst_29num_output_epsilons(PyObject *__pyx_v_self, PyObject *__pyx_arg_state); /*proto*/
static size_t __pyx_f_9pywrapfst_4_Fst_num_output_epsilons(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_self, __pyx_t_10basictypes_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;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  int __pyx_t_8;
  __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)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_output_epsilons); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1601, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_4_Fst_29num_output_epsilons)) {
      __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_v_state); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1601, __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);
        }
      }
      if (!__pyx_t_5) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1601, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_4)) {
          PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1601, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
          PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1601, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        } else
        #endif
        {
          __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1601, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
          __Pyx_GIVEREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3);
          __pyx_t_3 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1601, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_7 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1601, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_7;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pywrapfst.pyx":1618
 *     See also: `num_input_epsilons`.
 *     """
 *     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, 1618, __pyx_L1_error)
  }
  __pyx_v_result = __pyx_v_self->_fst.get()->NumOutputEpsilons(__pyx_v_state);

  /* "pywrapfst.pyx":1619
 *     """
 *     cdef size_t result = self._fst.get().NumOutputEpsilons(state)
 *     if result == SIZE_MAX:             # <<<<<<<<<<<<<<
 *       raise FstIndexError("State index out of range")
 *     return result
 */
  __pyx_t_8 = ((__pyx_v_result == SIZE_MAX) != 0);
  if (__pyx_t_8) {

    /* "pywrapfst.pyx":1620
 *     cdef size_t result = self._fst.get().NumOutputEpsilons(state)
 *     if result == SIZE_MAX:
 *       raise FstIndexError("State index out of range")             # <<<<<<<<<<<<<<
 *     return result
 * 
 */
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1620, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1620, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 1620, __pyx_L1_error)

    /* "pywrapfst.pyx":1619
 *     """
 *     cdef size_t result = self._fst.get().NumOutputEpsilons(state)
 *     if result == SIZE_MAX:             # <<<<<<<<<<<<<<
 *       raise FstIndexError("State index out of range")
 *     return result
 */
  }

  /* "pywrapfst.pyx":1621
 *     if result == SIZE_MAX:
 *       raise FstIndexError("State index out of range")
 *     return result             # <<<<<<<<<<<<<<
 * 
 *   cpdef _FstSymbolTable output_symbols(self):
 */
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "pywrapfst.pyx":1601
 *     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_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("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_9pywrapfst_4_Fst_29num_output_epsilons(PyObject *__pyx_v_self, PyObject *__pyx_arg_state); /*proto*/
static char __pyx_doc_9pywrapfst_4_Fst_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\n    See also: `num_input_epsilons`.\n    ";
static PyObject *__pyx_pw_9pywrapfst_4_Fst_29num_output_epsilons(PyObject *__pyx_v_self, PyObject *__pyx_arg_state) {
  __pyx_t_10basictypes_int64 __pyx_v_state;
  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_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1601, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pywrapfst._Fst.num_output_epsilons", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pywrapfst_4_Fst_28num_output_epsilons(((struct __pyx_obj_9pywrapfst__Fst *)__pyx_v_self), ((__pyx_t_10basictypes_int64)__pyx_v_state));

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

static PyObject *__pyx_pf_9pywrapfst_4_Fst_28num_output_epsilons(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_self, __pyx_t_10basictypes_int64 __pyx_v_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  size_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("num_output_epsilons", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_9pywrapfst_4_Fst_num_output_epsilons(__pyx_v_self, __pyx_v_state, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1601, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1601, __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("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;
}

/* "pywrapfst.pyx":1623
 *     return result
 * 
 *   cpdef _FstSymbolTable output_symbols(self):             # <<<<<<<<<<<<<<
 *     """
 *     output_symbols(self)
 */

static PyObject *__pyx_pw_9pywrapfst_4_Fst_31output_symbols(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static struct __pyx_obj_9pywrapfst__FstSymbolTable *__pyx_f_9pywrapfst_4_Fst_output_symbols(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_self, int __pyx_skip_dispatch) {
  fst::SymbolTable *__pyx_v_syms;
  struct __pyx_obj_9pywrapfst__FstSymbolTable *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("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)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_output_symbols); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1623, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_4_Fst_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);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1623, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1623, __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_9pywrapfst__FstSymbolTable))))) __PYX_ERR(0, 1623, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_9pywrapfst__FstSymbolTable *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pywrapfst.pyx":1632
 *     """
 *     cdef fst.SymbolTable *syms = const_cast[SymbolTable_ptr](
 *       self._fst.get().OutputSymbols())             # <<<<<<<<<<<<<<
 *     if syms == NULL:
 *       return
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 1632, __pyx_L1_error)
  }

  /* "pywrapfst.pyx":1631
 *     See also: `input_symbols`.
 *     """
 *     cdef fst.SymbolTable *syms = const_cast[SymbolTable_ptr](             # <<<<<<<<<<<<<<
 *       self._fst.get().OutputSymbols())
 *     if syms == NULL:
 */
  __pyx_v_syms = const_cast<__pyx_t_9pywrapfst_SymbolTable_ptr>(__pyx_v_self->_fst.get()->OutputSymbols());

  /* "pywrapfst.pyx":1633
 *     cdef fst.SymbolTable *syms = const_cast[SymbolTable_ptr](
 *       self._fst.get().OutputSymbols())
 *     if syms == NULL:             # <<<<<<<<<<<<<<
 *       return
 *     return _init_FstSymbolTable(syms, self._fst)
 */
  __pyx_t_5 = ((__pyx_v_syms == NULL) != 0);
  if (__pyx_t_5) {

    /* "pywrapfst.pyx":1634
 *       self._fst.get().OutputSymbols())
 *     if syms == NULL:
 *       return             # <<<<<<<<<<<<<<
 *     return _init_FstSymbolTable(syms, self._fst)
 * 
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_r = ((struct __pyx_obj_9pywrapfst__FstSymbolTable *)Py_None); __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "pywrapfst.pyx":1633
 *     cdef fst.SymbolTable *syms = const_cast[SymbolTable_ptr](
 *       self._fst.get().OutputSymbols())
 *     if syms == NULL:             # <<<<<<<<<<<<<<
 *       return
 *     return _init_FstSymbolTable(syms, self._fst)
 */
  }

  /* "pywrapfst.pyx":1635
 *     if syms == NULL:
 *       return
 *     return _init_FstSymbolTable(syms, self._fst)             # <<<<<<<<<<<<<<
 * 
 *   cpdef uint64 properties(self, uint64 mask, bool test):
 */
  __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, 1635, __pyx_L1_error)
  }
  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_FstSymbolTable(__pyx_v_syms, __pyx_v_self->_fst)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1635, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_9pywrapfst__FstSymbolTable *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":1623
 *     return result
 * 
 *   cpdef _FstSymbolTable 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("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_9pywrapfst_4_Fst_31output_symbols(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_9pywrapfst_4_Fst_30output_symbols[] = "\n    output_symbols(self)\n\n    Returns the FST's output symbol table, or None if none is present.\n\n    See also: `input_symbols`.\n    ";
static PyObject *__pyx_pw_9pywrapfst_4_Fst_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_9pywrapfst_4_Fst_30output_symbols(((struct __pyx_obj_9pywrapfst__Fst *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_4_Fst_30output_symbols(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("output_symbols", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_4_Fst_output_symbols(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1623, __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("pywrapfst._Fst.output_symbols", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":1637
 *     return _init_FstSymbolTable(syms, self._fst)
 * 
 *   cpdef uint64 properties(self, uint64 mask, bool test):             # <<<<<<<<<<<<<<
 *     """
 *     properties(self, mask, test)
 */

static PyObject *__pyx_pw_9pywrapfst_4_Fst_33properties(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static __pyx_t_10basictypes_uint64 __pyx_f_9pywrapfst_4_Fst_properties(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_self, __pyx_t_10basictypes_uint64 __pyx_v_mask, bool __pyx_v_test, int __pyx_skip_dispatch) {
  __pyx_t_10basictypes_uint64 __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;
  __pyx_t_10basictypes_uint64 __pyx_t_9;
  __Pyx_RefNannySetupContext("properties", 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)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_properties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1637, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_4_Fst_33properties)) {
      __pyx_t_3 = __Pyx_PyInt_From_uint64_t(__pyx_v_mask); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1637, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_test); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1637, __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, 1637, __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, 1637, __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, 1637, __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, 1637, __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_PyInt_As_uint64_t(__pyx_t_2); if (unlikely((__pyx_t_9 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1637, __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;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pywrapfst.pyx":1655
 *       A 64-bit bitmask representing the requested properties.
 *     """
 *     return self._fst.get().Properties(mask, test)             # <<<<<<<<<<<<<<
 * 
 *   cpdef int64 start(self):
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 1655, __pyx_L1_error)
  }
  __pyx_r = __pyx_v_self->_fst.get()->Properties(__pyx_v_mask, __pyx_v_test);
  goto __pyx_L0;

  /* "pywrapfst.pyx":1637
 *     return _init_FstSymbolTable(syms, self._fst)
 * 
 *   cpdef uint64 properties(self, uint64 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_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_WriteUnraisable("pywrapfst._Fst.properties", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_4_Fst_33properties(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9pywrapfst_4_Fst_32properties[] = "\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 64-bit bitmask representing the requested properties.\n    ";
static PyObject *__pyx_pw_9pywrapfst_4_Fst_33properties(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  __pyx_t_10basictypes_uint64 __pyx_v_mask;
  bool __pyx_v_test;
  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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_test)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("properties", 1, 2, 2, 1); __PYX_ERR(0, 1637, __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, 1637, __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 = __Pyx_PyInt_As_uint64_t(values[0]); if (unlikely((__pyx_v_mask == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1637, __pyx_L3_error)
    __pyx_v_test = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_test == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1637, __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, 1637, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pywrapfst._Fst.properties", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pywrapfst_4_Fst_32properties(((struct __pyx_obj_9pywrapfst__Fst *)__pyx_v_self), __pyx_v_mask, __pyx_v_test);

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

static PyObject *__pyx_pf_9pywrapfst_4_Fst_32properties(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_self, __pyx_t_10basictypes_uint64 __pyx_v_mask, bool __pyx_v_test) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("properties", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_uint64_t(__pyx_f_9pywrapfst_4_Fst_properties(__pyx_v_self, __pyx_v_mask, __pyx_v_test, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1637, __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("pywrapfst._Fst.properties", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":1657
 *     return self._fst.get().Properties(mask, test)
 * 
 *   cpdef int64 start(self):             # <<<<<<<<<<<<<<
 *     """
 *     start(self)
 */

static PyObject *__pyx_pw_9pywrapfst_4_Fst_35start(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static __pyx_t_10basictypes_int64 __pyx_f_9pywrapfst_4_Fst_start(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_self, int __pyx_skip_dispatch) {
  __pyx_t_10basictypes_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;
  __pyx_t_10basictypes_int64 __pyx_t_5;
  __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)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1657, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_4_Fst_35start)) {
      __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);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1657, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1657, __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_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1657, __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;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pywrapfst.pyx":1663
 *     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, 1663, __pyx_L1_error)
  }
  __pyx_r = __pyx_v_self->_fst.get()->Start();
  goto __pyx_L0;

  /* "pywrapfst.pyx":1657
 *     return self._fst.get().Properties(mask, test)
 * 
 *   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("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_9pywrapfst_4_Fst_35start(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_9pywrapfst_4_Fst_34start[] = "\n    start(self)\n\n    Returns the start state.\n    ";
static PyObject *__pyx_pw_9pywrapfst_4_Fst_35start(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("start (wrapper)", 0);
  __pyx_r = __pyx_pf_9pywrapfst_4_Fst_34start(((struct __pyx_obj_9pywrapfst__Fst *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_4_Fst_34start(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("start", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_f_9pywrapfst_4_Fst_start(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1657, __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("pywrapfst._Fst.start", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":1665
 *     return self._fst.get().Start()
 * 
 *   cpdef StateIterator states(self):             # <<<<<<<<<<<<<<
 *     """
 *     states(self)
 */

static PyObject *__pyx_pw_9pywrapfst_4_Fst_37states(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static struct __pyx_obj_9pywrapfst_StateIterator *__pyx_f_9pywrapfst_4_Fst_states(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_self, int __pyx_skip_dispatch) {
  struct __pyx_obj_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;
  __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)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_states); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1665, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_4_Fst_37states)) {
      __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);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1665, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1665, __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_9pywrapfst_StateIterator))))) __PYX_ERR(0, 1665, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_9pywrapfst_StateIterator *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pywrapfst.pyx":1676
 *     See also: `arcs`, `mutable_arcs`.
 *     """
 *     return StateIterator(self)             # <<<<<<<<<<<<<<
 * 
 *   cpdef string text(self, _SymbolTable isymbols=None,
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1676, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self));
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_9pywrapfst_StateIterator), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1676, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = ((struct __pyx_obj_9pywrapfst_StateIterator *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":1665
 *     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("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_9pywrapfst_4_Fst_37states(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_9pywrapfst_4_Fst_36states[] = "\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\n    See also: `arcs`, `mutable_arcs`.\n    ";
static PyObject *__pyx_pw_9pywrapfst_4_Fst_37states(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("states (wrapper)", 0);
  __pyx_r = __pyx_pf_9pywrapfst_4_Fst_36states(((struct __pyx_obj_9pywrapfst__Fst *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_4_Fst_36states(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("states", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_4_Fst_states(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1665, __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("pywrapfst._Fst.states", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":1678
 *     return StateIterator(self)
 * 
 *   cpdef string text(self, _SymbolTable isymbols=None,             # <<<<<<<<<<<<<<
 *       _SymbolTable osymbols=None, _SymbolTable ssymbols=None,
 *       bool acceptor=False, bool show_weight_one=False, missing_sym=b""):
 */

static PyObject *__pyx_pw_9pywrapfst_4_Fst_39text(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static std::string __pyx_f_9pywrapfst_4_Fst_text(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_4_Fst_text *__pyx_optional_args) {
  struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_isymbols = ((struct __pyx_obj_9pywrapfst__SymbolTable *)Py_None);

  /* "pywrapfst.pyx":1679
 * 
 *   cpdef string text(self, _SymbolTable isymbols=None,
 *       _SymbolTable osymbols=None, _SymbolTable ssymbols=None,             # <<<<<<<<<<<<<<
 *       bool acceptor=False, bool show_weight_one=False, missing_sym=b""):
 *     """
 */
  struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_osymbols = ((struct __pyx_obj_9pywrapfst__SymbolTable *)Py_None);
  struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_ssymbols = ((struct __pyx_obj_9pywrapfst__SymbolTable *)Py_None);

  /* "pywrapfst.pyx":1680
 *   cpdef string text(self, _SymbolTable isymbols=None,
 *       _SymbolTable osymbols=None, _SymbolTable ssymbols=None,
 *       bool acceptor=False, bool show_weight_one=False, missing_sym=b""):             # <<<<<<<<<<<<<<
 *     """
 *     text(self, isymbols=None, osymbols=None, ssymbols=None, acceptor=False,
 */
  bool __pyx_v_acceptor = ((bool)0);
  bool __pyx_v_show_weight_one = ((bool)0);
  PyObject *__pyx_v_missing_sym = ((PyObject *)__pyx_kp_b__24);
  fst::SymbolTable *__pyx_v_ssymbols_ptr;
  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 *__pyx_t_12;
  fst::SymbolTable const *__pyx_t_13;
  fst::SymbolTable const *__pyx_t_14;
  std::string __pyx_t_15;
  __Pyx_RefNannySetupContext("text", 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;
              }
            }
          }
        }
      }
    }
  }

  /* "pywrapfst.pyx":1678
 *     return StateIterator(self)
 * 
 *   cpdef string text(self, _SymbolTable isymbols=None,             # <<<<<<<<<<<<<<
 *       _SymbolTable osymbols=None, _SymbolTable ssymbols=None,
 *       bool acceptor=False, bool show_weight_one=False, missing_sym=b""):
 */
  /* 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)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_text); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1678, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_4_Fst_39text)) {
      __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_acceptor); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1678, __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, 1678, __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, 1678, __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, 1678, __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, 1678, __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, 1678, __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, 1678, __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;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pywrapfst.pyx":1703
 *     """
 *     # Prints FST to stringstream, then returns resulting string.
 *     cdef fst.SymbolTable *ssymbols_ptr = NULL             # <<<<<<<<<<<<<<
 *     if ssymbols is not None:
 *       ssymbols_ptr = ssymbols._table
 */
  __pyx_v_ssymbols_ptr = NULL;

  /* "pywrapfst.pyx":1704
 *     # Prints FST to stringstream, then returns resulting string.
 *     cdef fst.SymbolTable *ssymbols_ptr = NULL
 *     if ssymbols is not None:             # <<<<<<<<<<<<<<
 *       ssymbols_ptr = ssymbols._table
 *     cdef stringstream sstrm
 */
  __pyx_t_10 = (((PyObject *)__pyx_v_ssymbols) != Py_None);
  __pyx_t_11 = (__pyx_t_10 != 0);
  if (__pyx_t_11) {

    /* "pywrapfst.pyx":1705
 *     cdef fst.SymbolTable *ssymbols_ptr = NULL
 *     if ssymbols is not None:
 *       ssymbols_ptr = ssymbols._table             # <<<<<<<<<<<<<<
 *     cdef stringstream sstrm
 *     fst.PrintFst(deref(self._fst), sstrm, b"<pywrapfst>",
 */
    if (unlikely(((PyObject *)__pyx_v_ssymbols) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_table");
      __PYX_ERR(0, 1705, __pyx_L1_error)
    }
    __pyx_t_12 = __pyx_v_ssymbols->_table;
    __pyx_v_ssymbols_ptr = __pyx_t_12;

    /* "pywrapfst.pyx":1704
 *     # Prints FST to stringstream, then returns resulting string.
 *     cdef fst.SymbolTable *ssymbols_ptr = NULL
 *     if ssymbols is not None:             # <<<<<<<<<<<<<<
 *       ssymbols_ptr = ssymbols._table
 *     cdef stringstream sstrm
 */
  }

  /* "pywrapfst.pyx":1707
 *       ssymbols_ptr = ssymbols._table
 *     cdef stringstream sstrm
 *     fst.PrintFst(deref(self._fst), sstrm, b"<pywrapfst>",             # <<<<<<<<<<<<<<
 *         self._fst.get().InputSymbols() if isymbols is None
 *         else isymbols._table,
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 1707, __pyx_L1_error)
  }
  __pyx_t_9 = __pyx_convert_string_from_py_std__in_string(__pyx_kp_b_pywrapfst); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1707, __pyx_L1_error)

  /* "pywrapfst.pyx":1708
 *     cdef stringstream sstrm
 *     fst.PrintFst(deref(self._fst), sstrm, b"<pywrapfst>",
 *         self._fst.get().InputSymbols() if isymbols is None             # <<<<<<<<<<<<<<
 *         else isymbols._table,
 *         self._fst.get().OutputSymbols() if osymbols is None
 */
  __pyx_t_11 = (((PyObject *)__pyx_v_isymbols) == Py_None);
  if ((__pyx_t_11 != 0)) {
    if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
      __PYX_ERR(0, 1708, __pyx_L1_error)
    }
    __pyx_t_13 = __pyx_v_self->_fst.get()->InputSymbols();
  } else {

    /* "pywrapfst.pyx":1709
 *     fst.PrintFst(deref(self._fst), sstrm, b"<pywrapfst>",
 *         self._fst.get().InputSymbols() if isymbols is None
 *         else isymbols._table,             # <<<<<<<<<<<<<<
 *         self._fst.get().OutputSymbols() if osymbols is None
 *         else osymbols._table,
 */
    if (unlikely(((PyObject *)__pyx_v_isymbols) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_table");
      __PYX_ERR(0, 1709, __pyx_L1_error)
    }
    __pyx_t_13 = __pyx_v_isymbols->_table;
  }

  /* "pywrapfst.pyx":1710
 *         self._fst.get().InputSymbols() if isymbols is None
 *         else isymbols._table,
 *         self._fst.get().OutputSymbols() if osymbols is None             # <<<<<<<<<<<<<<
 *         else osymbols._table,
 *         ssymbols_ptr, acceptor, show_weight_one, tostring(missing_sym))
 */
  __pyx_t_11 = (((PyObject *)__pyx_v_osymbols) == Py_None);
  if ((__pyx_t_11 != 0)) {
    if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
      __PYX_ERR(0, 1710, __pyx_L1_error)
    }
    __pyx_t_14 = __pyx_v_self->_fst.get()->OutputSymbols();
  } else {

    /* "pywrapfst.pyx":1711
 *         else isymbols._table,
 *         self._fst.get().OutputSymbols() if osymbols is None
 *         else osymbols._table,             # <<<<<<<<<<<<<<
 *         ssymbols_ptr, acceptor, show_weight_one, tostring(missing_sym))
 *     return sstrm.str()
 */
    if (unlikely(((PyObject *)__pyx_v_osymbols) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_table");
      __PYX_ERR(0, 1711, __pyx_L1_error)
    }
    __pyx_t_14 = __pyx_v_osymbols->_table;
  }

  /* "pywrapfst.pyx":1712
 *         self._fst.get().OutputSymbols() if osymbols is None
 *         else osymbols._table,
 *         ssymbols_ptr, acceptor, show_weight_one, tostring(missing_sym))             # <<<<<<<<<<<<<<
 *     return sstrm.str()
 * 
 */
  __pyx_t_15 = __pyx_f_9pywrapfst_tostring(__pyx_v_missing_sym, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1712, __pyx_L1_error)

  /* "pywrapfst.pyx":1707
 *       ssymbols_ptr = ssymbols._table
 *     cdef stringstream sstrm
 *     fst.PrintFst(deref(self._fst), sstrm, b"<pywrapfst>",             # <<<<<<<<<<<<<<
 *         self._fst.get().InputSymbols() if isymbols is None
 *         else isymbols._table,
 */
  fst::script::PrintFst((*__pyx_v_self->_fst), __pyx_v_sstrm, __pyx_t_9, __pyx_t_13, __pyx_t_14, __pyx_v_ssymbols_ptr, __pyx_v_acceptor, __pyx_v_show_weight_one, __pyx_t_15);

  /* "pywrapfst.pyx":1713
 *         else osymbols._table,
 *         ssymbols_ptr, acceptor, show_weight_one, tostring(missing_sym))
 *     return sstrm.str()             # <<<<<<<<<<<<<<
 * 
 *   cpdef bool verify(self):
 */
  __pyx_r = __pyx_v_sstrm.str();
  goto __pyx_L0;

  /* "pywrapfst.pyx":1678
 *     return StateIterator(self)
 * 
 *   cpdef string text(self, _SymbolTable isymbols=None,             # <<<<<<<<<<<<<<
 *       _SymbolTable osymbols=None, _SymbolTable ssymbols=None,
 *       bool acceptor=False, bool show_weight_one=False, missing_sym=b""):
 */

  /* 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_WriteUnraisable("pywrapfst._Fst.text", __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_9pywrapfst_4_Fst_39text(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9pywrapfst_4_Fst_38text[] = "\n    text(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_9pywrapfst_4_Fst_39text(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_isymbols = 0;
  struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_osymbols = 0;
  struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_ssymbols = 0;
  bool __pyx_v_acceptor;
  bool __pyx_v_show_weight_one;
  PyObject *__pyx_v_missing_sym = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("text (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_9pywrapfst__SymbolTable *)Py_None);

    /* "pywrapfst.pyx":1679
 * 
 *   cpdef string text(self, _SymbolTable isymbols=None,
 *       _SymbolTable osymbols=None, _SymbolTable ssymbols=None,             # <<<<<<<<<<<<<<
 *       bool acceptor=False, bool show_weight_one=False, missing_sym=b""):
 *     """
 */
    values[1] = (PyObject *)((struct __pyx_obj_9pywrapfst__SymbolTable *)Py_None);
    values[2] = (PyObject *)((struct __pyx_obj_9pywrapfst__SymbolTable *)Py_None);
    values[5] = ((PyObject *)__pyx_kp_b__24);
    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 = PyDict_GetItem(__pyx_kwds, __pyx_n_s_isymbols);
          if (value) { values[0] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_osymbols);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ssymbols);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_acceptor);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__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 = PyDict_GetItem(__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, "text") < 0)) __PYX_ERR(0, 1678, __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_9pywrapfst__SymbolTable *)values[0]);
    __pyx_v_osymbols = ((struct __pyx_obj_9pywrapfst__SymbolTable *)values[1]);
    __pyx_v_ssymbols = ((struct __pyx_obj_9pywrapfst__SymbolTable *)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, 1680, __pyx_L3_error)
    } else {

      /* "pywrapfst.pyx":1680
 *   cpdef string text(self, _SymbolTable isymbols=None,
 *       _SymbolTable osymbols=None, _SymbolTable ssymbols=None,
 *       bool acceptor=False, bool show_weight_one=False, missing_sym=b""):             # <<<<<<<<<<<<<<
 *     """
 *     text(self, isymbols=None, osymbols=None, ssymbols=None, acceptor=False,
 */
      __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, 1680, __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("text", 0, 0, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1678, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pywrapfst._Fst.text", __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_9pywrapfst__SymbolTable, 1, "isymbols", 0))) __PYX_ERR(0, 1678, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_osymbols), __pyx_ptype_9pywrapfst__SymbolTable, 1, "osymbols", 0))) __PYX_ERR(0, 1679, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ssymbols), __pyx_ptype_9pywrapfst__SymbolTable, 1, "ssymbols", 0))) __PYX_ERR(0, 1679, __pyx_L1_error)
  __pyx_r = __pyx_pf_9pywrapfst_4_Fst_38text(((struct __pyx_obj_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);

  /* "pywrapfst.pyx":1678
 *     return StateIterator(self)
 * 
 *   cpdef string text(self, _SymbolTable isymbols=None,             # <<<<<<<<<<<<<<
 *       _SymbolTable osymbols=None, _SymbolTable ssymbols=None,
 *       bool acceptor=False, bool show_weight_one=False, missing_sym=b""):
 */

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

static PyObject *__pyx_pf_9pywrapfst_4_Fst_38text(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_self, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_isymbols, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_osymbols, struct __pyx_obj_9pywrapfst__SymbolTable *__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_9pywrapfst_4_Fst_text __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("text", 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_9pywrapfst__Fst->text(__pyx_v_self, 1, &__pyx_t_2); 
  __pyx_t_3 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1678, __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("pywrapfst._Fst.text", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":1715
 *     return sstrm.str()
 * 
 *   cpdef bool verify(self):             # <<<<<<<<<<<<<<
 *     """
 *     verify(self)
 */

static PyObject *__pyx_pw_9pywrapfst_4_Fst_41verify(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static bool __pyx_f_9pywrapfst_4_Fst_verify(struct __pyx_obj_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;
  __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)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_verify); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1715, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_4_Fst_41verify)) {
      __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);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1715, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1715, __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, 1715, __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;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pywrapfst.pyx":1724
 *       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, 1724, __pyx_L1_error)
  }
  __pyx_r = fst::script::Verify((*__pyx_v_self->_fst));
  goto __pyx_L0;

  /* "pywrapfst.pyx":1715
 *     return sstrm.str()
 * 
 *   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("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_9pywrapfst_4_Fst_41verify(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_9pywrapfst_4_Fst_40verify[] = "\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_9pywrapfst_4_Fst_41verify(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("verify (wrapper)", 0);
  __pyx_r = __pyx_pf_9pywrapfst_4_Fst_40verify(((struct __pyx_obj_9pywrapfst__Fst *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_4_Fst_40verify(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("verify", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_9pywrapfst_4_Fst_verify(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1715, __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("pywrapfst._Fst.verify", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":1726
 *     return fst.Verify(deref(self._fst))
 * 
 *   cpdef string weight_type(self):             # <<<<<<<<<<<<<<
 *     """
 *     weight_type(self)
 */

static PyObject *__pyx_pw_9pywrapfst_4_Fst_43weight_type(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static std::string __pyx_f_9pywrapfst_4_Fst_weight_type(struct __pyx_obj_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;
  __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)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_weight_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1726, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_4_Fst_43weight_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);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1726, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1726, __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, 1726, __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;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pywrapfst.pyx":1735
 *       A string representing the weight type.
 *     """
 *     return self._fst.get().WeightType()             # <<<<<<<<<<<<<<
 * 
 *   cpdef void write(self, filename) except *:
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 1735, __pyx_L1_error)
  }
  __pyx_r = __pyx_v_self->_fst.get()->WeightType();
  goto __pyx_L0;

  /* "pywrapfst.pyx":1726
 *     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("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_9pywrapfst_4_Fst_43weight_type(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_9pywrapfst_4_Fst_42weight_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_9pywrapfst_4_Fst_43weight_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_9pywrapfst_4_Fst_42weight_type(((struct __pyx_obj_9pywrapfst__Fst *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_4_Fst_42weight_type(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("weight_type", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_f_9pywrapfst_4_Fst_weight_type(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1726, __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("pywrapfst._Fst.weight_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":1737
 *     return self._fst.get().WeightType()
 * 
 *   cpdef void write(self, filename) except *:             # <<<<<<<<<<<<<<
 *     """
 *     write(self, filename)
 */

static PyObject *__pyx_pw_9pywrapfst_4_Fst_45write(PyObject *__pyx_v_self, PyObject *__pyx_v_filename); /*proto*/
static void __pyx_f_9pywrapfst_4_Fst_write(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_self, PyObject *__pyx_v_filename, 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;
  std::string __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  __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)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_write); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1737, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_4_Fst_45write)) {
      __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);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_filename); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1737, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_filename};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1737, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_filename};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1737, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1737, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_filename);
          __Pyx_GIVEREF(__pyx_v_filename);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_filename);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1737, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pywrapfst.pyx":1751
 *       FstIOError: Write failed.
 *     """
 *     if not self._fst.get().Write(tostring(filename)):             # <<<<<<<<<<<<<<
 *       raise FstIOError("Write failed: {!r}".format(filename))
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 1751, __pyx_L1_error)
  }
  __pyx_t_6 = __pyx_f_9pywrapfst_tostring(__pyx_v_filename, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1751, __pyx_L1_error)
  __pyx_t_7 = ((!(__pyx_v_self->_fst.get()->Write(__pyx_t_6) != 0)) != 0);
  if (__pyx_t_7) {

    /* "pywrapfst.pyx":1752
 *     """
 *     if not self._fst.get().Write(tostring(filename)):
 *       raise FstIOError("Write failed: {!r}".format(filename))             # <<<<<<<<<<<<<<
 * 
 *   cpdef string write_to_string(self):
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIOError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1752, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Write_failed_r, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1752, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    if (!__pyx_t_4) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_filename); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1752, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_5)) {
        PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_filename};
        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1752, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
        PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_filename};
        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1752, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else
      #endif
      {
        __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1752, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_4); __pyx_t_4 = NULL;
        __Pyx_INCREF(__pyx_v_filename);
        __Pyx_GIVEREF(__pyx_v_filename);
        PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_v_filename);
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1752, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __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);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1752, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_2)) {
        PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
        __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1752, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
        PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
        __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1752, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      } else
      #endif
      {
        __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1752, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
        __Pyx_GIVEREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_3);
        __pyx_t_3 = 0;
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1752, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
    }
    __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, 1752, __pyx_L1_error)

    /* "pywrapfst.pyx":1751
 *       FstIOError: Write failed.
 *     """
 *     if not self._fst.get().Write(tostring(filename)):             # <<<<<<<<<<<<<<
 *       raise FstIOError("Write failed: {!r}".format(filename))
 * 
 */
  }

  /* "pywrapfst.pyx":1737
 *     return self._fst.get().WeightType()
 * 
 *   cpdef void write(self, filename) except *:             # <<<<<<<<<<<<<<
 *     """
 *     write(self, filename)
 */

  /* 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_8);
  __Pyx_AddTraceback("pywrapfst._Fst.write", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_4_Fst_45write(PyObject *__pyx_v_self, PyObject *__pyx_v_filename); /*proto*/
static char __pyx_doc_9pywrapfst_4_Fst_44write[] = "\n    write(self, filename)\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      filename: The string location of the output file.\n\n    Raises:\n      FstIOError: Write failed.\n    ";
static PyObject *__pyx_pw_9pywrapfst_4_Fst_45write(PyObject *__pyx_v_self, PyObject *__pyx_v_filename) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("write (wrapper)", 0);
  __pyx_r = __pyx_pf_9pywrapfst_4_Fst_44write(((struct __pyx_obj_9pywrapfst__Fst *)__pyx_v_self), ((PyObject *)__pyx_v_filename));

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

static PyObject *__pyx_pf_9pywrapfst_4_Fst_44write(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_self, PyObject *__pyx_v_filename) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("write", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_9pywrapfst_4_Fst_write(__pyx_v_self, __pyx_v_filename, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1737, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1737, __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("pywrapfst._Fst.write", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":1754
 *       raise FstIOError("Write failed: {!r}".format(filename))
 * 
 *   cpdef string write_to_string(self):             # <<<<<<<<<<<<<<
 *     """
 *     write_to_string(self)
 */

static PyObject *__pyx_pw_9pywrapfst_4_Fst_47write_to_string(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static std::string __pyx_f_9pywrapfst_4_Fst_write_to_string(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_self, int __pyx_skip_dispatch) {
  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;
  std::string __pyx_t_5;
  int __pyx_t_6;
  __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)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_write_to_string); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1754, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_4_Fst_47write_to_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);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1754, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1754, __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, 1754, __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;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pywrapfst.pyx":1769
 *     """
 *     cdef stringstream sstrm
 *     if not self._fst.get().Write(sstrm, "write_to_string"):             # <<<<<<<<<<<<<<
 *       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, 1769, __pyx_L1_error)
  }
  __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_write_to_string); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1769, __pyx_L1_error)
  __pyx_t_6 = ((!(__pyx_v_self->_fst.get()->Write(__pyx_v_sstrm, __pyx_t_5) != 0)) != 0);
  if (__pyx_t_6) {

    /* "pywrapfst.pyx":1770
 *     cdef stringstream sstrm
 *     if not self._fst.get().Write(sstrm, "write_to_string"):
 *       raise FstIOError("Write to string failed")             # <<<<<<<<<<<<<<
 *     return sstrm.str()
 * 
 */
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIOError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1770, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1770, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 1770, __pyx_L1_error)

    /* "pywrapfst.pyx":1769
 *     """
 *     cdef stringstream sstrm
 *     if not self._fst.get().Write(sstrm, "write_to_string"):             # <<<<<<<<<<<<<<
 *       raise FstIOError("Write to string failed")
 *     return sstrm.str()
 */
  }

  /* "pywrapfst.pyx":1771
 *     if not self._fst.get().Write(sstrm, "write_to_string"):
 *       raise FstIOError("Write to string failed")
 *     return sstrm.str()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_sstrm.str();
  goto __pyx_L0;

  /* "pywrapfst.pyx":1754
 *       raise FstIOError("Write failed: {!r}".format(filename))
 * 
 *   cpdef string 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_WriteUnraisable("pywrapfst._Fst.write_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_9pywrapfst_4_Fst_47write_to_string(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_9pywrapfst_4_Fst_46write_to_string[] = "\n    write_to_string(self)\n\n    Serializes FST to a string.\n\n    Returns:\n      A string.\n\n    Raises:\n      FstIOError: Write to string failed.\n\n    See also: `read_from_string`.\n    ";
static PyObject *__pyx_pw_9pywrapfst_4_Fst_47write_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_9pywrapfst_4_Fst_46write_to_string(((struct __pyx_obj_9pywrapfst__Fst *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_4_Fst_46write_to_string(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("write_to_string", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_f_9pywrapfst_4_Fst_write_to_string(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1754, __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("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;
}

/* "pywrapfst.pyx":1784
 *   """
 * 
 *   cdef void _check_mutating_imethod(self) except *:             # <<<<<<<<<<<<<<
 *     """Checks whether an operation mutating the FST has produced an error.
 * 
 */

static void __pyx_f_9pywrapfst_11_MutableFst__check_mutating_imethod(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("_check_mutating_imethod", 0);

  /* "pywrapfst.pyx":1789
 *     This function is not visible to Python users.
 *     """
 *     if self._fst.get().Properties(fst.kError, True) == fst.kError:             # <<<<<<<<<<<<<<
 *       raise FstOpError("Operation failed")
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 1789, __pyx_L1_error)
  }
  __pyx_t_1 = ((__pyx_v_self->__pyx_base._fst.get()->Properties(fst::kError, 1) == fst::kError) != 0);
  if (__pyx_t_1) {

    /* "pywrapfst.pyx":1790
 *     """
 *     if self._fst.get().Properties(fst.kError, True) == fst.kError:
 *       raise FstOpError("Operation failed")             # <<<<<<<<<<<<<<
 * 
 *   cdef void _add_arc(self, int64 state, Arc arc) except *:
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstOpError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1790, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1790, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 1790, __pyx_L1_error)

    /* "pywrapfst.pyx":1789
 *     This function is not visible to Python users.
 *     """
 *     if self._fst.get().Properties(fst.kError, True) == fst.kError:             # <<<<<<<<<<<<<<
 *       raise FstOpError("Operation failed")
 * 
 */
  }

  /* "pywrapfst.pyx":1784
 *   """
 * 
 *   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_AddTraceback("pywrapfst._MutableFst._check_mutating_imethod", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pywrapfst.pyx":1792
 *       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_9pywrapfst_11_MutableFst__add_arc(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, __pyx_t_10basictypes_int64 __pyx_v_state, struct __pyx_obj_9pywrapfst_Arc *__pyx_v_arc) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("_add_arc", 0);

  /* "pywrapfst.pyx":1793
 * 
 *   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, 1793, __pyx_L1_error)
  }
  __pyx_t_1 = ((!(__pyx_v_self->__pyx_base._fst.get()->ValidStateId(__pyx_v_state) != 0)) != 0);
  if (__pyx_t_1) {

    /* "pywrapfst.pyx":1794
 *   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_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1794, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1794, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 1794, __pyx_L1_error)

    /* "pywrapfst.pyx":1793
 * 
 *   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)):
 */
  }

  /* "pywrapfst.pyx":1795
 *     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")
 *     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, 1795, __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, 1795, __pyx_L1_error)
  }
  __pyx_t_1 = ((!(__pyx_v_self->_mfst.get()->AddArc(__pyx_v_state, (*__pyx_v_arc->_arc)) != 0)) != 0);
  if (__pyx_t_1) {

    /* "pywrapfst.pyx":1796
 *       raise FstIndexError("State index out of range")
 *     if not self._mfst.get().AddArc(state, deref(arc._arc)):
 *       raise FstOpError("Incompatible or invalid weight type")             # <<<<<<<<<<<<<<
 *     self._check_mutating_imethod()
 * 
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstOpError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1796, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1796, __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, 1796, __pyx_L1_error)

    /* "pywrapfst.pyx":1795
 *     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")
 *     self._check_mutating_imethod()
 */
  }

  /* "pywrapfst.pyx":1797
 *     if not self._mfst.get().AddArc(state, deref(arc._arc)):
 *       raise FstOpError("Incompatible or invalid weight type")
 *     self._check_mutating_imethod()             # <<<<<<<<<<<<<<
 * 
 *   def add_arc(self, int64 state, Arc arc):
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_check_mutating_imethod");
    __PYX_ERR(0, 1797, __pyx_L1_error)
  }
  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1797, __pyx_L1_error)

  /* "pywrapfst.pyx":1792
 *       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_AddTraceback("pywrapfst._MutableFst._add_arc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pywrapfst.pyx":1799
 *     self._check_mutating_imethod()
 * 
 *   def add_arc(self, int64 state, Arc arc):             # <<<<<<<<<<<<<<
 *     """
 *     add_arc(self, state, arc)
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_1add_arc(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9pywrapfst_11_MutableFst_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\n    See also: `add_state`.\n    ";
static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_1add_arc(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  __pyx_t_10basictypes_int64 __pyx_v_state;
  struct __pyx_obj_9pywrapfst_Arc *__pyx_v_arc = 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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_state)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arc)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("add_arc", 1, 2, 2, 1); __PYX_ERR(0, 1799, __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, 1799, __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_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1799, __pyx_L3_error)
    __pyx_v_arc = ((struct __pyx_obj_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, 1799, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("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_9pywrapfst_Arc, 1, "arc", 0))) __PYX_ERR(0, 1799, __pyx_L1_error)
  __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_add_arc(((struct __pyx_obj_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_9pywrapfst_11_MutableFst_add_arc(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, __pyx_t_10basictypes_int64 __pyx_v_state, struct __pyx_obj_9pywrapfst_Arc *__pyx_v_arc) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("add_arc", 0);

  /* "pywrapfst.pyx":1818
 *     See also: `add_state`.
 *     """
 *     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, 1818, __pyx_L1_error)
  }
  ((struct __pyx_vtabstruct_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, 1818, __pyx_L1_error)

  /* "pywrapfst.pyx":1819
 *     """
 *     self._add_arc(state, arc)
 *     return self             # <<<<<<<<<<<<<<
 * 
 *   cpdef int64 add_state(self) except *:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "pywrapfst.pyx":1799
 *     self._check_mutating_imethod()
 * 
 *   def add_arc(self, int64 state, Arc arc):             # <<<<<<<<<<<<<<
 *     """
 *     add_arc(self, state, arc)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pywrapfst._MutableFst.add_arc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":1821
 *     return self
 * 
 *   cpdef int64 add_state(self) except *:             # <<<<<<<<<<<<<<
 *     """
 *     add_state(self)
 */

static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_3add_state(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static __pyx_t_10basictypes_int64 __pyx_f_9pywrapfst_11_MutableFst_add_state(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, int __pyx_skip_dispatch) {
  __pyx_t_10basictypes_int64 __pyx_v_result;
  __pyx_t_10basictypes_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;
  __pyx_t_10basictypes_int64 __pyx_t_5;
  __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)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_state); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1821, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_11_MutableFst_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);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1821, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1821, __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_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1821, __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;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pywrapfst.pyx":1832
 *     See also: `add_arc`, `set_start`, `set_final`.
 *     """
 *     cdef int64 result = self._mfst.get().AddState()             # <<<<<<<<<<<<<<
 *     self._check_mutating_imethod()
 *     return result
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
    __PYX_ERR(0, 1832, __pyx_L1_error)
  }
  __pyx_v_result = __pyx_v_self->_mfst.get()->AddState();

  /* "pywrapfst.pyx":1833
 *     """
 *     cdef int64 result = self._mfst.get().AddState()
 *     self._check_mutating_imethod()             # <<<<<<<<<<<<<<
 *     return result
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_check_mutating_imethod");
    __PYX_ERR(0, 1833, __pyx_L1_error)
  }
  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1833, __pyx_L1_error)

  /* "pywrapfst.pyx":1834
 *     cdef int64 result = self._mfst.get().AddState()
 *     self._check_mutating_imethod()
 *     return result             # <<<<<<<<<<<<<<
 * 
 *   cdef void _arcsort(self, sort_type=b"ilabel") except *:
 */
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "pywrapfst.pyx":1821
 *     return self
 * 
 *   cpdef int64 add_state(self) except *:             # <<<<<<<<<<<<<<
 *     """
 *     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_AddTraceback("pywrapfst._MutableFst.add_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_3add_state(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_9pywrapfst_11_MutableFst_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\n    See also: `add_arc`, `set_start`, `set_final`.\n    ";
static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_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_9pywrapfst_11_MutableFst_2add_state(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_2add_state(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __pyx_t_10basictypes_int64 __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("add_state", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_9pywrapfst_11_MutableFst_add_state(__pyx_v_self, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1821, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1821, __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("pywrapfst._MutableFst.add_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":1836
 *     return result
 * 
 *   cdef void _arcsort(self, sort_type=b"ilabel") except *:             # <<<<<<<<<<<<<<
 *     cdef fst.ArcSortType sort_type_enum
 *     if not fst.GetArcSortType(tostring(sort_type), addr(sort_type_enum)):
 */

static void __pyx_f_9pywrapfst_11_MutableFst__arcsort(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, struct __pyx_opt_args_9pywrapfst_11_MutableFst__arcsort *__pyx_optional_args) {
  PyObject *__pyx_v_sort_type = ((PyObject *)__pyx_n_b_ilabel);
  enum fst::script::ArcSortType __pyx_v_sort_type_enum;
  __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;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("_arcsort", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_sort_type = __pyx_optional_args->sort_type;
    }
  }

  /* "pywrapfst.pyx":1838
 *   cdef void _arcsort(self, sort_type=b"ilabel") except *:
 *     cdef fst.ArcSortType sort_type_enum
 *     if not fst.GetArcSortType(tostring(sort_type), addr(sort_type_enum)):             # <<<<<<<<<<<<<<
 *       raise FstArgError("Unknown sort type {!r}".format(sort_type))
 *     fst.ArcSort(self._mfst.get(), sort_type_enum)
 */
  __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_sort_type, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1838, __pyx_L1_error)
  __pyx_t_2 = ((!(fst::script::GetArcSortType(__pyx_t_1, (&__pyx_v_sort_type_enum)) != 0)) != 0);
  if (__pyx_t_2) {

    /* "pywrapfst.pyx":1839
 *     cdef fst.ArcSortType sort_type_enum
 *     if not fst.GetArcSortType(tostring(sort_type), addr(sort_type_enum)):
 *       raise FstArgError("Unknown sort type {!r}".format(sort_type))             # <<<<<<<<<<<<<<
 *     fst.ArcSort(self._mfst.get(), sort_type_enum)
 *     self._check_mutating_imethod()
 */
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstArgError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1839, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Unknown_sort_type_r, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1839, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    if (!__pyx_t_7) {
      __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_sort_type); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1839, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_sort_type};
        __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1839, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_GOTREF(__pyx_t_5);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_sort_type};
        __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1839, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_GOTREF(__pyx_t_5);
      } else
      #endif
      {
        __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1839, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
        __Pyx_INCREF(__pyx_v_sort_type);
        __Pyx_GIVEREF(__pyx_v_sort_type);
        PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_v_sort_type);
        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1839, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (!__pyx_t_6) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1839, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1839, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1839, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      } else
      #endif
      {
        __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1839, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
        __Pyx_GIVEREF(__pyx_t_5);
        PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_5);
        __pyx_t_5 = 0;
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1839, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 1839, __pyx_L1_error)

    /* "pywrapfst.pyx":1838
 *   cdef void _arcsort(self, sort_type=b"ilabel") except *:
 *     cdef fst.ArcSortType sort_type_enum
 *     if not fst.GetArcSortType(tostring(sort_type), addr(sort_type_enum)):             # <<<<<<<<<<<<<<
 *       raise FstArgError("Unknown sort type {!r}".format(sort_type))
 *     fst.ArcSort(self._mfst.get(), sort_type_enum)
 */
  }

  /* "pywrapfst.pyx":1840
 *     if not fst.GetArcSortType(tostring(sort_type), addr(sort_type_enum)):
 *       raise FstArgError("Unknown sort type {!r}".format(sort_type))
 *     fst.ArcSort(self._mfst.get(), sort_type_enum)             # <<<<<<<<<<<<<<
 *     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, 1840, __pyx_L1_error)
  }
  fst::script::ArcSort(__pyx_v_self->_mfst.get(), __pyx_v_sort_type_enum);

  /* "pywrapfst.pyx":1841
 *       raise FstArgError("Unknown sort type {!r}".format(sort_type))
 *     fst.ArcSort(self._mfst.get(), sort_type_enum)
 *     self._check_mutating_imethod()             # <<<<<<<<<<<<<<
 * 
 *   def arcsort(self, sort_type=b"ilabel"):
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_check_mutating_imethod");
    __PYX_ERR(0, 1841, __pyx_L1_error)
  }
  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1841, __pyx_L1_error)

  /* "pywrapfst.pyx":1836
 *     return result
 * 
 *   cdef void _arcsort(self, sort_type=b"ilabel") except *:             # <<<<<<<<<<<<<<
 *     cdef fst.ArcSortType sort_type_enum
 *     if not fst.GetArcSortType(tostring(sort_type), addr(sort_type_enum)):
 */

  /* 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_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("pywrapfst._MutableFst._arcsort", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pywrapfst.pyx":1843
 *     self._check_mutating_imethod()
 * 
 *   def arcsort(self, sort_type=b"ilabel"):             # <<<<<<<<<<<<<<
 *     """
 *     arcsort(self, sort_type="ilabel")
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_5arcsort(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9pywrapfst_11_MutableFst_4arcsort[] = "\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\n    See also: `topsort`.\n    ";
static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_5arcsort(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_sort_type = 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_b_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 = PyDict_GetItem(__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, 1843, __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, 1843, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pywrapfst._MutableFst.arcsort", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_4arcsort(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self), __pyx_v_sort_type);

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

static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_4arcsort(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, PyObject *__pyx_v_sort_type) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  struct __pyx_opt_args_9pywrapfst_11_MutableFst__arcsort __pyx_t_1;
  __Pyx_RefNannySetupContext("arcsort", 0);

  /* "pywrapfst.pyx":1864
 *     See also: `topsort`.
 *     """
 *     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, 1864, __pyx_L1_error)
  }
  __pyx_t_1.__pyx_n = 1;
  __pyx_t_1.sort_type = __pyx_v_sort_type;
  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_arcsort(__pyx_v_self, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1864, __pyx_L1_error)

  /* "pywrapfst.pyx":1865
 *     """
 *     self._arcsort(sort_type)
 *     return self             # <<<<<<<<<<<<<<
 * 
 *   cdef void _closure(self, bool closure_plus=False) except *:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "pywrapfst.pyx":1843
 *     self._check_mutating_imethod()
 * 
 *   def arcsort(self, sort_type=b"ilabel"):             # <<<<<<<<<<<<<<
 *     """
 *     arcsort(self, sort_type="ilabel")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pywrapfst._MutableFst.arcsort", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":1867
 *     return self
 * 
 *   cdef void _closure(self, bool closure_plus=False) except *:             # <<<<<<<<<<<<<<
 *     fst.Closure(self._mfst.get(), fst.GetClosureType(closure_plus))
 *     self._check_mutating_imethod()
 */

static void __pyx_f_9pywrapfst_11_MutableFst__closure(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, struct __pyx_opt_args_9pywrapfst_11_MutableFst__closure *__pyx_optional_args) {
  bool __pyx_v_closure_plus = ((bool)0);
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_closure", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_closure_plus = __pyx_optional_args->closure_plus;
    }
  }

  /* "pywrapfst.pyx":1868
 * 
 *   cdef void _closure(self, bool closure_plus=False) except *:
 *     fst.Closure(self._mfst.get(), fst.GetClosureType(closure_plus))             # <<<<<<<<<<<<<<
 *     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, 1868, __pyx_L1_error)
  }
  fst::script::Closure(__pyx_v_self->_mfst.get(), fst::script::GetClosureType(__pyx_v_closure_plus));

  /* "pywrapfst.pyx":1869
 *   cdef void _closure(self, bool closure_plus=False) except *:
 *     fst.Closure(self._mfst.get(), fst.GetClosureType(closure_plus))
 *     self._check_mutating_imethod()             # <<<<<<<<<<<<<<
 * 
 *   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'", "_check_mutating_imethod");
    __PYX_ERR(0, 1869, __pyx_L1_error)
  }
  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1869, __pyx_L1_error)

  /* "pywrapfst.pyx":1867
 *     return self
 * 
 *   cdef void _closure(self, bool closure_plus=False) except *:             # <<<<<<<<<<<<<<
 *     fst.Closure(self._mfst.get(), fst.GetClosureType(closure_plus))
 *     self._check_mutating_imethod()
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pywrapfst._MutableFst._closure", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pywrapfst.pyx":1871
 *     self._check_mutating_imethod()
 * 
 *   def closure(self, bool closure_plus=False):             # <<<<<<<<<<<<<<
 *     """
 *     closure(self, closure_plus=False)
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_7closure(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9pywrapfst_11_MutableFst_6closure[] = "\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_9pywrapfst_11_MutableFst_7closure(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  bool __pyx_v_closure_plus;
  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 = PyDict_GetItem(__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, 1871, __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, 1871, __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, 1871, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pywrapfst._MutableFst.closure", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_6closure(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self), __pyx_v_closure_plus);

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

static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_6closure(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, bool __pyx_v_closure_plus) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  struct __pyx_opt_args_9pywrapfst_11_MutableFst__closure __pyx_t_1;
  __Pyx_RefNannySetupContext("closure", 0);

  /* "pywrapfst.pyx":1889
 *       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, 1889, __pyx_L1_error)
  }
  __pyx_t_1.__pyx_n = 1;
  __pyx_t_1.closure_plus = __pyx_v_closure_plus;
  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_closure(__pyx_v_self, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1889, __pyx_L1_error)

  /* "pywrapfst.pyx":1890
 *     """
 *     self._closure(closure_plus)
 *     return self             # <<<<<<<<<<<<<<
 * 
 *   cdef void _concat(self, _Fst ifst) except *:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "pywrapfst.pyx":1871
 *     self._check_mutating_imethod()
 * 
 *   def closure(self, bool closure_plus=False):             # <<<<<<<<<<<<<<
 *     """
 *     closure(self, closure_plus=False)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pywrapfst._MutableFst.closure", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":1892
 *     return self
 * 
 *   cdef void _concat(self, _Fst ifst) except *:             # <<<<<<<<<<<<<<
 *     fst.Concat(self._mfst.get(), deref(ifst._fst))
 *     self._check_mutating_imethod()
 */

static void __pyx_f_9pywrapfst_11_MutableFst__concat(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_concat", 0);

  /* "pywrapfst.pyx":1893
 * 
 *   cdef void _concat(self, _Fst ifst) except *:
 *     fst.Concat(self._mfst.get(), deref(ifst._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, 1893, __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, 1893, __pyx_L1_error)
  }
  fst::script::Concat(__pyx_v_self->_mfst.get(), (*__pyx_v_ifst->_fst));

  /* "pywrapfst.pyx":1894
 *   cdef void _concat(self, _Fst ifst) except *:
 *     fst.Concat(self._mfst.get(), deref(ifst._fst))
 *     self._check_mutating_imethod()             # <<<<<<<<<<<<<<
 * 
 *   def concat(self, _Fst ifst):
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_check_mutating_imethod");
    __PYX_ERR(0, 1894, __pyx_L1_error)
  }
  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1894, __pyx_L1_error)

  /* "pywrapfst.pyx":1892
 *     return self
 * 
 *   cdef void _concat(self, _Fst ifst) except *:             # <<<<<<<<<<<<<<
 *     fst.Concat(self._mfst.get(), deref(ifst._fst))
 *     self._check_mutating_imethod()
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pywrapfst._MutableFst._concat", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pywrapfst.pyx":1896
 *     self._check_mutating_imethod()
 * 
 *   def concat(self, _Fst ifst):             # <<<<<<<<<<<<<<
 *     """
 *     concat(self, ifst)
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_9concat(PyObject *__pyx_v_self, PyObject *__pyx_v_ifst); /*proto*/
static char __pyx_doc_9pywrapfst_11_MutableFst_8concat[] = "\n    concat(self, ifst)\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      ifst: The second input FST.\n\n    Returns:\n      self.\n    ";
static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_9concat(PyObject *__pyx_v_self, PyObject *__pyx_v_ifst) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("concat (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 1896, __pyx_L1_error)
  __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_8concat(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self), ((struct __pyx_obj_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_9pywrapfst_11_MutableFst_8concat(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("concat", 0);

  /* "pywrapfst.pyx":1913
 *       self.
 *     """
 *     self._concat(ifst)             # <<<<<<<<<<<<<<
 *     return self
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_concat");
    __PYX_ERR(0, 1913, __pyx_L1_error)
  }
  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_concat(__pyx_v_self, __pyx_v_ifst); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1913, __pyx_L1_error)

  /* "pywrapfst.pyx":1914
 *     """
 *     self._concat(ifst)
 *     return self             # <<<<<<<<<<<<<<
 * 
 *   cdef void _connect(self) except *:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "pywrapfst.pyx":1896
 *     self._check_mutating_imethod()
 * 
 *   def concat(self, _Fst ifst):             # <<<<<<<<<<<<<<
 *     """
 *     concat(self, ifst)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pywrapfst._MutableFst.concat", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":1916
 *     return self
 * 
 *   cdef void _connect(self) except *:             # <<<<<<<<<<<<<<
 *     fst.Connect(self._mfst.get())
 *     self._check_mutating_imethod()
 */

static void __pyx_f_9pywrapfst_11_MutableFst__connect(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_connect", 0);

  /* "pywrapfst.pyx":1917
 * 
 *   cdef void _connect(self) except *:
 *     fst.Connect(self._mfst.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, 1917, __pyx_L1_error)
  }
  fst::script::Connect(__pyx_v_self->_mfst.get());

  /* "pywrapfst.pyx":1918
 *   cdef void _connect(self) except *:
 *     fst.Connect(self._mfst.get())
 *     self._check_mutating_imethod()             # <<<<<<<<<<<<<<
 * 
 *   def connect(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, 1918, __pyx_L1_error)
  }
  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1918, __pyx_L1_error)

  /* "pywrapfst.pyx":1916
 *     return self
 * 
 *   cdef void _connect(self) except *:             # <<<<<<<<<<<<<<
 *     fst.Connect(self._mfst.get())
 *     self._check_mutating_imethod()
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pywrapfst._MutableFst._connect", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pywrapfst.pyx":1920
 *     self._check_mutating_imethod()
 * 
 *   def connect(self):             # <<<<<<<<<<<<<<
 *     """
 *     connect(self)
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_11connect(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_9pywrapfst_11_MutableFst_10connect[] = "\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_9pywrapfst_11_MutableFst_11connect(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("connect (wrapper)", 0);
  __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_10connect(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_10connect(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("connect", 0);

  /* "pywrapfst.pyx":1932
 *       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, 1932, __pyx_L1_error)
  }
  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_connect(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1932, __pyx_L1_error)

  /* "pywrapfst.pyx":1933
 *     """
 *     self._connect()
 *     return self             # <<<<<<<<<<<<<<
 * 
 *   cdef void _decode(self, EncodeMapper encoder) except *:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "pywrapfst.pyx":1920
 *     self._check_mutating_imethod()
 * 
 *   def connect(self):             # <<<<<<<<<<<<<<
 *     """
 *     connect(self)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pywrapfst._MutableFst.connect", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":1935
 *     return self
 * 
 *   cdef void _decode(self, EncodeMapper encoder) except *:             # <<<<<<<<<<<<<<
 *     fst.Decode(self._mfst.get(), deref(encoder._encoder))
 *     self._check_mutating_imethod()
 */

static void __pyx_f_9pywrapfst_11_MutableFst__decode(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_encoder) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_decode", 0);

  /* "pywrapfst.pyx":1936
 * 
 *   cdef void _decode(self, EncodeMapper encoder) except *:
 *     fst.Decode(self._mfst.get(), deref(encoder._encoder))             # <<<<<<<<<<<<<<
 *     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, 1936, __pyx_L1_error)
  }
  if (unlikely(((PyObject *)__pyx_v_encoder) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_encoder");
    __PYX_ERR(0, 1936, __pyx_L1_error)
  }
  fst::script::Decode(__pyx_v_self->_mfst.get(), (*__pyx_v_encoder->_encoder));

  /* "pywrapfst.pyx":1937
 *   cdef void _decode(self, EncodeMapper encoder) except *:
 *     fst.Decode(self._mfst.get(), deref(encoder._encoder))
 *     self._check_mutating_imethod()             # <<<<<<<<<<<<<<
 * 
 *   def decode(self, EncodeMapper encoder):
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_check_mutating_imethod");
    __PYX_ERR(0, 1937, __pyx_L1_error)
  }
  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1937, __pyx_L1_error)

  /* "pywrapfst.pyx":1935
 *     return self
 * 
 *   cdef void _decode(self, EncodeMapper encoder) except *:             # <<<<<<<<<<<<<<
 *     fst.Decode(self._mfst.get(), deref(encoder._encoder))
 *     self._check_mutating_imethod()
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pywrapfst._MutableFst._decode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pywrapfst.pyx":1939
 *     self._check_mutating_imethod()
 * 
 *   def decode(self, EncodeMapper encoder):             # <<<<<<<<<<<<<<
 *     """
 *     decode(self, encoder)
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_13decode(PyObject *__pyx_v_self, PyObject *__pyx_v_encoder); /*proto*/
static char __pyx_doc_9pywrapfst_11_MutableFst_12decode[] = "\n    decode(self, encoder)\n\n    Decodes encoded labels and/or weights.\n\n    This operation reverses the encoding performed by `encode`.\n\n    Args:\n      encoder: An EncodeMapper object used to encode the FST.\n\n    Returns:\n      self.\n\n    See also: `encode`.\n    ";
static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_13decode(PyObject *__pyx_v_self, PyObject *__pyx_v_encoder) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("decode (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_encoder), __pyx_ptype_9pywrapfst_EncodeMapper, 1, "encoder", 0))) __PYX_ERR(0, 1939, __pyx_L1_error)
  __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_12decode(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self), ((struct __pyx_obj_9pywrapfst_EncodeMapper *)__pyx_v_encoder));

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

static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_12decode(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_encoder) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("decode", 0);

  /* "pywrapfst.pyx":1955
 *     See also: `encode`.
 *     """
 *     self._decode(encoder)             # <<<<<<<<<<<<<<
 *     return self
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_decode");
    __PYX_ERR(0, 1955, __pyx_L1_error)
  }
  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_decode(__pyx_v_self, __pyx_v_encoder); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1955, __pyx_L1_error)

  /* "pywrapfst.pyx":1956
 *     """
 *     self._decode(encoder)
 *     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;

  /* "pywrapfst.pyx":1939
 *     self._check_mutating_imethod()
 * 
 *   def decode(self, EncodeMapper encoder):             # <<<<<<<<<<<<<<
 *     """
 *     decode(self, encoder)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pywrapfst._MutableFst.decode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":1958
 *     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_9pywrapfst_11_MutableFst__delete_arcs(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, __pyx_t_10basictypes_int64 __pyx_v_state, struct __pyx_opt_args_9pywrapfst_11_MutableFst__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;
  __Pyx_RefNannySetupContext("_delete_arcs", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_n = __pyx_optional_args->n;
    }
  }

  /* "pywrapfst.pyx":1959
 * 
 *   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, 1959, __pyx_L1_error)
    }
    __pyx_t_1 = __pyx_v_self->_mfst.get()->DeleteArcs(__pyx_v_state, __pyx_v_n);
  } else {

    /* "pywrapfst.pyx":1960
 *   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, 1960, __pyx_L1_error)
    }
    __pyx_t_1 = __pyx_v_self->_mfst.get()->DeleteArcs(__pyx_v_state);
  }

  /* "pywrapfst.pyx":1959
 * 
 *   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 (__pyx_t_2) {

    /* "pywrapfst.pyx":1961
 *     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_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1961, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1961, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(0, 1961, __pyx_L1_error)

    /* "pywrapfst.pyx":1959
 * 
 *   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")
 */
  }

  /* "pywrapfst.pyx":1962
 *             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, 1962, __pyx_L1_error)
  }
  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1962, __pyx_L1_error)

  /* "pywrapfst.pyx":1958
 *     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_AddTraceback("pywrapfst._MutableFst._delete_arcs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pywrapfst.pyx":1964
 *     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_9pywrapfst_11_MutableFst_15delete_arcs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9pywrapfst_11_MutableFst_14delete_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\n    See also: `delete_states`.\n    ";
static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_15delete_arcs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  __pyx_t_10basictypes_int64 __pyx_v_state;
  size_t __pyx_v_n;
  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] = PyDict_GetItem(__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 = PyDict_GetItem(__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, 1964, __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_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1964, __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, 1964, __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, 1964, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pywrapfst._MutableFst.delete_arcs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_14delete_arcs(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self), __pyx_v_state, __pyx_v_n);

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

static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_14delete_arcs(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, __pyx_t_10basictypes_int64 __pyx_v_state, size_t __pyx_v_n) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  struct __pyx_opt_args_9pywrapfst_11_MutableFst__delete_arcs __pyx_t_1;
  __Pyx_RefNannySetupContext("delete_arcs", 0);

  /* "pywrapfst.pyx":1984
 *     See also: `delete_states`.
 *     """
 *     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, 1984, __pyx_L1_error)
  }
  __pyx_t_1.__pyx_n = 1;
  __pyx_t_1.n = __pyx_v_n;
  ((struct __pyx_vtabstruct_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, 1984, __pyx_L1_error)

  /* "pywrapfst.pyx":1985
 *     """
 *     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;

  /* "pywrapfst.pyx":1964
 *     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("pywrapfst._MutableFst.delete_arcs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":1987
 *     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_9pywrapfst_11_MutableFst__delete_states(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, struct __pyx_opt_args_9pywrapfst_11_MutableFst__delete_states *__pyx_optional_args) {
  PyObject *__pyx_v_states = ((PyObject *)Py_None);
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  std::vector<__pyx_t_10basictypes_int64>  __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("_delete_states", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_states = __pyx_optional_args->states;
    }
  }

  /* "pywrapfst.pyx":1989
 *   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, 1989, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "pywrapfst.pyx":1990
 *     # 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, 1990, __pyx_L1_error)
    }
    __pyx_t_2 = __pyx_convert_vector_from_py___pyx_t_10basictypes_int64(__pyx_v_states); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1990, __pyx_L1_error)
    __pyx_t_1 = ((!(__pyx_v_self->_mfst.get()->DeleteStates(((std::vector<__pyx_t_10basictypes_int64>  const )__pyx_t_2)) != 0)) != 0);
    if (__pyx_t_1) {

      /* "pywrapfst.pyx":1991
 *     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_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1991, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1991, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __PYX_ERR(0, 1991, __pyx_L1_error)

      /* "pywrapfst.pyx":1990
 *     # 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:
 */
    }

    /* "pywrapfst.pyx":1989
 *   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;
  }

  /* "pywrapfst.pyx":1993
 *         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, 1993, __pyx_L1_error)
    }
    __pyx_v_self->_mfst.get()->DeleteStates();
  }
  __pyx_L3:;

  /* "pywrapfst.pyx":1994
 *     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, 1994, __pyx_L1_error)
  }
  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1994, __pyx_L1_error)

  /* "pywrapfst.pyx":1987
 *     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_AddTraceback("pywrapfst._MutableFst._delete_states", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pywrapfst.pyx":1996
 *     self._check_mutating_imethod()
 * 
 *   def delete_states(self, states=None):             # <<<<<<<<<<<<<<
 *     """
 *     delete_states(self, states=None)
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_17delete_states(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9pywrapfst_11_MutableFst_16delete_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\n    See also: `delete_arcs`.\n    ";
static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_17delete_states(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_states = 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 = PyDict_GetItem(__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, 1996, __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, 1996, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pywrapfst._MutableFst.delete_states", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_16delete_states(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self), __pyx_v_states);

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

static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_16delete_states(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, PyObject *__pyx_v_states) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  struct __pyx_opt_args_9pywrapfst_11_MutableFst__delete_states __pyx_t_1;
  __Pyx_RefNannySetupContext("delete_states", 0);

  /* "pywrapfst.pyx":2014
 *     See also: `delete_arcs`.
 *     """
 *     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, 2014, __pyx_L1_error)
  }
  __pyx_t_1.__pyx_n = 1;
  __pyx_t_1.states = __pyx_v_states;
  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_delete_states(__pyx_v_self, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2014, __pyx_L1_error)

  /* "pywrapfst.pyx":2015
 *     """
 *     self._delete_states(states)
 *     return self             # <<<<<<<<<<<<<<
 * 
 *   cdef void _encode(self, EncodeMapper encoder) except *:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "pywrapfst.pyx":1996
 *     self._check_mutating_imethod()
 * 
 *   def delete_states(self, states=None):             # <<<<<<<<<<<<<<
 *     """
 *     delete_states(self, states=None)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pywrapfst._MutableFst.delete_states", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":2017
 *     return self
 * 
 *   cdef void _encode(self, EncodeMapper encoder) except *:             # <<<<<<<<<<<<<<
 *     fst.Encode(self._mfst.get(), encoder._encoder.get())
 *     self._check_mutating_imethod()
 */

static void __pyx_f_9pywrapfst_11_MutableFst__encode(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_encoder) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_encode", 0);

  /* "pywrapfst.pyx":2018
 * 
 *   cdef void _encode(self, EncodeMapper encoder) except *:
 *     fst.Encode(self._mfst.get(), encoder._encoder.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, 2018, __pyx_L1_error)
  }
  if (unlikely(((PyObject *)__pyx_v_encoder) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_encoder");
    __PYX_ERR(0, 2018, __pyx_L1_error)
  }
  fst::script::Encode(__pyx_v_self->_mfst.get(), __pyx_v_encoder->_encoder.get());

  /* "pywrapfst.pyx":2019
 *   cdef void _encode(self, EncodeMapper encoder) except *:
 *     fst.Encode(self._mfst.get(), encoder._encoder.get())
 *     self._check_mutating_imethod()             # <<<<<<<<<<<<<<
 * 
 *   def encode(self, EncodeMapper encoder):
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_check_mutating_imethod");
    __PYX_ERR(0, 2019, __pyx_L1_error)
  }
  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2019, __pyx_L1_error)

  /* "pywrapfst.pyx":2017
 *     return self
 * 
 *   cdef void _encode(self, EncodeMapper encoder) except *:             # <<<<<<<<<<<<<<
 *     fst.Encode(self._mfst.get(), encoder._encoder.get())
 *     self._check_mutating_imethod()
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pywrapfst._MutableFst._encode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pywrapfst.pyx":2021
 *     self._check_mutating_imethod()
 * 
 *   def encode(self, EncodeMapper encoder):             # <<<<<<<<<<<<<<
 *     """
 *     encode(self, encoder)
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_19encode(PyObject *__pyx_v_self, PyObject *__pyx_v_encoder); /*proto*/
static char __pyx_doc_9pywrapfst_11_MutableFst_18encode[] = "\n    encode(self, encoder)\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      encoder: An EncodeMapper object to be used as the encoder.\n\n    Returns:\n      self.\n\n    See also: `decode`.\n    ";
static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_19encode(PyObject *__pyx_v_self, PyObject *__pyx_v_encoder) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("encode (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_encoder), __pyx_ptype_9pywrapfst_EncodeMapper, 1, "encoder", 0))) __PYX_ERR(0, 2021, __pyx_L1_error)
  __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_18encode(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self), ((struct __pyx_obj_9pywrapfst_EncodeMapper *)__pyx_v_encoder));

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

static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_18encode(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_encoder) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("encode", 0);

  /* "pywrapfst.pyx":2042
 *     See also: `decode`.
 *     """
 *     self._encode(encoder)             # <<<<<<<<<<<<<<
 *     return self
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_encode");
    __PYX_ERR(0, 2042, __pyx_L1_error)
  }
  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_encode(__pyx_v_self, __pyx_v_encoder); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2042, __pyx_L1_error)

  /* "pywrapfst.pyx":2043
 *     """
 *     self._encode(encoder)
 *     return self             # <<<<<<<<<<<<<<
 * 
 *   cdef void _invert(self) except *:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "pywrapfst.pyx":2021
 *     self._check_mutating_imethod()
 * 
 *   def encode(self, EncodeMapper encoder):             # <<<<<<<<<<<<<<
 *     """
 *     encode(self, encoder)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pywrapfst._MutableFst.encode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":2045
 *     return self
 * 
 *   cdef void _invert(self) except *:             # <<<<<<<<<<<<<<
 *     fst.Invert(self._mfst.get())
 *     self._check_mutating_imethod()
 */

static void __pyx_f_9pywrapfst_11_MutableFst__invert(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_invert", 0);

  /* "pywrapfst.pyx":2046
 * 
 *   cdef void _invert(self) except *:
 *     fst.Invert(self._mfst.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, 2046, __pyx_L1_error)
  }
  fst::script::Invert(__pyx_v_self->_mfst.get());

  /* "pywrapfst.pyx":2047
 *   cdef void _invert(self) except *:
 *     fst.Invert(self._mfst.get())
 *     self._check_mutating_imethod()             # <<<<<<<<<<<<<<
 * 
 *   def invert(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, 2047, __pyx_L1_error)
  }
  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2047, __pyx_L1_error)

  /* "pywrapfst.pyx":2045
 *     return self
 * 
 *   cdef void _invert(self) except *:             # <<<<<<<<<<<<<<
 *     fst.Invert(self._mfst.get())
 *     self._check_mutating_imethod()
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pywrapfst._MutableFst._invert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pywrapfst.pyx":2049
 *     self._check_mutating_imethod()
 * 
 *   def invert(self):             # <<<<<<<<<<<<<<
 *     """
 *     invert(self)
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_21invert(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_9pywrapfst_11_MutableFst_20invert[] = "\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_9pywrapfst_11_MutableFst_21invert(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("invert (wrapper)", 0);
  __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_20invert(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_20invert(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("invert", 0);

  /* "pywrapfst.pyx":2061
 *       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, 2061, __pyx_L1_error)
  }
  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_invert(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2061, __pyx_L1_error)

  /* "pywrapfst.pyx":2062
 *     """
 *     self._invert()
 *     return self             # <<<<<<<<<<<<<<
 * 
 *   cdef void _minimize(self, float delta=fst.kShortestDelta,
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "pywrapfst.pyx":2049
 *     self._check_mutating_imethod()
 * 
 *   def invert(self):             # <<<<<<<<<<<<<<
 *     """
 *     invert(self)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pywrapfst._MutableFst.invert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":2064
 *     return self
 * 
 *   cdef void _minimize(self, float delta=fst.kShortestDelta,             # <<<<<<<<<<<<<<
 *                       bool allow_nondet=False) except *:
 *     # This runs in-place when the second argument is null.
 */

static void __pyx_f_9pywrapfst_11_MutableFst__minimize(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, struct __pyx_opt_args_9pywrapfst_11_MutableFst__minimize *__pyx_optional_args) {
  float __pyx_v_delta = __pyx_k__35;

  /* "pywrapfst.pyx":2065
 * 
 *   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
  __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;
      }
    }
  }

  /* "pywrapfst.pyx":2067
 *                       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, 2067, __pyx_L1_error)
  }
  fst::script::Minimize(__pyx_v_self->_mfst.get(), NULL, __pyx_v_delta, __pyx_v_allow_nondet);

  /* "pywrapfst.pyx":2068
 *     # 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, 2068, __pyx_L1_error)
  }
  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2068, __pyx_L1_error)

  /* "pywrapfst.pyx":2064
 *     return self
 * 
 *   cdef void _minimize(self, float delta=fst.kShortestDelta,             # <<<<<<<<<<<<<<
 *                       bool allow_nondet=False) except *:
 *     # This runs in-place when the second argument is null.
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pywrapfst._MutableFst._minimize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pywrapfst.pyx":2070
 *     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_9pywrapfst_11_MutableFst_23minimize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9pywrapfst_11_MutableFst_22minimize[] = "\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_9pywrapfst_11_MutableFst_23minimize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  float __pyx_v_delta;
  bool __pyx_v_allow_nondet;
  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 = PyDict_GetItem(__pyx_kwds, __pyx_n_s_delta);
          if (value) { values[0] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__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, 2070, __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, 2070, __pyx_L3_error)
    } else {
      __pyx_v_delta = __pyx_k__36;
    }
    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, 2070, __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, 2070, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pywrapfst._MutableFst.minimize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_22minimize(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self), __pyx_v_delta, __pyx_v_allow_nondet);

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

static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_22minimize(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, float __pyx_v_delta, bool __pyx_v_allow_nondet) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  struct __pyx_opt_args_9pywrapfst_11_MutableFst__minimize __pyx_t_1;
  __Pyx_RefNannySetupContext("minimize", 0);

  /* "pywrapfst.pyx":2096
 *       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, 2096, __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_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_minimize(__pyx_v_self, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2096, __pyx_L1_error)

  /* "pywrapfst.pyx":2097
 *     """
 *     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;

  /* "pywrapfst.pyx":2070
 *     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("pywrapfst._MutableFst.minimize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":2099
 *     return self
 * 
 *   cpdef MutableArcIterator mutable_arcs(self, int64 state):             # <<<<<<<<<<<<<<
 *     """
 *     mutable_arcs(self, state)
 */

static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_25mutable_arcs(PyObject *__pyx_v_self, PyObject *__pyx_arg_state); /*proto*/
static struct __pyx_obj_9pywrapfst_MutableArcIterator *__pyx_f_9pywrapfst_11_MutableFst_mutable_arcs(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, __pyx_t_10basictypes_int64 __pyx_v_state, int __pyx_skip_dispatch) {
  struct __pyx_obj_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;
  PyObject *__pyx_t_6 = NULL;
  __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)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_mutable_arcs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2099, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_11_MutableFst_25mutable_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, 2099, __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);
        }
      }
      if (!__pyx_t_5) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2099, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_4)) {
          PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2099, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
          PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2099, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        } else
        #endif
        {
          __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2099, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
          __Pyx_GIVEREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3);
          __pyx_t_3 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2099, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_9pywrapfst_MutableArcIterator))))) __PYX_ERR(0, 2099, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_9pywrapfst_MutableArcIterator *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pywrapfst.pyx":2113
 *     See also: `arcs`, `states`.
 *     """
 *     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, 2113, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2113, __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_9pywrapfst_MutableArcIterator), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2113, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = ((struct __pyx_obj_9pywrapfst_MutableArcIterator *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":2099
 *     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_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("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_9pywrapfst_11_MutableFst_25mutable_arcs(PyObject *__pyx_v_self, PyObject *__pyx_arg_state); /*proto*/
static char __pyx_doc_9pywrapfst_11_MutableFst_24mutable_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\n    See also: `arcs`, `states`.\n    ";
static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_25mutable_arcs(PyObject *__pyx_v_self, PyObject *__pyx_arg_state) {
  __pyx_t_10basictypes_int64 __pyx_v_state;
  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_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2099, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pywrapfst._MutableFst.mutable_arcs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_24mutable_arcs(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self), ((__pyx_t_10basictypes_int64)__pyx_v_state));

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

static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_24mutable_arcs(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, __pyx_t_10basictypes_int64 __pyx_v_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("mutable_arcs", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_11_MutableFst_mutable_arcs(__pyx_v_self, __pyx_v_state, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2099, __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("pywrapfst._MutableFst.mutable_arcs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":2115
 *     return MutableArcIterator(self, state)
 * 
 *   def mutable_input_symbols(self):             # <<<<<<<<<<<<<<
 *     """
 *     mutable_input_symbols(self)
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_27mutable_input_symbols(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_9pywrapfst_11_MutableFst_26mutable_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_9pywrapfst_11_MutableFst_27mutable_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_9pywrapfst_11_MutableFst_26mutable_input_symbols(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_26mutable_input_symbols(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self) {
  fst::SymbolTable *__pyx_v_tst;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("mutable_input_symbols", 0);

  /* "pywrapfst.pyx":2121
 *     Returns the FST's (mutable) input symbol table, or None if none is present.
 *     """
 *     cdef fst.SymbolTable *tst = self._mfst.get().MutableInputSymbols()             # <<<<<<<<<<<<<<
 *     if tst == NULL:
 *       return
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
    __PYX_ERR(0, 2121, __pyx_L1_error)
  }
  __pyx_v_tst = __pyx_v_self->_mfst.get()->MutableInputSymbols();

  /* "pywrapfst.pyx":2122
 *     """
 *     cdef fst.SymbolTable *tst = self._mfst.get().MutableInputSymbols()
 *     if tst == NULL:             # <<<<<<<<<<<<<<
 *       return
 *     return _init_MutableFstSymbolTable(tst, self._mfst)
 */
  __pyx_t_1 = ((__pyx_v_tst == NULL) != 0);
  if (__pyx_t_1) {

    /* "pywrapfst.pyx":2123
 *     cdef fst.SymbolTable *tst = self._mfst.get().MutableInputSymbols()
 *     if tst == NULL:
 *       return             # <<<<<<<<<<<<<<
 *     return _init_MutableFstSymbolTable(tst, self._mfst)
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "pywrapfst.pyx":2122
 *     """
 *     cdef fst.SymbolTable *tst = self._mfst.get().MutableInputSymbols()
 *     if tst == NULL:             # <<<<<<<<<<<<<<
 *       return
 *     return _init_MutableFstSymbolTable(tst, self._mfst)
 */
  }

  /* "pywrapfst.pyx":2124
 *     if tst == NULL:
 *       return
 *     return _init_MutableFstSymbolTable(tst, self._mfst)             # <<<<<<<<<<<<<<
 * 
 *   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, 2124, __pyx_L1_error)
  }
  __pyx_t_2 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFstSymbolTable(__pyx_v_tst, __pyx_v_self->_mfst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2124, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":2115
 *     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("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;
}

/* "pywrapfst.pyx":2126
 *     return _init_MutableFstSymbolTable(tst, self._mfst)
 * 
 *   def mutable_output_symbols(self):             # <<<<<<<<<<<<<<
 *     """
 *     mutable_output_symbols(self)
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_29mutable_output_symbols(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_9pywrapfst_11_MutableFst_28mutable_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_9pywrapfst_11_MutableFst_29mutable_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_9pywrapfst_11_MutableFst_28mutable_output_symbols(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_28mutable_output_symbols(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self) {
  fst::SymbolTable *__pyx_v_tst;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("mutable_output_symbols", 0);

  /* "pywrapfst.pyx":2132
 *     Returns the FST's (mutable) output symbol table, or None if none is present.
 *     """
 *     cdef fst.SymbolTable *tst = self._mfst.get().MutableOutputSymbols()             # <<<<<<<<<<<<<<
 *     if tst == NULL:
 *       return
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
    __PYX_ERR(0, 2132, __pyx_L1_error)
  }
  __pyx_v_tst = __pyx_v_self->_mfst.get()->MutableOutputSymbols();

  /* "pywrapfst.pyx":2133
 *     """
 *     cdef fst.SymbolTable *tst = self._mfst.get().MutableOutputSymbols()
 *     if tst == NULL:             # <<<<<<<<<<<<<<
 *       return
 *     return _init_MutableFstSymbolTable(tst, self._mfst)
 */
  __pyx_t_1 = ((__pyx_v_tst == NULL) != 0);
  if (__pyx_t_1) {

    /* "pywrapfst.pyx":2134
 *     cdef fst.SymbolTable *tst = self._mfst.get().MutableOutputSymbols()
 *     if tst == NULL:
 *       return             # <<<<<<<<<<<<<<
 *     return _init_MutableFstSymbolTable(tst, self._mfst)
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "pywrapfst.pyx":2133
 *     """
 *     cdef fst.SymbolTable *tst = self._mfst.get().MutableOutputSymbols()
 *     if tst == NULL:             # <<<<<<<<<<<<<<
 *       return
 *     return _init_MutableFstSymbolTable(tst, self._mfst)
 */
  }

  /* "pywrapfst.pyx":2135
 *     if tst == NULL:
 *       return
 *     return _init_MutableFstSymbolTable(tst, self._mfst)             # <<<<<<<<<<<<<<
 * 
 *   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, 2135, __pyx_L1_error)
  }
  __pyx_t_2 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFstSymbolTable(__pyx_v_tst, __pyx_v_self->_mfst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2135, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":2126
 *     return _init_MutableFstSymbolTable(tst, self._mfst)
 * 
 *   def mutable_output_symbols(self):             # <<<<<<<<<<<<<<
 *     """
 *     mutable_output_symbols(self)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("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;
}

/* "pywrapfst.pyx":2137
 *     return _init_MutableFstSymbolTable(tst, self._mfst)
 * 
 *   cpdef int64 num_states(self):             # <<<<<<<<<<<<<<
 *     """
 *     num_states(self)
 */

static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_31num_states(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static __pyx_t_10basictypes_int64 __pyx_f_9pywrapfst_11_MutableFst_num_states(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, int __pyx_skip_dispatch) {
  __pyx_t_10basictypes_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;
  __pyx_t_10basictypes_int64 __pyx_t_5;
  __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)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_states); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2137, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_11_MutableFst_31num_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);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2137, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2137, __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_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2137, __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;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pywrapfst.pyx":2143
 *     Returns the number of states.
 *     """
 *     return self._mfst.get().NumStates()             # <<<<<<<<<<<<<<
 * 
 *   cdef void _project(self, bool project_output=False) except *:
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
    __PYX_ERR(0, 2143, __pyx_L1_error)
  }
  __pyx_r = __pyx_v_self->_mfst.get()->NumStates();
  goto __pyx_L0;

  /* "pywrapfst.pyx":2137
 *     return _init_MutableFstSymbolTable(tst, self._mfst)
 * 
 *   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("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_9pywrapfst_11_MutableFst_31num_states(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_9pywrapfst_11_MutableFst_30num_states[] = "\n    num_states(self)\n\n    Returns the number of states.\n    ";
static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_31num_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_9pywrapfst_11_MutableFst_30num_states(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_30num_states(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("num_states", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_f_9pywrapfst_11_MutableFst_num_states(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2137, __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("pywrapfst._MutableFst.num_states", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":2145
 *     return self._mfst.get().NumStates()
 * 
 *   cdef void _project(self, bool project_output=False) except *:             # <<<<<<<<<<<<<<
 *     fst.Project(self._mfst.get(), fst.GetProjectType(project_output))
 *     self._check_mutating_imethod()
 */

static void __pyx_f_9pywrapfst_11_MutableFst__project(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, struct __pyx_opt_args_9pywrapfst_11_MutableFst__project *__pyx_optional_args) {
  bool __pyx_v_project_output = ((bool)0);
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_project", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_project_output = __pyx_optional_args->project_output;
    }
  }

  /* "pywrapfst.pyx":2146
 * 
 *   cdef void _project(self, bool project_output=False) except *:
 *     fst.Project(self._mfst.get(), fst.GetProjectType(project_output))             # <<<<<<<<<<<<<<
 *     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, 2146, __pyx_L1_error)
  }
  fst::script::Project(__pyx_v_self->_mfst.get(), fst::script::GetProjectType(__pyx_v_project_output));

  /* "pywrapfst.pyx":2147
 *   cdef void _project(self, bool project_output=False) except *:
 *     fst.Project(self._mfst.get(), fst.GetProjectType(project_output))
 *     self._check_mutating_imethod()             # <<<<<<<<<<<<<<
 * 
 *   def project(self, bool project_output=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, 2147, __pyx_L1_error)
  }
  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2147, __pyx_L1_error)

  /* "pywrapfst.pyx":2145
 *     return self._mfst.get().NumStates()
 * 
 *   cdef void _project(self, bool project_output=False) except *:             # <<<<<<<<<<<<<<
 *     fst.Project(self._mfst.get(), fst.GetProjectType(project_output))
 *     self._check_mutating_imethod()
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pywrapfst._MutableFst._project", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pywrapfst.pyx":2149
 *     self._check_mutating_imethod()
 * 
 *   def project(self, bool project_output=False):             # <<<<<<<<<<<<<<
 *     """
 *     project(self, project_output=False)
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_33project(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9pywrapfst_11_MutableFst_32project[] = "\n    project(self, project_output=False)\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_output: Should the output labels be projected?\n\n    Returns:\n      self.\n\n    See also: `decode`, `encode`, `relabel_pairs`, `relabel_symbols`.\n    ";
static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_33project(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  bool __pyx_v_project_output;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("project (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_project_output,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 = PyDict_GetItem(__pyx_kwds, __pyx_n_s_project_output);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "project") < 0)) __PYX_ERR(0, 2149, __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_project_output = __Pyx_PyObject_IsTrue(values[0]); if (unlikely((__pyx_v_project_output == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2149, __pyx_L3_error)
    } else {
      __pyx_v_project_output = ((bool)0);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("project", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2149, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pywrapfst._MutableFst.project", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_32project(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self), __pyx_v_project_output);

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

static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_32project(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, bool __pyx_v_project_output) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  struct __pyx_opt_args_9pywrapfst_11_MutableFst__project __pyx_t_1;
  __Pyx_RefNannySetupContext("project", 0);

  /* "pywrapfst.pyx":2167
 *     See also: `decode`, `encode`, `relabel_pairs`, `relabel_symbols`.
 *     """
 *     self._project(project_output)             # <<<<<<<<<<<<<<
 *     return self
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_project");
    __PYX_ERR(0, 2167, __pyx_L1_error)
  }
  __pyx_t_1.__pyx_n = 1;
  __pyx_t_1.project_output = __pyx_v_project_output;
  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_project(__pyx_v_self, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2167, __pyx_L1_error)

  /* "pywrapfst.pyx":2168
 *     """
 *     self._project(project_output)
 *     return self             # <<<<<<<<<<<<<<
 * 
 *   cdef void _prune(self, float delta=fst.kDelta, int64 nstate=fst.kNoStateId,
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "pywrapfst.pyx":2149
 *     self._check_mutating_imethod()
 * 
 *   def project(self, bool project_output=False):             # <<<<<<<<<<<<<<
 *     """
 *     project(self, project_output=False)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pywrapfst._MutableFst.project", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":2170
 *     return self
 * 
 *   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.
 */

static void __pyx_f_9pywrapfst_11_MutableFst__prune(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, struct __pyx_opt_args_9pywrapfst_11_MutableFst__prune *__pyx_optional_args) {
  float __pyx_v_delta = __pyx_k__37;
  __pyx_t_10basictypes_int64 __pyx_v_nstate = __pyx_k__38;

  /* "pywrapfst.pyx":2171
 * 
 *   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.
 *     cdef fst.WeightClass wc = _get_WeightClass_or_Zero(self.weight_type(),
 */
  PyObject *__pyx_v_weight = ((PyObject *)Py_None);
  fst::script::WeightClass __pyx_v_wc;
  __Pyx_RefNannyDeclarations
  fst::script::WeightClass __pyx_t_1;
  __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;
        }
      }
    }
  }

  /* "pywrapfst.pyx":2173
 *                    weight=None) except *:
 *     # Threshold is set to semiring Zero (no pruning) if no weight is specified.
 *     cdef fst.WeightClass wc = _get_WeightClass_or_Zero(self.weight_type(),             # <<<<<<<<<<<<<<
 *                                                        weight)
 *     fst.Prune(self._mfst.get(), wc, 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, 2173, __pyx_L1_error)
  }

  /* "pywrapfst.pyx":2174
 *     # Threshold is set to semiring Zero (no pruning) if no weight is specified.
 *     cdef fst.WeightClass wc = _get_WeightClass_or_Zero(self.weight_type(),
 *                                                        weight)             # <<<<<<<<<<<<<<
 *     fst.Prune(self._mfst.get(), wc, nstate, delta)
 *     self._check_mutating_imethod()
 */
  __pyx_t_1 = __pyx_f_9pywrapfst__get_WeightClass_or_Zero(((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.weight_type(((struct __pyx_obj_9pywrapfst__Fst *)__pyx_v_self), 0), __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2173, __pyx_L1_error)
  __pyx_v_wc = __pyx_t_1;

  /* "pywrapfst.pyx":2175
 *     cdef fst.WeightClass wc = _get_WeightClass_or_Zero(self.weight_type(),
 *                                                        weight)
 *     fst.Prune(self._mfst.get(), wc, 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, 2175, __pyx_L1_error)
  }
  fst::script::Prune(__pyx_v_self->_mfst.get(), __pyx_v_wc, __pyx_v_nstate, __pyx_v_delta);

  /* "pywrapfst.pyx":2176
 *                                                        weight)
 *     fst.Prune(self._mfst.get(), wc, 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, 2176, __pyx_L1_error)
  }
  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2176, __pyx_L1_error)

  /* "pywrapfst.pyx":2170
 *     return self
 * 
 *   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.
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pywrapfst._MutableFst._prune", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pywrapfst.pyx":2178
 *     self._check_mutating_imethod()
 * 
 *   def prune(self,             # <<<<<<<<<<<<<<
 *             float delta=fst.kDelta,
 *             int64 nstate=fst.kNoStateId,
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_35prune(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9pywrapfst_11_MutableFst_34prune[] = "\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\n    See also: The constructive variant.\n    ";
static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_35prune(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  float __pyx_v_delta;
  __pyx_t_10basictypes_int64 __pyx_v_nstate;
  PyObject *__pyx_v_weight = 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};

    /* "pywrapfst.pyx":2181
 *             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 = PyDict_GetItem(__pyx_kwds, __pyx_n_s_delta);
          if (value) { values[0] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nstate);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__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, 2178, __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, 2179, __pyx_L3_error)
    } else {
      __pyx_v_delta = __pyx_k__39;
    }
    if (values[1]) {
      __pyx_v_nstate = __Pyx_PyInt_As_int64_t(values[1]); if (unlikely((__pyx_v_nstate == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2180, __pyx_L3_error)
    } else {
      __pyx_v_nstate = __pyx_k__40;
    }
    __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, 2178, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pywrapfst._MutableFst.prune", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_34prune(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self), __pyx_v_delta, __pyx_v_nstate, __pyx_v_weight);

  /* "pywrapfst.pyx":2178
 *     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_9pywrapfst_11_MutableFst_34prune(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, float __pyx_v_delta, __pyx_t_10basictypes_int64 __pyx_v_nstate, PyObject *__pyx_v_weight) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  struct __pyx_opt_args_9pywrapfst_11_MutableFst__prune __pyx_t_1;
  __Pyx_RefNannySetupContext("prune", 0);

  /* "pywrapfst.pyx":2203
 *     See also: The constructive variant.
 *     """
 *     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, 2203, __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_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_prune(__pyx_v_self, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2203, __pyx_L1_error)

  /* "pywrapfst.pyx":2204
 *     """
 *     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;

  /* "pywrapfst.pyx":2178
 *     self._check_mutating_imethod()
 * 
 *   def prune(self,             # <<<<<<<<<<<<<<
 *             float delta=fst.kDelta,
 *             int64 nstate=fst.kNoStateId,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pywrapfst._MutableFst.prune", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":2206
 *     return self
 * 
 *   cdef void _push(self,             # <<<<<<<<<<<<<<
 *                   float delta=fst.kDelta,
 *                   bool remove_total_weight=False,
 */

static void __pyx_f_9pywrapfst_11_MutableFst__push(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, struct __pyx_opt_args_9pywrapfst_11_MutableFst__push *__pyx_optional_args) {
  float __pyx_v_delta = __pyx_k__41;

  /* "pywrapfst.pyx":2208
 *   cdef void _push(self,
 *                   float delta=fst.kDelta,
 *                   bool remove_total_weight=False,             # <<<<<<<<<<<<<<
 *                   bool to_final=False) except *:
 *     fst.Push(self._mfst.get(), fst.GetReweightType(to_final), delta,
 */
  bool __pyx_v_remove_total_weight = ((bool)0);

  /* "pywrapfst.pyx":2209
 *                   float delta=fst.kDelta,
 *                   bool remove_total_weight=False,
 *                   bool to_final=False) except *:             # <<<<<<<<<<<<<<
 *     fst.Push(self._mfst.get(), fst.GetReweightType(to_final), delta,
 *              remove_total_weight)
 */
  bool __pyx_v_to_final = ((bool)0);
  __Pyx_RefNannyDeclarations
  __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;
        }
      }
    }
  }

  /* "pywrapfst.pyx":2210
 *                   bool remove_total_weight=False,
 *                   bool to_final=False) except *:
 *     fst.Push(self._mfst.get(), fst.GetReweightType(to_final), delta,             # <<<<<<<<<<<<<<
 *              remove_total_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, 2210, __pyx_L1_error)
  }

  /* "pywrapfst.pyx":2211
 *                   bool to_final=False) except *:
 *     fst.Push(self._mfst.get(), fst.GetReweightType(to_final), delta,
 *              remove_total_weight)             # <<<<<<<<<<<<<<
 *     self._check_mutating_imethod()
 * 
 */
  fst::script::Push(__pyx_v_self->_mfst.get(), fst::script::GetReweightType(__pyx_v_to_final), __pyx_v_delta, __pyx_v_remove_total_weight);

  /* "pywrapfst.pyx":2212
 *     fst.Push(self._mfst.get(), fst.GetReweightType(to_final), delta,
 *              remove_total_weight)
 *     self._check_mutating_imethod()             # <<<<<<<<<<<<<<
 * 
 *   def push(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, 2212, __pyx_L1_error)
  }
  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2212, __pyx_L1_error)

  /* "pywrapfst.pyx":2206
 *     return self
 * 
 *   cdef void _push(self,             # <<<<<<<<<<<<<<
 *                   float delta=fst.kDelta,
 *                   bool remove_total_weight=False,
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pywrapfst._MutableFst._push", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pywrapfst.pyx":2214
 *     self._check_mutating_imethod()
 * 
 *   def push(self,             # <<<<<<<<<<<<<<
 *            float delta=fst.kDelta,
 *            bool remove_total_weight=False,
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_37push(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9pywrapfst_11_MutableFst_36push[] = "\n    push(self, delta=0.0009765625, 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\n    See also: The constructive variant, which also supports label pushing.\n    ";
static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_37push(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;
  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 = PyDict_GetItem(__pyx_kwds, __pyx_n_s_delta);
          if (value) { values[0] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__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 = PyDict_GetItem(__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, 2214, __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, 2215, __pyx_L3_error)
    } else {
      __pyx_v_delta = __pyx_k__42;
    }
    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, 2216, __pyx_L3_error)
    } else {

      /* "pywrapfst.pyx":2216
 *   def push(self,
 *            float delta=fst.kDelta,
 *            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, 2217, __pyx_L3_error)
    } else {

      /* "pywrapfst.pyx":2217
 *            float delta=fst.kDelta,
 *            bool remove_total_weight=False,
 *            bool to_final=False):             # <<<<<<<<<<<<<<
 *     """
 *     push(self, delta=0.0009765625, 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, 2214, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pywrapfst._MutableFst.push", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_36push(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self), __pyx_v_delta, __pyx_v_remove_total_weight, __pyx_v_to_final);

  /* "pywrapfst.pyx":2214
 *     self._check_mutating_imethod()
 * 
 *   def push(self,             # <<<<<<<<<<<<<<
 *            float delta=fst.kDelta,
 *            bool remove_total_weight=False,
 */

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

static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_36push(struct __pyx_obj_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_9pywrapfst_11_MutableFst__push __pyx_t_1;
  __Pyx_RefNannySetupContext("push", 0);

  /* "pywrapfst.pyx":2243
 *     See also: The constructive variant, which also supports label pushing.
 *     """
 *     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, 2243, __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_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_push(__pyx_v_self, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2243, __pyx_L1_error)

  /* "pywrapfst.pyx":2244
 *     """
 *     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;

  /* "pywrapfst.pyx":2214
 *     self._check_mutating_imethod()
 * 
 *   def push(self,             # <<<<<<<<<<<<<<
 *            float delta=fst.kDelta,
 *            bool remove_total_weight=False,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pywrapfst._MutableFst.push", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":2246
 *     return self
 * 
 *   cdef void _relabel_pairs(self, ipairs=None, opairs=None) except *:             # <<<<<<<<<<<<<<
 *     cdef unique_ptr[vector[fst.LabelPair]] _ipairs
 *     _ipairs.reset(new vector[fst.LabelPair]())
 */

static void __pyx_f_9pywrapfst_11_MutableFst__relabel_pairs(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, struct __pyx_opt_args_9pywrapfst_11_MutableFst__relabel_pairs *__pyx_optional_args) {
  PyObject *__pyx_v_ipairs = ((PyObject *)Py_None);
  PyObject *__pyx_v_opairs = ((PyObject *)Py_None);
  std::unique_ptr<std::vector<__pyx_t_3fst_LabelPair> >  __pyx_v__ipairs;
  std::unique_ptr<std::vector<__pyx_t_3fst_LabelPair> >  __pyx_v__opairs;
  __pyx_t_10basictypes_int64 __pyx_v_before;
  __pyx_t_10basictypes_int64 __pyx_v_after;
  __Pyx_RefNannyDeclarations
  std::vector<__pyx_t_3fst_LabelPair>  *__pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *(*__pyx_t_10)(PyObject *);
  __pyx_t_10basictypes_int64 __pyx_t_11;
  __pyx_t_10basictypes_int64 __pyx_t_12;
  __pyx_t_3fst_LabelPair __pyx_t_13;
  int __pyx_t_14;
  __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;
      }
    }
  }

  /* "pywrapfst.pyx":2248
 *   cdef void _relabel_pairs(self, ipairs=None, opairs=None) except *:
 *     cdef unique_ptr[vector[fst.LabelPair]] _ipairs
 *     _ipairs.reset(new vector[fst.LabelPair]())             # <<<<<<<<<<<<<<
 *     cdef unique_ptr[vector[fst.LabelPair]] _opairs
 *     _opairs.reset(new vector[fst.LabelPair]())
 */
  try {
    __pyx_t_1 = new std::vector<__pyx_t_3fst_LabelPair> ();
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(0, 2248, __pyx_L1_error)
  }
  __pyx_v__ipairs.reset(__pyx_t_1);

  /* "pywrapfst.pyx":2250
 *     _ipairs.reset(new vector[fst.LabelPair]())
 *     cdef unique_ptr[vector[fst.LabelPair]] _opairs
 *     _opairs.reset(new vector[fst.LabelPair]())             # <<<<<<<<<<<<<<
 *     cdef int64 before
 *     cdef int64 after
 */
  try {
    __pyx_t_1 = new std::vector<__pyx_t_3fst_LabelPair> ();
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(0, 2250, __pyx_L1_error)
  }
  __pyx_v__opairs.reset(__pyx_t_1);

  /* "pywrapfst.pyx":2253
 *     cdef int64 before
 *     cdef int64 after
 *     if ipairs:             # <<<<<<<<<<<<<<
 *       for (before, after) in ipairs:
 *         _ipairs.get().push_back(fst.LabelPair(before, after))
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_ipairs); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 2253, __pyx_L1_error)
  if (__pyx_t_2) {

    /* "pywrapfst.pyx":2254
 *     cdef int64 after
 *     if ipairs:
 *       for (before, after) in ipairs:             # <<<<<<<<<<<<<<
 *         _ipairs.get().push_back(fst.LabelPair(before, after))
 *     if opairs:
 */
    if (likely(PyList_CheckExact(__pyx_v_ipairs)) || PyTuple_CheckExact(__pyx_v_ipairs)) {
      __pyx_t_3 = __pyx_v_ipairs; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
      __pyx_t_5 = NULL;
    } else {
      __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_ipairs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2254, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2254, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_5)) {
        if (likely(PyList_CheckExact(__pyx_t_3))) {
          if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_6 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 2254, __pyx_L1_error)
          #else
          __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2254, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          #endif
        } else {
          if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 2254, __pyx_L1_error)
          #else
          __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2254, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          #endif
        }
      } else {
        __pyx_t_6 = __pyx_t_5(__pyx_t_3);
        if (unlikely(!__pyx_t_6)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 2254, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_6);
      }
      if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) {
        PyObject* sequence = __pyx_t_6;
        #if !CYTHON_COMPILING_IN_PYPY
        Py_ssize_t size = Py_SIZE(sequence);
        #else
        Py_ssize_t size = PySequence_Size(sequence);
        #endif
        if (unlikely(size != 2)) {
          if (size > 2) __Pyx_RaiseTooManyValuesError(2);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          __PYX_ERR(0, 2254, __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_8 = PyTuple_GET_ITEM(sequence, 1); 
        } else {
          __pyx_t_7 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_8 = PyList_GET_ITEM(sequence, 1); 
        }
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_8);
        #else
        __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2254, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2254, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        #endif
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        Py_ssize_t index = -1;
        __pyx_t_9 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2254, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_10 = Py_TYPE(__pyx_t_9)->tp_iternext;
        index = 0; __pyx_t_7 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_7)) goto __pyx_L6_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_7);
        index = 1; __pyx_t_8 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_8)) goto __pyx_L6_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_8);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 2254, __pyx_L1_error)
        __pyx_t_10 = NULL;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        goto __pyx_L7_unpacking_done;
        __pyx_L6_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_10 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        __PYX_ERR(0, 2254, __pyx_L1_error)
        __pyx_L7_unpacking_done:;
      }
      __pyx_t_11 = __Pyx_PyInt_As_int64_t(__pyx_t_7); if (unlikely((__pyx_t_11 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2254, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_12 = __Pyx_PyInt_As_int64_t(__pyx_t_8); if (unlikely((__pyx_t_12 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2254, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_v_before = __pyx_t_11;
      __pyx_v_after = __pyx_t_12;

      /* "pywrapfst.pyx":2255
 *     if ipairs:
 *       for (before, after) in ipairs:
 *         _ipairs.get().push_back(fst.LabelPair(before, after))             # <<<<<<<<<<<<<<
 *     if opairs:
 *       for (before, after) in opairs:
 */
      try {
        __pyx_t_13 = __pyx_t_3fst_LabelPair(__pyx_v_before, __pyx_v_after);
      } catch(...) {
        __Pyx_CppExn2PyErr();
        __PYX_ERR(0, 2255, __pyx_L1_error)
      }
      try {
        __pyx_v__ipairs.get()->push_back(__pyx_t_13);
      } catch(...) {
        __Pyx_CppExn2PyErr();
        __PYX_ERR(0, 2255, __pyx_L1_error)
      }

      /* "pywrapfst.pyx":2254
 *     cdef int64 after
 *     if ipairs:
 *       for (before, after) in ipairs:             # <<<<<<<<<<<<<<
 *         _ipairs.get().push_back(fst.LabelPair(before, after))
 *     if opairs:
 */
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "pywrapfst.pyx":2253
 *     cdef int64 before
 *     cdef int64 after
 *     if ipairs:             # <<<<<<<<<<<<<<
 *       for (before, after) in ipairs:
 *         _ipairs.get().push_back(fst.LabelPair(before, after))
 */
  }

  /* "pywrapfst.pyx":2256
 *       for (before, after) in ipairs:
 *         _ipairs.get().push_back(fst.LabelPair(before, after))
 *     if opairs:             # <<<<<<<<<<<<<<
 *       for (before, after) in opairs:
 *         _opairs.get().push_back(fst.LabelPair(before, after))
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_opairs); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 2256, __pyx_L1_error)
  if (__pyx_t_2) {

    /* "pywrapfst.pyx":2257
 *         _ipairs.get().push_back(fst.LabelPair(before, after))
 *     if opairs:
 *       for (before, after) in opairs:             # <<<<<<<<<<<<<<
 *         _opairs.get().push_back(fst.LabelPair(before, after))
 *     if _ipairs.get().empty() and _opairs.get().empty():
 */
    if (likely(PyList_CheckExact(__pyx_v_opairs)) || PyTuple_CheckExact(__pyx_v_opairs)) {
      __pyx_t_3 = __pyx_v_opairs; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
      __pyx_t_5 = NULL;
    } else {
      __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_opairs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2257, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2257, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_5)) {
        if (likely(PyList_CheckExact(__pyx_t_3))) {
          if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_6 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 2257, __pyx_L1_error)
          #else
          __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2257, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          #endif
        } else {
          if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 2257, __pyx_L1_error)
          #else
          __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2257, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          #endif
        }
      } else {
        __pyx_t_6 = __pyx_t_5(__pyx_t_3);
        if (unlikely(!__pyx_t_6)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 2257, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_6);
      }
      if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) {
        PyObject* sequence = __pyx_t_6;
        #if !CYTHON_COMPILING_IN_PYPY
        Py_ssize_t size = Py_SIZE(sequence);
        #else
        Py_ssize_t size = PySequence_Size(sequence);
        #endif
        if (unlikely(size != 2)) {
          if (size > 2) __Pyx_RaiseTooManyValuesError(2);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          __PYX_ERR(0, 2257, __pyx_L1_error)
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_8 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); 
        } else {
          __pyx_t_8 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_7 = PyList_GET_ITEM(sequence, 1); 
        }
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_7);
        #else
        __pyx_t_8 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2257, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2257, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        #endif
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        Py_ssize_t index = -1;
        __pyx_t_9 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2257, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_10 = Py_TYPE(__pyx_t_9)->tp_iternext;
        index = 0; __pyx_t_8 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_8)) goto __pyx_L11_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_8);
        index = 1; __pyx_t_7 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_7)) goto __pyx_L11_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_7);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 2257, __pyx_L1_error)
        __pyx_t_10 = NULL;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        goto __pyx_L12_unpacking_done;
        __pyx_L11_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_10 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        __PYX_ERR(0, 2257, __pyx_L1_error)
        __pyx_L12_unpacking_done:;
      }
      __pyx_t_12 = __Pyx_PyInt_As_int64_t(__pyx_t_8); if (unlikely((__pyx_t_12 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2257, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_11 = __Pyx_PyInt_As_int64_t(__pyx_t_7); if (unlikely((__pyx_t_11 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2257, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_before = __pyx_t_12;
      __pyx_v_after = __pyx_t_11;

      /* "pywrapfst.pyx":2258
 *     if opairs:
 *       for (before, after) in opairs:
 *         _opairs.get().push_back(fst.LabelPair(before, after))             # <<<<<<<<<<<<<<
 *     if _ipairs.get().empty() and _opairs.get().empty():
 *       raise FstArgError("No relabeling pairs specified.")
 */
      try {
        __pyx_t_13 = __pyx_t_3fst_LabelPair(__pyx_v_before, __pyx_v_after);
      } catch(...) {
        __Pyx_CppExn2PyErr();
        __PYX_ERR(0, 2258, __pyx_L1_error)
      }
      try {
        __pyx_v__opairs.get()->push_back(__pyx_t_13);
      } catch(...) {
        __Pyx_CppExn2PyErr();
        __PYX_ERR(0, 2258, __pyx_L1_error)
      }

      /* "pywrapfst.pyx":2257
 *         _ipairs.get().push_back(fst.LabelPair(before, after))
 *     if opairs:
 *       for (before, after) in opairs:             # <<<<<<<<<<<<<<
 *         _opairs.get().push_back(fst.LabelPair(before, after))
 *     if _ipairs.get().empty() and _opairs.get().empty():
 */
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "pywrapfst.pyx":2256
 *       for (before, after) in ipairs:
 *         _ipairs.get().push_back(fst.LabelPair(before, after))
 *     if opairs:             # <<<<<<<<<<<<<<
 *       for (before, after) in opairs:
 *         _opairs.get().push_back(fst.LabelPair(before, after))
 */
  }

  /* "pywrapfst.pyx":2259
 *       for (before, after) in opairs:
 *         _opairs.get().push_back(fst.LabelPair(before, after))
 *     if _ipairs.get().empty() and _opairs.get().empty():             # <<<<<<<<<<<<<<
 *       raise FstArgError("No relabeling pairs specified.")
 *     fst.Relabel(self._mfst.get(), deref(_ipairs), deref(_opairs))
 */
  __pyx_t_14 = (__pyx_v__ipairs.get()->empty() != 0);
  if (__pyx_t_14) {
  } else {
    __pyx_t_2 = __pyx_t_14;
    goto __pyx_L14_bool_binop_done;
  }
  __pyx_t_14 = (__pyx_v__opairs.get()->empty() != 0);
  __pyx_t_2 = __pyx_t_14;
  __pyx_L14_bool_binop_done:;
  if (__pyx_t_2) {

    /* "pywrapfst.pyx":2260
 *         _opairs.get().push_back(fst.LabelPair(before, after))
 *     if _ipairs.get().empty() and _opairs.get().empty():
 *       raise FstArgError("No relabeling pairs specified.")             # <<<<<<<<<<<<<<
 *     fst.Relabel(self._mfst.get(), deref(_ipairs), deref(_opairs))
 *     self._check_mutating_imethod()
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstArgError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2260, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__43, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2260, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_6, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __PYX_ERR(0, 2260, __pyx_L1_error)

    /* "pywrapfst.pyx":2259
 *       for (before, after) in opairs:
 *         _opairs.get().push_back(fst.LabelPair(before, after))
 *     if _ipairs.get().empty() and _opairs.get().empty():             # <<<<<<<<<<<<<<
 *       raise FstArgError("No relabeling pairs specified.")
 *     fst.Relabel(self._mfst.get(), deref(_ipairs), deref(_opairs))
 */
  }

  /* "pywrapfst.pyx":2261
 *     if _ipairs.get().empty() and _opairs.get().empty():
 *       raise FstArgError("No relabeling pairs specified.")
 *     fst.Relabel(self._mfst.get(), deref(_ipairs), deref(_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, 2261, __pyx_L1_error)
  }
  fst::script::Relabel(__pyx_v_self->_mfst.get(), (*__pyx_v__ipairs), (*__pyx_v__opairs));

  /* "pywrapfst.pyx":2262
 *       raise FstArgError("No relabeling pairs specified.")
 *     fst.Relabel(self._mfst.get(), deref(_ipairs), deref(_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, 2262, __pyx_L1_error)
  }
  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2262, __pyx_L1_error)

  /* "pywrapfst.pyx":2246
 *     return self
 * 
 *   cdef void _relabel_pairs(self, ipairs=None, opairs=None) except *:             # <<<<<<<<<<<<<<
 *     cdef unique_ptr[vector[fst.LabelPair]] _ipairs
 *     _ipairs.reset(new vector[fst.LabelPair]())
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("pywrapfst._MutableFst._relabel_pairs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pywrapfst.pyx":2264
 *     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_9pywrapfst_11_MutableFst_39relabel_pairs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9pywrapfst_11_MutableFst_38relabel_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\n    See also: `decode`, `encode`, `project`, `relabel_tables`.\n    ";
static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_39relabel_pairs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_ipairs = 0;
  PyObject *__pyx_v_opairs = 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 = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ipairs);
          if (value) { values[0] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__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, 2264, __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, 2264, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pywrapfst._MutableFst.relabel_pairs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_38relabel_pairs(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self), __pyx_v_ipairs, __pyx_v_opairs);

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

static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_38relabel_pairs(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, PyObject *__pyx_v_ipairs, PyObject *__pyx_v_opairs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  struct __pyx_opt_args_9pywrapfst_11_MutableFst__relabel_pairs __pyx_t_1;
  __Pyx_RefNannySetupContext("relabel_pairs", 0);

  /* "pywrapfst.pyx":2286
 *     See also: `decode`, `encode`, `project`, `relabel_tables`.
 *     """
 *     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, 2286, __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_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_relabel_pairs(__pyx_v_self, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2286, __pyx_L1_error)

  /* "pywrapfst.pyx":2287
 *     """
 *     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;

  /* "pywrapfst.pyx":2264
 *     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("pywrapfst._MutableFst.relabel_pairs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":2289
 *     return self
 * 
 *   cdef void _relabel_tables(self,             # <<<<<<<<<<<<<<
 *                             _SymbolTable old_isymbols=None,
 *                             _SymbolTable new_isymbols=None,
 */

static void __pyx_f_9pywrapfst_11_MutableFst__relabel_tables(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, struct __pyx_opt_args_9pywrapfst_11_MutableFst__relabel_tables *__pyx_optional_args) {

  /* "pywrapfst.pyx":2290
 * 
 *   cdef void _relabel_tables(self,
 *                             _SymbolTable old_isymbols=None,             # <<<<<<<<<<<<<<
 *                             _SymbolTable new_isymbols=None,
 *                             unknown_isymbol=b"",
 */
  struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_old_isymbols = ((struct __pyx_obj_9pywrapfst__SymbolTable *)Py_None);

  /* "pywrapfst.pyx":2291
 *   cdef void _relabel_tables(self,
 *                             _SymbolTable old_isymbols=None,
 *                             _SymbolTable new_isymbols=None,             # <<<<<<<<<<<<<<
 *                             unknown_isymbol=b"",
 *                             bool attach_new_isymbols=True,
 */
  struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_new_isymbols = ((struct __pyx_obj_9pywrapfst__SymbolTable *)Py_None);
  PyObject *__pyx_v_unknown_isymbol = ((PyObject *)__pyx_kp_b__24);

  /* "pywrapfst.pyx":2293
 *                             _SymbolTable new_isymbols=None,
 *                             unknown_isymbol=b"",
 *                             bool attach_new_isymbols=True,             # <<<<<<<<<<<<<<
 *                             _SymbolTable old_osymbols=None,
 *                             _SymbolTable new_osymbols=None,
 */
  bool __pyx_v_attach_new_isymbols = ((bool)1);

  /* "pywrapfst.pyx":2294
 *                             unknown_isymbol=b"",
 *                             bool attach_new_isymbols=True,
 *                             _SymbolTable old_osymbols=None,             # <<<<<<<<<<<<<<
 *                             _SymbolTable new_osymbols=None,
 *                             unknown_osymbol=b"",
 */
  struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_old_osymbols = ((struct __pyx_obj_9pywrapfst__SymbolTable *)Py_None);

  /* "pywrapfst.pyx":2295
 *                             bool attach_new_isymbols=True,
 *                             _SymbolTable old_osymbols=None,
 *                             _SymbolTable new_osymbols=None,             # <<<<<<<<<<<<<<
 *                             unknown_osymbol=b"",
 *                             bool attach_new_osymbols=True) except *:
 */
  struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_new_osymbols = ((struct __pyx_obj_9pywrapfst__SymbolTable *)Py_None);
  PyObject *__pyx_v_unknown_osymbol = ((PyObject *)__pyx_kp_b__24);

  /* "pywrapfst.pyx":2297
 *                             _SymbolTable new_osymbols=None,
 *                             unknown_osymbol=b"",
 *                             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 *__pyx_v_new_isymbols_ptr;
  fst::SymbolTable *__pyx_v_new_osymbols_ptr;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  fst::SymbolTable *__pyx_t_6;
  fst::SymbolTable const *__pyx_t_7;
  std::string __pyx_t_8;
  fst::SymbolTable const *__pyx_t_9;
  std::string __pyx_t_10;
  __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;
                  }
                }
              }
            }
          }
        }
      }
    }
  }

  /* "pywrapfst.pyx":2298
 *                             unknown_osymbol=b"",
 *                             bool attach_new_osymbols=True) except *:
 *     if new_isymbols is None and new_osymbols is None:             # <<<<<<<<<<<<<<
 *       raise FstArgError("No new SymbolTables specified")
 *     cdef fst.SymbolTable *new_isymbols_ptr = NULL
 */
  __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 (__pyx_t_1) {

    /* "pywrapfst.pyx":2299
 *                             bool attach_new_osymbols=True) except *:
 *     if new_isymbols is None and new_osymbols is None:
 *       raise FstArgError("No new SymbolTables specified")             # <<<<<<<<<<<<<<
 *     cdef fst.SymbolTable *new_isymbols_ptr = NULL
 *     if new_isymbols is not None:
 */
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstArgError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2299, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__44, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2299, __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, 2299, __pyx_L1_error)

    /* "pywrapfst.pyx":2298
 *                             unknown_osymbol=b"",
 *                             bool attach_new_osymbols=True) except *:
 *     if new_isymbols is None and new_osymbols is None:             # <<<<<<<<<<<<<<
 *       raise FstArgError("No new SymbolTables specified")
 *     cdef fst.SymbolTable *new_isymbols_ptr = NULL
 */
  }

  /* "pywrapfst.pyx":2300
 *     if new_isymbols is None and new_osymbols is None:
 *       raise FstArgError("No new SymbolTables specified")
 *     cdef fst.SymbolTable *new_isymbols_ptr = NULL             # <<<<<<<<<<<<<<
 *     if new_isymbols is not None:
 *       new_isymbols_ptr = new_isymbols._table
 */
  __pyx_v_new_isymbols_ptr = NULL;

  /* "pywrapfst.pyx":2301
 *       raise FstArgError("No new SymbolTables specified")
 *     cdef fst.SymbolTable *new_isymbols_ptr = NULL
 *     if new_isymbols is not None:             # <<<<<<<<<<<<<<
 *       new_isymbols_ptr = new_isymbols._table
 *     cdef fst.SymbolTable *new_osymbols_ptr = NULL
 */
  __pyx_t_1 = (((PyObject *)__pyx_v_new_isymbols) != Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pywrapfst.pyx":2302
 *     cdef fst.SymbolTable *new_isymbols_ptr = NULL
 *     if new_isymbols is not None:
 *       new_isymbols_ptr = new_isymbols._table             # <<<<<<<<<<<<<<
 *     cdef fst.SymbolTable *new_osymbols_ptr = 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'", "_table");
      __PYX_ERR(0, 2302, __pyx_L1_error)
    }
    __pyx_t_6 = __pyx_v_new_isymbols->_table;
    __pyx_v_new_isymbols_ptr = __pyx_t_6;

    /* "pywrapfst.pyx":2301
 *       raise FstArgError("No new SymbolTables specified")
 *     cdef fst.SymbolTable *new_isymbols_ptr = NULL
 *     if new_isymbols is not None:             # <<<<<<<<<<<<<<
 *       new_isymbols_ptr = new_isymbols._table
 *     cdef fst.SymbolTable *new_osymbols_ptr = NULL
 */
  }

  /* "pywrapfst.pyx":2303
 *     if new_isymbols is not None:
 *       new_isymbols_ptr = new_isymbols._table
 *     cdef fst.SymbolTable *new_osymbols_ptr = NULL             # <<<<<<<<<<<<<<
 *     if new_osymbols is not None:
 *       new_osymbols_ptr = new_osymbols._table
 */
  __pyx_v_new_osymbols_ptr = NULL;

  /* "pywrapfst.pyx":2304
 *       new_isymbols_ptr = new_isymbols._table
 *     cdef fst.SymbolTable *new_osymbols_ptr = NULL
 *     if new_osymbols is not None:             # <<<<<<<<<<<<<<
 *       new_osymbols_ptr = new_osymbols._table
 *     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) {

    /* "pywrapfst.pyx":2305
 *     cdef fst.SymbolTable *new_osymbols_ptr = NULL
 *     if new_osymbols is not None:
 *       new_osymbols_ptr = new_osymbols._table             # <<<<<<<<<<<<<<
 *     fst.Relabel(self._mfst.get(),
 *         self._fst.get().InputSymbols() if old_isymbols is None else
 */
    if (unlikely(((PyObject *)__pyx_v_new_osymbols) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_table");
      __PYX_ERR(0, 2305, __pyx_L1_error)
    }
    __pyx_t_6 = __pyx_v_new_osymbols->_table;
    __pyx_v_new_osymbols_ptr = __pyx_t_6;

    /* "pywrapfst.pyx":2304
 *       new_isymbols_ptr = new_isymbols._table
 *     cdef fst.SymbolTable *new_osymbols_ptr = NULL
 *     if new_osymbols is not None:             # <<<<<<<<<<<<<<
 *       new_osymbols_ptr = new_osymbols._table
 *     fst.Relabel(self._mfst.get(),
 */
  }

  /* "pywrapfst.pyx":2306
 *     if new_osymbols is not None:
 *       new_osymbols_ptr = new_osymbols._table
 *     fst.Relabel(self._mfst.get(),             # <<<<<<<<<<<<<<
 *         self._fst.get().InputSymbols() if old_isymbols is None else
 *         old_isymbols._table, new_isymbols_ptr, tostring(unknown_isymbol),
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
    __PYX_ERR(0, 2306, __pyx_L1_error)
  }

  /* "pywrapfst.pyx":2307
 *       new_osymbols_ptr = new_osymbols._table
 *     fst.Relabel(self._mfst.get(),
 *         self._fst.get().InputSymbols() if old_isymbols is None else             # <<<<<<<<<<<<<<
 *         old_isymbols._table, new_isymbols_ptr, tostring(unknown_isymbol),
 *         attach_new_isymbols,
 */
  __pyx_t_1 = (((PyObject *)__pyx_v_old_isymbols) == Py_None);
  if ((__pyx_t_1 != 0)) {
    if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
      __PYX_ERR(0, 2307, __pyx_L1_error)
    }
    __pyx_t_7 = __pyx_v_self->__pyx_base._fst.get()->InputSymbols();
  } else {

    /* "pywrapfst.pyx":2308
 *     fst.Relabel(self._mfst.get(),
 *         self._fst.get().InputSymbols() if old_isymbols is None else
 *         old_isymbols._table, new_isymbols_ptr, tostring(unknown_isymbol),             # <<<<<<<<<<<<<<
 *         attach_new_isymbols,
 *         self._fst.get().OutputSymbols() if old_osymbols is None else
 */
    if (unlikely(((PyObject *)__pyx_v_old_isymbols) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_table");
      __PYX_ERR(0, 2308, __pyx_L1_error)
    }
    __pyx_t_7 = __pyx_v_old_isymbols->_table;
  }
  __pyx_t_8 = __pyx_f_9pywrapfst_tostring(__pyx_v_unknown_isymbol, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2308, __pyx_L1_error)

  /* "pywrapfst.pyx":2310
 *         old_isymbols._table, new_isymbols_ptr, tostring(unknown_isymbol),
 *         attach_new_isymbols,
 *         self._fst.get().OutputSymbols() if old_osymbols is None else             # <<<<<<<<<<<<<<
 *         old_osymbols._table, new_osymbols_ptr, tostring(unknown_osymbol),
 *         attach_new_osymbols)
 */
  __pyx_t_1 = (((PyObject *)__pyx_v_old_osymbols) == Py_None);
  if ((__pyx_t_1 != 0)) {
    if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
      __PYX_ERR(0, 2310, __pyx_L1_error)
    }
    __pyx_t_9 = __pyx_v_self->__pyx_base._fst.get()->OutputSymbols();
  } else {

    /* "pywrapfst.pyx":2311
 *         attach_new_isymbols,
 *         self._fst.get().OutputSymbols() if old_osymbols is None else
 *         old_osymbols._table, new_osymbols_ptr, tostring(unknown_osymbol),             # <<<<<<<<<<<<<<
 *         attach_new_osymbols)
 *     self._check_mutating_imethod()
 */
    if (unlikely(((PyObject *)__pyx_v_old_osymbols) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_table");
      __PYX_ERR(0, 2311, __pyx_L1_error)
    }
    __pyx_t_9 = __pyx_v_old_osymbols->_table;
  }
  __pyx_t_10 = __pyx_f_9pywrapfst_tostring(__pyx_v_unknown_osymbol, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2311, __pyx_L1_error)

  /* "pywrapfst.pyx":2306
 *     if new_osymbols is not None:
 *       new_osymbols_ptr = new_osymbols._table
 *     fst.Relabel(self._mfst.get(),             # <<<<<<<<<<<<<<
 *         self._fst.get().InputSymbols() if old_isymbols is None else
 *         old_isymbols._table, new_isymbols_ptr, tostring(unknown_isymbol),
 */
  fst::script::Relabel(__pyx_v_self->_mfst.get(), __pyx_t_7, __pyx_v_new_isymbols_ptr, __pyx_t_8, __pyx_v_attach_new_isymbols, __pyx_t_9, __pyx_v_new_osymbols_ptr, __pyx_t_10, __pyx_v_attach_new_osymbols);

  /* "pywrapfst.pyx":2313
 *         old_osymbols._table, new_osymbols_ptr, 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, 2313, __pyx_L1_error)
  }
  ((struct __pyx_vtabstruct_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)

  /* "pywrapfst.pyx":2289
 *     return self
 * 
 *   cdef void _relabel_tables(self,             # <<<<<<<<<<<<<<
 *                             _SymbolTable old_isymbols=None,
 *                             _SymbolTable new_isymbols=None,
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pywrapfst._MutableFst._relabel_tables", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pywrapfst.pyx":2315
 *     self._check_mutating_imethod()
 * 
 *   def relabel_tables(self,             # <<<<<<<<<<<<<<
 *                      _SymbolTable old_isymbols=None,
 *                      _SymbolTable new_isymbols=None,
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_41relabel_tables(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9pywrapfst_11_MutableFst_40relabel_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\n    See also: `decode`, `encode`, `project`, `relabel_pairs`.\n    ";
static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_41relabel_tables(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_old_isymbols = 0;
  struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_new_isymbols = 0;
  PyObject *__pyx_v_unknown_isymbol = 0;
  bool __pyx_v_attach_new_isymbols;
  struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_old_osymbols = 0;
  struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_new_osymbols = 0;
  PyObject *__pyx_v_unknown_osymbol = 0;
  bool __pyx_v_attach_new_osymbols;
  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};

    /* "pywrapfst.pyx":2316
 * 
 *   def relabel_tables(self,
 *                      _SymbolTable old_isymbols=None,             # <<<<<<<<<<<<<<
 *                      _SymbolTable new_isymbols=None,
 *                      unknown_isymbol=b"",
 */
    values[0] = (PyObject *)((struct __pyx_obj_9pywrapfst__SymbolTable *)Py_None);

    /* "pywrapfst.pyx":2317
 *   def relabel_tables(self,
 *                      _SymbolTable old_isymbols=None,
 *                      _SymbolTable new_isymbols=None,             # <<<<<<<<<<<<<<
 *                      unknown_isymbol=b"",
 *                      bool attach_new_isymbols=True,
 */
    values[1] = (PyObject *)((struct __pyx_obj_9pywrapfst__SymbolTable *)Py_None);
    values[2] = ((PyObject *)__pyx_kp_b__24);

    /* "pywrapfst.pyx":2320
 *                      unknown_isymbol=b"",
 *                      bool attach_new_isymbols=True,
 *                      _SymbolTable old_osymbols=None,             # <<<<<<<<<<<<<<
 *                      _SymbolTable new_osymbols=None,
 *                      unknown_osymbol=b"",
 */
    values[4] = (PyObject *)((struct __pyx_obj_9pywrapfst__SymbolTable *)Py_None);

    /* "pywrapfst.pyx":2321
 *                      bool attach_new_isymbols=True,
 *                      _SymbolTable old_osymbols=None,
 *                      _SymbolTable new_osymbols=None,             # <<<<<<<<<<<<<<
 *                      unknown_osymbol=b"",
 *                      bool attach_new_osymbols=True):
 */
    values[5] = (PyObject *)((struct __pyx_obj_9pywrapfst__SymbolTable *)Py_None);
    values[6] = ((PyObject *)__pyx_kp_b__24);
    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 = PyDict_GetItem(__pyx_kwds, __pyx_n_s_old_isymbols);
          if (value) { values[0] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_new_isymbols);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_unknown_isymbol);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__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 = PyDict_GetItem(__pyx_kwds, __pyx_n_s_old_osymbols);
          if (value) { values[4] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_new_osymbols);
          if (value) { values[5] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_unknown_osymbol);
          if (value) { values[6] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__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, 2315, __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_9pywrapfst__SymbolTable *)values[0]);
    __pyx_v_new_isymbols = ((struct __pyx_obj_9pywrapfst__SymbolTable *)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, 2319, __pyx_L3_error)
    } else {

      /* "pywrapfst.pyx":2319
 *                      _SymbolTable new_isymbols=None,
 *                      unknown_isymbol=b"",
 *                      bool attach_new_isymbols=True,             # <<<<<<<<<<<<<<
 *                      _SymbolTable old_osymbols=None,
 *                      _SymbolTable new_osymbols=None,
 */
      __pyx_v_attach_new_isymbols = ((bool)1);
    }
    __pyx_v_old_osymbols = ((struct __pyx_obj_9pywrapfst__SymbolTable *)values[4]);
    __pyx_v_new_osymbols = ((struct __pyx_obj_9pywrapfst__SymbolTable *)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, 2323, __pyx_L3_error)
    } else {

      /* "pywrapfst.pyx":2323
 *                      _SymbolTable new_osymbols=None,
 *                      unknown_osymbol=b"",
 *                      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, 2315, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("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_9pywrapfst__SymbolTable, 1, "old_isymbols", 0))) __PYX_ERR(0, 2316, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_new_isymbols), __pyx_ptype_9pywrapfst__SymbolTable, 1, "new_isymbols", 0))) __PYX_ERR(0, 2317, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_old_osymbols), __pyx_ptype_9pywrapfst__SymbolTable, 1, "old_osymbols", 0))) __PYX_ERR(0, 2320, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_new_osymbols), __pyx_ptype_9pywrapfst__SymbolTable, 1, "new_osymbols", 0))) __PYX_ERR(0, 2321, __pyx_L1_error)
  __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_40relabel_tables(((struct __pyx_obj_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);

  /* "pywrapfst.pyx":2315
 *     self._check_mutating_imethod()
 * 
 *   def relabel_tables(self,             # <<<<<<<<<<<<<<
 *                      _SymbolTable old_isymbols=None,
 *                      _SymbolTable 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_9pywrapfst_11_MutableFst_40relabel_tables(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_old_isymbols, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_new_isymbols, PyObject *__pyx_v_unknown_isymbol, bool __pyx_v_attach_new_isymbols, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_old_osymbols, struct __pyx_obj_9pywrapfst__SymbolTable *__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_9pywrapfst_11_MutableFst__relabel_tables __pyx_t_1;
  __Pyx_RefNannySetupContext("relabel_tables", 0);

  /* "pywrapfst.pyx":2359
 *     See also: `decode`, `encode`, `project`, `relabel_pairs`.
 *     """
 *     self._relabel_tables(old_isymbols, new_isymbols,             # <<<<<<<<<<<<<<
 *                          unknown_isymbol, attach_new_isymbols,
 *                          old_osymbols, new_osymbols,
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_relabel_tables");
    __PYX_ERR(0, 2359, __pyx_L1_error)
  }

  /* "pywrapfst.pyx":2362
 *                          unknown_isymbol, attach_new_isymbols,
 *                          old_osymbols, 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_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_relabel_tables(__pyx_v_self, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2359, __pyx_L1_error)

  /* "pywrapfst.pyx":2363
 *                          old_osymbols, new_osymbols,
 *                          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;

  /* "pywrapfst.pyx":2315
 *     self._check_mutating_imethod()
 * 
 *   def relabel_tables(self,             # <<<<<<<<<<<<<<
 *                      _SymbolTable old_isymbols=None,
 *                      _SymbolTable new_isymbols=None,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pywrapfst._MutableFst.relabel_tables", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":2365
 *     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_9pywrapfst_11_MutableFst__reserve_arcs(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, __pyx_t_10basictypes_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;
  __Pyx_RefNannySetupContext("_reserve_arcs", 0);

  /* "pywrapfst.pyx":2366
 * 
 *   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, 2366, __pyx_L1_error)
  }
  __pyx_t_1 = ((!(__pyx_v_self->_mfst.get()->ReserveArcs(__pyx_v_state, __pyx_v_n) != 0)) != 0);
  if (__pyx_t_1) {

    /* "pywrapfst.pyx":2367
 *   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_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2367, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__45, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2367, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 2367, __pyx_L1_error)

    /* "pywrapfst.pyx":2366
 * 
 *   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()
 */
  }

  /* "pywrapfst.pyx":2368
 *     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, 2368, __pyx_L1_error)
  }
  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2368, __pyx_L1_error)

  /* "pywrapfst.pyx":2365
 *     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_AddTraceback("pywrapfst._MutableFst._reserve_arcs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pywrapfst.pyx":2370
 *     self._check_mutating_imethod()
 * 
 *   def reserve_arcs(self, int64 state, size_t n):             # <<<<<<<<<<<<<<
 *     """
 *     reserve_arcs(self, state, n)
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_43reserve_arcs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9pywrapfst_11_MutableFst_42reserve_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\n    See also: `reserve_states`.\n    ";
static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_43reserve_arcs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  __pyx_t_10basictypes_int64 __pyx_v_state;
  size_t __pyx_v_n;
  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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_state)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("reserve_arcs", 1, 2, 2, 1); __PYX_ERR(0, 2370, __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, 2370, __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_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2370, __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, 2370, __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, 2370, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pywrapfst._MutableFst.reserve_arcs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_42reserve_arcs(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self), __pyx_v_state, __pyx_v_n);

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

static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_42reserve_arcs(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, __pyx_t_10basictypes_int64 __pyx_v_state, size_t __pyx_v_n) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("reserve_arcs", 0);

  /* "pywrapfst.pyx":2388
 *     See also: `reserve_states`.
 *     """
 *     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, 2388, __pyx_L1_error)
  }
  ((struct __pyx_vtabstruct_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, 2388, __pyx_L1_error)

  /* "pywrapfst.pyx":2389
 *     """
 *     self._reserve_arcs(state, n)
 *     return self             # <<<<<<<<<<<<<<
 * 
 *   cdef void _reserve_states(self, int64 n) except *:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "pywrapfst.pyx":2370
 *     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("pywrapfst._MutableFst.reserve_arcs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":2391
 *     return self
 * 
 *   cdef void _reserve_states(self, int64 n) except *:             # <<<<<<<<<<<<<<
 *     self._mfst.get().ReserveStates(n)
 *     self._check_mutating_imethod()
 */

static void __pyx_f_9pywrapfst_11_MutableFst__reserve_states(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, __pyx_t_10basictypes_int64 __pyx_v_n) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_reserve_states", 0);

  /* "pywrapfst.pyx":2392
 * 
 *   cdef void _reserve_states(self, int64 n) except *:
 *     self._mfst.get().ReserveStates(n)             # <<<<<<<<<<<<<<
 *     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, 2392, __pyx_L1_error)
  }
  __pyx_v_self->_mfst.get()->ReserveStates(__pyx_v_n);

  /* "pywrapfst.pyx":2393
 *   cdef void _reserve_states(self, int64 n) except *:
 *     self._mfst.get().ReserveStates(n)
 *     self._check_mutating_imethod()             # <<<<<<<<<<<<<<
 * 
 *   def reserve_states(self, int64 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, 2393, __pyx_L1_error)
  }
  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2393, __pyx_L1_error)

  /* "pywrapfst.pyx":2391
 *     return self
 * 
 *   cdef void _reserve_states(self, int64 n) except *:             # <<<<<<<<<<<<<<
 *     self._mfst.get().ReserveStates(n)
 *     self._check_mutating_imethod()
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pywrapfst._MutableFst._reserve_states", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pywrapfst.pyx":2395
 *     self._check_mutating_imethod()
 * 
 *   def reserve_states(self, int64 n):             # <<<<<<<<<<<<<<
 *     """
 *     reserve_states(self, n)
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_45reserve_states(PyObject *__pyx_v_self, PyObject *__pyx_arg_n); /*proto*/
static char __pyx_doc_9pywrapfst_11_MutableFst_44reserve_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\n    See also: `reserve_arcs`.\n    ";
static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_45reserve_states(PyObject *__pyx_v_self, PyObject *__pyx_arg_n) {
  __pyx_t_10basictypes_int64 __pyx_v_n;
  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_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2395, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pywrapfst._MutableFst.reserve_states", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_44reserve_states(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self), ((__pyx_t_10basictypes_int64)__pyx_v_n));

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

static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_44reserve_states(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, __pyx_t_10basictypes_int64 __pyx_v_n) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("reserve_states", 0);

  /* "pywrapfst.pyx":2409
 *     See also: `reserve_arcs`.
 *     """
 *     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, 2409, __pyx_L1_error)
  }
  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_reserve_states(__pyx_v_self, __pyx_v_n); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2409, __pyx_L1_error)

  /* "pywrapfst.pyx":2410
 *     """
 *     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;

  /* "pywrapfst.pyx":2395
 *     self._check_mutating_imethod()
 * 
 *   def reserve_states(self, int64 n):             # <<<<<<<<<<<<<<
 *     """
 *     reserve_states(self, n)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pywrapfst._MutableFst.reserve_states", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":2412
 *     return self
 * 
 *   cdef void _reweight(self, potentials, bool to_final=False) except *:             # <<<<<<<<<<<<<<
 *     cdef unique_ptr[vector[fst.WeightClass]] _potentials
 *     _potentials.reset(new vector[fst.WeightClass]())
 */

static void __pyx_f_9pywrapfst_11_MutableFst__reweight(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, PyObject *__pyx_v_potentials, struct __pyx_opt_args_9pywrapfst_11_MutableFst__reweight *__pyx_optional_args) {
  bool __pyx_v_to_final = ((bool)0);
  std::unique_ptr<std::vector<fst::script::WeightClass> >  __pyx_v__potentials;
  CYTHON_UNUSED std::string __pyx_v_weight_type;
  PyObject *__pyx_v_weight = NULL;
  __Pyx_RefNannyDeclarations
  std::vector<fst::script::WeightClass>  *__pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  fst::script::WeightClass __pyx_t_6;
  __Pyx_RefNannySetupContext("_reweight", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_to_final = __pyx_optional_args->to_final;
    }
  }

  /* "pywrapfst.pyx":2414
 *   cdef void _reweight(self, potentials, bool to_final=False) except *:
 *     cdef unique_ptr[vector[fst.WeightClass]] _potentials
 *     _potentials.reset(new vector[fst.WeightClass]())             # <<<<<<<<<<<<<<
 *     cdef string weight_type = self.weight_type()
 *     for weight in potentials:
 */
  try {
    __pyx_t_1 = new std::vector<fst::script::WeightClass> ();
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(0, 2414, __pyx_L1_error)
  }
  __pyx_v__potentials.reset(__pyx_t_1);

  /* "pywrapfst.pyx":2415
 *     cdef unique_ptr[vector[fst.WeightClass]] _potentials
 *     _potentials.reset(new vector[fst.WeightClass]())
 *     cdef string weight_type = self.weight_type()             # <<<<<<<<<<<<<<
 *     for weight in potentials:
 *         _potentials.get().push_back(_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'", "weight_type");
    __PYX_ERR(0, 2415, __pyx_L1_error)
  }
  __pyx_v_weight_type = ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.weight_type(((struct __pyx_obj_9pywrapfst__Fst *)__pyx_v_self), 0);

  /* "pywrapfst.pyx":2416
 *     _potentials.reset(new vector[fst.WeightClass]())
 *     cdef string weight_type = self.weight_type()
 *     for weight in potentials:             # <<<<<<<<<<<<<<
 *         _potentials.get().push_back(_get_WeightClass_or_One(self.weight_type(),
 *                                                             weight))
 */
  if (likely(PyList_CheckExact(__pyx_v_potentials)) || PyTuple_CheckExact(__pyx_v_potentials)) {
    __pyx_t_2 = __pyx_v_potentials; __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_potentials); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2416, __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, 2416, __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, 2416, __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, 2416, __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, 2416, __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, 2416, __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, 2416, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_XDECREF_SET(__pyx_v_weight, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "pywrapfst.pyx":2417
 *     cdef string weight_type = self.weight_type()
 *     for weight in potentials:
 *         _potentials.get().push_back(_get_WeightClass_or_One(self.weight_type(),             # <<<<<<<<<<<<<<
 *                                                             weight))
 *     fst.Reweight(self._mfst.get(), deref(_potentials),
 */
    if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "weight_type");
      __PYX_ERR(0, 2417, __pyx_L1_error)
    }

    /* "pywrapfst.pyx":2418
 *     for weight in potentials:
 *         _potentials.get().push_back(_get_WeightClass_or_One(self.weight_type(),
 *                                                             weight))             # <<<<<<<<<<<<<<
 *     fst.Reweight(self._mfst.get(), deref(_potentials),
 *                  fst.GetReweightType(to_final))
 */
    __pyx_t_6 = __pyx_f_9pywrapfst__get_WeightClass_or_One(((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.weight_type(((struct __pyx_obj_9pywrapfst__Fst *)__pyx_v_self), 0), __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2417, __pyx_L1_error)

    /* "pywrapfst.pyx":2417
 *     cdef string weight_type = self.weight_type()
 *     for weight in potentials:
 *         _potentials.get().push_back(_get_WeightClass_or_One(self.weight_type(),             # <<<<<<<<<<<<<<
 *                                                             weight))
 *     fst.Reweight(self._mfst.get(), deref(_potentials),
 */
    try {
      __pyx_v__potentials.get()->push_back(__pyx_t_6);
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(0, 2417, __pyx_L1_error)
    }

    /* "pywrapfst.pyx":2416
 *     _potentials.reset(new vector[fst.WeightClass]())
 *     cdef string weight_type = self.weight_type()
 *     for weight in potentials:             # <<<<<<<<<<<<<<
 *         _potentials.get().push_back(_get_WeightClass_or_One(self.weight_type(),
 *                                                             weight))
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pywrapfst.pyx":2419
 *         _potentials.get().push_back(_get_WeightClass_or_One(self.weight_type(),
 *                                                             weight))
 *     fst.Reweight(self._mfst.get(), deref(_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, 2419, __pyx_L1_error)
  }

  /* "pywrapfst.pyx":2420
 *                                                             weight))
 *     fst.Reweight(self._mfst.get(), deref(_potentials),
 *                  fst.GetReweightType(to_final))             # <<<<<<<<<<<<<<
 *     self._check_mutating_imethod()
 * 
 */
  fst::script::Reweight(__pyx_v_self->_mfst.get(), (*__pyx_v__potentials), fst::script::GetReweightType(__pyx_v_to_final));

  /* "pywrapfst.pyx":2421
 *     fst.Reweight(self._mfst.get(), deref(_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, 2421, __pyx_L1_error)
  }
  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2421, __pyx_L1_error)

  /* "pywrapfst.pyx":2412
 *     return self
 * 
 *   cdef void _reweight(self, potentials, bool to_final=False) except *:             # <<<<<<<<<<<<<<
 *     cdef unique_ptr[vector[fst.WeightClass]] _potentials
 *     _potentials.reset(new vector[fst.WeightClass]())
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pywrapfst._MutableFst._reweight", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_weight);
  __Pyx_RefNannyFinishContext();
}

/* "pywrapfst.pyx":2423
 *     self._check_mutating_imethod()
 * 
 *   def reweight(self, potentials, bool to_final=False):             # <<<<<<<<<<<<<<
 *     """
 *     reweight(self, potentials, to_final=False)
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_47reweight(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9pywrapfst_11_MutableFst_46reweight[] = "\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_9pywrapfst_11_MutableFst_47reweight(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_potentials = 0;
  bool __pyx_v_to_final;
  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] = PyDict_GetItem(__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 = PyDict_GetItem(__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, 2423, __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, 2423, __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, 2423, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pywrapfst._MutableFst.reweight", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_46reweight(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self), __pyx_v_potentials, __pyx_v_to_final);

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

static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_46reweight(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, PyObject *__pyx_v_potentials, bool __pyx_v_to_final) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  struct __pyx_opt_args_9pywrapfst_11_MutableFst__reweight __pyx_t_1;
  __Pyx_RefNannySetupContext("reweight", 0);

  /* "pywrapfst.pyx":2445
 *       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, 2445, __pyx_L1_error)
  }
  __pyx_t_1.__pyx_n = 1;
  __pyx_t_1.to_final = __pyx_v_to_final;
  ((struct __pyx_vtabstruct_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, 2445, __pyx_L1_error)

  /* "pywrapfst.pyx":2446
 *     """
 *     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;

  /* "pywrapfst.pyx":2423
 *     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("pywrapfst._MutableFst.reweight", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":2448
 *     return self
 * 
 *   cdef void _rmepsilon(self,             # <<<<<<<<<<<<<<
 *                        queue_type=b"auto",
 *                        bool connect=True,
 */

static void __pyx_f_9pywrapfst_11_MutableFst__rmepsilon(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, struct __pyx_opt_args_9pywrapfst_11_MutableFst__rmepsilon *__pyx_optional_args) {
  PyObject *__pyx_v_queue_type = ((PyObject *)__pyx_n_b_auto);

  /* "pywrapfst.pyx":2450
 *   cdef void _rmepsilon(self,
 *                        queue_type=b"auto",
 *                        bool connect=True,             # <<<<<<<<<<<<<<
 *                        weight=None,
 *                        int64 nstate=fst.kNoStateId,
 */
  bool __pyx_v_connect = ((bool)1);

  /* "pywrapfst.pyx":2451
 *                        queue_type=b"auto",
 *                        bool connect=True,
 *                        weight=None,             # <<<<<<<<<<<<<<
 *                        int64 nstate=fst.kNoStateId,
 *                        float delta=fst.kShortestDelta) except *:
 */
  PyObject *__pyx_v_weight = ((PyObject *)Py_None);
  __pyx_t_10basictypes_int64 __pyx_v_nstate = __pyx_k__46;
  float __pyx_v_delta = __pyx_k__47;
  fst::script::WeightClass __pyx_v_wc;
  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;
  __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;
            }
          }
        }
      }
    }
  }

  /* "pywrapfst.pyx":2454
 *                        int64 nstate=fst.kNoStateId,
 *                        float delta=fst.kShortestDelta) except *:
 *     cdef fst.WeightClass wc = _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, 2454, __pyx_L1_error)
  }

  /* "pywrapfst.pyx":2455
 *                        float delta=fst.kShortestDelta) except *:
 *     cdef fst.WeightClass wc = _get_WeightClass_or_Zero(self.weight_type(),
 *                                                        weight)             # <<<<<<<<<<<<<<
 *     cdef unique_ptr[fst.RmEpsilonOptions] opts
 *     opts.reset(new fst.RmEpsilonOptions(_get_queue_type(tostring(queue_type)),
 */
  __pyx_t_1 = __pyx_f_9pywrapfst__get_WeightClass_or_Zero(((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.weight_type(((struct __pyx_obj_9pywrapfst__Fst *)__pyx_v_self), 0), __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2454, __pyx_L1_error)
  __pyx_v_wc = __pyx_t_1;

  /* "pywrapfst.pyx":2457
 *                                                        weight)
 *     cdef unique_ptr[fst.RmEpsilonOptions] opts
 *     opts.reset(new fst.RmEpsilonOptions(_get_queue_type(tostring(queue_type)),             # <<<<<<<<<<<<<<
 *                                         connect, wc, nstate, delta))
 *     fst.RmEpsilon(self._mfst.get(), deref(opts))
 */
  __pyx_t_2 = __pyx_f_9pywrapfst_tostring(__pyx_v_queue_type, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2457, __pyx_L1_error)
  __pyx_t_3 = __pyx_f_9pywrapfst__get_queue_type(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2457, __pyx_L1_error)

  /* "pywrapfst.pyx":2458
 *     cdef unique_ptr[fst.RmEpsilonOptions] opts
 *     opts.reset(new fst.RmEpsilonOptions(_get_queue_type(tostring(queue_type)),
 *                                         connect, wc, nstate, delta))             # <<<<<<<<<<<<<<
 *     fst.RmEpsilon(self._mfst.get(), deref(opts))
 *     self._check_mutating_imethod()
 */
  __pyx_v_opts.reset(new fst::script::RmEpsilonOptions(__pyx_t_3, __pyx_v_connect, __pyx_v_wc, __pyx_v_nstate, __pyx_v_delta));

  /* "pywrapfst.pyx":2459
 *     opts.reset(new fst.RmEpsilonOptions(_get_queue_type(tostring(queue_type)),
 *                                         connect, wc, 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, 2459, __pyx_L1_error)
  }
  fst::script::RmEpsilon(__pyx_v_self->_mfst.get(), (*__pyx_v_opts));

  /* "pywrapfst.pyx":2460
 *                                         connect, wc, nstate, 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, 2460, __pyx_L1_error)
  }
  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2460, __pyx_L1_error)

  /* "pywrapfst.pyx":2448
 *     return self
 * 
 *   cdef void _rmepsilon(self,             # <<<<<<<<<<<<<<
 *                        queue_type=b"auto",
 *                        bool connect=True,
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pywrapfst._MutableFst._rmepsilon", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pywrapfst.pyx":2462
 *     self._check_mutating_imethod()
 * 
 *   def rmepsilon(self,             # <<<<<<<<<<<<<<
 *                 queue_type=b"auto",
 *                 bool connect=True,
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_49rmepsilon(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9pywrapfst_11_MutableFst_48rmepsilon[] = "\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_9pywrapfst_11_MutableFst_49rmepsilon(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;
  __pyx_t_10basictypes_int64 __pyx_v_nstate;
  float __pyx_v_delta;
  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_b_auto);

    /* "pywrapfst.pyx":2465
 *                 queue_type=b"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 = PyDict_GetItem(__pyx_kwds, __pyx_n_s_queue_type);
          if (value) { values[0] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_connect);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_weight);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nstate);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__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, 2462, __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, 2464, __pyx_L3_error)
    } else {

      /* "pywrapfst.pyx":2464
 *   def rmepsilon(self,
 *                 queue_type=b"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_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2466, __pyx_L3_error)
    } else {
      __pyx_v_nstate = __pyx_k__48;
    }
    if (values[4]) {
      __pyx_v_delta = __pyx_PyFloat_AsFloat(values[4]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 2467, __pyx_L3_error)
    } else {
      __pyx_v_delta = __pyx_k__49;
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("rmepsilon", 0, 0, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2462, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pywrapfst._MutableFst.rmepsilon", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_48rmepsilon(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self), __pyx_v_queue_type, __pyx_v_connect, __pyx_v_weight, __pyx_v_nstate, __pyx_v_delta);

  /* "pywrapfst.pyx":2462
 *     self._check_mutating_imethod()
 * 
 *   def rmepsilon(self,             # <<<<<<<<<<<<<<
 *                 queue_type=b"auto",
 *                 bool connect=True,
 */

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

static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_48rmepsilon(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, PyObject *__pyx_v_queue_type, bool __pyx_v_connect, PyObject *__pyx_v_weight, __pyx_t_10basictypes_int64 __pyx_v_nstate, float __pyx_v_delta) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  struct __pyx_opt_args_9pywrapfst_11_MutableFst__rmepsilon __pyx_t_1;
  __Pyx_RefNannySetupContext("rmepsilon", 0);

  /* "pywrapfst.pyx":2489
 *       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, 2489, __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_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_rmepsilon(__pyx_v_self, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2489, __pyx_L1_error)

  /* "pywrapfst.pyx":2490
 *     """
 *     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;

  /* "pywrapfst.pyx":2462
 *     self._check_mutating_imethod()
 * 
 *   def rmepsilon(self,             # <<<<<<<<<<<<<<
 *                 queue_type=b"auto",
 *                 bool connect=True,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pywrapfst._MutableFst.rmepsilon", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":2492
 *     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_9pywrapfst_11_MutableFst__set_final(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, __pyx_t_10basictypes_int64 __pyx_v_state, struct __pyx_opt_args_9pywrapfst_11_MutableFst__set_final *__pyx_optional_args) {
  PyObject *__pyx_v_weight = ((PyObject *)Py_None);
  fst::script::WeightClass __pyx_v_wc;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  fst::script::WeightClass __pyx_t_4;
  __Pyx_RefNannySetupContext("_set_final", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_weight = __pyx_optional_args->weight;
    }
  }

  /* "pywrapfst.pyx":2493
 * 
 *   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 wc = _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, 2493, __pyx_L1_error)
  }
  __pyx_t_1 = ((!(__pyx_v_self->_mfst.get()->ValidStateId(__pyx_v_state) != 0)) != 0);
  if (__pyx_t_1) {

    /* "pywrapfst.pyx":2494
 *   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 wc = _get_WeightClass_or_One(self.weight_type(),
 *                                                       weight)
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2494, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__50, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2494, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 2494, __pyx_L1_error)

    /* "pywrapfst.pyx":2493
 * 
 *   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 wc = _get_WeightClass_or_One(self.weight_type(),
 */
  }

  /* "pywrapfst.pyx":2495
 *     if not self._mfst.get().ValidStateId(state):
 *       raise FstIndexError("State index out of range")
 *     cdef fst.WeightClass wc = _get_WeightClass_or_One(self.weight_type(),             # <<<<<<<<<<<<<<
 *                                                       weight)
 *     if not self._mfst.get().SetFinal(state, wc):
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "weight_type");
    __PYX_ERR(0, 2495, __pyx_L1_error)
  }

  /* "pywrapfst.pyx":2496
 *       raise FstIndexError("State index out of range")
 *     cdef fst.WeightClass wc = _get_WeightClass_or_One(self.weight_type(),
 *                                                       weight)             # <<<<<<<<<<<<<<
 *     if not self._mfst.get().SetFinal(state, wc):
 *       raise FstOpError("Incompatible or invalid weight")
 */
  __pyx_t_4 = __pyx_f_9pywrapfst__get_WeightClass_or_One(((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.weight_type(((struct __pyx_obj_9pywrapfst__Fst *)__pyx_v_self), 0), __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2495, __pyx_L1_error)
  __pyx_v_wc = __pyx_t_4;

  /* "pywrapfst.pyx":2497
 *     cdef fst.WeightClass wc = _get_WeightClass_or_One(self.weight_type(),
 *                                                       weight)
 *     if not self._mfst.get().SetFinal(state, wc):             # <<<<<<<<<<<<<<
 *       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, 2497, __pyx_L1_error)
  }
  __pyx_t_1 = ((!(__pyx_v_self->_mfst.get()->SetFinal(__pyx_v_state, __pyx_v_wc) != 0)) != 0);
  if (__pyx_t_1) {

    /* "pywrapfst.pyx":2498
 *                                                       weight)
 *     if not self._mfst.get().SetFinal(state, wc):
 *       raise FstOpError("Incompatible or invalid weight")             # <<<<<<<<<<<<<<
 *     self._check_mutating_imethod()
 * 
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstOpError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2498, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__51, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2498, __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, 2498, __pyx_L1_error)

    /* "pywrapfst.pyx":2497
 *     cdef fst.WeightClass wc = _get_WeightClass_or_One(self.weight_type(),
 *                                                       weight)
 *     if not self._mfst.get().SetFinal(state, wc):             # <<<<<<<<<<<<<<
 *       raise FstOpError("Incompatible or invalid weight")
 *     self._check_mutating_imethod()
 */
  }

  /* "pywrapfst.pyx":2499
 *     if not self._mfst.get().SetFinal(state, wc):
 *       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, 2499, __pyx_L1_error)
  }
  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2499, __pyx_L1_error)

  /* "pywrapfst.pyx":2492
 *     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_AddTraceback("pywrapfst._MutableFst._set_final", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pywrapfst.pyx":2501
 *     self._check_mutating_imethod()
 * 
 *   def set_final(self, int64 state, weight=None):             # <<<<<<<<<<<<<<
 *     """
 *     set_final(self, state, weight)
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_51set_final(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9pywrapfst_11_MutableFst_50set_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\n    See also: `set_start`.\n    ";
static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_51set_final(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  __pyx_t_10basictypes_int64 __pyx_v_state;
  PyObject *__pyx_v_weight = 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] = PyDict_GetItem(__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 = PyDict_GetItem(__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, 2501, __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_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2501, __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, 2501, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pywrapfst._MutableFst.set_final", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_50set_final(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self), __pyx_v_state, __pyx_v_weight);

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

static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_50set_final(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, __pyx_t_10basictypes_int64 __pyx_v_state, PyObject *__pyx_v_weight) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  struct __pyx_opt_args_9pywrapfst_11_MutableFst__set_final __pyx_t_1;
  __Pyx_RefNannySetupContext("set_final", 0);

  /* "pywrapfst.pyx":2521
 *     See also: `set_start`.
 *     """
 *     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, 2521, __pyx_L1_error)
  }
  __pyx_t_1.__pyx_n = 1;
  __pyx_t_1.weight = __pyx_v_weight;
  ((struct __pyx_vtabstruct_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, 2521, __pyx_L1_error)

  /* "pywrapfst.pyx":2522
 *     """
 *     self._set_final(state, weight)
 *     return self             # <<<<<<<<<<<<<<
 * 
 *   cdef void _set_input_symbols(self, _SymbolTable syms) except *:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "pywrapfst.pyx":2501
 *     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("pywrapfst._MutableFst.set_final", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":2524
 *     return self
 * 
 *   cdef void _set_input_symbols(self, _SymbolTable syms) except *:             # <<<<<<<<<<<<<<
 *     if syms is None:
 *       self._mfst.get().SetInputSymbols(NULL)
 */

static void __pyx_f_9pywrapfst_11_MutableFst__set_input_symbols(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_syms) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("_set_input_symbols", 0);

  /* "pywrapfst.pyx":2525
 * 
 *   cdef void _set_input_symbols(self, _SymbolTable syms) except *:
 *     if syms is None:             # <<<<<<<<<<<<<<
 *       self._mfst.get().SetInputSymbols(NULL)
 *       return
 */
  __pyx_t_1 = (((PyObject *)__pyx_v_syms) == Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pywrapfst.pyx":2526
 *   cdef void _set_input_symbols(self, _SymbolTable syms) except *:
 *     if syms is None:
 *       self._mfst.get().SetInputSymbols(NULL)             # <<<<<<<<<<<<<<
 *       return
 *     self._mfst.get().SetInputSymbols(syms._table)
 */
    if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
      __PYX_ERR(0, 2526, __pyx_L1_error)
    }
    __pyx_v_self->_mfst.get()->SetInputSymbols(NULL);

    /* "pywrapfst.pyx":2527
 *     if syms is None:
 *       self._mfst.get().SetInputSymbols(NULL)
 *       return             # <<<<<<<<<<<<<<
 *     self._mfst.get().SetInputSymbols(syms._table)
 *     self._check_mutating_imethod()
 */
    goto __pyx_L0;

    /* "pywrapfst.pyx":2525
 * 
 *   cdef void _set_input_symbols(self, _SymbolTable syms) except *:
 *     if syms is None:             # <<<<<<<<<<<<<<
 *       self._mfst.get().SetInputSymbols(NULL)
 *       return
 */
  }

  /* "pywrapfst.pyx":2528
 *       self._mfst.get().SetInputSymbols(NULL)
 *       return
 *     self._mfst.get().SetInputSymbols(syms._table)             # <<<<<<<<<<<<<<
 *     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, 2528, __pyx_L1_error)
  }
  if (unlikely(((PyObject *)__pyx_v_syms) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_table");
    __PYX_ERR(0, 2528, __pyx_L1_error)
  }
  __pyx_v_self->_mfst.get()->SetInputSymbols(__pyx_v_syms->_table);

  /* "pywrapfst.pyx":2529
 *       return
 *     self._mfst.get().SetInputSymbols(syms._table)
 *     self._check_mutating_imethod()             # <<<<<<<<<<<<<<
 * 
 *   def set_input_symbols(self, _SymbolTable syms):
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_check_mutating_imethod");
    __PYX_ERR(0, 2529, __pyx_L1_error)
  }
  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2529, __pyx_L1_error)

  /* "pywrapfst.pyx":2524
 *     return self
 * 
 *   cdef void _set_input_symbols(self, _SymbolTable syms) except *:             # <<<<<<<<<<<<<<
 *     if syms is None:
 *       self._mfst.get().SetInputSymbols(NULL)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pywrapfst._MutableFst._set_input_symbols", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pywrapfst.pyx":2531
 *     self._check_mutating_imethod()
 * 
 *   def set_input_symbols(self, _SymbolTable syms):             # <<<<<<<<<<<<<<
 *     """
 *     set_input_symbols(self, syms)
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_53set_input_symbols(PyObject *__pyx_v_self, PyObject *__pyx_v_syms); /*proto*/
static char __pyx_doc_9pywrapfst_11_MutableFst_52set_input_symbols[] = "\n    set_input_symbols(self, syms)\n\n    Sets the input symbol table.\n\n    Passing None as a value will delete the input symbol table.\n\n    Args:\n      syms: A SymbolTable.\n\n    Returns:\n      self.\n\n    See also: `set_output_symbols`.\n    ";
static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_53set_input_symbols(PyObject *__pyx_v_self, PyObject *__pyx_v_syms) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_input_symbols (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_syms), __pyx_ptype_9pywrapfst__SymbolTable, 1, "syms", 0))) __PYX_ERR(0, 2531, __pyx_L1_error)
  __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_52set_input_symbols(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self), ((struct __pyx_obj_9pywrapfst__SymbolTable *)__pyx_v_syms));

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

static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_52set_input_symbols(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_syms) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_input_symbols", 0);

  /* "pywrapfst.pyx":2547
 *     See also: `set_output_symbols`.
 *     """
 *     self._set_input_symbols(syms)             # <<<<<<<<<<<<<<
 *     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, 2547, __pyx_L1_error)
  }
  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_set_input_symbols(__pyx_v_self, __pyx_v_syms); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2547, __pyx_L1_error)

  /* "pywrapfst.pyx":2548
 *     """
 *     self._set_input_symbols(syms)
 *     return self             # <<<<<<<<<<<<<<
 * 
 *   cdef void _set_output_symbols(self, _SymbolTable syms) except *:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "pywrapfst.pyx":2531
 *     self._check_mutating_imethod()
 * 
 *   def set_input_symbols(self, _SymbolTable syms):             # <<<<<<<<<<<<<<
 *     """
 *     set_input_symbols(self, syms)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("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;
}

/* "pywrapfst.pyx":2550
 *     return self
 * 
 *   cdef void _set_output_symbols(self, _SymbolTable syms) except *:             # <<<<<<<<<<<<<<
 *     if syms is None:
 *       self._mfst.get().SetOutputSymbols(NULL)
 */

static void __pyx_f_9pywrapfst_11_MutableFst__set_output_symbols(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_syms) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("_set_output_symbols", 0);

  /* "pywrapfst.pyx":2551
 * 
 *   cdef void _set_output_symbols(self, _SymbolTable syms) except *:
 *     if syms is None:             # <<<<<<<<<<<<<<
 *       self._mfst.get().SetOutputSymbols(NULL)
 *       return
 */
  __pyx_t_1 = (((PyObject *)__pyx_v_syms) == Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pywrapfst.pyx":2552
 *   cdef void _set_output_symbols(self, _SymbolTable syms) except *:
 *     if syms is None:
 *       self._mfst.get().SetOutputSymbols(NULL)             # <<<<<<<<<<<<<<
 *       return
 *     self._mfst.get().SetOutputSymbols(syms._table)
 */
    if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
      __PYX_ERR(0, 2552, __pyx_L1_error)
    }
    __pyx_v_self->_mfst.get()->SetOutputSymbols(NULL);

    /* "pywrapfst.pyx":2553
 *     if syms is None:
 *       self._mfst.get().SetOutputSymbols(NULL)
 *       return             # <<<<<<<<<<<<<<
 *     self._mfst.get().SetOutputSymbols(syms._table)
 *     self._check_mutating_imethod()
 */
    goto __pyx_L0;

    /* "pywrapfst.pyx":2551
 * 
 *   cdef void _set_output_symbols(self, _SymbolTable syms) except *:
 *     if syms is None:             # <<<<<<<<<<<<<<
 *       self._mfst.get().SetOutputSymbols(NULL)
 *       return
 */
  }

  /* "pywrapfst.pyx":2554
 *       self._mfst.get().SetOutputSymbols(NULL)
 *       return
 *     self._mfst.get().SetOutputSymbols(syms._table)             # <<<<<<<<<<<<<<
 *     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, 2554, __pyx_L1_error)
  }
  if (unlikely(((PyObject *)__pyx_v_syms) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_table");
    __PYX_ERR(0, 2554, __pyx_L1_error)
  }
  __pyx_v_self->_mfst.get()->SetOutputSymbols(__pyx_v_syms->_table);

  /* "pywrapfst.pyx":2555
 *       return
 *     self._mfst.get().SetOutputSymbols(syms._table)
 *     self._check_mutating_imethod()             # <<<<<<<<<<<<<<
 * 
 *   def set_output_symbols(self, _SymbolTable syms):
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_check_mutating_imethod");
    __PYX_ERR(0, 2555, __pyx_L1_error)
  }
  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2555, __pyx_L1_error)

  /* "pywrapfst.pyx":2550
 *     return self
 * 
 *   cdef void _set_output_symbols(self, _SymbolTable syms) except *:             # <<<<<<<<<<<<<<
 *     if syms is None:
 *       self._mfst.get().SetOutputSymbols(NULL)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pywrapfst._MutableFst._set_output_symbols", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pywrapfst.pyx":2557
 *     self._check_mutating_imethod()
 * 
 *   def set_output_symbols(self, _SymbolTable syms):             # <<<<<<<<<<<<<<
 *     """
 *     set_output_symbols(self, syms)
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_55set_output_symbols(PyObject *__pyx_v_self, PyObject *__pyx_v_syms); /*proto*/
static char __pyx_doc_9pywrapfst_11_MutableFst_54set_output_symbols[] = "\n    set_output_symbols(self, syms)\n\n    Sets the output symbol table.\n\n    Passing None as a value will delete the output symbol table.\n\n    Args:\n      syms: A SymbolTable.\n\n    Returns:\n      self.\n\n    See also: `set_input_symbols`.\n    ";
static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_55set_output_symbols(PyObject *__pyx_v_self, PyObject *__pyx_v_syms) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_output_symbols (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_syms), __pyx_ptype_9pywrapfst__SymbolTable, 1, "syms", 0))) __PYX_ERR(0, 2557, __pyx_L1_error)
  __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_54set_output_symbols(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self), ((struct __pyx_obj_9pywrapfst__SymbolTable *)__pyx_v_syms));

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

static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_54set_output_symbols(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_syms) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_output_symbols", 0);

  /* "pywrapfst.pyx":2573
 *     See also: `set_input_symbols`.
 *     """
 *     self._set_output_symbols(syms)             # <<<<<<<<<<<<<<
 *     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, 2573, __pyx_L1_error)
  }
  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_set_output_symbols(__pyx_v_self, __pyx_v_syms); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2573, __pyx_L1_error)

  /* "pywrapfst.pyx":2574
 *     """
 *     self._set_output_symbols(syms)
 *     return self             # <<<<<<<<<<<<<<
 * 
 *   cdef void _set_properties(self, uint64 props, uint64 mask):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "pywrapfst.pyx":2557
 *     self._check_mutating_imethod()
 * 
 *   def set_output_symbols(self, _SymbolTable syms):             # <<<<<<<<<<<<<<
 *     """
 *     set_output_symbols(self, syms)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("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;
}

/* "pywrapfst.pyx":2576
 *     return self
 * 
 *   cdef void _set_properties(self, uint64 props, uint64 mask):             # <<<<<<<<<<<<<<
 *     self._mfst.get().SetProperties(props, mask)
 * 
 */

static void __pyx_f_9pywrapfst_11_MutableFst__set_properties(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, __pyx_t_10basictypes_uint64 __pyx_v_props, __pyx_t_10basictypes_uint64 __pyx_v_mask) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_set_properties", 0);

  /* "pywrapfst.pyx":2577
 * 
 *   cdef void _set_properties(self, uint64 props, uint64 mask):
 *     self._mfst.get().SetProperties(props, mask)             # <<<<<<<<<<<<<<
 * 
 *   def set_properties(self, uint64 props, uint64 mask):
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
    __PYX_ERR(0, 2577, __pyx_L1_error)
  }
  __pyx_v_self->_mfst.get()->SetProperties(__pyx_v_props, __pyx_v_mask);

  /* "pywrapfst.pyx":2576
 *     return self
 * 
 *   cdef void _set_properties(self, uint64 props, uint64 mask):             # <<<<<<<<<<<<<<
 *     self._mfst.get().SetProperties(props, mask)
 * 
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("pywrapfst._MutableFst._set_properties", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pywrapfst.pyx":2579
 *     self._mfst.get().SetProperties(props, mask)
 * 
 *   def set_properties(self, uint64 props, uint64 mask):             # <<<<<<<<<<<<<<
 *     """
 *     set_properties(self, props, mask)
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_57set_properties(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9pywrapfst_11_MutableFst_56set_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_9pywrapfst_11_MutableFst_57set_properties(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  __pyx_t_10basictypes_uint64 __pyx_v_props;
  __pyx_t_10basictypes_uint64 __pyx_v_mask;
  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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_props)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_properties", 1, 2, 2, 1); __PYX_ERR(0, 2579, __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, 2579, __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 = __Pyx_PyInt_As_uint64_t(values[0]); if (unlikely((__pyx_v_props == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2579, __pyx_L3_error)
    __pyx_v_mask = __Pyx_PyInt_As_uint64_t(values[1]); if (unlikely((__pyx_v_mask == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2579, __pyx_L3_error)
  }
  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, 2579, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pywrapfst._MutableFst.set_properties", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_56set_properties(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self), __pyx_v_props, __pyx_v_mask);

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

static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_56set_properties(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, __pyx_t_10basictypes_uint64 __pyx_v_props, __pyx_t_10basictypes_uint64 __pyx_v_mask) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_properties", 0);

  /* "pywrapfst.pyx":2593
 *       self.
 *     """
 *     self._set_properties(props, mask)             # <<<<<<<<<<<<<<
 *     return self
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_set_properties");
    __PYX_ERR(0, 2593, __pyx_L1_error)
  }
  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_set_properties(__pyx_v_self, __pyx_v_props, __pyx_v_mask);

  /* "pywrapfst.pyx":2594
 *     """
 *     self._set_properties(props, mask)
 *     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;

  /* "pywrapfst.pyx":2579
 *     self._mfst.get().SetProperties(props, mask)
 * 
 *   def set_properties(self, uint64 props, uint64 mask):             # <<<<<<<<<<<<<<
 *     """
 *     set_properties(self, props, mask)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pywrapfst._MutableFst.set_properties", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":2596
 *     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_9pywrapfst_11_MutableFst__set_start(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, __pyx_t_10basictypes_int64 __pyx_v_state) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("_set_start", 0);

  /* "pywrapfst.pyx":2597
 * 
 *   cdef void _set_start(self, int64 state) except *:
 *     if not self._mfst.get().SetStart(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, 2597, __pyx_L1_error)
  }
  __pyx_t_1 = ((!(__pyx_v_self->_mfst.get()->SetStart(__pyx_v_state) != 0)) != 0);
  if (__pyx_t_1) {

    /* "pywrapfst.pyx":2598
 *   cdef void _set_start(self, int64 state) except *:
 *     if not self._mfst.get().SetStart(state):
 *       raise FstIndexError("State index out of range")             # <<<<<<<<<<<<<<
 *     self._check_mutating_imethod()
 * 
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2598, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__52, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2598, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 2598, __pyx_L1_error)

    /* "pywrapfst.pyx":2597
 * 
 *   cdef void _set_start(self, int64 state) except *:
 *     if not self._mfst.get().SetStart(state):             # <<<<<<<<<<<<<<
 *       raise FstIndexError("State index out of range")
 *     self._check_mutating_imethod()
 */
  }

  /* "pywrapfst.pyx":2599
 *     if not self._mfst.get().SetStart(state):
 *       raise FstIndexError("State index out of range")
 *     self._check_mutating_imethod()             # <<<<<<<<<<<<<<
 * 
 *   def set_start(self, int64 state):
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_check_mutating_imethod");
    __PYX_ERR(0, 2599, __pyx_L1_error)
  }
  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2599, __pyx_L1_error)

  /* "pywrapfst.pyx":2596
 *     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_AddTraceback("pywrapfst._MutableFst._set_start", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pywrapfst.pyx":2601
 *     self._check_mutating_imethod()
 * 
 *   def set_start(self, int64 state):             # <<<<<<<<<<<<<<
 *     """
 *     set_start(self, state)
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_59set_start(PyObject *__pyx_v_self, PyObject *__pyx_arg_state); /*proto*/
static char __pyx_doc_9pywrapfst_11_MutableFst_58set_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\n    See also: `set_final`.\n    ";
static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_59set_start(PyObject *__pyx_v_self, PyObject *__pyx_arg_state) {
  __pyx_t_10basictypes_int64 __pyx_v_state;
  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_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2601, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pywrapfst._MutableFst.set_start", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_58set_start(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self), ((__pyx_t_10basictypes_int64)__pyx_v_state));

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

static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_58set_start(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, __pyx_t_10basictypes_int64 __pyx_v_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_start", 0);

  /* "pywrapfst.pyx":2618
 *     See also: `set_final`.
 *     """
 *     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, 2618, __pyx_L1_error)
  }
  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_set_start(__pyx_v_self, __pyx_v_state); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2618, __pyx_L1_error)

  /* "pywrapfst.pyx":2619
 *     """
 *     self._set_start(state)
 *     return self             # <<<<<<<<<<<<<<
 * 
 *   cdef void _topsort(self) except *:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "pywrapfst.pyx":2601
 *     self._check_mutating_imethod()
 * 
 *   def set_start(self, int64 state):             # <<<<<<<<<<<<<<
 *     """
 *     set_start(self, state)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pywrapfst._MutableFst.set_start", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":2621
 *     return self
 * 
 *   cdef void _topsort(self) except *:             # <<<<<<<<<<<<<<
 *     # 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_9pywrapfst_11_MutableFst__topsort(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("_topsort", 0);

  /* "pywrapfst.pyx":2623
 *   cdef void _topsort(self) except *:
 *     # 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.")
 *     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, 2623, __pyx_L1_error)
  }
  __pyx_t_1 = ((!(fst::script::TopSort(__pyx_v_self->_mfst.get()) != 0)) != 0);
  if (__pyx_t_1) {

    /* "pywrapfst.pyx":2624
 *     # 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.")             # <<<<<<<<<<<<<<
 *     self._check_mutating_imethod()
 * 
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_logging); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2624, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_warning); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2624, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__53, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2624, __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;

    /* "pywrapfst.pyx":2623
 *   cdef void _topsort(self) except *:
 *     # 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.")
 *     self._check_mutating_imethod()
 */
  }

  /* "pywrapfst.pyx":2625
 *     if not fst.TopSort(self._mfst.get()):
 *       logging.warning("Cannot topsort cyclic FST.")
 *     self._check_mutating_imethod()             # <<<<<<<<<<<<<<
 * 
 *   def topsort(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, 2625, __pyx_L1_error)
  }
  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2625, __pyx_L1_error)

  /* "pywrapfst.pyx":2621
 *     return self
 * 
 *   cdef void _topsort(self) except *:             # <<<<<<<<<<<<<<
 *     # 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_AddTraceback("pywrapfst._MutableFst._topsort", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pywrapfst.pyx":2627
 *     self._check_mutating_imethod()
 * 
 *   def topsort(self):             # <<<<<<<<<<<<<<
 *     """
 *     topsort(self)
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_61topsort(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_9pywrapfst_11_MutableFst_60topsort[] = "\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\n    See also: `arcsort`.\n    ";
static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_61topsort(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("topsort (wrapper)", 0);
  __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_60topsort(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_60topsort(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("topsort", 0);

  /* "pywrapfst.pyx":2642
 *     See also: `arcsort`.
 *     """
 *     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, 2642, __pyx_L1_error)
  }
  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_topsort(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2642, __pyx_L1_error)

  /* "pywrapfst.pyx":2643
 *     """
 *     self._topsort()
 *     return self             # <<<<<<<<<<<<<<
 * 
 *   cdef void _union(self, _Fst ifst) except *:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "pywrapfst.pyx":2627
 *     self._check_mutating_imethod()
 * 
 *   def topsort(self):             # <<<<<<<<<<<<<<
 *     """
 *     topsort(self)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pywrapfst._MutableFst.topsort", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":2645
 *     return self
 * 
 *   cdef void _union(self, _Fst ifst) except *:             # <<<<<<<<<<<<<<
 *     fst.Union(self._mfst.get(), deref(ifst._fst))
 *     self._check_mutating_imethod()
 */

static void __pyx_f_9pywrapfst_11_MutableFst__union(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_union", 0);

  /* "pywrapfst.pyx":2646
 * 
 *   cdef void _union(self, _Fst ifst) except *:
 *     fst.Union(self._mfst.get(), deref(ifst._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, 2646, __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, 2646, __pyx_L1_error)
  }
  fst::script::Union(__pyx_v_self->_mfst.get(), (*__pyx_v_ifst->_fst));

  /* "pywrapfst.pyx":2647
 *   cdef void _union(self, _Fst ifst) except *:
 *     fst.Union(self._mfst.get(), deref(ifst._fst))
 *     self._check_mutating_imethod()             # <<<<<<<<<<<<<<
 * 
 *   def union(self, _Fst ifst):
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_check_mutating_imethod");
    __PYX_ERR(0, 2647, __pyx_L1_error)
  }
  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2647, __pyx_L1_error)

  /* "pywrapfst.pyx":2645
 *     return self
 * 
 *   cdef void _union(self, _Fst ifst) except *:             # <<<<<<<<<<<<<<
 *     fst.Union(self._mfst.get(), deref(ifst._fst))
 *     self._check_mutating_imethod()
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pywrapfst._MutableFst._union", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pywrapfst.pyx":2649
 *     self._check_mutating_imethod()
 * 
 *   def union(self, _Fst ifst):             # <<<<<<<<<<<<<<
 *     """
 *     union(self, ifst)
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_63union(PyObject *__pyx_v_self, PyObject *__pyx_v_ifst); /*proto*/
static char __pyx_doc_9pywrapfst_11_MutableFst_62union[] = "\n    union(self, ifst)\n\n    Computes the union (sum) of two FSTs.\n\n    This operation computes the union (sum) of two FSTs. If A transduces string\n    x to y with weight a and B transduces string w to v with weight b, then\n    their union transduces x to y with weight a and w to v with weight b.\n\n    Args:\n      ifst: The second input FST.\n\n    Returns:\n      self.\n    ";
static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_63union(PyObject *__pyx_v_self, PyObject *__pyx_v_ifst) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("union (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 2649, __pyx_L1_error)
  __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_62union(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self), ((struct __pyx_obj_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_9pywrapfst_11_MutableFst_62union(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("union", 0);

  /* "pywrapfst.pyx":2665
 *       self.
 *     """
 *     self._union(ifst)             # <<<<<<<<<<<<<<
 *     return self
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_union");
    __PYX_ERR(0, 2665, __pyx_L1_error)
  }
  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_union(__pyx_v_self, __pyx_v_ifst); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2665, __pyx_L1_error)

  /* "pywrapfst.pyx":2666
 *     """
 *     self._union(ifst)
 *     return self             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "pywrapfst.pyx":2649
 *     self._check_mutating_imethod()
 * 
 *   def union(self, _Fst ifst):             # <<<<<<<<<<<<<<
 *     """
 *     union(self, ifst)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pywrapfst._MutableFst.union", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":2691
 * 
 * 
 * cdef _Fst _init_Fst(FstClass_ptr tfst):             # <<<<<<<<<<<<<<
 *   if tfst.Properties(fst.kError, True):
 *     raise FstOpError("Operation failed")
 */

static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst__init_Fst(__pyx_t_9pywrapfst_FstClass_ptr __pyx_v_tfst) {
  struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ofst = 0;
  struct __pyx_obj_9pywrapfst__Fst *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("_init_Fst", 0);

  /* "pywrapfst.pyx":2692
 * 
 * cdef _Fst _init_Fst(FstClass_ptr tfst):
 *   if tfst.Properties(fst.kError, True):             # <<<<<<<<<<<<<<
 *     raise FstOpError("Operation failed")
 *   cdef _Fst ofst = _Fst.__new__(_Fst)
 */
  __pyx_t_1 = (__pyx_v_tfst->Properties(fst::kError, 1) != 0);
  if (__pyx_t_1) {

    /* "pywrapfst.pyx":2693
 * cdef _Fst _init_Fst(FstClass_ptr tfst):
 *   if tfst.Properties(fst.kError, True):
 *     raise FstOpError("Operation failed")             # <<<<<<<<<<<<<<
 *   cdef _Fst ofst = _Fst.__new__(_Fst)
 *   ofst._fst.reset(tfst)
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstOpError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2693, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__54, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2693, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 2693, __pyx_L1_error)

    /* "pywrapfst.pyx":2692
 * 
 * cdef _Fst _init_Fst(FstClass_ptr tfst):
 *   if tfst.Properties(fst.kError, True):             # <<<<<<<<<<<<<<
 *     raise FstOpError("Operation failed")
 *   cdef _Fst ofst = _Fst.__new__(_Fst)
 */
  }

  /* "pywrapfst.pyx":2694
 *   if tfst.Properties(fst.kError, True):
 *     raise FstOpError("Operation failed")
 *   cdef _Fst ofst = _Fst.__new__(_Fst)             # <<<<<<<<<<<<<<
 *   ofst._fst.reset(tfst)
 *   return ofst
 */
  __pyx_t_3 = __pyx_tp_new_9pywrapfst__Fst(((PyTypeObject *)__pyx_ptype_9pywrapfst__Fst), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2694, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (!(likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_9pywrapfst__Fst)))) __PYX_ERR(0, 2694, __pyx_L1_error)
  __pyx_v_ofst = ((struct __pyx_obj_9pywrapfst__Fst *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "pywrapfst.pyx":2695
 *     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, 2695, __pyx_L1_error)
  }
  __pyx_v_ofst->_fst.reset(__pyx_v_tfst);

  /* "pywrapfst.pyx":2696
 *   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;

  /* "pywrapfst.pyx":2691
 * 
 * 
 * cdef _Fst _init_Fst(FstClass_ptr tfst):             # <<<<<<<<<<<<<<
 *   if tfst.Properties(fst.kError, True):
 *     raise FstOpError("Operation failed")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("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;
}

/* "pywrapfst.pyx":2699
 * 
 * 
 * cdef _MutableFst _init_MutableFst(MutableFstClass_ptr tfst):             # <<<<<<<<<<<<<<
 *   if tfst.Properties(fst.kError, True):
 *     raise FstOpError("Operation failed")
 */

static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst__init_MutableFst(__pyx_t_9pywrapfst_MutableFstClass_ptr __pyx_v_tfst) {
  struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_ofst = 0;
  struct __pyx_obj_9pywrapfst__MutableFst *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("_init_MutableFst", 0);

  /* "pywrapfst.pyx":2700
 * 
 * cdef _MutableFst _init_MutableFst(MutableFstClass_ptr tfst):
 *   if tfst.Properties(fst.kError, True):             # <<<<<<<<<<<<<<
 *     raise FstOpError("Operation failed")
 *   cdef _MutableFst ofst = _MutableFst.__new__(_MutableFst)
 */
  __pyx_t_1 = (__pyx_v_tfst->Properties(fst::kError, 1) != 0);
  if (__pyx_t_1) {

    /* "pywrapfst.pyx":2701
 * cdef _MutableFst _init_MutableFst(MutableFstClass_ptr tfst):
 *   if tfst.Properties(fst.kError, True):
 *     raise FstOpError("Operation failed")             # <<<<<<<<<<<<<<
 *   cdef _MutableFst ofst = _MutableFst.__new__(_MutableFst)
 *   ofst._fst.reset(tfst)
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstOpError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2701, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__55, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2701, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 2701, __pyx_L1_error)

    /* "pywrapfst.pyx":2700
 * 
 * cdef _MutableFst _init_MutableFst(MutableFstClass_ptr tfst):
 *   if tfst.Properties(fst.kError, True):             # <<<<<<<<<<<<<<
 *     raise FstOpError("Operation failed")
 *   cdef _MutableFst ofst = _MutableFst.__new__(_MutableFst)
 */
  }

  /* "pywrapfst.pyx":2702
 *   if tfst.Properties(fst.kError, True):
 *     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_3 = __pyx_tp_new_9pywrapfst__MutableFst(((PyTypeObject *)__pyx_ptype_9pywrapfst__MutableFst), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2702, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (!(likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_9pywrapfst__MutableFst)))) __PYX_ERR(0, 2702, __pyx_L1_error)
  __pyx_v_ofst = ((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "pywrapfst.pyx":2703
 *     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, fst.FstClass](ofst._fst)
 */
  if (unlikely(((PyObject *)__pyx_v_ofst) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 2703, __pyx_L1_error)
  }
  __pyx_v_ofst->__pyx_base._fst.reset(__pyx_v_tfst);

  /* "pywrapfst.pyx":2705
 *   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'", "_fst");
    __PYX_ERR(0, 2705, __pyx_L1_error)
  }
  if (unlikely(((PyObject *)__pyx_v_ofst) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
    __PYX_ERR(0, 2705, __pyx_L1_error)
  }
  __pyx_v_ofst->_mfst = std::static_pointer_cast<fst::script::MutableFstClass,fst::script::FstClass>(__pyx_v_ofst->__pyx_base._fst);

  /* "pywrapfst.pyx":2706
 *   # Makes a copy of it as the derived type! Cool.
 *   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;

  /* "pywrapfst.pyx":2699
 * 
 * 
 * cdef _MutableFst _init_MutableFst(MutableFstClass_ptr tfst):             # <<<<<<<<<<<<<<
 *   if tfst.Properties(fst.kError, True):
 *     raise FstOpError("Operation failed")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("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;
}

/* "pywrapfst.pyx":2709
 * 
 * 
 * cdef _Fst _init_XFst(FstClass_ptr tfst):             # <<<<<<<<<<<<<<
 *   if tfst.Properties(fst.kMutable, True):
 *     return _init_MutableFst(static_cast[MutableFstClass_ptr](tfst))
 */

static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst__init_XFst(__pyx_t_9pywrapfst_FstClass_ptr __pyx_v_tfst) {
  struct __pyx_obj_9pywrapfst__Fst *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("_init_XFst", 0);

  /* "pywrapfst.pyx":2710
 * 
 * cdef _Fst _init_XFst(FstClass_ptr tfst):
 *   if tfst.Properties(fst.kMutable, True):             # <<<<<<<<<<<<<<
 *     return _init_MutableFst(static_cast[MutableFstClass_ptr](tfst))
 *   else:
 */
  __pyx_t_1 = (__pyx_v_tfst->Properties(fst::kMutable, 1) != 0);
  if (__pyx_t_1) {

    /* "pywrapfst.pyx":2711
 * cdef _Fst _init_XFst(FstClass_ptr tfst):
 *   if tfst.Properties(fst.kMutable, True):
 *     return _init_MutableFst(static_cast[MutableFstClass_ptr](tfst))             # <<<<<<<<<<<<<<
 *   else:
 *     return _init_Fst(tfst)
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_2 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(static_cast<__pyx_t_9pywrapfst_MutableFstClass_ptr>(__pyx_v_tfst))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2711, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = ((struct __pyx_obj_9pywrapfst__Fst *)__pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "pywrapfst.pyx":2710
 * 
 * cdef _Fst _init_XFst(FstClass_ptr tfst):
 *   if tfst.Properties(fst.kMutable, True):             # <<<<<<<<<<<<<<
 *     return _init_MutableFst(static_cast[MutableFstClass_ptr](tfst))
 *   else:
 */
  }

  /* "pywrapfst.pyx":2713
 *     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_9pywrapfst__init_Fst(__pyx_v_tfst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2713, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = ((struct __pyx_obj_9pywrapfst__Fst *)__pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }

  /* "pywrapfst.pyx":2709
 * 
 * 
 * cdef _Fst _init_XFst(FstClass_ptr tfst):             # <<<<<<<<<<<<<<
 *   if tfst.Properties(fst.kMutable, True):
 *     return _init_MutableFst(static_cast[MutableFstClass_ptr](tfst))
 */

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

/* "pywrapfst.pyx":2716
 * 
 * 
 * cdef _MutableFst _create_Fst(arc_type=b"standard"):             # <<<<<<<<<<<<<<
 *   cdef unique_ptr[fst.VectorFstClass] tfst
 *   tfst.reset(new fst.VectorFstClass(tostring(arc_type)))
 */

static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst__create_Fst(struct __pyx_opt_args_9pywrapfst__create_Fst *__pyx_optional_args) {
  PyObject *__pyx_v_arc_type = ((PyObject *)__pyx_n_b_standard);
  std::unique_ptr<fst::script::VectorFstClass>  __pyx_v_tfst;
  struct __pyx_obj_9pywrapfst__MutableFst *__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;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("_create_Fst", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_arc_type = __pyx_optional_args->arc_type;
    }
  }

  /* "pywrapfst.pyx":2718
 * cdef _MutableFst _create_Fst(arc_type=b"standard"):
 *   cdef unique_ptr[fst.VectorFstClass] tfst
 *   tfst.reset(new fst.VectorFstClass(tostring(arc_type)))             # <<<<<<<<<<<<<<
 *   if tfst.get() == NULL:
 *     raise FstOpError("Unknown arc type: {!r}".format(arc_type))
 */
  __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_arc_type, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2718, __pyx_L1_error)
  __pyx_v_tfst.reset(new fst::script::VectorFstClass(__pyx_t_1));

  /* "pywrapfst.pyx":2719
 *   cdef unique_ptr[fst.VectorFstClass] tfst
 *   tfst.reset(new fst.VectorFstClass(tostring(arc_type)))
 *   if tfst.get() == NULL:             # <<<<<<<<<<<<<<
 *     raise FstOpError("Unknown arc type: {!r}".format(arc_type))
 *   return _init_MutableFst(tfst.release())
 */
  __pyx_t_2 = ((__pyx_v_tfst.get() == NULL) != 0);
  if (__pyx_t_2) {

    /* "pywrapfst.pyx":2720
 *   tfst.reset(new fst.VectorFstClass(tostring(arc_type)))
 *   if tfst.get() == NULL:
 *     raise FstOpError("Unknown arc type: {!r}".format(arc_type))             # <<<<<<<<<<<<<<
 *   return _init_MutableFst(tfst.release())
 * 
 */
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstOpError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2720, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Unknown_arc_type_r, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2720, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    if (!__pyx_t_7) {
      __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_arc_type); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2720, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_arc_type};
        __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2720, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_GOTREF(__pyx_t_5);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_arc_type};
        __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2720, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_GOTREF(__pyx_t_5);
      } else
      #endif
      {
        __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2720, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
        __Pyx_INCREF(__pyx_v_arc_type);
        __Pyx_GIVEREF(__pyx_v_arc_type);
        PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_v_arc_type);
        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2720, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (!__pyx_t_6) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2720, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2720, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2720, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      } else
      #endif
      {
        __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2720, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
        __Pyx_GIVEREF(__pyx_t_5);
        PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_5);
        __pyx_t_5 = 0;
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2720, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 2720, __pyx_L1_error)

    /* "pywrapfst.pyx":2719
 *   cdef unique_ptr[fst.VectorFstClass] tfst
 *   tfst.reset(new fst.VectorFstClass(tostring(arc_type)))
 *   if tfst.get() == NULL:             # <<<<<<<<<<<<<<
 *     raise FstOpError("Unknown arc type: {!r}".format(arc_type))
 *   return _init_MutableFst(tfst.release())
 */
  }

  /* "pywrapfst.pyx":2721
 *   if tfst.get() == NULL:
 *     raise FstOpError("Unknown arc type: {!r}".format(arc_type))
 *   return _init_MutableFst(tfst.release())             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_3 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst.release())); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2721, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = ((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":2716
 * 
 * 
 * cdef _MutableFst _create_Fst(arc_type=b"standard"):             # <<<<<<<<<<<<<<
 *   cdef unique_ptr[fst.VectorFstClass] tfst
 *   tfst.reset(new fst.VectorFstClass(tostring(arc_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_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("pywrapfst._create_Fst", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":2724
 * 
 * 
 * cpdef _Fst _read(filename):             # <<<<<<<<<<<<<<
 *   cdef unique_ptr[fst.FstClass] tfst
 *   tfst.reset(fst.FstClass.Read(tostring(filename)))
 */

static PyObject *__pyx_pw_9pywrapfst_13_read(PyObject *__pyx_self, PyObject *__pyx_v_filename); /*proto*/
static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst__read(PyObject *__pyx_v_filename, CYTHON_UNUSED int __pyx_skip_dispatch) {
  std::unique_ptr<fst::script::FstClass>  __pyx_v_tfst;
  struct __pyx_obj_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;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("_read", 0);

  /* "pywrapfst.pyx":2726
 * cpdef _Fst _read(filename):
 *   cdef unique_ptr[fst.FstClass] tfst
 *   tfst.reset(fst.FstClass.Read(tostring(filename)))             # <<<<<<<<<<<<<<
 *   if tfst.get() == NULL:
 *     raise FstIOError("Read failed: {!r}".format(filename))
 */
  __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_filename, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2726, __pyx_L1_error)
  __pyx_v_tfst.reset(fst::script::FstClass::Read(__pyx_t_1));

  /* "pywrapfst.pyx":2727
 *   cdef unique_ptr[fst.FstClass] tfst
 *   tfst.reset(fst.FstClass.Read(tostring(filename)))
 *   if tfst.get() == NULL:             # <<<<<<<<<<<<<<
 *     raise FstIOError("Read failed: {!r}".format(filename))
 *   return _init_XFst(tfst.release())
 */
  __pyx_t_2 = ((__pyx_v_tfst.get() == NULL) != 0);
  if (__pyx_t_2) {

    /* "pywrapfst.pyx":2728
 *   tfst.reset(fst.FstClass.Read(tostring(filename)))
 *   if tfst.get() == NULL:
 *     raise FstIOError("Read failed: {!r}".format(filename))             # <<<<<<<<<<<<<<
 *   return _init_XFst(tfst.release())
 * 
 */
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIOError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2728, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Read_failed_r, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2728, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    if (!__pyx_t_7) {
      __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_filename); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2728, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_filename};
        __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2728, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_GOTREF(__pyx_t_5);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_filename};
        __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2728, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_GOTREF(__pyx_t_5);
      } else
      #endif
      {
        __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2728, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
        __Pyx_INCREF(__pyx_v_filename);
        __Pyx_GIVEREF(__pyx_v_filename);
        PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_v_filename);
        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2728, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (!__pyx_t_6) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2728, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2728, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2728, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      } else
      #endif
      {
        __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2728, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
        __Pyx_GIVEREF(__pyx_t_5);
        PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_5);
        __pyx_t_5 = 0;
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2728, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 2728, __pyx_L1_error)

    /* "pywrapfst.pyx":2727
 *   cdef unique_ptr[fst.FstClass] tfst
 *   tfst.reset(fst.FstClass.Read(tostring(filename)))
 *   if tfst.get() == NULL:             # <<<<<<<<<<<<<<
 *     raise FstIOError("Read failed: {!r}".format(filename))
 *   return _init_XFst(tfst.release())
 */
  }

  /* "pywrapfst.pyx":2729
 *   if tfst.get() == NULL:
 *     raise FstIOError("Read failed: {!r}".format(filename))
 *   return _init_XFst(tfst.release())             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_3 = ((PyObject *)__pyx_f_9pywrapfst__init_XFst(__pyx_v_tfst.release())); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2729, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = ((struct __pyx_obj_9pywrapfst__Fst *)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":2724
 * 
 * 
 * cpdef _Fst _read(filename):             # <<<<<<<<<<<<<<
 *   cdef unique_ptr[fst.FstClass] tfst
 *   tfst.reset(fst.FstClass.Read(tostring(filename)))
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("pywrapfst._read", __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_9pywrapfst_13_read(PyObject *__pyx_self, PyObject *__pyx_v_filename); /*proto*/
static PyObject *__pyx_pw_9pywrapfst_13_read(PyObject *__pyx_self, PyObject *__pyx_v_filename) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_read (wrapper)", 0);
  __pyx_r = __pyx_pf_9pywrapfst_12_read(__pyx_self, ((PyObject *)__pyx_v_filename));

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

static PyObject *__pyx_pf_9pywrapfst_12_read(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filename) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("_read", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__read(__pyx_v_filename, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2724, __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("pywrapfst._read", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":2732
 * 
 * 
 * cpdef _Fst _read_from_string(state):             # <<<<<<<<<<<<<<
 *   cdef stringstream sstrm
 *   sstrm << tostring(state)
 */

static PyObject *__pyx_pw_9pywrapfst_15_read_from_string(PyObject *__pyx_self, PyObject *__pyx_v_state); /*proto*/
static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst__read_from_string(PyObject *__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_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;
  __Pyx_RefNannySetupContext("_read_from_string", 0);

  /* "pywrapfst.pyx":2734
 * cpdef _Fst _read_from_string(state):
 *   cdef stringstream sstrm
 *   sstrm << tostring(state)             # <<<<<<<<<<<<<<
 *   cdef unique_ptr[fst.FstClass] tfst
 *   tfst.reset(fst.FstClass.ReadFromStream(sstrm, b"<pywrapfst>"))
 */
  __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_state, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2734, __pyx_L1_error)
  (__pyx_v_sstrm << __pyx_t_1);

  /* "pywrapfst.pyx":2736
 *   sstrm << tostring(state)
 *   cdef unique_ptr[fst.FstClass] tfst
 *   tfst.reset(fst.FstClass.ReadFromStream(sstrm, b"<pywrapfst>"))             # <<<<<<<<<<<<<<
 *   if tfst.get() == NULL:
 *     raise FstIOError("Read failed: <string>")
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_kp_b_pywrapfst); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2736, __pyx_L1_error)
  __pyx_v_tfst.reset(fst::script::FstClass::Read(__pyx_v_sstrm, __pyx_t_1));

  /* "pywrapfst.pyx":2737
 *   cdef unique_ptr[fst.FstClass] tfst
 *   tfst.reset(fst.FstClass.ReadFromStream(sstrm, b"<pywrapfst>"))
 *   if tfst.get() == NULL:             # <<<<<<<<<<<<<<
 *     raise FstIOError("Read failed: <string>")
 *   return _init_XFst(tfst.release())
 */
  __pyx_t_2 = ((__pyx_v_tfst.get() == NULL) != 0);
  if (__pyx_t_2) {

    /* "pywrapfst.pyx":2738
 *   tfst.reset(fst.FstClass.ReadFromStream(sstrm, b"<pywrapfst>"))
 *   if tfst.get() == NULL:
 *     raise FstIOError("Read failed: <string>")             # <<<<<<<<<<<<<<
 *   return _init_XFst(tfst.release())
 * 
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIOError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2738, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__56, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2738, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(0, 2738, __pyx_L1_error)

    /* "pywrapfst.pyx":2737
 *   cdef unique_ptr[fst.FstClass] tfst
 *   tfst.reset(fst.FstClass.ReadFromStream(sstrm, b"<pywrapfst>"))
 *   if tfst.get() == NULL:             # <<<<<<<<<<<<<<
 *     raise FstIOError("Read failed: <string>")
 *   return _init_XFst(tfst.release())
 */
  }

  /* "pywrapfst.pyx":2739
 *   if tfst.get() == NULL:
 *     raise FstIOError("Read failed: <string>")
 *   return _init_XFst(tfst.release())             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_4 = ((PyObject *)__pyx_f_9pywrapfst__init_XFst(__pyx_v_tfst.release())); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2739, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_r = ((struct __pyx_obj_9pywrapfst__Fst *)__pyx_t_4);
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":2732
 * 
 * 
 * cpdef _Fst _read_from_string(state):             # <<<<<<<<<<<<<<
 *   cdef stringstream sstrm
 *   sstrm << tostring(state)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pywrapfst._read_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_9pywrapfst_15_read_from_string(PyObject *__pyx_self, PyObject *__pyx_v_state); /*proto*/
static PyObject *__pyx_pw_9pywrapfst_15_read_from_string(PyObject *__pyx_self, PyObject *__pyx_v_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_read_from_string (wrapper)", 0);
  __pyx_r = __pyx_pf_9pywrapfst_14_read_from_string(__pyx_self, ((PyObject *)__pyx_v_state));

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

static PyObject *__pyx_pf_9pywrapfst_14_read_from_string(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("_read_from_string", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__read_from_string(__pyx_v_state, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2732, __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("pywrapfst._read_from_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":2759
 *    """
 * 
 *    def __new__(cls, arc_type=b"standard"):             # <<<<<<<<<<<<<<
 *     return _create_Fst(arc_type)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_3Fst_1__new__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_9pywrapfst_3Fst_1__new__ = {"__new__", (PyCFunction)__pyx_pw_9pywrapfst_3Fst_1__new__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_9pywrapfst_3Fst_1__new__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_cls = 0;
  PyObject *__pyx_v_arc_type = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__new__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cls,&__pyx_n_s_arc_type,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)((PyObject*)__pyx_n_b_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  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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_cls)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arc_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, "__new__") < 0)) __PYX_ERR(0, 2759, __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_cls = values[0];
    __pyx_v_arc_type = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__new__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2759, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pywrapfst.Fst.__new__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pywrapfst_3Fst___new__(__pyx_self, __pyx_v_cls, __pyx_v_arc_type);

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

static PyObject *__pyx_pf_9pywrapfst_3Fst___new__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_cls, PyObject *__pyx_v_arc_type) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_9pywrapfst__create_Fst __pyx_t_2;
  __Pyx_RefNannySetupContext("__new__", 0);

  /* "pywrapfst.pyx":2760
 * 
 *    def __new__(cls, arc_type=b"standard"):
 *     return _create_Fst(arc_type)             # <<<<<<<<<<<<<<
 * 
 *    @staticmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.arc_type = __pyx_v_arc_type;
  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__create_Fst(&__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2760, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":2759
 *    """
 * 
 *    def __new__(cls, arc_type=b"standard"):             # <<<<<<<<<<<<<<
 *     return _create_Fst(arc_type)
 * 
 */

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

/* "pywrapfst.pyx":2763
 * 
 *    @staticmethod
 *    def read(filename):             # <<<<<<<<<<<<<<
 *      """
 *      read(filename):
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_3Fst_3read(PyObject *__pyx_self, PyObject *__pyx_v_filename); /*proto*/
static char __pyx_doc_9pywrapfst_3Fst_2read[] = "\n     read(filename):\n\n     Reads an FST from a file.\n\n     Args:\n       filename: The string location of the input file.\n\n     Returns:\n       An FST object.\n\n     Raises:\n       FstIOError: Read failed.\n     ";
static PyMethodDef __pyx_mdef_9pywrapfst_3Fst_3read = {"read", (PyCFunction)__pyx_pw_9pywrapfst_3Fst_3read, METH_O, __pyx_doc_9pywrapfst_3Fst_2read};
static PyObject *__pyx_pw_9pywrapfst_3Fst_3read(PyObject *__pyx_self, PyObject *__pyx_v_filename) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("read (wrapper)", 0);
  __pyx_r = __pyx_pf_9pywrapfst_3Fst_2read(__pyx_self, ((PyObject *)__pyx_v_filename));

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

static PyObject *__pyx_pf_9pywrapfst_3Fst_2read(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filename) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("read", 0);

  /* "pywrapfst.pyx":2778
 *        FstIOError: Read failed.
 *      """
 *      return _read(filename)             # <<<<<<<<<<<<<<
 * 
 *    @staticmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__read(__pyx_v_filename, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2778, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":2763
 * 
 *    @staticmethod
 *    def read(filename):             # <<<<<<<<<<<<<<
 *      """
 *      read(filename):
 */

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

/* "pywrapfst.pyx":2781
 * 
 *    @staticmethod
 *    def read_from_string(state):             # <<<<<<<<<<<<<<
 *      """
 *      read_from_string(string, fst_type=None)
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_3Fst_5read_from_string(PyObject *__pyx_self, PyObject *__pyx_v_state); /*proto*/
static char __pyx_doc_9pywrapfst_3Fst_4read_from_string[] = "\n     read_from_string(string, fst_type=None)\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       FstOpError: Read-time conversion failed.\n\n     See also: `write_to_string`.\n     ";
static PyMethodDef __pyx_mdef_9pywrapfst_3Fst_5read_from_string = {"read_from_string", (PyCFunction)__pyx_pw_9pywrapfst_3Fst_5read_from_string, METH_O, __pyx_doc_9pywrapfst_3Fst_4read_from_string};
static PyObject *__pyx_pw_9pywrapfst_3Fst_5read_from_string(PyObject *__pyx_self, PyObject *__pyx_v_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("read_from_string (wrapper)", 0);
  __pyx_r = __pyx_pf_9pywrapfst_3Fst_4read_from_string(__pyx_self, ((PyObject *)__pyx_v_state));

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

static PyObject *__pyx_pf_9pywrapfst_3Fst_4read_from_string(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("read_from_string", 0);

  /* "pywrapfst.pyx":2799
 *      See also: `write_to_string`.
 *      """
 *      return _read_from_string(state)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__read_from_string(__pyx_v_state, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2799, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":2781
 * 
 *    @staticmethod
 *    def read_from_string(state):             # <<<<<<<<<<<<<<
 *      """
 *      read_from_string(string, fst_type=None)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("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;
}

/* "pywrapfst.pyx":2914
 *   """
 * 
 *   def __repr__(self):             # <<<<<<<<<<<<<<
 *     return "<Arc at 0x{:x}>".format(id(self))
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_3Arc_1__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9pywrapfst_3Arc_1__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9pywrapfst_3Arc___repr__(((struct __pyx_obj_9pywrapfst_Arc *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_3Arc___repr__(struct __pyx_obj_9pywrapfst_Arc *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "pywrapfst.pyx":2915
 * 
 *   def __repr__(self):
 *     return "<Arc at 0x{:x}>".format(id(self))             # <<<<<<<<<<<<<<
 * 
 *   def __init__(self, int64 ilabel, int64 olabel, weight, int64 nextstate):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Arc_at_0x_x, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2915, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2915, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2915, __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 && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2915, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_4};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2915, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_4};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2915, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else
    #endif
    {
      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2915, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2915, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":2914
 *   """
 * 
 *   def __repr__(self):             # <<<<<<<<<<<<<<
 *     return "<Arc at 0x{:x}>".format(id(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_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pywrapfst.Arc.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":2917
 *     return "<Arc at 0x{:x}>".format(id(self))
 * 
 *   def __init__(self, int64 ilabel, int64 olabel, weight, int64 nextstate):             # <<<<<<<<<<<<<<
 *     cdef fst.WeightClass wc = _get_WeightClass_or_One(b"tropical", weight)
 *     self._arc.reset(new fst.ArcClass(ilabel, olabel, wc, nextstate))
 */

/* Python wrapper */
static int __pyx_pw_9pywrapfst_3Arc_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_9pywrapfst_3Arc_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  __pyx_t_10basictypes_int64 __pyx_v_ilabel;
  __pyx_t_10basictypes_int64 __pyx_v_olabel;
  PyObject *__pyx_v_weight = 0;
  __pyx_t_10basictypes_int64 __pyx_v_nextstate;
  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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ilabel)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_olabel)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 1); __PYX_ERR(0, 2917, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_weight)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 2); __PYX_ERR(0, 2917, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nextstate)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 3); __PYX_ERR(0, 2917, __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, 2917, __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_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2917, __pyx_L3_error)
    __pyx_v_olabel = __Pyx_PyInt_As_int64_t(values[1]); if (unlikely((__pyx_v_olabel == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2917, __pyx_L3_error)
    __pyx_v_weight = values[2];
    __pyx_v_nextstate = __Pyx_PyInt_As_int64_t(values[3]); if (unlikely((__pyx_v_nextstate == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2917, __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, 2917, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pywrapfst.Arc.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pywrapfst_3Arc_2__init__(((struct __pyx_obj_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_9pywrapfst_3Arc_2__init__(struct __pyx_obj_9pywrapfst_Arc *__pyx_v_self, __pyx_t_10basictypes_int64 __pyx_v_ilabel, __pyx_t_10basictypes_int64 __pyx_v_olabel, PyObject *__pyx_v_weight, __pyx_t_10basictypes_int64 __pyx_v_nextstate) {
  fst::script::WeightClass __pyx_v_wc;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  fst::script::WeightClass __pyx_t_2;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pywrapfst.pyx":2918
 * 
 *   def __init__(self, int64 ilabel, int64 olabel, weight, int64 nextstate):
 *     cdef fst.WeightClass wc = _get_WeightClass_or_One(b"tropical", weight)             # <<<<<<<<<<<<<<
 *     self._arc.reset(new fst.ArcClass(ilabel, olabel, wc, nextstate))
 * 
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_tropical); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2918, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_9pywrapfst__get_WeightClass_or_One(__pyx_t_1, __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2918, __pyx_L1_error)
  __pyx_v_wc = __pyx_t_2;

  /* "pywrapfst.pyx":2919
 *   def __init__(self, int64 ilabel, int64 olabel, weight, int64 nextstate):
 *     cdef fst.WeightClass wc = _get_WeightClass_or_One(b"tropical", weight)
 *     self._arc.reset(new fst.ArcClass(ilabel, olabel, wc, 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, 2919, __pyx_L1_error)
  }
  __pyx_v_self->_arc.reset(new fst::script::ArcClass(__pyx_v_ilabel, __pyx_v_olabel, __pyx_v_wc, __pyx_v_nextstate));

  /* "pywrapfst.pyx":2917
 *     return "<Arc at 0x{:x}>".format(id(self))
 * 
 *   def __init__(self, int64 ilabel, int64 olabel, weight, int64 nextstate):             # <<<<<<<<<<<<<<
 *     cdef fst.WeightClass wc = _get_WeightClass_or_One(b"tropical", weight)
 *     self._arc.reset(new fst.ArcClass(ilabel, olabel, wc, nextstate))
 */

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

/* "pywrapfst.pyx":2921
 *     self._arc.reset(new fst.ArcClass(ilabel, olabel, wc, nextstate))
 * 
 *   cpdef Arc copy(self):             # <<<<<<<<<<<<<<
 *     return Arc(self.ilabel, self.olabel, self.weight, self.nextstate)
 * 
 */

static PyObject *__pyx_pw_9pywrapfst_3Arc_5copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static struct __pyx_obj_9pywrapfst_Arc *__pyx_f_9pywrapfst_3Arc_copy(struct __pyx_obj_9pywrapfst_Arc *__pyx_v_self, int __pyx_skip_dispatch) {
  struct __pyx_obj_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;
  __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)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_copy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2921, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_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);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2921, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2921, __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_9pywrapfst_Arc))))) __PYX_ERR(0, 2921, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_9pywrapfst_Arc *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pywrapfst.pyx":2922
 * 
 *   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, 2922, __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, 2922, __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, 2922, __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, 2922, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2922, __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_9pywrapfst_Arc), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2922, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_r = ((struct __pyx_obj_9pywrapfst_Arc *)__pyx_t_4);
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":2921
 *     self._arc.reset(new fst.ArcClass(ilabel, olabel, wc, 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("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_9pywrapfst_3Arc_5copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_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_9pywrapfst_3Arc_4copy(((struct __pyx_obj_9pywrapfst_Arc *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_3Arc_4copy(struct __pyx_obj_9pywrapfst_Arc *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("copy", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_3Arc_copy(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2921, __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("pywrapfst.Arc.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":2926
 *   property ilabel:
 * 
 *     def __get__(self):             # <<<<<<<<<<<<<<
 *       return deref(self._arc).ilabel
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_3Arc_6ilabel_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9pywrapfst_3Arc_6ilabel_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9pywrapfst_3Arc_6ilabel___get__(((struct __pyx_obj_9pywrapfst_Arc *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_3Arc_6ilabel___get__(struct __pyx_obj_9pywrapfst_Arc *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pywrapfst.pyx":2927
 * 
 *     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, 2927, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_PyInt_From_int64_t((*__pyx_v_self->_arc).ilabel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2927, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":2926
 *   property ilabel:
 * 
 *     def __get__(self):             # <<<<<<<<<<<<<<
 *       return deref(self._arc).ilabel
 * 
 */

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

/* "pywrapfst.pyx":2929
 *       return deref(self._arc).ilabel
 * 
 *     def __set__(self, int64 value):             # <<<<<<<<<<<<<<
 *       deref(self._arc).ilabel = value
 * 
 */

/* Python wrapper */
static int __pyx_pw_9pywrapfst_3Arc_6ilabel_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value); /*proto*/
static int __pyx_pw_9pywrapfst_3Arc_6ilabel_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value) {
  __pyx_t_10basictypes_int64 __pyx_v_value;
  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_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2929, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pywrapfst.Arc.ilabel.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pywrapfst_3Arc_6ilabel_2__set__(((struct __pyx_obj_9pywrapfst_Arc *)__pyx_v_self), ((__pyx_t_10basictypes_int64)__pyx_v_value));

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

static int __pyx_pf_9pywrapfst_3Arc_6ilabel_2__set__(struct __pyx_obj_9pywrapfst_Arc *__pyx_v_self, __pyx_t_10basictypes_int64 __pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "pywrapfst.pyx":2930
 * 
 *     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, 2930, __pyx_L1_error)
  }
  (*__pyx_v_self->_arc).ilabel = __pyx_v_value;

  /* "pywrapfst.pyx":2929
 *       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("pywrapfst.Arc.ilabel.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":2934
 *   property olabel:
 * 
 *     def __get__(self):             # <<<<<<<<<<<<<<
 *       return deref(self._arc).olabel
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_3Arc_6olabel_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9pywrapfst_3Arc_6olabel_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9pywrapfst_3Arc_6olabel___get__(((struct __pyx_obj_9pywrapfst_Arc *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_3Arc_6olabel___get__(struct __pyx_obj_9pywrapfst_Arc *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pywrapfst.pyx":2935
 * 
 *     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, 2935, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_PyInt_From_int64_t((*__pyx_v_self->_arc).olabel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2935, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":2934
 *   property olabel:
 * 
 *     def __get__(self):             # <<<<<<<<<<<<<<
 *       return deref(self._arc).olabel
 * 
 */

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

/* "pywrapfst.pyx":2937
 *       return deref(self._arc).olabel
 * 
 *     def __set__(self, int64 value):             # <<<<<<<<<<<<<<
 *       deref(self._arc).olabel = value
 * 
 */

/* Python wrapper */
static int __pyx_pw_9pywrapfst_3Arc_6olabel_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value); /*proto*/
static int __pyx_pw_9pywrapfst_3Arc_6olabel_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value) {
  __pyx_t_10basictypes_int64 __pyx_v_value;
  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_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2937, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pywrapfst.Arc.olabel.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pywrapfst_3Arc_6olabel_2__set__(((struct __pyx_obj_9pywrapfst_Arc *)__pyx_v_self), ((__pyx_t_10basictypes_int64)__pyx_v_value));

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

static int __pyx_pf_9pywrapfst_3Arc_6olabel_2__set__(struct __pyx_obj_9pywrapfst_Arc *__pyx_v_self, __pyx_t_10basictypes_int64 __pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "pywrapfst.pyx":2938
 * 
 *     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, 2938, __pyx_L1_error)
  }
  (*__pyx_v_self->_arc).olabel = __pyx_v_value;

  /* "pywrapfst.pyx":2937
 *       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("pywrapfst.Arc.olabel.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":2942
 *   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_9pywrapfst_3Arc_6weight_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9pywrapfst_3Arc_6weight_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9pywrapfst_3Arc_6weight___get__(((struct __pyx_obj_9pywrapfst_Arc *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_3Arc_6weight___get__(struct __pyx_obj_9pywrapfst_Arc *__pyx_v_self) {
  struct __pyx_obj_9pywrapfst_Weight *__pyx_v_weight = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pywrapfst.pyx":2943
 * 
 *     def __get__(self):
 *       cdef Weight weight = Weight.__new__(Weight)             # <<<<<<<<<<<<<<
 *       weight._weight.reset(new fst.WeightClass(deref(self._arc).weight))
 *       return weight
 */
  __pyx_t_1 = __pyx_tp_new_9pywrapfst_Weight(((PyTypeObject *)__pyx_ptype_9pywrapfst_Weight), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2943, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_9pywrapfst_Weight)))) __PYX_ERR(0, 2943, __pyx_L1_error)
  __pyx_v_weight = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pywrapfst.pyx":2944
 *     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, 2944, __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, 2944, __pyx_L1_error)
  }
  __pyx_v_weight->_weight.reset(new fst::script::WeightClass((*__pyx_v_self->_arc).weight));

  /* "pywrapfst.pyx":2945
 *       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;

  /* "pywrapfst.pyx":2942
 *   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("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;
}

/* "pywrapfst.pyx":2947
 *       return weight
 * 
 *     def __set__(self, weight):             # <<<<<<<<<<<<<<
 *       deref(self._arc).weight = _get_WeightClass_or_One(b"tropical", weight)
 * 
 */

/* Python wrapper */
static int __pyx_pw_9pywrapfst_3Arc_6weight_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_weight); /*proto*/
static int __pyx_pw_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_9pywrapfst_3Arc_6weight_2__set__(((struct __pyx_obj_9pywrapfst_Arc *)__pyx_v_self), ((PyObject *)__pyx_v_weight));

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

static int __pyx_pf_9pywrapfst_3Arc_6weight_2__set__(struct __pyx_obj_9pywrapfst_Arc *__pyx_v_self, PyObject *__pyx_v_weight) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  fst::script::WeightClass __pyx_t_2;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "pywrapfst.pyx":2948
 * 
 *     def __set__(self, weight):
 *       deref(self._arc).weight = _get_WeightClass_or_One(b"tropical", weight)             # <<<<<<<<<<<<<<
 * 
 *   property nextstate:
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_tropical); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2948, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_9pywrapfst__get_WeightClass_or_One(__pyx_t_1, __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2948, __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, 2948, __pyx_L1_error)
  }
  (*__pyx_v_self->_arc).weight = __pyx_t_2;

  /* "pywrapfst.pyx":2947
 *       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("pywrapfst.Arc.weight.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":2952
 *   property nextstate:
 * 
 *     def __get__(self):             # <<<<<<<<<<<<<<
 *       return deref(self._arc).nextstate
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_3Arc_9nextstate_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9pywrapfst_3Arc_9nextstate_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9pywrapfst_3Arc_9nextstate___get__(((struct __pyx_obj_9pywrapfst_Arc *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_3Arc_9nextstate___get__(struct __pyx_obj_9pywrapfst_Arc *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pywrapfst.pyx":2953
 * 
 *     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, 2953, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_PyInt_From_int64_t((*__pyx_v_self->_arc).nextstate); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2953, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":2952
 *   property nextstate:
 * 
 *     def __get__(self):             # <<<<<<<<<<<<<<
 *       return deref(self._arc).nextstate
 * 
 */

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

/* "pywrapfst.pyx":2955
 *       return deref(self._arc).nextstate
 * 
 *     def __set__(self, int64 value):             # <<<<<<<<<<<<<<
 *       deref(self._arc).nextstate = value
 * 
 */

/* Python wrapper */
static int __pyx_pw_9pywrapfst_3Arc_9nextstate_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value); /*proto*/
static int __pyx_pw_9pywrapfst_3Arc_9nextstate_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value) {
  __pyx_t_10basictypes_int64 __pyx_v_value;
  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_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2955, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pywrapfst.Arc.nextstate.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pywrapfst_3Arc_9nextstate_2__set__(((struct __pyx_obj_9pywrapfst_Arc *)__pyx_v_self), ((__pyx_t_10basictypes_int64)__pyx_v_value));

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

static int __pyx_pf_9pywrapfst_3Arc_9nextstate_2__set__(struct __pyx_obj_9pywrapfst_Arc *__pyx_v_self, __pyx_t_10basictypes_int64 __pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "pywrapfst.pyx":2956
 * 
 *     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, 2956, __pyx_L1_error)
  }
  (*__pyx_v_self->_arc).nextstate = __pyx_v_value;

  /* "pywrapfst.pyx":2955
 *       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("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_9pywrapfst_3Arc_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_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_9pywrapfst_3Arc_6__reduce_cython__(((struct __pyx_obj_9pywrapfst_Arc *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_3Arc_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9pywrapfst_Arc *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __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__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._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("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_9pywrapfst_3Arc_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static PyObject *__pyx_pw_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_9pywrapfst_3Arc_8__setstate_cython__(((struct __pyx_obj_9pywrapfst_Arc *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

static PyObject *__pyx_pf_9pywrapfst_3Arc_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_9pywrapfst_Arc *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __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__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._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("pywrapfst.Arc.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":2959
 * 
 * 
 * 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_9pywrapfst_Arc *__pyx_f_9pywrapfst__init_Arc(fst::script::ArcClass const &__pyx_v_arc) {
  struct __pyx_obj_9pywrapfst_Weight *__pyx_v_weight = 0;
  struct __pyx_obj_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;
  __Pyx_RefNannySetupContext("_init_Arc", 0);

  /* "pywrapfst.pyx":2960
 * 
 * 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 = __pyx_tp_new_9pywrapfst_Weight(((PyTypeObject *)__pyx_ptype_9pywrapfst_Weight), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2960, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_9pywrapfst_Weight)))) __PYX_ERR(0, 2960, __pyx_L1_error)
  __pyx_v_weight = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pywrapfst.pyx":2961
 * 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, 2961, __pyx_L1_error)
  }
  __pyx_v_weight->_weight.reset(new fst::script::WeightClass(__pyx_v_arc.weight));

  /* "pywrapfst.pyx":2962
 *   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, 2962, __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, 2962, __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, 2962, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2962, __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_9pywrapfst_Arc), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2962, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_r = ((struct __pyx_obj_9pywrapfst_Arc *)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":2959
 * 
 * 
 * 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("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;
}

/* "pywrapfst.pyx":2973
 *   """
 * 
 *   def __repr__(self):             # <<<<<<<<<<<<<<
 *     return "<ArcIterator at 0x{:x}>".format(id(self))
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_11ArcIterator_1__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9pywrapfst_11ArcIterator_1__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9pywrapfst_11ArcIterator___repr__(((struct __pyx_obj_9pywrapfst_ArcIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_11ArcIterator___repr__(struct __pyx_obj_9pywrapfst_ArcIterator *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "pywrapfst.pyx":2974
 * 
 *   def __repr__(self):
 *     return "<ArcIterator at 0x{:x}>".format(id(self))             # <<<<<<<<<<<<<<
 * 
 *   def __init__(self, _Fst ifst, int64 state):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_ArcIterator_at_0x_x, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2974, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2974, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2974, __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 && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2974, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_4};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2974, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_4};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2974, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else
    #endif
    {
      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2974, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2974, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":2973
 *   """
 * 
 *   def __repr__(self):             # <<<<<<<<<<<<<<
 *     return "<ArcIterator at 0x{:x}>".format(id(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_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pywrapfst.ArcIterator.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":2976
 *     return "<ArcIterator at 0x{:x}>".format(id(self))
 * 
 *   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_9pywrapfst_11ArcIterator_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_9pywrapfst_11ArcIterator_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst = 0;
  __pyx_t_10basictypes_int64 __pyx_v_state;
  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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ifst)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_state)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 2976, __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, 2976, __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_9pywrapfst__Fst *)values[0]);
    __pyx_v_state = __Pyx_PyInt_As_int64_t(values[1]); if (unlikely((__pyx_v_state == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2976, __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, 2976, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("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_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 2976, __pyx_L1_error)
  __pyx_r = __pyx_pf_9pywrapfst_11ArcIterator_2__init__(((struct __pyx_obj_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_9pywrapfst_11ArcIterator_2__init__(struct __pyx_obj_9pywrapfst_ArcIterator *__pyx_v_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst, __pyx_t_10basictypes_int64 __pyx_v_state) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  std::shared_ptr<fst::script::FstClass>  __pyx_t_4;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pywrapfst.pyx":2977
 * 
 *   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, 2977, __pyx_L1_error)
  }
  __pyx_t_1 = ((!(__pyx_v_ifst->_fst.get()->ValidStateId(__pyx_v_state) != 0)) != 0);
  if (__pyx_t_1) {

    /* "pywrapfst.pyx":2978
 *   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_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2978, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__59, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2978, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 2978, __pyx_L1_error)

    /* "pywrapfst.pyx":2977
 * 
 *   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.
 */
  }

  /* "pywrapfst.pyx":2980
 *       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, 2980, __pyx_L1_error)
  }
  __pyx_t_4 = __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, 2980, __pyx_L1_error)
  }
  __pyx_v_self->_fst = __pyx_t_4;

  /* "pywrapfst.pyx":2981
 *     # 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, 2981, __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, 2981, __pyx_L1_error)
  }
  __pyx_v_self->_aiter.reset(new fst::script::ArcIteratorClass((*__pyx_v_self->_fst), __pyx_v_state));

  /* "pywrapfst.pyx":2976
 *     return "<ArcIterator at 0x{:x}>".format(id(self))
 * 
 *   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_AddTraceback("pywrapfst.ArcIterator.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":2984
 * 
 *   # This just registers this class as a possible iterator.
 *   def __iter__(self):             # <<<<<<<<<<<<<<
 *     return self
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_11ArcIterator_5__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9pywrapfst_11ArcIterator_5__iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9pywrapfst_11ArcIterator_4__iter__(((struct __pyx_obj_9pywrapfst_ArcIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_11ArcIterator_4__iter__(struct __pyx_obj_9pywrapfst_ArcIterator *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);

  /* "pywrapfst.pyx":2985
 *   # 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;

  /* "pywrapfst.pyx":2984
 * 
 *   # 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;
}

/* "pywrapfst.pyx":2988
 * 
 *   # 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_9pywrapfst_11ArcIterator_7__next__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9pywrapfst_11ArcIterator_7__next__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__next__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9pywrapfst_11ArcIterator_6__next__(((struct __pyx_obj_9pywrapfst_ArcIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_11ArcIterator_6__next__(struct __pyx_obj_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;
  __Pyx_RefNannySetupContext("__next__", 0);

  /* "pywrapfst.pyx":2989
 *   # 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, 2989, __pyx_L1_error)
  }
  __pyx_t_1 = (((struct __pyx_vtabstruct_9pywrapfst_ArcIterator *)__pyx_v_self->__pyx_vtab)->done(__pyx_v_self, 0) != 0);
  if (__pyx_t_1) {

    /* "pywrapfst.pyx":2990
 *   def __next__(self):
 *     if self.done():
 *       raise StopIteration             # <<<<<<<<<<<<<<
 *     result = self.value()
 *     self.next()
 */
    __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
    __PYX_ERR(0, 2990, __pyx_L1_error)

    /* "pywrapfst.pyx":2989
 *   # Magic method used to get a Pythonic API out of the C++ API.
 *   def __next__(self):
 *     if self.done():             # <<<<<<<<<<<<<<
 *       raise StopIteration
 *     result = self.value()
 */
  }

  /* "pywrapfst.pyx":2991
 *     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, 2991, __pyx_L1_error)
  }
  __pyx_t_2 = ((struct __pyx_vtabstruct_9pywrapfst_ArcIterator *)__pyx_v_self->__pyx_vtab)->value(__pyx_v_self, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2991, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_result = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pywrapfst.pyx":2992
 *       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, 2992, __pyx_L1_error)
  }
  ((struct __pyx_vtabstruct_9pywrapfst_ArcIterator *)__pyx_v_self->__pyx_vtab)->next(__pyx_v_self, 0);

  /* "pywrapfst.pyx":2993
 *     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;

  /* "pywrapfst.pyx":2988
 * 
 *   # 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("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;
}

/* "pywrapfst.pyx":2995
 *     return result
 * 
 *   cpdef bool done(self):             # <<<<<<<<<<<<<<
 *     """
 *     done(self)
 */

static PyObject *__pyx_pw_9pywrapfst_11ArcIterator_9done(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static bool __pyx_f_9pywrapfst_11ArcIterator_done(struct __pyx_obj_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;
  __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)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_done); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2995, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_11ArcIterator_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);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2995, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2995, __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, 2995, __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;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pywrapfst.pyx":3004
 *       True if the iterator is exhausted, False otherwise.
 *     """
 *     return self._aiter.get().Done()             # <<<<<<<<<<<<<<
 * 
 *   cpdef uint32 flags(self):
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_aiter");
    __PYX_ERR(0, 3004, __pyx_L1_error)
  }
  __pyx_r = __pyx_v_self->_aiter.get()->Done();
  goto __pyx_L0;

  /* "pywrapfst.pyx":2995
 *     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("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_9pywrapfst_11ArcIterator_9done(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_9pywrapfst_11ArcIterator_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_9pywrapfst_11ArcIterator_9done(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("done (wrapper)", 0);
  __pyx_r = __pyx_pf_9pywrapfst_11ArcIterator_8done(((struct __pyx_obj_9pywrapfst_ArcIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_11ArcIterator_8done(struct __pyx_obj_9pywrapfst_ArcIterator *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("done", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_9pywrapfst_11ArcIterator_done(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2995, __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("pywrapfst.ArcIterator.done", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":3006
 *     return self._aiter.get().Done()
 * 
 *   cpdef uint32 flags(self):             # <<<<<<<<<<<<<<
 *     """
 *     flags(self)
 */

static PyObject *__pyx_pw_9pywrapfst_11ArcIterator_11flags(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static __pyx_t_10basictypes_uint32 __pyx_f_9pywrapfst_11ArcIterator_flags(struct __pyx_obj_9pywrapfst_ArcIterator *__pyx_v_self, int __pyx_skip_dispatch) {
  __pyx_t_10basictypes_uint32 __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __pyx_t_10basictypes_uint32 __pyx_t_5;
  __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)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3006, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_11ArcIterator_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);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3006, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3006, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_5 = __Pyx_PyInt_As_uint32_t(__pyx_t_2); if (unlikely((__pyx_t_5 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3006, __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;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pywrapfst.pyx":3015
 *       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, 3015, __pyx_L1_error)
  }
  __pyx_r = __pyx_v_self->_aiter.get()->Flags();
  goto __pyx_L0;

  /* "pywrapfst.pyx":3006
 *     return self._aiter.get().Done()
 * 
 *   cpdef uint32 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("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_9pywrapfst_11ArcIterator_11flags(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_9pywrapfst_11ArcIterator_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_9pywrapfst_11ArcIterator_11flags(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("flags (wrapper)", 0);
  __pyx_r = __pyx_pf_9pywrapfst_11ArcIterator_10flags(((struct __pyx_obj_9pywrapfst_ArcIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_11ArcIterator_10flags(struct __pyx_obj_9pywrapfst_ArcIterator *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("flags", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_uint32_t(__pyx_f_9pywrapfst_11ArcIterator_flags(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3006, __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("pywrapfst.ArcIterator.flags", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":3017
 *     return self._aiter.get().Flags()
 * 
 *   cpdef void next(self):             # <<<<<<<<<<<<<<
 *     """
 *     next(self)
 */

static PyObject *__pyx_pw_9pywrapfst_11ArcIterator_13next(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static void __pyx_f_9pywrapfst_11ArcIterator_next(struct __pyx_obj_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;
  __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)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_next); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3017, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_11ArcIterator_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);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3017, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3017, __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;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pywrapfst.pyx":3023
 *     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, 3023, __pyx_L1_error)
  }
  __pyx_v_self->_aiter.get()->Next();

  /* "pywrapfst.pyx":3017
 *     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("pywrapfst.ArcIterator.next", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_11ArcIterator_13next(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_9pywrapfst_11ArcIterator_12next[] = "\n    next(self)\n\n    Advances the iterator.\n    ";
static PyObject *__pyx_pw_9pywrapfst_11ArcIterator_13next(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("next (wrapper)", 0);
  __pyx_r = __pyx_pf_9pywrapfst_11ArcIterator_12next(((struct __pyx_obj_9pywrapfst_ArcIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_11ArcIterator_12next(struct __pyx_obj_9pywrapfst_ArcIterator *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("next", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_9pywrapfst_11ArcIterator_next(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3017, __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("pywrapfst.ArcIterator.next", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":3025
 *     self._aiter.get().Next()
 * 
 *   cpdef size_t position(self):             # <<<<<<<<<<<<<<
 *     """
 *     position(self)
 */

static PyObject *__pyx_pw_9pywrapfst_11ArcIterator_15position(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static size_t __pyx_f_9pywrapfst_11ArcIterator_position(struct __pyx_obj_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;
  __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)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_position); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3025, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_11ArcIterator_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);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3025, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3025, __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, 3025, __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;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pywrapfst.pyx":3034
 *       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, 3034, __pyx_L1_error)
  }
  __pyx_r = __pyx_v_self->_aiter.get()->Position();
  goto __pyx_L0;

  /* "pywrapfst.pyx":3025
 *     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("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_9pywrapfst_11ArcIterator_15position(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_9pywrapfst_11ArcIterator_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_9pywrapfst_11ArcIterator_15position(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("position (wrapper)", 0);
  __pyx_r = __pyx_pf_9pywrapfst_11ArcIterator_14position(((struct __pyx_obj_9pywrapfst_ArcIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_11ArcIterator_14position(struct __pyx_obj_9pywrapfst_ArcIterator *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("position", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_f_9pywrapfst_11ArcIterator_position(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3025, __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("pywrapfst.ArcIterator.position", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":3036
 *     return self._aiter.get().Position()
 * 
 *   cpdef void reset(self):             # <<<<<<<<<<<<<<
 *     """
 *     reset(self)
 */

static PyObject *__pyx_pw_9pywrapfst_11ArcIterator_17reset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static void __pyx_f_9pywrapfst_11ArcIterator_reset(struct __pyx_obj_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;
  __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)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3036, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_11ArcIterator_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);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3036, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3036, __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;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pywrapfst.pyx":3042
 *     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, 3042, __pyx_L1_error)
  }
  __pyx_v_self->_aiter.get()->Reset();

  /* "pywrapfst.pyx":3036
 *     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("pywrapfst.ArcIterator.reset", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_11ArcIterator_17reset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_9pywrapfst_11ArcIterator_16reset[] = "\n    reset(self)\n\n    Resets the iterator to the initial position.\n    ";
static PyObject *__pyx_pw_9pywrapfst_11ArcIterator_17reset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("reset (wrapper)", 0);
  __pyx_r = __pyx_pf_9pywrapfst_11ArcIterator_16reset(((struct __pyx_obj_9pywrapfst_ArcIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_11ArcIterator_16reset(struct __pyx_obj_9pywrapfst_ArcIterator *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("reset", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_9pywrapfst_11ArcIterator_reset(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3036, __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("pywrapfst.ArcIterator.reset", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":3044
 *     self._aiter.get().Reset()
 * 
 *   cpdef void seek(self, size_t a):             # <<<<<<<<<<<<<<
 *     """
 *     seek(self, a)
 */

static PyObject *__pyx_pw_9pywrapfst_11ArcIterator_19seek(PyObject *__pyx_v_self, PyObject *__pyx_arg_a); /*proto*/
static void __pyx_f_9pywrapfst_11ArcIterator_seek(struct __pyx_obj_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;
  PyObject *__pyx_t_6 = NULL;
  __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)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_seek); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3044, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_11ArcIterator_19seek)) {
      __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_v_a); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3044, __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);
        }
      }
      if (!__pyx_t_5) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3044, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_4)) {
          PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3044, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
          PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3044, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        } else
        #endif
        {
          __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3044, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
          __Pyx_GIVEREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3);
          __pyx_t_3 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3044, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pywrapfst.pyx":3053
 *       a: The position to seek to.
 *     """
 *     self._aiter.get().Seek(a)             # <<<<<<<<<<<<<<
 * 
 *   cpdef void set_flags(self, uint32 flags, uint32 mask):
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_aiter");
    __PYX_ERR(0, 3053, __pyx_L1_error)
  }
  __pyx_v_self->_aiter.get()->Seek(__pyx_v_a);

  /* "pywrapfst.pyx":3044
 *     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_XDECREF(__pyx_t_6);
  __Pyx_WriteUnraisable("pywrapfst.ArcIterator.seek", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_11ArcIterator_19seek(PyObject *__pyx_v_self, PyObject *__pyx_arg_a); /*proto*/
static char __pyx_doc_9pywrapfst_11ArcIterator_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_9pywrapfst_11ArcIterator_19seek(PyObject *__pyx_v_self, PyObject *__pyx_arg_a) {
  size_t __pyx_v_a;
  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, 3044, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pywrapfst.ArcIterator.seek", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pywrapfst_11ArcIterator_18seek(((struct __pyx_obj_9pywrapfst_ArcIterator *)__pyx_v_self), ((size_t)__pyx_v_a));

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

static PyObject *__pyx_pf_9pywrapfst_11ArcIterator_18seek(struct __pyx_obj_9pywrapfst_ArcIterator *__pyx_v_self, size_t __pyx_v_a) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("seek", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_9pywrapfst_11ArcIterator_seek(__pyx_v_self, __pyx_v_a, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3044, __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("pywrapfst.ArcIterator.seek", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":3055
 *     self._aiter.get().Seek(a)
 * 
 *   cpdef void set_flags(self, uint32 flags, uint32 mask):             # <<<<<<<<<<<<<<
 *     """
 *     set_flags(self, flags, mask)
 */

static PyObject *__pyx_pw_9pywrapfst_11ArcIterator_21set_flags(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static void __pyx_f_9pywrapfst_11ArcIterator_set_flags(struct __pyx_obj_9pywrapfst_ArcIterator *__pyx_v_self, __pyx_t_10basictypes_uint32 __pyx_v_flags, __pyx_t_10basictypes_uint32 __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;
  __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)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3055, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_11ArcIterator_21set_flags)) {
      __pyx_t_3 = __Pyx_PyInt_From_uint32_t(__pyx_v_flags); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3055, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyInt_From_uint32_t(__pyx_v_mask); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3055, __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, 3055, __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, 3055, __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, 3055, __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, 3055, __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;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pywrapfst.pyx":3065
 *       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, 3065, __pyx_L1_error)
  }
  __pyx_v_self->_aiter.get()->SetFlags(__pyx_v_flags, __pyx_v_mask);

  /* "pywrapfst.pyx":3055
 *     self._aiter.get().Seek(a)
 * 
 *   cpdef void set_flags(self, uint32 flags, uint32 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("pywrapfst.ArcIterator.set_flags", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_11ArcIterator_21set_flags(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9pywrapfst_11ArcIterator_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_9pywrapfst_11ArcIterator_21set_flags(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  __pyx_t_10basictypes_uint32 __pyx_v_flags;
  __pyx_t_10basictypes_uint32 __pyx_v_mask;
  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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_flags", 1, 2, 2, 1); __PYX_ERR(0, 3055, __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, 3055, __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_uint32_t(values[0]); if (unlikely((__pyx_v_flags == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3055, __pyx_L3_error)
    __pyx_v_mask = __Pyx_PyInt_As_uint32_t(values[1]); if (unlikely((__pyx_v_mask == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3055, __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, 3055, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pywrapfst.ArcIterator.set_flags", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pywrapfst_11ArcIterator_20set_flags(((struct __pyx_obj_9pywrapfst_ArcIterator *)__pyx_v_self), __pyx_v_flags, __pyx_v_mask);

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

static PyObject *__pyx_pf_9pywrapfst_11ArcIterator_20set_flags(struct __pyx_obj_9pywrapfst_ArcIterator *__pyx_v_self, __pyx_t_10basictypes_uint32 __pyx_v_flags, __pyx_t_10basictypes_uint32 __pyx_v_mask) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("set_flags", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_9pywrapfst_11ArcIterator_set_flags(__pyx_v_self, __pyx_v_flags, __pyx_v_mask, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3055, __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("pywrapfst.ArcIterator.set_flags", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":3067
 *     self._aiter.get().SetFlags(flags, mask)
 * 
 *   cpdef object value(self):             # <<<<<<<<<<<<<<
 *     """
 *     value(self)
 */

static PyObject *__pyx_pw_9pywrapfst_11ArcIterator_23value(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_9pywrapfst_11ArcIterator_value(struct __pyx_obj_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;
  __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)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3067, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_11ArcIterator_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);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3067, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3067, __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;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pywrapfst.pyx":3073
 *     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, 3073, __pyx_L1_error)
  }
  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_Arc(__pyx_v_self->_aiter.get()->Value())); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3073, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":3067
 *     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("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_9pywrapfst_11ArcIterator_23value(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_9pywrapfst_11ArcIterator_22value[] = "\n    value(self)\n\n    Returns the current arc.\n    ";
static PyObject *__pyx_pw_9pywrapfst_11ArcIterator_23value(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("value (wrapper)", 0);
  __pyx_r = __pyx_pf_9pywrapfst_11ArcIterator_22value(((struct __pyx_obj_9pywrapfst_ArcIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_11ArcIterator_22value(struct __pyx_obj_9pywrapfst_ArcIterator *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("value", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_9pywrapfst_11ArcIterator_value(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3067, __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("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_9pywrapfst_11ArcIterator_25__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_9pywrapfst_11ArcIterator_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_9pywrapfst_11ArcIterator_24__reduce_cython__(((struct __pyx_obj_9pywrapfst_ArcIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_11ArcIterator_24__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9pywrapfst_ArcIterator *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __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__60, 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("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_9pywrapfst_11ArcIterator_27__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static PyObject *__pyx_pw_9pywrapfst_11ArcIterator_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_9pywrapfst_11ArcIterator_26__setstate_cython__(((struct __pyx_obj_9pywrapfst_ArcIterator *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

static PyObject *__pyx_pf_9pywrapfst_11ArcIterator_26__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_9pywrapfst_ArcIterator *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __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__61, 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("pywrapfst.ArcIterator.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":3085
 *   """
 * 
 *   def __repr__(self):             # <<<<<<<<<<<<<<
 *     return "<MutableArcIterator at 0x{:x}>".format(id(self))
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_18MutableArcIterator_1__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9pywrapfst_18MutableArcIterator_1__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9pywrapfst_18MutableArcIterator___repr__(((struct __pyx_obj_9pywrapfst_MutableArcIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_18MutableArcIterator___repr__(struct __pyx_obj_9pywrapfst_MutableArcIterator *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "pywrapfst.pyx":3086
 * 
 *   def __repr__(self):
 *     return "<MutableArcIterator at 0x{:x}>".format(id(self))             # <<<<<<<<<<<<<<
 * 
 *   def __init__(self, _MutableFst ifst, int64 state):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_MutableArcIterator_at_0x_x, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3086, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3086, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3086, __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 && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3086, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_4};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3086, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_4};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3086, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else
    #endif
    {
      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3086, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3086, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":3085
 *   """
 * 
 *   def __repr__(self):             # <<<<<<<<<<<<<<
 *     return "<MutableArcIterator at 0x{:x}>".format(id(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_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pywrapfst.MutableArcIterator.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":3088
 *     return "<MutableArcIterator at 0x{:x}>".format(id(self))
 * 
 *   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_9pywrapfst_18MutableArcIterator_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_9pywrapfst_18MutableArcIterator_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_ifst = 0;
  __pyx_t_10basictypes_int64 __pyx_v_state;
  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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ifst)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_state)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 3088, __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, 3088, __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_9pywrapfst__MutableFst *)values[0]);
    __pyx_v_state = __Pyx_PyInt_As_int64_t(values[1]); if (unlikely((__pyx_v_state == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3088, __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, 3088, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("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_9pywrapfst__MutableFst, 1, "ifst", 0))) __PYX_ERR(0, 3088, __pyx_L1_error)
  __pyx_r = __pyx_pf_9pywrapfst_18MutableArcIterator_2__init__(((struct __pyx_obj_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_9pywrapfst_18MutableArcIterator_2__init__(struct __pyx_obj_9pywrapfst_MutableArcIterator *__pyx_v_self, struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_ifst, __pyx_t_10basictypes_int64 __pyx_v_state) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  std::shared_ptr<fst::script::MutableFstClass>  __pyx_t_4;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pywrapfst.pyx":3089
 * 
 *   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, 3089, __pyx_L1_error)
  }
  __pyx_t_1 = ((!(__pyx_v_ifst->__pyx_base._fst.get()->ValidStateId(__pyx_v_state) != 0)) != 0);
  if (__pyx_t_1) {

    /* "pywrapfst.pyx":3090
 *   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_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3090, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__62, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3090, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 3090, __pyx_L1_error)

    /* "pywrapfst.pyx":3089
 * 
 *   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.
 */
  }

  /* "pywrapfst.pyx":3092
 *       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, 3092, __pyx_L1_error)
  }
  __pyx_t_4 = __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, 3092, __pyx_L1_error)
  }
  __pyx_v_self->_mfst = __pyx_t_4;

  /* "pywrapfst.pyx":3093
 *     # 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))             # <<<<<<<<<<<<<<
 * 
 *   cpdef bool done(self):
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_aiter");
    __PYX_ERR(0, 3093, __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, 3093, __pyx_L1_error)
  }
  __pyx_v_self->_aiter.reset(new fst::script::MutableArcIteratorClass(__pyx_v_ifst->_mfst.get(), __pyx_v_state));

  /* "pywrapfst.pyx":3088
 *     return "<MutableArcIterator at 0x{:x}>".format(id(self))
 * 
 *   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_AddTraceback("pywrapfst.MutableArcIterator.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":3095
 *     self._aiter.reset(new fst.MutableArcIteratorClass(ifst._mfst.get(), state))
 * 
 *   cpdef bool done(self):             # <<<<<<<<<<<<<<
 *     """
 *     done(self)
 */

static PyObject *__pyx_pw_9pywrapfst_18MutableArcIterator_5done(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static bool __pyx_f_9pywrapfst_18MutableArcIterator_done(struct __pyx_obj_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;
  __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)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_done); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3095, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_18MutableArcIterator_5done)) {
      __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);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3095, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3095, __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, 3095, __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;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pywrapfst.pyx":3104
 *       True if the iterator is exhausted, False otherwise.
 *     """
 *     return self._aiter.get().Done()             # <<<<<<<<<<<<<<
 * 
 *   cpdef uint32 flags(self):
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_aiter");
    __PYX_ERR(0, 3104, __pyx_L1_error)
  }
  __pyx_r = __pyx_v_self->_aiter.get()->Done();
  goto __pyx_L0;

  /* "pywrapfst.pyx":3095
 *     self._aiter.reset(new fst.MutableArcIteratorClass(ifst._mfst.get(), state))
 * 
 *   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("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_9pywrapfst_18MutableArcIterator_5done(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_9pywrapfst_18MutableArcIterator_4done[] = "\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_9pywrapfst_18MutableArcIterator_5done(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("done (wrapper)", 0);
  __pyx_r = __pyx_pf_9pywrapfst_18MutableArcIterator_4done(((struct __pyx_obj_9pywrapfst_MutableArcIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_18MutableArcIterator_4done(struct __pyx_obj_9pywrapfst_MutableArcIterator *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("done", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_9pywrapfst_18MutableArcIterator_done(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3095, __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("pywrapfst.MutableArcIterator.done", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":3106
 *     return self._aiter.get().Done()
 * 
 *   cpdef uint32 flags(self):             # <<<<<<<<<<<<<<
 *     """
 *     flags(self)
 */

static PyObject *__pyx_pw_9pywrapfst_18MutableArcIterator_7flags(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static __pyx_t_10basictypes_uint32 __pyx_f_9pywrapfst_18MutableArcIterator_flags(struct __pyx_obj_9pywrapfst_MutableArcIterator *__pyx_v_self, int __pyx_skip_dispatch) {
  __pyx_t_10basictypes_uint32 __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __pyx_t_10basictypes_uint32 __pyx_t_5;
  __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)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3106, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_18MutableArcIterator_7flags)) {
      __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);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3106, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3106, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_5 = __Pyx_PyInt_As_uint32_t(__pyx_t_2); if (unlikely((__pyx_t_5 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3106, __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;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pywrapfst.pyx":3115
 *       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, 3115, __pyx_L1_error)
  }
  __pyx_r = __pyx_v_self->_aiter.get()->Flags();
  goto __pyx_L0;

  /* "pywrapfst.pyx":3106
 *     return self._aiter.get().Done()
 * 
 *   cpdef uint32 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("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_9pywrapfst_18MutableArcIterator_7flags(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_9pywrapfst_18MutableArcIterator_6flags[] = "\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_9pywrapfst_18MutableArcIterator_7flags(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("flags (wrapper)", 0);
  __pyx_r = __pyx_pf_9pywrapfst_18MutableArcIterator_6flags(((struct __pyx_obj_9pywrapfst_MutableArcIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_18MutableArcIterator_6flags(struct __pyx_obj_9pywrapfst_MutableArcIterator *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("flags", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_uint32_t(__pyx_f_9pywrapfst_18MutableArcIterator_flags(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3106, __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("pywrapfst.MutableArcIterator.flags", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":3117
 *     return self._aiter.get().Flags()
 * 
 *   cpdef void next(self):             # <<<<<<<<<<<<<<
 *     """
 *     next(self)
 */

static PyObject *__pyx_pw_9pywrapfst_18MutableArcIterator_9next(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static void __pyx_f_9pywrapfst_18MutableArcIterator_next(struct __pyx_obj_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;
  __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)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_next); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3117, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_18MutableArcIterator_9next)) {
      __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);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3117, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3117, __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;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pywrapfst.pyx":3123
 *     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, 3123, __pyx_L1_error)
  }
  __pyx_v_self->_aiter.get()->Next();

  /* "pywrapfst.pyx":3117
 *     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("pywrapfst.MutableArcIterator.next", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_18MutableArcIterator_9next(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_9pywrapfst_18MutableArcIterator_8next[] = "\n    next(self)\n\n    Advances the iterator.\n    ";
static PyObject *__pyx_pw_9pywrapfst_18MutableArcIterator_9next(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("next (wrapper)", 0);
  __pyx_r = __pyx_pf_9pywrapfst_18MutableArcIterator_8next(((struct __pyx_obj_9pywrapfst_MutableArcIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_18MutableArcIterator_8next(struct __pyx_obj_9pywrapfst_MutableArcIterator *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("next", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_9pywrapfst_18MutableArcIterator_next(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3117, __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("pywrapfst.MutableArcIterator.next", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":3125
 *     self._aiter.get().Next()
 * 
 *   cpdef size_t position(self):             # <<<<<<<<<<<<<<
 *     """
 *     position(self)
 */

static PyObject *__pyx_pw_9pywrapfst_18MutableArcIterator_11position(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static size_t __pyx_f_9pywrapfst_18MutableArcIterator_position(struct __pyx_obj_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;
  __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)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_position); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3125, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_18MutableArcIterator_11position)) {
      __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);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3125, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3125, __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, 3125, __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;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pywrapfst.pyx":3134
 *       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, 3134, __pyx_L1_error)
  }
  __pyx_r = __pyx_v_self->_aiter.get()->Position();
  goto __pyx_L0;

  /* "pywrapfst.pyx":3125
 *     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("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_9pywrapfst_18MutableArcIterator_11position(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_9pywrapfst_18MutableArcIterator_10position[] = "\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_9pywrapfst_18MutableArcIterator_11position(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("position (wrapper)", 0);
  __pyx_r = __pyx_pf_9pywrapfst_18MutableArcIterator_10position(((struct __pyx_obj_9pywrapfst_MutableArcIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_18MutableArcIterator_10position(struct __pyx_obj_9pywrapfst_MutableArcIterator *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("position", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_f_9pywrapfst_18MutableArcIterator_position(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3125, __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("pywrapfst.MutableArcIterator.position", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":3136
 *     return self._aiter.get().Position()
 * 
 *   cpdef void reset(self):             # <<<<<<<<<<<<<<
 *     """
 *     reset(self)
 */

static PyObject *__pyx_pw_9pywrapfst_18MutableArcIterator_13reset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static void __pyx_f_9pywrapfst_18MutableArcIterator_reset(struct __pyx_obj_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;
  __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)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3136, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_18MutableArcIterator_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);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3136, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3136, __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;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pywrapfst.pyx":3142
 *     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, 3142, __pyx_L1_error)
  }
  __pyx_v_self->_aiter.get()->Reset();

  /* "pywrapfst.pyx":3136
 *     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("pywrapfst.MutableArcIterator.reset", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_18MutableArcIterator_13reset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_9pywrapfst_18MutableArcIterator_12reset[] = "\n    reset(self)\n\n    Resets the iterator to the initial position.\n    ";
static PyObject *__pyx_pw_9pywrapfst_18MutableArcIterator_13reset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("reset (wrapper)", 0);
  __pyx_r = __pyx_pf_9pywrapfst_18MutableArcIterator_12reset(((struct __pyx_obj_9pywrapfst_MutableArcIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_18MutableArcIterator_12reset(struct __pyx_obj_9pywrapfst_MutableArcIterator *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("reset", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_9pywrapfst_18MutableArcIterator_reset(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3136, __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("pywrapfst.MutableArcIterator.reset", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":3144
 *     self._aiter.get().Reset()
 * 
 *   cpdef void seek(self, size_t a):             # <<<<<<<<<<<<<<
 *     """
 *     seek(self, a)
 */

static PyObject *__pyx_pw_9pywrapfst_18MutableArcIterator_15seek(PyObject *__pyx_v_self, PyObject *__pyx_arg_a); /*proto*/
static void __pyx_f_9pywrapfst_18MutableArcIterator_seek(struct __pyx_obj_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;
  PyObject *__pyx_t_6 = NULL;
  __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)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_seek); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3144, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_18MutableArcIterator_15seek)) {
      __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_v_a); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3144, __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);
        }
      }
      if (!__pyx_t_5) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3144, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_4)) {
          PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3144, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
          PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3144, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        } else
        #endif
        {
          __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3144, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
          __Pyx_GIVEREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3);
          __pyx_t_3 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3144, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pywrapfst.pyx":3153
 *       a: The position to seek to.
 *     """
 *     self._aiter.get().Seek(a)             # <<<<<<<<<<<<<<
 * 
 *   cpdef void set_flags(self, uint32 flags, uint32 mask):
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_aiter");
    __PYX_ERR(0, 3153, __pyx_L1_error)
  }
  __pyx_v_self->_aiter.get()->Seek(__pyx_v_a);

  /* "pywrapfst.pyx":3144
 *     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_XDECREF(__pyx_t_6);
  __Pyx_WriteUnraisable("pywrapfst.MutableArcIterator.seek", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_18MutableArcIterator_15seek(PyObject *__pyx_v_self, PyObject *__pyx_arg_a); /*proto*/
static char __pyx_doc_9pywrapfst_18MutableArcIterator_14seek[] = "\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_9pywrapfst_18MutableArcIterator_15seek(PyObject *__pyx_v_self, PyObject *__pyx_arg_a) {
  size_t __pyx_v_a;
  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, 3144, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pywrapfst.MutableArcIterator.seek", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pywrapfst_18MutableArcIterator_14seek(((struct __pyx_obj_9pywrapfst_MutableArcIterator *)__pyx_v_self), ((size_t)__pyx_v_a));

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

static PyObject *__pyx_pf_9pywrapfst_18MutableArcIterator_14seek(struct __pyx_obj_9pywrapfst_MutableArcIterator *__pyx_v_self, size_t __pyx_v_a) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("seek", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_9pywrapfst_18MutableArcIterator_seek(__pyx_v_self, __pyx_v_a, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3144, __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("pywrapfst.MutableArcIterator.seek", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":3155
 *     self._aiter.get().Seek(a)
 * 
 *   cpdef void set_flags(self, uint32 flags, uint32 mask):             # <<<<<<<<<<<<<<
 *     """
 *     set_flags(self, flags, mask)
 */

static PyObject *__pyx_pw_9pywrapfst_18MutableArcIterator_17set_flags(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static void __pyx_f_9pywrapfst_18MutableArcIterator_set_flags(struct __pyx_obj_9pywrapfst_MutableArcIterator *__pyx_v_self, __pyx_t_10basictypes_uint32 __pyx_v_flags, __pyx_t_10basictypes_uint32 __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;
  __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)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3155, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_18MutableArcIterator_17set_flags)) {
      __pyx_t_3 = __Pyx_PyInt_From_uint32_t(__pyx_v_flags); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3155, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyInt_From_uint32_t(__pyx_v_mask); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3155, __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, 3155, __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, 3155, __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, 3155, __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, 3155, __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;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pywrapfst.pyx":3165
 *       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, 3165, __pyx_L1_error)
  }
  __pyx_v_self->_aiter.get()->SetFlags(__pyx_v_flags, __pyx_v_mask);

  /* "pywrapfst.pyx":3155
 *     self._aiter.get().Seek(a)
 * 
 *   cpdef void set_flags(self, uint32 flags, uint32 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("pywrapfst.MutableArcIterator.set_flags", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_18MutableArcIterator_17set_flags(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9pywrapfst_18MutableArcIterator_16set_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_9pywrapfst_18MutableArcIterator_17set_flags(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  __pyx_t_10basictypes_uint32 __pyx_v_flags;
  __pyx_t_10basictypes_uint32 __pyx_v_mask;
  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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_flags", 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, "set_flags") < 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_flags = __Pyx_PyInt_As_uint32_t(values[0]); if (unlikely((__pyx_v_flags == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3155, __pyx_L3_error)
    __pyx_v_mask = __Pyx_PyInt_As_uint32_t(values[1]); if (unlikely((__pyx_v_mask == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3155, __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, 3155, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pywrapfst.MutableArcIterator.set_flags", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pywrapfst_18MutableArcIterator_16set_flags(((struct __pyx_obj_9pywrapfst_MutableArcIterator *)__pyx_v_self), __pyx_v_flags, __pyx_v_mask);

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

static PyObject *__pyx_pf_9pywrapfst_18MutableArcIterator_16set_flags(struct __pyx_obj_9pywrapfst_MutableArcIterator *__pyx_v_self, __pyx_t_10basictypes_uint32 __pyx_v_flags, __pyx_t_10basictypes_uint32 __pyx_v_mask) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("set_flags", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_9pywrapfst_18MutableArcIterator_set_flags(__pyx_v_self, __pyx_v_flags, __pyx_v_mask, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3155, __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("pywrapfst.MutableArcIterator.set_flags", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":3167
 *     self._aiter.get().SetFlags(flags, mask)
 * 
 *   cpdef void set_value(self, Arc arc):             # <<<<<<<<<<<<<<
 *     """
 *     set_value(self, arc)
 */

static PyObject *__pyx_pw_9pywrapfst_18MutableArcIterator_19set_value(PyObject *__pyx_v_self, PyObject *__pyx_v_arc); /*proto*/
static void __pyx_f_9pywrapfst_18MutableArcIterator_set_value(struct __pyx_obj_9pywrapfst_MutableArcIterator *__pyx_v_self, struct __pyx_obj_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;
  PyObject *__pyx_t_5 = NULL;
  __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)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3167, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_18MutableArcIterator_19set_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);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_arc)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3167, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_arc)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3167, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_arc)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3167, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3167, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(((PyObject *)__pyx_v_arc));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_arc));
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_arc));
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3167, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pywrapfst.pyx":3176
 *       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, 3176, __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, 3176, __pyx_L1_error)
  }
  __pyx_v_self->_aiter.get()->SetValue((*__pyx_v_arc->_arc));

  /* "pywrapfst.pyx":3167
 *     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_XDECREF(__pyx_t_5);
  __Pyx_WriteUnraisable("pywrapfst.MutableArcIterator.set_value", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_18MutableArcIterator_19set_value(PyObject *__pyx_v_self, PyObject *__pyx_v_arc); /*proto*/
static char __pyx_doc_9pywrapfst_18MutableArcIterator_18set_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_9pywrapfst_18MutableArcIterator_19set_value(PyObject *__pyx_v_self, PyObject *__pyx_v_arc) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_value (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arc), __pyx_ptype_9pywrapfst_Arc, 1, "arc", 0))) __PYX_ERR(0, 3167, __pyx_L1_error)
  __pyx_r = __pyx_pf_9pywrapfst_18MutableArcIterator_18set_value(((struct __pyx_obj_9pywrapfst_MutableArcIterator *)__pyx_v_self), ((struct __pyx_obj_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_9pywrapfst_18MutableArcIterator_18set_value(struct __pyx_obj_9pywrapfst_MutableArcIterator *__pyx_v_self, struct __pyx_obj_9pywrapfst_Arc *__pyx_v_arc) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("set_value", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_9pywrapfst_18MutableArcIterator_set_value(__pyx_v_self, __pyx_v_arc, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3167, __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("pywrapfst.MutableArcIterator.set_value", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":3178
 *     self._aiter.get().SetValue(deref(arc._arc))
 * 
 *   cpdef object value(self):             # <<<<<<<<<<<<<<
 *     """
 *     value(self)
 */

static PyObject *__pyx_pw_9pywrapfst_18MutableArcIterator_21value(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_9pywrapfst_18MutableArcIterator_value(struct __pyx_obj_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;
  __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)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3178, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_18MutableArcIterator_21value)) {
      __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);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3178, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3178, __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;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pywrapfst.pyx":3184
 *     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, 3184, __pyx_L1_error)
  }
  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_Arc(__pyx_v_self->_aiter.get()->Value())); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3184, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":3178
 *     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("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_9pywrapfst_18MutableArcIterator_21value(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_9pywrapfst_18MutableArcIterator_20value[] = "\n    value(self)\n\n    Returns the current arc.\n    ";
static PyObject *__pyx_pw_9pywrapfst_18MutableArcIterator_21value(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("value (wrapper)", 0);
  __pyx_r = __pyx_pf_9pywrapfst_18MutableArcIterator_20value(((struct __pyx_obj_9pywrapfst_MutableArcIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_18MutableArcIterator_20value(struct __pyx_obj_9pywrapfst_MutableArcIterator *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("value", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_9pywrapfst_18MutableArcIterator_value(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3178, __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("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_9pywrapfst_18MutableArcIterator_23__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_9pywrapfst_18MutableArcIterator_23__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_9pywrapfst_18MutableArcIterator_22__reduce_cython__(((struct __pyx_obj_9pywrapfst_MutableArcIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_18MutableArcIterator_22__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9pywrapfst_MutableArcIterator *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __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__63, 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("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_9pywrapfst_18MutableArcIterator_25__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static PyObject *__pyx_pw_9pywrapfst_18MutableArcIterator_25__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_9pywrapfst_18MutableArcIterator_24__setstate_cython__(((struct __pyx_obj_9pywrapfst_MutableArcIterator *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

static PyObject *__pyx_pf_9pywrapfst_18MutableArcIterator_24__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_9pywrapfst_MutableArcIterator *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __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__64, 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("pywrapfst.MutableArcIterator.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":3198
 *   """
 * 
 *   def __repr__(self):             # <<<<<<<<<<<<<<
 *     return "<StateIterator at 0x{:x}>".format(id(self))
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_13StateIterator_1__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9pywrapfst_13StateIterator_1__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9pywrapfst_13StateIterator___repr__(((struct __pyx_obj_9pywrapfst_StateIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_13StateIterator___repr__(struct __pyx_obj_9pywrapfst_StateIterator *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "pywrapfst.pyx":3199
 * 
 *   def __repr__(self):
 *     return "<StateIterator at 0x{:x}>".format(id(self))             # <<<<<<<<<<<<<<
 * 
 *   def __init__(self, _Fst ifst):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_StateIterator_at_0x_x, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3199, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3199, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3199, __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 && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3199, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_4};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3199, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_4};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3199, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else
    #endif
    {
      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3199, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3199, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":3198
 *   """
 * 
 *   def __repr__(self):             # <<<<<<<<<<<<<<
 *     return "<StateIterator at 0x{:x}>".format(id(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_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pywrapfst.StateIterator.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":3201
 *     return "<StateIterator at 0x{:x}>".format(id(self))
 * 
 *   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_9pywrapfst_13StateIterator_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_9pywrapfst_13StateIterator_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst = 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] = PyDict_GetItem(__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, 3201, __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_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, 3201, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("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_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 3201, __pyx_L1_error)
  __pyx_r = __pyx_pf_9pywrapfst_13StateIterator_2__init__(((struct __pyx_obj_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_9pywrapfst_13StateIterator_2__init__(struct __pyx_obj_9pywrapfst_StateIterator *__pyx_v_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  std::shared_ptr<fst::script::FstClass>  __pyx_t_1;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pywrapfst.pyx":3203
 *   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, 3203, __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, 3203, __pyx_L1_error)
  }
  __pyx_v_self->_fst = __pyx_t_1;

  /* "pywrapfst.pyx":3204
 *     # 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, 3204, __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, 3204, __pyx_L1_error)
  }
  __pyx_v_self->_siter.reset(new fst::script::StateIteratorClass((*__pyx_v_self->_fst)));

  /* "pywrapfst.pyx":3201
 *     return "<StateIterator at 0x{:x}>".format(id(self))
 * 
 *   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("pywrapfst.StateIterator.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":3207
 * 
 *   # This just registers this class as a possible iterator.
 *   def __iter__(self):             # <<<<<<<<<<<<<<
 *     return self
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_13StateIterator_5__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9pywrapfst_13StateIterator_5__iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9pywrapfst_13StateIterator_4__iter__(((struct __pyx_obj_9pywrapfst_StateIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_13StateIterator_4__iter__(struct __pyx_obj_9pywrapfst_StateIterator *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);

  /* "pywrapfst.pyx":3208
 *   # 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;

  /* "pywrapfst.pyx":3207
 * 
 *   # 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;
}

/* "pywrapfst.pyx":3211
 * 
 *   # 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_9pywrapfst_13StateIterator_7__next__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9pywrapfst_13StateIterator_7__next__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__next__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9pywrapfst_13StateIterator_6__next__(((struct __pyx_obj_9pywrapfst_StateIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_13StateIterator_6__next__(struct __pyx_obj_9pywrapfst_StateIterator *__pyx_v_self) {
  __pyx_t_10basictypes_int64 __pyx_v_result;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__next__", 0);

  /* "pywrapfst.pyx":3212
 *   # 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, 3212, __pyx_L1_error)
  }
  __pyx_t_1 = (((struct __pyx_vtabstruct_9pywrapfst_StateIterator *)__pyx_v_self->__pyx_vtab)->done(__pyx_v_self, 0) != 0);
  if (__pyx_t_1) {

    /* "pywrapfst.pyx":3213
 *   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, 3213, __pyx_L1_error)

    /* "pywrapfst.pyx":3212
 *   # 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()
 */
  }

  /* "pywrapfst.pyx":3214
 *     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, 3214, __pyx_L1_error)
  }
  __pyx_v_result = ((struct __pyx_vtabstruct_9pywrapfst_StateIterator *)__pyx_v_self->__pyx_vtab)->value(__pyx_v_self, 0);

  /* "pywrapfst.pyx":3215
 *       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, 3215, __pyx_L1_error)
  }
  ((struct __pyx_vtabstruct_9pywrapfst_StateIterator *)__pyx_v_self->__pyx_vtab)->next(__pyx_v_self, 0);

  /* "pywrapfst.pyx":3216
 *     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, 3216, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":3211
 * 
 *   # 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("pywrapfst.StateIterator.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":3218
 *     return result
 * 
 *   cpdef bool done(self):             # <<<<<<<<<<<<<<
 *     """
 *     done(self)
 */

static PyObject *__pyx_pw_9pywrapfst_13StateIterator_9done(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static bool __pyx_f_9pywrapfst_13StateIterator_done(struct __pyx_obj_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;
  __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)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_done); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3218, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_13StateIterator_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);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3218, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3218, __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, 3218, __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;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pywrapfst.pyx":3227
 *       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, 3227, __pyx_L1_error)
  }
  __pyx_r = __pyx_v_self->_siter.get()->Done();
  goto __pyx_L0;

  /* "pywrapfst.pyx":3218
 *     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("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_9pywrapfst_13StateIterator_9done(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_9pywrapfst_13StateIterator_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_9pywrapfst_13StateIterator_9done(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("done (wrapper)", 0);
  __pyx_r = __pyx_pf_9pywrapfst_13StateIterator_8done(((struct __pyx_obj_9pywrapfst_StateIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_13StateIterator_8done(struct __pyx_obj_9pywrapfst_StateIterator *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("done", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_9pywrapfst_13StateIterator_done(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3218, __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("pywrapfst.StateIterator.done", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":3229
 *     return self._siter.get().Done()
 * 
 *   cpdef void next(self):             # <<<<<<<<<<<<<<
 *     """
 *     next(self)
 */

static PyObject *__pyx_pw_9pywrapfst_13StateIterator_11next(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static void __pyx_f_9pywrapfst_13StateIterator_next(struct __pyx_obj_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;
  __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)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_next); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3229, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_13StateIterator_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);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3229, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3229, __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;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pywrapfst.pyx":3235
 *     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, 3235, __pyx_L1_error)
  }
  __pyx_v_self->_siter.get()->Next();

  /* "pywrapfst.pyx":3229
 *     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("pywrapfst.StateIterator.next", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_13StateIterator_11next(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_9pywrapfst_13StateIterator_10next[] = "\n    next(self)\n\n    Advances the iterator.\n    ";
static PyObject *__pyx_pw_9pywrapfst_13StateIterator_11next(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("next (wrapper)", 0);
  __pyx_r = __pyx_pf_9pywrapfst_13StateIterator_10next(((struct __pyx_obj_9pywrapfst_StateIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_13StateIterator_10next(struct __pyx_obj_9pywrapfst_StateIterator *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("next", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_9pywrapfst_13StateIterator_next(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3229, __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("pywrapfst.StateIterator.next", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":3237
 *     self._siter.get().Next()
 * 
 *   cpdef void reset(self):             # <<<<<<<<<<<<<<
 *     """
 *     reset(self)
 */

static PyObject *__pyx_pw_9pywrapfst_13StateIterator_13reset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static void __pyx_f_9pywrapfst_13StateIterator_reset(struct __pyx_obj_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;
  __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)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3237, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_13StateIterator_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);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3237, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3237, __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;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pywrapfst.pyx":3243
 *     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, 3243, __pyx_L1_error)
  }
  __pyx_v_self->_siter.get()->Reset();

  /* "pywrapfst.pyx":3237
 *     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("pywrapfst.StateIterator.reset", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_13StateIterator_13reset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_9pywrapfst_13StateIterator_12reset[] = "\n    reset(self)\n\n    Resets the iterator to the initial position.\n    ";
static PyObject *__pyx_pw_9pywrapfst_13StateIterator_13reset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("reset (wrapper)", 0);
  __pyx_r = __pyx_pf_9pywrapfst_13StateIterator_12reset(((struct __pyx_obj_9pywrapfst_StateIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_13StateIterator_12reset(struct __pyx_obj_9pywrapfst_StateIterator *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("reset", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_9pywrapfst_13StateIterator_reset(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3237, __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("pywrapfst.StateIterator.reset", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":3245
 *     self._siter.get().Reset()
 * 
 *   cpdef int64 value(self):             # <<<<<<<<<<<<<<
 *     """
 *     value(self)
 */

static PyObject *__pyx_pw_9pywrapfst_13StateIterator_15value(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static __pyx_t_10basictypes_int64 __pyx_f_9pywrapfst_13StateIterator_value(struct __pyx_obj_9pywrapfst_StateIterator *__pyx_v_self, int __pyx_skip_dispatch) {
  __pyx_t_10basictypes_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;
  __pyx_t_10basictypes_int64 __pyx_t_5;
  __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)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3245, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_13StateIterator_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);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3245, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3245, __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_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3245, __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;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pywrapfst.pyx":3251
 *     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, 3251, __pyx_L1_error)
  }
  __pyx_r = __pyx_v_self->_siter.get()->Value();
  goto __pyx_L0;

  /* "pywrapfst.pyx":3245
 *     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("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_9pywrapfst_13StateIterator_15value(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_9pywrapfst_13StateIterator_14value[] = "\n    value(self)\n\n    Returns the current state index.\n    ";
static PyObject *__pyx_pw_9pywrapfst_13StateIterator_15value(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("value (wrapper)", 0);
  __pyx_r = __pyx_pf_9pywrapfst_13StateIterator_14value(((struct __pyx_obj_9pywrapfst_StateIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_13StateIterator_14value(struct __pyx_obj_9pywrapfst_StateIterator *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("value", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_f_9pywrapfst_13StateIterator_value(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3245, __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("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_9pywrapfst_13StateIterator_17__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_9pywrapfst_13StateIterator_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_9pywrapfst_13StateIterator_16__reduce_cython__(((struct __pyx_obj_9pywrapfst_StateIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_13StateIterator_16__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9pywrapfst_StateIterator *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __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__65, 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("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_9pywrapfst_13StateIterator_19__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static PyObject *__pyx_pw_9pywrapfst_13StateIterator_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_9pywrapfst_13StateIterator_18__setstate_cython__(((struct __pyx_obj_9pywrapfst_StateIterator *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

static PyObject *__pyx_pf_9pywrapfst_13StateIterator_18__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_9pywrapfst_StateIterator *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __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__66, 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("pywrapfst.StateIterator.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":3257
 * 
 * 
 * cdef _Fst _map(_Fst ifst,             # <<<<<<<<<<<<<<
 *                float delta=fst.kDelta,
 *                map_type=b"identity",
 */

static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst__map(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst, struct __pyx_opt_args_9pywrapfst__map *__pyx_optional_args) {
  float __pyx_v_delta = __pyx_k__67;
  PyObject *__pyx_v_map_type = ((PyObject *)__pyx_n_b_identity);
  double __pyx_v_power = ((double)1.);

  /* "pywrapfst.pyx":3261
 *                map_type=b"identity",
 *                double power=1.,
 *                weight=None):             # <<<<<<<<<<<<<<
 *   cdef fst.MapType map_type_enum
 *   if not fst.GetMapType(tostring(map_type), addr(map_type_enum)):
 */
  PyObject *__pyx_v_weight = ((PyObject *)Py_None);
  enum fst::script::MapType __pyx_v_map_type_enum;
  fst::script::WeightClass __pyx_v_wc;
  struct __pyx_obj_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;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  fst::script::WeightClass __pyx_t_9;
  fst::script::WeightClass __pyx_t_10;
  __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;
          }
        }
      }
    }
  }

  /* "pywrapfst.pyx":3263
 *                weight=None):
 *   cdef fst.MapType map_type_enum
 *   if not fst.GetMapType(tostring(map_type), addr(map_type_enum)):             # <<<<<<<<<<<<<<
 *     raise FstArgError("Unknown map type: {!r}".format(map_type))
 *   cdef fst.WeightClass wc = (_get_WeightClass_or_One(ifst.weight_type(),
 */
  __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_map_type, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3263, __pyx_L1_error)
  __pyx_t_2 = ((!(fst::script::GetMapType(__pyx_t_1, (&__pyx_v_map_type_enum)) != 0)) != 0);
  if (__pyx_t_2) {

    /* "pywrapfst.pyx":3264
 *   cdef fst.MapType map_type_enum
 *   if not fst.GetMapType(tostring(map_type), addr(map_type_enum)):
 *     raise FstArgError("Unknown map type: {!r}".format(map_type))             # <<<<<<<<<<<<<<
 *   cdef fst.WeightClass wc = (_get_WeightClass_or_One(ifst.weight_type(),
 *       weight) if map_type_enum == fst.TIMES_MAPPER else
 */
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstArgError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3264, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Unknown_map_type_r, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3264, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    if (!__pyx_t_7) {
      __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_map_type); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3264, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_map_type};
        __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3264, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_GOTREF(__pyx_t_5);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_map_type};
        __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3264, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_GOTREF(__pyx_t_5);
      } else
      #endif
      {
        __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3264, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
        __Pyx_INCREF(__pyx_v_map_type);
        __Pyx_GIVEREF(__pyx_v_map_type);
        PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_v_map_type);
        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3264, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (!__pyx_t_6) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3264, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3264, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3264, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      } else
      #endif
      {
        __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3264, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
        __Pyx_GIVEREF(__pyx_t_5);
        PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_5);
        __pyx_t_5 = 0;
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3264, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 3264, __pyx_L1_error)

    /* "pywrapfst.pyx":3263
 *                weight=None):
 *   cdef fst.MapType map_type_enum
 *   if not fst.GetMapType(tostring(map_type), addr(map_type_enum)):             # <<<<<<<<<<<<<<
 *     raise FstArgError("Unknown map type: {!r}".format(map_type))
 *   cdef fst.WeightClass wc = (_get_WeightClass_or_One(ifst.weight_type(),
 */
  }

  /* "pywrapfst.pyx":3266
 *     raise FstArgError("Unknown map type: {!r}".format(map_type))
 *   cdef fst.WeightClass wc = (_get_WeightClass_or_One(ifst.weight_type(),
 *       weight) if map_type_enum == fst.TIMES_MAPPER else             # <<<<<<<<<<<<<<
 *       _get_WeightClass_or_Zero(ifst.weight_type(), weight))
 *   return _init_XFst(fst.Map(deref(ifst._fst), map_type_enum, delta, power, wc))
 */
  if (((__pyx_v_map_type_enum == fst::script::TIMES_MAPPER) != 0)) {

    /* "pywrapfst.pyx":3265
 *   if not fst.GetMapType(tostring(map_type), addr(map_type_enum)):
 *     raise FstArgError("Unknown map type: {!r}".format(map_type))
 *   cdef fst.WeightClass wc = (_get_WeightClass_or_One(ifst.weight_type(),             # <<<<<<<<<<<<<<
 *       weight) if map_type_enum == fst.TIMES_MAPPER else
 *       _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, 3265, __pyx_L1_error)
    }

    /* "pywrapfst.pyx":3266
 *     raise FstArgError("Unknown map type: {!r}".format(map_type))
 *   cdef fst.WeightClass wc = (_get_WeightClass_or_One(ifst.weight_type(),
 *       weight) if map_type_enum == fst.TIMES_MAPPER else             # <<<<<<<<<<<<<<
 *       _get_WeightClass_or_Zero(ifst.weight_type(), weight))
 *   return _init_XFst(fst.Map(deref(ifst._fst), map_type_enum, delta, power, wc))
 */
    __pyx_t_10 = __pyx_f_9pywrapfst__get_WeightClass_or_One(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_ifst->__pyx_vtab)->weight_type(__pyx_v_ifst, 0), __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3265, __pyx_L1_error)
    __pyx_t_9 = __pyx_t_10;
  } else {

    /* "pywrapfst.pyx":3267
 *   cdef fst.WeightClass wc = (_get_WeightClass_or_One(ifst.weight_type(),
 *       weight) if map_type_enum == fst.TIMES_MAPPER else
 *       _get_WeightClass_or_Zero(ifst.weight_type(), weight))             # <<<<<<<<<<<<<<
 *   return _init_XFst(fst.Map(deref(ifst._fst), map_type_enum, delta, power, wc))
 * 
 */
    if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "weight_type");
      __PYX_ERR(0, 3267, __pyx_L1_error)
    }
    __pyx_t_10 = __pyx_f_9pywrapfst__get_WeightClass_or_Zero(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_ifst->__pyx_vtab)->weight_type(__pyx_v_ifst, 0), __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3267, __pyx_L1_error)
    __pyx_t_9 = __pyx_t_10;
  }
  __pyx_v_wc = __pyx_t_9;

  /* "pywrapfst.pyx":3268
 *       weight) if map_type_enum == fst.TIMES_MAPPER else
 *       _get_WeightClass_or_Zero(ifst.weight_type(), weight))
 *   return _init_XFst(fst.Map(deref(ifst._fst), map_type_enum, delta, power, wc))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  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_3 = ((PyObject *)__pyx_f_9pywrapfst__init_XFst(fst::script::Map((*__pyx_v_ifst->_fst), __pyx_v_map_type_enum, __pyx_v_delta, __pyx_v_power, __pyx_v_wc))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3268, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = ((struct __pyx_obj_9pywrapfst__Fst *)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":3257
 * 
 * 
 * cdef _Fst _map(_Fst ifst,             # <<<<<<<<<<<<<<
 *                float delta=fst.kDelta,
 *                map_type=b"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_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("pywrapfst._map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":3271
 * 
 * 
 * cpdef _Fst arcmap(_Fst ifst,             # <<<<<<<<<<<<<<
 *                   float delta=fst.kDelta,
 *                   map_type=b"identity",
 */

static PyObject *__pyx_pw_9pywrapfst_17arcmap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst_arcmap(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_arcmap *__pyx_optional_args) {
  float __pyx_v_delta = __pyx_k__68;
  PyObject *__pyx_v_map_type = ((PyObject *)__pyx_n_b_identity);
  double __pyx_v_power = ((double)1.);

  /* "pywrapfst.pyx":3275
 *                   map_type=b"identity",
 *                   double power=1.,
 *                   weight=None):             # <<<<<<<<<<<<<<
 *   """
 *   arcmap(ifst, delta=0.0009765625, map_type="identity", weight=None)
 */
  PyObject *__pyx_v_weight = ((PyObject *)Py_None);
  struct __pyx_obj_9pywrapfst__Fst *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_9pywrapfst__map __pyx_t_2;
  __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;
          }
        }
      }
    }
  }

  /* "pywrapfst.pyx":3318
 *   See also: `statemap`.
 *   """
 *   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_9pywrapfst__map(__pyx_v_ifst, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3318, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_9pywrapfst__Fst *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":3271
 * 
 * 
 * cpdef _Fst arcmap(_Fst ifst,             # <<<<<<<<<<<<<<
 *                   float delta=fst.kDelta,
 *                   map_type=b"identity",
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("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_9pywrapfst_17arcmap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9pywrapfst_16arcmap[] = "\n  arcmap(ifst, delta=0.0009765625, map_type=\"identity\", 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    * float_power: raises all weights to a floating-point power.\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 an integral 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 to all weights.\n    * to_log: converts weights to the log semiring.\n    * to_log64: converts weights to the log64 semiring.\n    * to_standard: converts weights to the tropical (\"standard\") 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        `float_power` or `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\n  See also: `statemap`.\n  ";
static PyObject *__pyx_pw_9pywrapfst_17arcmap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_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;
  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_b_identity);

    /* "pywrapfst.pyx":3275
 *                   map_type=b"identity",
 *                   double power=1.,
 *                   weight=None):             # <<<<<<<<<<<<<<
 *   """
 *   arcmap(ifst, delta=0.0009765625, map_type="identity", 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] = PyDict_GetItem(__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 = PyDict_GetItem(__pyx_kwds, __pyx_n_s_delta);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_map_type);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_power);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__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, 3271, __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_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, 3272, __pyx_L3_error)
    } else {
      __pyx_v_delta = __pyx_k__68;
    }
    __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, 3274, __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, 3271, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("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_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 3271, __pyx_L1_error)
  __pyx_r = __pyx_pf_9pywrapfst_16arcmap(__pyx_self, __pyx_v_ifst, __pyx_v_delta, __pyx_v_map_type, __pyx_v_power, __pyx_v_weight);

  /* "pywrapfst.pyx":3271
 * 
 * 
 * cpdef _Fst arcmap(_Fst ifst,             # <<<<<<<<<<<<<<
 *                   float delta=fst.kDelta,
 *                   map_type=b"identity",
 */

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

static PyObject *__pyx_pf_9pywrapfst_16arcmap(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_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_9pywrapfst_arcmap __pyx_t_2;
  __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_9pywrapfst_arcmap(__pyx_v_ifst, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3271, __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("pywrapfst.arcmap", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":3321
 * 
 * 
 * cpdef _MutableFst compose(_Fst ifst1,             # <<<<<<<<<<<<<<
 *                           _Fst ifst2,
 *                           compose_filter=b"auto",
 */

static PyObject *__pyx_pw_9pywrapfst_19compose(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_compose(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst1, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst2, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_compose *__pyx_optional_args) {
  PyObject *__pyx_v_compose_filter = ((PyObject *)__pyx_n_b_auto);

  /* "pywrapfst.pyx":3324
 *                           _Fst ifst2,
 *                           compose_filter=b"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_9pywrapfst__MutableFst *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  enum fst::ComposeFilter __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __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;
      }
    }
  }

  /* "pywrapfst.pyx":3349
 *   """
 *   cdef unique_ptr[fst.VectorFstClass] tfst
 *   tfst.reset(new fst.VectorFstClass(ifst1.arc_type()))             # <<<<<<<<<<<<<<
 *   cdef unique_ptr[fst.ComposeOptions] opts
 *   opts.reset(new fst.ComposeOptions(connect,
 */
  if (unlikely(((PyObject *)__pyx_v_ifst1) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "arc_type");
    __PYX_ERR(0, 3349, __pyx_L1_error)
  }
  __pyx_v_tfst.reset(new fst::script::VectorFstClass(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_ifst1->__pyx_vtab)->arc_type(__pyx_v_ifst1, 0)));

  /* "pywrapfst.pyx":3352
 *   cdef unique_ptr[fst.ComposeOptions] opts
 *   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_9pywrapfst_tostring(__pyx_v_compose_filter, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3352, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_9pywrapfst__get_compose_filter(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3352, __pyx_L1_error)

  /* "pywrapfst.pyx":3351
 *   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))))
 *   fst.Compose(deref(ifst1._fst), deref(ifst2._fst), tfst.get(), deref(opts))
 */
  __pyx_v_opts.reset(new fst::ComposeOptions(__pyx_v_connect, __pyx_t_2));

  /* "pywrapfst.pyx":3353
 *   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())
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_ifst1) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 3353, __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, 3353, __pyx_L1_error)
  }
  fst::script::Compose((*__pyx_v_ifst1->_fst), (*__pyx_v_ifst2->_fst), __pyx_v_tfst.get(), (*__pyx_v_opts));

  /* "pywrapfst.pyx":3354
 *       _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_9pywrapfst__init_MutableFst(__pyx_v_tfst.release())); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3354, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = ((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":3321
 * 
 * 
 * cpdef _MutableFst compose(_Fst ifst1,             # <<<<<<<<<<<<<<
 *                           _Fst ifst2,
 *                           compose_filter=b"auto",
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("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_9pywrapfst_19compose(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9pywrapfst_18compose[] = "\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\", \"null\", \"sequence\", \"trivial\".\n    connect: Should output be trimmed?\n\n  Returns:\n    An FST.\n\n  See also: `arcsort`.\n  ";
static PyObject *__pyx_pw_9pywrapfst_19compose(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst1 = 0;
  struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst2 = 0;
  PyObject *__pyx_v_compose_filter = 0;
  bool __pyx_v_connect;
  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_b_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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ifst1)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ifst2)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("compose", 0, 2, 4, 1); __PYX_ERR(0, 3321, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_compose_filter);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__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, 3321, __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_9pywrapfst__Fst *)values[0]);
    __pyx_v_ifst2 = ((struct __pyx_obj_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, 3324, __pyx_L3_error)
    } else {

      /* "pywrapfst.pyx":3324
 *                           _Fst ifst2,
 *                           compose_filter=b"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, 3321, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("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_9pywrapfst__Fst, 1, "ifst1", 0))) __PYX_ERR(0, 3321, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst2), __pyx_ptype_9pywrapfst__Fst, 1, "ifst2", 0))) __PYX_ERR(0, 3322, __pyx_L1_error)
  __pyx_r = __pyx_pf_9pywrapfst_18compose(__pyx_self, __pyx_v_ifst1, __pyx_v_ifst2, __pyx_v_compose_filter, __pyx_v_connect);

  /* "pywrapfst.pyx":3321
 * 
 * 
 * cpdef _MutableFst compose(_Fst ifst1,             # <<<<<<<<<<<<<<
 *                           _Fst ifst2,
 *                           compose_filter=b"auto",
 */

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

static PyObject *__pyx_pf_9pywrapfst_18compose(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst1, struct __pyx_obj_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_9pywrapfst_compose __pyx_t_2;
  __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_9pywrapfst_compose(__pyx_v_ifst1, __pyx_v_ifst2, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3321, __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("pywrapfst.compose", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":3357
 * 
 * 
 * cpdef _Fst convert(_Fst ifst, fst_type=None):             # <<<<<<<<<<<<<<
 *   """
 *   convert(ifst, fst_type=None)
 */

static PyObject *__pyx_pw_9pywrapfst_21convert(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst_convert(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_convert *__pyx_optional_args) {
  PyObject *__pyx_v_fst_type = ((PyObject *)Py_None);
  std::string __pyx_v_fst_type_string;
  std::unique_ptr<fst::script::FstClass>  __pyx_v_tfst;
  struct __pyx_obj_9pywrapfst__Fst *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::string __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;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  __Pyx_RefNannySetupContext("convert", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_fst_type = __pyx_optional_args->fst_type;
    }
  }

  /* "pywrapfst.pyx":3374
 *     FstOpError: Conversion failed.
 *   """
 *   cdef string fst_type_string = b"" if fst_type is None else tostring(fst_type)             # <<<<<<<<<<<<<<
 *   cdef unique_ptr[fst.FstClass] tfst
 *   tfst.reset(fst.Convert(deref(ifst._fst), fst_type_string))
 */
  __pyx_t_2 = (__pyx_v_fst_type == Py_None);
  if ((__pyx_t_2 != 0)) {
    __pyx_t_3 = __pyx_convert_string_from_py_std__in_string(__pyx_kp_b__24); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3374, __pyx_L1_error)
    __pyx_t_1 = __pyx_t_3;
  } else {
    __pyx_t_3 = __pyx_f_9pywrapfst_tostring(__pyx_v_fst_type, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3374, __pyx_L1_error)
    __pyx_t_4 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3374, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __pyx_convert_string_from_py_std__in_string(__pyx_t_4); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3374, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_1 = __pyx_t_3;
  }
  __pyx_v_fst_type_string = __pyx_t_1;

  /* "pywrapfst.pyx":3376
 *   cdef string fst_type_string = b"" if fst_type is None else tostring(fst_type)
 *   cdef unique_ptr[fst.FstClass] tfst
 *   tfst.reset(fst.Convert(deref(ifst._fst), fst_type_string))             # <<<<<<<<<<<<<<
 *   # 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, 3376, __pyx_L1_error)
  }
  __pyx_v_tfst.reset(fst::script::Convert((*__pyx_v_ifst->_fst), __pyx_v_fst_type_string));

  /* "pywrapfst.pyx":3378
 *   tfst.reset(fst.Convert(deref(ifst._fst), fst_type_string))
 *   # Script-land Convert returns a null pointer to signal failure.
 *   if tfst.get() == NULL:             # <<<<<<<<<<<<<<
 *     raise FstOpError("Conversion to {!r} failed".format(fst_type))
 *   return _init_XFst(tfst.release())
 */
  __pyx_t_2 = ((__pyx_v_tfst.get() == NULL) != 0);
  if (__pyx_t_2) {

    /* "pywrapfst.pyx":3379
 *   # Script-land Convert returns a null pointer to signal failure.
 *   if tfst.get() == NULL:
 *     raise FstOpError("Conversion to {!r} failed".format(fst_type))             # <<<<<<<<<<<<<<
 *   return _init_XFst(tfst.release())
 * 
 */
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstOpError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3379, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Conversion_to_r_failed, __pyx_n_s_format); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3379, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
      }
    }
    if (!__pyx_t_8) {
      __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_fst_type); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3379, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_fst_type};
        __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3379, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_GOTREF(__pyx_t_6);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_fst_type};
        __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3379, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_GOTREF(__pyx_t_6);
      } else
      #endif
      {
        __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3379, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
        __Pyx_INCREF(__pyx_v_fst_type);
        __Pyx_GIVEREF(__pyx_v_fst_type);
        PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_v_fst_type);
        __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3379, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = 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);
      }
    }
    if (!__pyx_t_7) {
      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3379, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_4);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_5)) {
        PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3379, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
        PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3379, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else
      #endif
      {
        __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3379, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
        __Pyx_GIVEREF(__pyx_t_6);
        PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_6);
        __pyx_t_6 = 0;
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3379, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(0, 3379, __pyx_L1_error)

    /* "pywrapfst.pyx":3378
 *   tfst.reset(fst.Convert(deref(ifst._fst), fst_type_string))
 *   # Script-land Convert returns a null pointer to signal failure.
 *   if tfst.get() == NULL:             # <<<<<<<<<<<<<<
 *     raise FstOpError("Conversion to {!r} failed".format(fst_type))
 *   return _init_XFst(tfst.release())
 */
  }

  /* "pywrapfst.pyx":3380
 *   if tfst.get() == NULL:
 *     raise FstOpError("Conversion to {!r} failed".format(fst_type))
 *   return _init_XFst(tfst.release())             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_4 = ((PyObject *)__pyx_f_9pywrapfst__init_XFst(__pyx_v_tfst.release())); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3380, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_r = ((struct __pyx_obj_9pywrapfst__Fst *)__pyx_t_4);
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":3357
 * 
 * 
 * cpdef _Fst convert(_Fst ifst, fst_type=None):             # <<<<<<<<<<<<<<
 *   """
 *   convert(ifst, fst_type=None)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("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_9pywrapfst_21convert(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9pywrapfst_20convert[] = "\n  convert(ifst, fst_type=None)\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 None if\n        no conversion is desired.\n\n  Returns:\n    An equivalent Fst converted to the desired FST type.\n\n  Raises:\n    FstOpError: Conversion failed.\n  ";
static PyObject *__pyx_pw_9pywrapfst_21convert(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst = 0;
  PyObject *__pyx_v_fst_type = 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 *)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] = PyDict_GetItem(__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 = PyDict_GetItem(__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, 3357, __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_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, 3357, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("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_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 3357, __pyx_L1_error)
  __pyx_r = __pyx_pf_9pywrapfst_20convert(__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_9pywrapfst_20convert(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_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_9pywrapfst_convert __pyx_t_2;
  __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_9pywrapfst_convert(__pyx_v_ifst, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3357, __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("pywrapfst.convert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":3383
 * 
 * 
 * cpdef _MutableFst determinize(_Fst ifst,             # <<<<<<<<<<<<<<
 *                               float delta=fst.kShortestDelta,
 *                               det_type=b"functional",
 */

static PyObject *__pyx_pw_9pywrapfst_23determinize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_determinize(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_determinize *__pyx_optional_args) {
  float __pyx_v_delta = __pyx_k__69;
  PyObject *__pyx_v_det_type = ((PyObject *)__pyx_n_b_functional);
  __pyx_t_10basictypes_int64 __pyx_v_nstate = __pyx_k__70;
  __pyx_t_10basictypes_int64 __pyx_v_subsequential_label = ((__pyx_t_10basictypes_int64)0);

  /* "pywrapfst.pyx":3388
 *                               int64 nstate=fst.kNoStateId,
 *                               int64 subsequential_label=0,
 *                               weight=None,             # <<<<<<<<<<<<<<
 *                               bool increment_subsequential_label=False):
 *   """
 */
  PyObject *__pyx_v_weight = ((PyObject *)Py_None);

  /* "pywrapfst.pyx":3389
 *                               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_wc;
  enum fst::DeterminizeType __pyx_v_determinize_type_enum;
  std::unique_ptr<fst::script::DeterminizeOptions>  __pyx_v_opts;
  struct __pyx_obj_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;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  __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;
              }
            }
          }
        }
      }
    }
  }

  /* "pywrapfst.pyx":3425
 *   """
 *   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 wc = _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, 3425, __pyx_L1_error)
  }
  __pyx_v_tfst.reset(new fst::script::VectorFstClass(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_ifst->__pyx_vtab)->arc_type(__pyx_v_ifst, 0)));

  /* "pywrapfst.pyx":3427
 *   tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
 *   # Threshold is set to semiring Zero (no pruning) if weight unspecified.
 *   cdef fst.WeightClass wc = _get_WeightClass_or_Zero(ifst.weight_type(),             # <<<<<<<<<<<<<<
 *                                                      weight)
 *   cdef fst.DeterminizeType determinize_type_enum
 */
  if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "weight_type");
    __PYX_ERR(0, 3427, __pyx_L1_error)
  }

  /* "pywrapfst.pyx":3428
 *   # Threshold is set to semiring Zero (no pruning) if weight unspecified.
 *   cdef fst.WeightClass wc = _get_WeightClass_or_Zero(ifst.weight_type(),
 *                                                      weight)             # <<<<<<<<<<<<<<
 *   cdef fst.DeterminizeType determinize_type_enum
 *   if not fst.GetDeterminizeType(tostring(det_type),
 */
  __pyx_t_1 = __pyx_f_9pywrapfst__get_WeightClass_or_Zero(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_ifst->__pyx_vtab)->weight_type(__pyx_v_ifst, 0), __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3427, __pyx_L1_error)
  __pyx_v_wc = __pyx_t_1;

  /* "pywrapfst.pyx":3430
 *                                                      weight)
 *   cdef fst.DeterminizeType determinize_type_enum
 *   if not fst.GetDeterminizeType(tostring(det_type),             # <<<<<<<<<<<<<<
 *                                 addr(determinize_type_enum)):
 *     raise FstArgError("Unknown determinization type: {!r}".format(det_type))
 */
  __pyx_t_2 = __pyx_f_9pywrapfst_tostring(__pyx_v_det_type, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3430, __pyx_L1_error)

  /* "pywrapfst.pyx":3431
 *   cdef fst.DeterminizeType determinize_type_enum
 *   if not fst.GetDeterminizeType(tostring(det_type),
 *                                 addr(determinize_type_enum)):             # <<<<<<<<<<<<<<
 *     raise FstArgError("Unknown determinization type: {!r}".format(det_type))
 *   cdef unique_ptr[fst.DeterminizeOptions] opts
 */
  __pyx_t_3 = ((!(fst::script::GetDeterminizeType(__pyx_t_2, (&__pyx_v_determinize_type_enum)) != 0)) != 0);

  /* "pywrapfst.pyx":3430
 *                                                      weight)
 *   cdef fst.DeterminizeType determinize_type_enum
 *   if not fst.GetDeterminizeType(tostring(det_type),             # <<<<<<<<<<<<<<
 *                                 addr(determinize_type_enum)):
 *     raise FstArgError("Unknown determinization type: {!r}".format(det_type))
 */
  if (__pyx_t_3) {

    /* "pywrapfst.pyx":3432
 *   if not fst.GetDeterminizeType(tostring(det_type),
 *                                 addr(determinize_type_enum)):
 *     raise FstArgError("Unknown determinization type: {!r}".format(det_type))             # <<<<<<<<<<<<<<
 *   cdef unique_ptr[fst.DeterminizeOptions] opts
 *   opts.reset(new fst.DeterminizeOptions(delta, wc, nstate, subsequential_label,
 */
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstArgError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3432, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Unknown_determinization_type_r, __pyx_n_s_format); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3432, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
      }
    }
    if (!__pyx_t_8) {
      __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_det_type); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3432, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_det_type};
        __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3432, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_GOTREF(__pyx_t_6);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_det_type};
        __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3432, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_GOTREF(__pyx_t_6);
      } else
      #endif
      {
        __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3432, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
        __Pyx_INCREF(__pyx_v_det_type);
        __Pyx_GIVEREF(__pyx_v_det_type);
        PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_v_det_type);
        __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3432, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = 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);
      }
    }
    if (!__pyx_t_7) {
      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3432, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_4);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_5)) {
        PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3432, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
        PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3432, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else
      #endif
      {
        __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3432, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
        __Pyx_GIVEREF(__pyx_t_6);
        PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_6);
        __pyx_t_6 = 0;
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3432, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(0, 3432, __pyx_L1_error)

    /* "pywrapfst.pyx":3430
 *                                                      weight)
 *   cdef fst.DeterminizeType determinize_type_enum
 *   if not fst.GetDeterminizeType(tostring(det_type),             # <<<<<<<<<<<<<<
 *                                 addr(determinize_type_enum)):
 *     raise FstArgError("Unknown determinization type: {!r}".format(det_type))
 */
  }

  /* "pywrapfst.pyx":3434
 *     raise FstArgError("Unknown determinization type: {!r}".format(det_type))
 *   cdef unique_ptr[fst.DeterminizeOptions] opts
 *   opts.reset(new fst.DeterminizeOptions(delta, wc, nstate, subsequential_label,             # <<<<<<<<<<<<<<
 *                                         determinize_type_enum,
 *                                         increment_subsequential_label))
 */
  __pyx_v_opts.reset(new fst::script::DeterminizeOptions(__pyx_v_delta, __pyx_v_wc, __pyx_v_nstate, __pyx_v_subsequential_label, __pyx_v_determinize_type_enum, __pyx_v_increment_subsequential_label));

  /* "pywrapfst.pyx":3437
 *                                         determinize_type_enum,
 *                                         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, 3437, __pyx_L1_error)
  }
  fst::script::Determinize((*__pyx_v_ifst->_fst), __pyx_v_tfst.get(), (*__pyx_v_opts));

  /* "pywrapfst.pyx":3438
 *                                         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_9pywrapfst__init_MutableFst(__pyx_v_tfst.release())); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3438, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_r = ((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_t_4);
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":3383
 * 
 * 
 * cpdef _MutableFst determinize(_Fst ifst,             # <<<<<<<<<<<<<<
 *                               float delta=fst.kShortestDelta,
 *                               det_type=b"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_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("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_9pywrapfst_23determinize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9pywrapfst_22determinize[] = "\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\n  See also: `disambiguate`, `rmepsilon`.\n  ";
static PyObject *__pyx_pw_9pywrapfst_23determinize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst = 0;
  float __pyx_v_delta;
  PyObject *__pyx_v_det_type = 0;
  __pyx_t_10basictypes_int64 __pyx_v_nstate;
  __pyx_t_10basictypes_int64 __pyx_v_subsequential_label;
  PyObject *__pyx_v_weight = 0;
  bool __pyx_v_increment_subsequential_label;
  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_b_functional);

    /* "pywrapfst.pyx":3388
 *                               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] = PyDict_GetItem(__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 = PyDict_GetItem(__pyx_kwds, __pyx_n_s_delta);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_det_type);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nstate);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_subsequential_label);
          if (value) { values[4] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_weight);
          if (value) { values[5] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__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, 3383, __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_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, 3384, __pyx_L3_error)
    } else {
      __pyx_v_delta = __pyx_k__69;
    }
    __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_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3386, __pyx_L3_error)
    } else {
      __pyx_v_nstate = __pyx_k__70;
    }
    if (values[4]) {
      __pyx_v_subsequential_label = __Pyx_PyInt_As_int64_t(values[4]); if (unlikely((__pyx_v_subsequential_label == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3387, __pyx_L3_error)
    } else {
      __pyx_v_subsequential_label = ((__pyx_t_10basictypes_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, 3389, __pyx_L3_error)
    } else {

      /* "pywrapfst.pyx":3389
 *                               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, 3383, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("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_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 3383, __pyx_L1_error)
  __pyx_r = __pyx_pf_9pywrapfst_22determinize(__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);

  /* "pywrapfst.pyx":3383
 * 
 * 
 * cpdef _MutableFst determinize(_Fst ifst,             # <<<<<<<<<<<<<<
 *                               float delta=fst.kShortestDelta,
 *                               det_type=b"functional",
 */

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

static PyObject *__pyx_pf_9pywrapfst_22determinize(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst, float __pyx_v_delta, PyObject *__pyx_v_det_type, __pyx_t_10basictypes_int64 __pyx_v_nstate, __pyx_t_10basictypes_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_9pywrapfst_determinize __pyx_t_2;
  __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_9pywrapfst_determinize(__pyx_v_ifst, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3383, __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("pywrapfst.determinize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":3441
 * 
 * 
 * cpdef _MutableFst difference(_Fst ifst1,             # <<<<<<<<<<<<<<
 *                              _Fst ifst2,
 *                              compose_filter=b"auto",
 */

static PyObject *__pyx_pw_9pywrapfst_25difference(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_difference(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst1, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst2, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_difference *__pyx_optional_args) {
  PyObject *__pyx_v_compose_filter = ((PyObject *)__pyx_n_b_auto);

  /* "pywrapfst.pyx":3444
 *                              _Fst ifst2,
 *                              compose_filter=b"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_9pywrapfst__MutableFst *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  enum fst::ComposeFilter __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __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;
      }
    }
  }

  /* "pywrapfst.pyx":3468
 *   """
 *   cdef unique_ptr[fst.VectorFstClass] tfst
 *   tfst.reset(new fst.VectorFstClass(ifst1.arc_type()))             # <<<<<<<<<<<<<<
 *   cdef unique_ptr[fst.ComposeOptions] opts
 *   opts.reset(new fst.ComposeOptions(connect, _get_compose_filter(
 */
  if (unlikely(((PyObject *)__pyx_v_ifst1) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "arc_type");
    __PYX_ERR(0, 3468, __pyx_L1_error)
  }
  __pyx_v_tfst.reset(new fst::script::VectorFstClass(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_ifst1->__pyx_vtab)->arc_type(__pyx_v_ifst1, 0)));

  /* "pywrapfst.pyx":3471
 *   cdef unique_ptr[fst.ComposeOptions] opts
 *   opts.reset(new fst.ComposeOptions(connect, _get_compose_filter(
 *       tostring(compose_filter))))             # <<<<<<<<<<<<<<
 *   fst.Difference(deref(ifst1._fst), deref(ifst2._fst), tfst.get(), deref(opts))
 *   return _init_MutableFst(tfst.release())
 */
  __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_compose_filter, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3471, __pyx_L1_error)

  /* "pywrapfst.pyx":3470
 *   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))))
 *   fst.Difference(deref(ifst1._fst), deref(ifst2._fst), tfst.get(), deref(opts))
 */
  __pyx_t_2 = __pyx_f_9pywrapfst__get_compose_filter(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3470, __pyx_L1_error)
  __pyx_v_opts.reset(new fst::ComposeOptions(__pyx_v_connect, __pyx_t_2));

  /* "pywrapfst.pyx":3472
 *   opts.reset(new fst.ComposeOptions(connect, _get_compose_filter(
 *       tostring(compose_filter))))
 *   fst.Difference(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, 3472, __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, 3472, __pyx_L1_error)
  }
  fst::script::Difference((*__pyx_v_ifst1->_fst), (*__pyx_v_ifst2->_fst), __pyx_v_tfst.get(), (*__pyx_v_opts));

  /* "pywrapfst.pyx":3473
 *       tostring(compose_filter))))
 *   fst.Difference(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_9pywrapfst__init_MutableFst(__pyx_v_tfst.release())); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3473, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = ((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":3441
 * 
 * 
 * cpdef _MutableFst difference(_Fst ifst1,             # <<<<<<<<<<<<<<
 *                              _Fst ifst2,
 *                              compose_filter=b"auto",
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("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_9pywrapfst_25difference(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9pywrapfst_24difference[] = "\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\", \"null\", \"sequence\", \"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_9pywrapfst_25difference(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst1 = 0;
  struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst2 = 0;
  PyObject *__pyx_v_compose_filter = 0;
  bool __pyx_v_connect;
  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_b_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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ifst1)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ifst2)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("difference", 0, 2, 4, 1); __PYX_ERR(0, 3441, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_compose_filter);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__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, 3441, __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_9pywrapfst__Fst *)values[0]);
    __pyx_v_ifst2 = ((struct __pyx_obj_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, 3444, __pyx_L3_error)
    } else {

      /* "pywrapfst.pyx":3444
 *                              _Fst ifst2,
 *                              compose_filter=b"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, 3441, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("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_9pywrapfst__Fst, 1, "ifst1", 0))) __PYX_ERR(0, 3441, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst2), __pyx_ptype_9pywrapfst__Fst, 1, "ifst2", 0))) __PYX_ERR(0, 3442, __pyx_L1_error)
  __pyx_r = __pyx_pf_9pywrapfst_24difference(__pyx_self, __pyx_v_ifst1, __pyx_v_ifst2, __pyx_v_compose_filter, __pyx_v_connect);

  /* "pywrapfst.pyx":3441
 * 
 * 
 * cpdef _MutableFst difference(_Fst ifst1,             # <<<<<<<<<<<<<<
 *                              _Fst ifst2,
 *                              compose_filter=b"auto",
 */

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

static PyObject *__pyx_pf_9pywrapfst_24difference(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst1, struct __pyx_obj_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_9pywrapfst_difference __pyx_t_2;
  __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_9pywrapfst_difference(__pyx_v_ifst1, __pyx_v_ifst2, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3441, __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("pywrapfst.difference", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":3476
 * 
 * 
 * cpdef _MutableFst disambiguate(_Fst ifst,             # <<<<<<<<<<<<<<
 *                                float delta=fst.kDelta,
 *                                int64 nstate=fst.kNoStateId,
 */

static PyObject *__pyx_pw_9pywrapfst_27disambiguate(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_disambiguate(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_disambiguate *__pyx_optional_args) {
  float __pyx_v_delta = __pyx_k__71;
  __pyx_t_10basictypes_int64 __pyx_v_nstate = __pyx_k__72;
  __pyx_t_10basictypes_int64 __pyx_v_subsequential_label = ((__pyx_t_10basictypes_int64)0);

  /* "pywrapfst.pyx":3480
 *                                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_wc;
  std::unique_ptr<fst::script::DisambiguateOptions>  __pyx_v_opts;
  struct __pyx_obj_9pywrapfst__MutableFst *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  fst::script::WeightClass __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __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;
          }
        }
      }
    }
  }

  /* "pywrapfst.pyx":3507
 *   """
 *   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 wc = _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, 3507, __pyx_L1_error)
  }
  __pyx_v_tfst.reset(new fst::script::VectorFstClass(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_ifst->__pyx_vtab)->arc_type(__pyx_v_ifst, 0)));

  /* "pywrapfst.pyx":3509
 *   tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
 *   # Threshold is set to semiring Zero (no pruning) if no weight is specified.
 *   cdef fst.WeightClass wc = _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, 3509, __pyx_L1_error)
  }

  /* "pywrapfst.pyx":3510
 *   # Threshold is set to semiring Zero (no pruning) if no weight is specified.
 *   cdef fst.WeightClass wc = _get_WeightClass_or_Zero(ifst.weight_type(),
 *                                                      weight)             # <<<<<<<<<<<<<<
 *   cdef unique_ptr[fst.DisambiguateOptions] opts
 *   opts.reset(new fst.DisambiguateOptions(delta, wc, nstate,
 */
  __pyx_t_1 = __pyx_f_9pywrapfst__get_WeightClass_or_Zero(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_ifst->__pyx_vtab)->weight_type(__pyx_v_ifst, 0), __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3509, __pyx_L1_error)
  __pyx_v_wc = __pyx_t_1;

  /* "pywrapfst.pyx":3512
 *                                                      weight)
 *   cdef unique_ptr[fst.DisambiguateOptions] opts
 *   opts.reset(new fst.DisambiguateOptions(delta, wc, nstate,             # <<<<<<<<<<<<<<
 *                                          subsequential_label))
 *   fst.Disambiguate(deref(ifst._fst), tfst.get(), deref(opts))
 */
  __pyx_v_opts.reset(new fst::script::DisambiguateOptions(__pyx_v_delta, __pyx_v_wc, __pyx_v_nstate, __pyx_v_subsequential_label));

  /* "pywrapfst.pyx":3514
 *   opts.reset(new fst.DisambiguateOptions(delta, wc, 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, 3514, __pyx_L1_error)
  }
  fst::script::Disambiguate((*__pyx_v_ifst->_fst), __pyx_v_tfst.get(), (*__pyx_v_opts));

  /* "pywrapfst.pyx":3515
 *                                          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_9pywrapfst__init_MutableFst(__pyx_v_tfst.release())); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3515, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = ((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":3476
 * 
 * 
 * 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("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_9pywrapfst_27disambiguate(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9pywrapfst_26disambiguate[] = "\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\n  See also: `determinize`, `rmepsilon`.\n  ";
static PyObject *__pyx_pw_9pywrapfst_27disambiguate(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst = 0;
  float __pyx_v_delta;
  __pyx_t_10basictypes_int64 __pyx_v_nstate;
  __pyx_t_10basictypes_int64 __pyx_v_subsequential_label;
  PyObject *__pyx_v_weight = 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};

    /* "pywrapfst.pyx":3480
 *                                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] = PyDict_GetItem(__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 = PyDict_GetItem(__pyx_kwds, __pyx_n_s_delta);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nstate);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_subsequential_label);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__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, 3476, __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_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, 3477, __pyx_L3_error)
    } else {
      __pyx_v_delta = __pyx_k__71;
    }
    if (values[2]) {
      __pyx_v_nstate = __Pyx_PyInt_As_int64_t(values[2]); if (unlikely((__pyx_v_nstate == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3478, __pyx_L3_error)
    } else {
      __pyx_v_nstate = __pyx_k__72;
    }
    if (values[3]) {
      __pyx_v_subsequential_label = __Pyx_PyInt_As_int64_t(values[3]); if (unlikely((__pyx_v_subsequential_label == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3479, __pyx_L3_error)
    } else {
      __pyx_v_subsequential_label = ((__pyx_t_10basictypes_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, 3476, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("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_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 3476, __pyx_L1_error)
  __pyx_r = __pyx_pf_9pywrapfst_26disambiguate(__pyx_self, __pyx_v_ifst, __pyx_v_delta, __pyx_v_nstate, __pyx_v_subsequential_label, __pyx_v_weight);

  /* "pywrapfst.pyx":3476
 * 
 * 
 * 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_9pywrapfst_26disambiguate(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst, float __pyx_v_delta, __pyx_t_10basictypes_int64 __pyx_v_nstate, __pyx_t_10basictypes_int64 __pyx_v_subsequential_label, PyObject *__pyx_v_weight) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_9pywrapfst_disambiguate __pyx_t_2;
  __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_9pywrapfst_disambiguate(__pyx_v_ifst, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3476, __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("pywrapfst.disambiguate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":3518
 * 
 * 
 * cpdef _MutableFst epsnormalize(_Fst ifst, bool eps_norm_output=False):             # <<<<<<<<<<<<<<
 *   """
 *   epsnormalize(ifst, eps_norm_output=False)
 */

static PyObject *__pyx_pw_9pywrapfst_29epsnormalize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_epsnormalize(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_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_9pywrapfst__MutableFst *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  enum fst::EpsNormalizeType __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __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;
    }
  }

  /* "pywrapfst.pyx":3541
 *   """
 *   cdef unique_ptr[fst.VectorFstClass] tfst
 *   tfst.reset(new fst.VectorFstClass(ifst.arc_type()))             # <<<<<<<<<<<<<<
 *   fst.EpsNormalize(deref(ifst._fst), tfst.get(), fst.EPS_NORM_OUTPUT if
 *                                                  eps_norm_output else
 */
  if (unlikely(((PyObject *)__pyx_v_ifst) == 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_9pywrapfst__Fst *)__pyx_v_ifst->__pyx_vtab)->arc_type(__pyx_v_ifst, 0)));

  /* "pywrapfst.pyx":3542
 *   cdef unique_ptr[fst.VectorFstClass] tfst
 *   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, 3542, __pyx_L1_error)
  }

  /* "pywrapfst.pyx":3543
 *   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)
 *   return _init_MutableFst(tfst.release())
 */
  if ((__pyx_v_eps_norm_output != 0)) {

    /* "pywrapfst.pyx":3542
 *   cdef unique_ptr[fst.VectorFstClass] tfst
 *   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)
 */
    __pyx_t_1 = fst::EPS_NORM_OUTPUT;
  } else {

    /* "pywrapfst.pyx":3544
 *   fst.EpsNormalize(deref(ifst._fst), tfst.get(), fst.EPS_NORM_OUTPUT if
 *                                                  eps_norm_output else
 *                                                  fst.EPS_NORM_INPUT)             # <<<<<<<<<<<<<<
 *   return _init_MutableFst(tfst.release())
 * 
 */
    __pyx_t_1 = fst::EPS_NORM_INPUT;
  }

  /* "pywrapfst.pyx":3542
 *   cdef unique_ptr[fst.VectorFstClass] tfst
 *   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)
 */
  fst::script::EpsNormalize((*__pyx_v_ifst->_fst), __pyx_v_tfst.get(), __pyx_t_1);

  /* "pywrapfst.pyx":3545
 *                                                  eps_norm_output else
 *                                                  fst.EPS_NORM_INPUT)
 *   return _init_MutableFst(tfst.release())             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_2 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst.release())); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3545, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = ((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":3518
 * 
 * 
 * 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("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_9pywrapfst_29epsnormalize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9pywrapfst_28epsnormalize[] = "\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\n  See also: `rmepsilon`.\n  ";
static PyObject *__pyx_pw_9pywrapfst_29epsnormalize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst = 0;
  bool __pyx_v_eps_norm_output;
  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] = PyDict_GetItem(__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 = PyDict_GetItem(__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, 3518, __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_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, 3518, __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, 3518, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("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_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 3518, __pyx_L1_error)
  __pyx_r = __pyx_pf_9pywrapfst_28epsnormalize(__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_9pywrapfst_28epsnormalize(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_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_9pywrapfst_epsnormalize __pyx_t_2;
  __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_9pywrapfst_epsnormalize(__pyx_v_ifst, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3518, __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("pywrapfst.epsnormalize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":3548
 * 
 * 
 * cpdef bool equal(_Fst ifst1, _Fst ifst2, float delta=fst.kDelta):             # <<<<<<<<<<<<<<
 *   """
 *   equal(ifst1, ifst2, delta=0.0009765625)
 */

static PyObject *__pyx_pw_9pywrapfst_31equal(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static bool __pyx_f_9pywrapfst_equal(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst1, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst2, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_equal *__pyx_optional_args) {
  float __pyx_v_delta = __pyx_k__73;
  bool __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("equal", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_delta = __pyx_optional_args->delta;
    }
  }

  /* "pywrapfst.pyx":3568
 *   See also: `equivalent`, `isomorphic`, `randequivalent`.
 *   """
 *   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, 3568, __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, 3568, __pyx_L1_error)
  }
  __pyx_r = fst::script::Equal((*__pyx_v_ifst1->_fst), (*__pyx_v_ifst2->_fst), __pyx_v_delta);
  goto __pyx_L0;

  /* "pywrapfst.pyx":3548
 * 
 * 
 * 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("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_9pywrapfst_31equal(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9pywrapfst_30equal[] = "\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\n  See also: `equivalent`, `isomorphic`, `randequivalent`.\n  ";
static PyObject *__pyx_pw_9pywrapfst_31equal(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst1 = 0;
  struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst2 = 0;
  float __pyx_v_delta;
  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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ifst1)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ifst2)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("equal", 0, 2, 3, 1); __PYX_ERR(0, 3548, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__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, 3548, __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_9pywrapfst__Fst *)values[0]);
    __pyx_v_ifst2 = ((struct __pyx_obj_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, 3548, __pyx_L3_error)
    } else {
      __pyx_v_delta = __pyx_k__73;
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("equal", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3548, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("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_9pywrapfst__Fst, 1, "ifst1", 0))) __PYX_ERR(0, 3548, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst2), __pyx_ptype_9pywrapfst__Fst, 1, "ifst2", 0))) __PYX_ERR(0, 3548, __pyx_L1_error)
  __pyx_r = __pyx_pf_9pywrapfst_30equal(__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_9pywrapfst_30equal(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst1, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst2, float __pyx_v_delta) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  bool __pyx_t_1;
  struct __pyx_opt_args_9pywrapfst_equal __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __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_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, 3548, __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("pywrapfst.equal", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":3571
 * 
 * 
 * cpdef bool equivalent(_Fst ifst1, _Fst ifst2, float delta=fst.kDelta) except *:             # <<<<<<<<<<<<<<
 *   """
 *   equivalent(ifst1, ifst2, delta=0.0009765625)
 */

static PyObject *__pyx_pw_9pywrapfst_33equivalent(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static bool __pyx_f_9pywrapfst_equivalent(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst1, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst2, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_equivalent *__pyx_optional_args) {
  float __pyx_v_delta = __pyx_k__74;
  bool __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("equivalent", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_delta = __pyx_optional_args->delta;
    }
  }

  /* "pywrapfst.pyx":3591
 *   See also: `equal`, `isomorphic`, `randequivalent`.
 *   """
 *   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, 3591, __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, 3591, __pyx_L1_error)
  }
  __pyx_r = fst::script::Equivalent((*__pyx_v_ifst1->_fst), (*__pyx_v_ifst2->_fst), __pyx_v_delta);
  goto __pyx_L0;

  /* "pywrapfst.pyx":3571
 * 
 * 
 * cpdef bool equivalent(_Fst ifst1, _Fst ifst2, float delta=fst.kDelta) except *:             # <<<<<<<<<<<<<<
 *   """
 *   equivalent(ifst1, ifst2, delta=0.0009765625)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pywrapfst.equivalent", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_33equivalent(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9pywrapfst_32equivalent[] = "\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\n  See also: `equal`, `isomorphic`, `randequivalent`.\n  ";
static PyObject *__pyx_pw_9pywrapfst_33equivalent(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst1 = 0;
  struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst2 = 0;
  float __pyx_v_delta;
  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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ifst1)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ifst2)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("equivalent", 0, 2, 3, 1); __PYX_ERR(0, 3571, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__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, 3571, __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_9pywrapfst__Fst *)values[0]);
    __pyx_v_ifst2 = ((struct __pyx_obj_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, 3571, __pyx_L3_error)
    } else {
      __pyx_v_delta = __pyx_k__74;
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("equivalent", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3571, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("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_9pywrapfst__Fst, 1, "ifst1", 0))) __PYX_ERR(0, 3571, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst2), __pyx_ptype_9pywrapfst__Fst, 1, "ifst2", 0))) __PYX_ERR(0, 3571, __pyx_L1_error)
  __pyx_r = __pyx_pf_9pywrapfst_32equivalent(__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_9pywrapfst_32equivalent(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst1, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst2, float __pyx_v_delta) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  bool __pyx_t_1;
  struct __pyx_opt_args_9pywrapfst_equivalent __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __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_9pywrapfst_equivalent(__pyx_v_ifst1, __pyx_v_ifst2, 0, &__pyx_t_2); if (unlikely(__pyx_t_1 == ((bool)-1) && PyErr_Occurred())) __PYX_ERR(0, 3571, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3571, __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("pywrapfst.equivalent", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":3594
 * 
 * 
 * cpdef _MutableFst intersect(_Fst ifst1,             # <<<<<<<<<<<<<<
 *                             _Fst ifst2,
 *                             compose_filter=b"auto",
 */

static PyObject *__pyx_pw_9pywrapfst_35intersect(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_intersect(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst1, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst2, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_intersect *__pyx_optional_args) {
  PyObject *__pyx_v_compose_filter = ((PyObject *)__pyx_n_b_auto);

  /* "pywrapfst.pyx":3597
 *                             _Fst ifst2,
 *                             compose_filter=b"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_9pywrapfst__MutableFst *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  enum fst::ComposeFilter __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __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;
      }
    }
  }

  /* "pywrapfst.pyx":3619
 *   """
 *   cdef unique_ptr[fst.VectorFstClass] tfst
 *   tfst.reset(new fst.VectorFstClass(ifst1.arc_type()))             # <<<<<<<<<<<<<<
 *   cdef unique_ptr[fst.ComposeOptions] opts
 *   opts.reset(new fst.ComposeOptions(connect,
 */
  if (unlikely(((PyObject *)__pyx_v_ifst1) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "arc_type");
    __PYX_ERR(0, 3619, __pyx_L1_error)
  }
  __pyx_v_tfst.reset(new fst::script::VectorFstClass(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_ifst1->__pyx_vtab)->arc_type(__pyx_v_ifst1, 0)));

  /* "pywrapfst.pyx":3622
 *   cdef unique_ptr[fst.ComposeOptions] opts
 *   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_9pywrapfst_tostring(__pyx_v_compose_filter, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3622, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_9pywrapfst__get_compose_filter(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3622, __pyx_L1_error)

  /* "pywrapfst.pyx":3621
 *   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))))
 *   fst.Intersect(deref(ifst1._fst), deref(ifst2._fst), tfst.get(), deref(opts))
 */
  __pyx_v_opts.reset(new fst::ComposeOptions(__pyx_v_connect, __pyx_t_2));

  /* "pywrapfst.pyx":3623
 *   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())
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_ifst1) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 3623, __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, 3623, __pyx_L1_error)
  }
  fst::script::Intersect((*__pyx_v_ifst1->_fst), (*__pyx_v_ifst2->_fst), __pyx_v_tfst.get(), (*__pyx_v_opts));

  /* "pywrapfst.pyx":3624
 *         _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_9pywrapfst__init_MutableFst(__pyx_v_tfst.release())); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3624, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = ((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":3594
 * 
 * 
 * cpdef _MutableFst intersect(_Fst ifst1,             # <<<<<<<<<<<<<<
 *                             _Fst ifst2,
 *                             compose_filter=b"auto",
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("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_9pywrapfst_35intersect(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9pywrapfst_34intersect[] = "\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\", \"null\", \"sequence\", \"trivial\".\n    connect: Should output be trimmed?\n\n  Returns:\n    An intersected FST.\n  ";
static PyObject *__pyx_pw_9pywrapfst_35intersect(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst1 = 0;
  struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst2 = 0;
  PyObject *__pyx_v_compose_filter = 0;
  bool __pyx_v_connect;
  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_b_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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ifst1)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ifst2)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("intersect", 0, 2, 4, 1); __PYX_ERR(0, 3594, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_compose_filter);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__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, 3594, __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_9pywrapfst__Fst *)values[0]);
    __pyx_v_ifst2 = ((struct __pyx_obj_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, 3597, __pyx_L3_error)
    } else {

      /* "pywrapfst.pyx":3597
 *                             _Fst ifst2,
 *                             compose_filter=b"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, 3594, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("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_9pywrapfst__Fst, 1, "ifst1", 0))) __PYX_ERR(0, 3594, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst2), __pyx_ptype_9pywrapfst__Fst, 1, "ifst2", 0))) __PYX_ERR(0, 3595, __pyx_L1_error)
  __pyx_r = __pyx_pf_9pywrapfst_34intersect(__pyx_self, __pyx_v_ifst1, __pyx_v_ifst2, __pyx_v_compose_filter, __pyx_v_connect);

  /* "pywrapfst.pyx":3594
 * 
 * 
 * cpdef _MutableFst intersect(_Fst ifst1,             # <<<<<<<<<<<<<<
 *                             _Fst ifst2,
 *                             compose_filter=b"auto",
 */

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

static PyObject *__pyx_pf_9pywrapfst_34intersect(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst1, struct __pyx_obj_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_9pywrapfst_intersect __pyx_t_2;
  __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_9pywrapfst_intersect(__pyx_v_ifst1, __pyx_v_ifst2, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3594, __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("pywrapfst.intersect", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":3627
 * 
 * 
 * cpdef bool isomorphic(_Fst ifst1, _Fst ifst2, float delta=fst.kDelta):             # <<<<<<<<<<<<<<
 *   """
 *   isomorphic(ifst1, ifst2, delta=0.0009765625)
 */

static PyObject *__pyx_pw_9pywrapfst_37isomorphic(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static bool __pyx_f_9pywrapfst_isomorphic(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst1, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst2, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_isomorphic *__pyx_optional_args) {
  float __pyx_v_delta = __pyx_k__75;
  bool __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("isomorphic", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_delta = __pyx_optional_args->delta;
    }
  }

  /* "pywrapfst.pyx":3650
 *   See also: `equal`, `equivalent`, `randequivalent`.
 *   """
 *   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, 3650, __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, 3650, __pyx_L1_error)
  }
  __pyx_r = fst::script::Isomorphic((*__pyx_v_ifst1->_fst), (*__pyx_v_ifst2->_fst), __pyx_v_delta);
  goto __pyx_L0;

  /* "pywrapfst.pyx":3627
 * 
 * 
 * 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("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_9pywrapfst_37isomorphic(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9pywrapfst_36isomorphic[] = "\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\n  See also: `equal`, `equivalent`, `randequivalent`.\n  ";
static PyObject *__pyx_pw_9pywrapfst_37isomorphic(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst1 = 0;
  struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst2 = 0;
  float __pyx_v_delta;
  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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ifst1)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ifst2)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("isomorphic", 0, 2, 3, 1); __PYX_ERR(0, 3627, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__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, 3627, __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_9pywrapfst__Fst *)values[0]);
    __pyx_v_ifst2 = ((struct __pyx_obj_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, 3627, __pyx_L3_error)
    } else {
      __pyx_v_delta = __pyx_k__75;
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("isomorphic", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3627, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("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_9pywrapfst__Fst, 1, "ifst1", 0))) __PYX_ERR(0, 3627, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst2), __pyx_ptype_9pywrapfst__Fst, 1, "ifst2", 0))) __PYX_ERR(0, 3627, __pyx_L1_error)
  __pyx_r = __pyx_pf_9pywrapfst_36isomorphic(__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_9pywrapfst_36isomorphic(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst1, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst2, float __pyx_v_delta) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  bool __pyx_t_1;
  struct __pyx_opt_args_9pywrapfst_isomorphic __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __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_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, 3627, __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("pywrapfst.isomorphic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":3653
 * 
 * 
 * cpdef _MutableFst prune(_Fst ifst,             # <<<<<<<<<<<<<<
 *                         float delta=fst.kDelta,
 *                         int64 nstate=fst.kNoStateId,
 */

static PyObject *__pyx_pw_9pywrapfst_39prune(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_prune(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_prune *__pyx_optional_args) {
  float __pyx_v_delta = __pyx_k__76;
  __pyx_t_10basictypes_int64 __pyx_v_nstate = __pyx_k__77;

  /* "pywrapfst.pyx":3656
 *                         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_wc;
  struct __pyx_obj_9pywrapfst__MutableFst *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  fst::script::WeightClass __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __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;
        }
      }
    }
  }

  /* "pywrapfst.pyx":3680
 *   """
 *   cdef unique_ptr[fst.VectorFstClass] tfst
 *   tfst.reset(new fst.VectorFstClass(ifst.arc_type()))             # <<<<<<<<<<<<<<
 *   cdef fst.WeightClass wc = _get_WeightClass_or_Zero(ifst.weight_type(), weight)
 *   fst.Prune(deref(ifst._fst), tfst.get(), wc, nstate, delta)
 */
  if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "arc_type");
    __PYX_ERR(0, 3680, __pyx_L1_error)
  }
  __pyx_v_tfst.reset(new fst::script::VectorFstClass(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_ifst->__pyx_vtab)->arc_type(__pyx_v_ifst, 0)));

  /* "pywrapfst.pyx":3681
 *   cdef unique_ptr[fst.VectorFstClass] tfst
 *   tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
 *   cdef fst.WeightClass wc = _get_WeightClass_or_Zero(ifst.weight_type(), weight)             # <<<<<<<<<<<<<<
 *   fst.Prune(deref(ifst._fst), tfst.get(), wc, 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'", "weight_type");
    __PYX_ERR(0, 3681, __pyx_L1_error)
  }
  __pyx_t_1 = __pyx_f_9pywrapfst__get_WeightClass_or_Zero(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_ifst->__pyx_vtab)->weight_type(__pyx_v_ifst, 0), __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3681, __pyx_L1_error)
  __pyx_v_wc = __pyx_t_1;

  /* "pywrapfst.pyx":3682
 *   tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
 *   cdef fst.WeightClass wc = _get_WeightClass_or_Zero(ifst.weight_type(), weight)
 *   fst.Prune(deref(ifst._fst), tfst.get(), wc, 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, 3682, __pyx_L1_error)
  }
  fst::script::Prune((*__pyx_v_ifst->_fst), __pyx_v_tfst.get(), __pyx_v_wc, __pyx_v_nstate, __pyx_v_delta);

  /* "pywrapfst.pyx":3683
 *   cdef fst.WeightClass wc = _get_WeightClass_or_Zero(ifst.weight_type(), weight)
 *   fst.Prune(deref(ifst._fst), tfst.get(), wc, nstate, delta)
 *   return _init_MutableFst(tfst.release())             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_2 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst.release())); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3683, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = ((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":3653
 * 
 * 
 * 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("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_9pywrapfst_39prune(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9pywrapfst_38prune[] = "\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\n  See also: The destructive variant.\n  ";
static PyObject *__pyx_pw_9pywrapfst_39prune(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst = 0;
  float __pyx_v_delta;
  __pyx_t_10basictypes_int64 __pyx_v_nstate;
  PyObject *__pyx_v_weight = 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};

    /* "pywrapfst.pyx":3656
 *                         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] = PyDict_GetItem(__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 = PyDict_GetItem(__pyx_kwds, __pyx_n_s_delta);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nstate);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__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, 3653, __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_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, 3654, __pyx_L3_error)
    } else {
      __pyx_v_delta = __pyx_k__76;
    }
    if (values[2]) {
      __pyx_v_nstate = __Pyx_PyInt_As_int64_t(values[2]); if (unlikely((__pyx_v_nstate == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3655, __pyx_L3_error)
    } else {
      __pyx_v_nstate = __pyx_k__77;
    }
    __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, 3653, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("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_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 3653, __pyx_L1_error)
  __pyx_r = __pyx_pf_9pywrapfst_38prune(__pyx_self, __pyx_v_ifst, __pyx_v_delta, __pyx_v_nstate, __pyx_v_weight);

  /* "pywrapfst.pyx":3653
 * 
 * 
 * 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_9pywrapfst_38prune(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst, float __pyx_v_delta, __pyx_t_10basictypes_int64 __pyx_v_nstate, PyObject *__pyx_v_weight) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_9pywrapfst_prune __pyx_t_2;
  __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_9pywrapfst_prune(__pyx_v_ifst, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3653, __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("pywrapfst.prune", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":3686
 * 
 * 
 * cpdef _MutableFst push(_Fst ifst,             # <<<<<<<<<<<<<<
 *                        float delta=fst.kDelta,
 *                        bool push_weights=False,
 */

static PyObject *__pyx_pw_9pywrapfst_41push(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_push(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_push *__pyx_optional_args) {
  float __pyx_v_delta = __pyx_k__78;

  /* "pywrapfst.pyx":3688
 * 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);

  /* "pywrapfst.pyx":3689
 *                        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);

  /* "pywrapfst.pyx":3690
 *                        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);

  /* "pywrapfst.pyx":3691
 *                        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);

  /* "pywrapfst.pyx":3692
 *                        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;
  __pyx_t_10basictypes_uint32 __pyx_v_flags;
  struct __pyx_obj_9pywrapfst__MutableFst *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __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;
              }
            }
          }
        }
      }
    }
  }

  /* "pywrapfst.pyx":3732
 *   # This is copied, almost verbatim, from nlp/fst/bin/fstpush.cc.
 *   cdef unique_ptr[fst.VectorFstClass] tfst
 *   tfst.reset(new fst.VectorFstClass(ifst.arc_type()))             # <<<<<<<<<<<<<<
 *   cdef uint32 flags = fst.GetPushFlags(push_weights, push_labels,
 *                                        remove_common_affix, remove_total_weight)
 */
  if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "arc_type");
    __PYX_ERR(0, 3732, __pyx_L1_error)
  }
  __pyx_v_tfst.reset(new fst::script::VectorFstClass(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_ifst->__pyx_vtab)->arc_type(__pyx_v_ifst, 0)));

  /* "pywrapfst.pyx":3733
 *   cdef unique_ptr[fst.VectorFstClass] tfst
 *   tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
 *   cdef uint32 flags = fst.GetPushFlags(push_weights, push_labels,             # <<<<<<<<<<<<<<
 *                                        remove_common_affix, remove_total_weight)
 *   fst.Push(deref(ifst._fst), tfst.get(), flags, fst.GetReweightType(to_final),
 */
  __pyx_v_flags = fst::script::GetPushFlags(__pyx_v_push_weights, __pyx_v_push_labels, __pyx_v_remove_common_affix, __pyx_v_remove_total_weight);

  /* "pywrapfst.pyx":3735
 *   cdef uint32 flags = fst.GetPushFlags(push_weights, push_labels,
 *                                        remove_common_affix, remove_total_weight)
 *   fst.Push(deref(ifst._fst), tfst.get(), flags, fst.GetReweightType(to_final),             # <<<<<<<<<<<<<<
 *            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, 3735, __pyx_L1_error)
  }

  /* "pywrapfst.pyx":3736
 *                                        remove_common_affix, remove_total_weight)
 *   fst.Push(deref(ifst._fst), tfst.get(), 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);

  /* "pywrapfst.pyx":3737
 *   fst.Push(deref(ifst._fst), tfst.get(), flags, fst.GetReweightType(to_final),
 *            delta)
 *   return _init_MutableFst(tfst.release())             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst.release())); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3737, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":3686
 * 
 * 
 * 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("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_9pywrapfst_41push(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9pywrapfst_40push[] = "\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\n  See also: The destructive variant.\n  ";
static PyObject *__pyx_pw_9pywrapfst_41push(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_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;
  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] = PyDict_GetItem(__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 = PyDict_GetItem(__pyx_kwds, __pyx_n_s_delta);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_push_weights);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_push_labels);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__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 = PyDict_GetItem(__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 = PyDict_GetItem(__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, 3686, __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_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, 3687, __pyx_L3_error)
    } else {
      __pyx_v_delta = __pyx_k__78;
    }
    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, 3688, __pyx_L3_error)
    } else {

      /* "pywrapfst.pyx":3688
 * 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, 3689, __pyx_L3_error)
    } else {

      /* "pywrapfst.pyx":3689
 *                        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, 3690, __pyx_L3_error)
    } else {

      /* "pywrapfst.pyx":3690
 *                        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, 3691, __pyx_L3_error)
    } else {

      /* "pywrapfst.pyx":3691
 *                        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, 3692, __pyx_L3_error)
    } else {

      /* "pywrapfst.pyx":3692
 *                        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, 3686, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("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_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 3686, __pyx_L1_error)
  __pyx_r = __pyx_pf_9pywrapfst_40push(__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);

  /* "pywrapfst.pyx":3686
 * 
 * 
 * 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_9pywrapfst_40push(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_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_9pywrapfst_push __pyx_t_2;
  __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_9pywrapfst_push(__pyx_v_ifst, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3686, __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("pywrapfst.push", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":3740
 * 
 * 
 * cpdef bool randequivalent(_Fst ifst1,             # <<<<<<<<<<<<<<
 *                           _Fst ifst2,
 *                           int32 npath=1,
 */

static PyObject *__pyx_pw_9pywrapfst_43randequivalent(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static bool __pyx_f_9pywrapfst_randequivalent(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst1, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst2, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_randequivalent *__pyx_optional_args) {
  __pyx_t_10basictypes_int32 __pyx_v_npath = ((__pyx_t_10basictypes_int32)1);
  float __pyx_v_delta = __pyx_k__79;
  time_t __pyx_v_seed = ((time_t)0);
  PyObject *__pyx_v_select = ((PyObject *)__pyx_n_b_uniform);
  __pyx_t_10basictypes_int32 __pyx_v_max_length = __pyx_k__80;
  enum fst::script::RandArcSelection __pyx_v_ras;
  std::unique_ptr<fst::RandGenOptions<enum fst::script::RandArcSelection> >  __pyx_v_opts;
  bool __pyx_r;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  enum fst::script::RandArcSelection __pyx_t_2;
  int __pyx_t_3;
  __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_seed = __pyx_optional_args->seed;
          if (__pyx_optional_args->__pyx_n > 3) {
            __pyx_v_select = __pyx_optional_args->select;
            if (__pyx_optional_args->__pyx_n > 4) {
              __pyx_v_max_length = __pyx_optional_args->max_length;
            }
          }
        }
      }
    }
  }

  /* "pywrapfst.pyx":3775
 *   See also: `equal`, `equivalent`, `isomorphic`, `randgen`.
 *   """
 *   cdef fst.RandArcSelection ras = _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_9pywrapfst_tostring(__pyx_v_select, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3775, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_9pywrapfst__get_rand_arc_selection(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3775, __pyx_L1_error)
  __pyx_v_ras = __pyx_t_2;

  /* "pywrapfst.pyx":3778
 *   cdef unique_ptr[fst.RandGenOptions[fst.RandArcSelection]] opts
 *   # The three trailing options will be ignored by RandEquivalent.
 *   opts.reset(new fst.RandGenOptions[fst.RandArcSelection](ras, max_length,             # <<<<<<<<<<<<<<
 *                                                           1, False, False))
 *   if seed == 0:
 */
  __pyx_v_opts.reset(new fst::RandGenOptions<enum fst::script::RandArcSelection> (__pyx_v_ras, __pyx_v_max_length, 1, 0, 0));

  /* "pywrapfst.pyx":3780
 *   opts.reset(new fst.RandGenOptions[fst.RandArcSelection](ras, max_length,
 *                                                           1, False, False))
 *   if seed == 0:             # <<<<<<<<<<<<<<
 *     seed = time(NULL) + getpid()
 *   return fst.RandEquivalent(deref(ifst1._fst), deref(ifst2._fst), npath, delta,
 */
  __pyx_t_3 = ((__pyx_v_seed == 0) != 0);
  if (__pyx_t_3) {

    /* "pywrapfst.pyx":3781
 *                                                           1, False, False))
 *   if seed == 0:
 *     seed = time(NULL) + getpid()             # <<<<<<<<<<<<<<
 *   return fst.RandEquivalent(deref(ifst1._fst), deref(ifst2._fst), npath, delta,
 *                            seed, deref(opts))
 */
    __pyx_v_seed = (time(NULL) + getpid());

    /* "pywrapfst.pyx":3780
 *   opts.reset(new fst.RandGenOptions[fst.RandArcSelection](ras, max_length,
 *                                                           1, False, False))
 *   if seed == 0:             # <<<<<<<<<<<<<<
 *     seed = time(NULL) + getpid()
 *   return fst.RandEquivalent(deref(ifst1._fst), deref(ifst2._fst), npath, delta,
 */
  }

  /* "pywrapfst.pyx":3782
 *   if seed == 0:
 *     seed = time(NULL) + getpid()
 *   return fst.RandEquivalent(deref(ifst1._fst), deref(ifst2._fst), npath, delta,             # <<<<<<<<<<<<<<
 *                            seed, deref(opts))
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_ifst1) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 3782, __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, 3782, __pyx_L1_error)
  }

  /* "pywrapfst.pyx":3783
 *     seed = time(NULL) + getpid()
 *   return fst.RandEquivalent(deref(ifst1._fst), deref(ifst2._fst), npath, delta,
 *                            seed, deref(opts))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = fst::script::RandEquivalent((*__pyx_v_ifst1->_fst), (*__pyx_v_ifst2->_fst), __pyx_v_npath, __pyx_v_delta, __pyx_v_seed, (*__pyx_v_opts));
  goto __pyx_L0;

  /* "pywrapfst.pyx":3740
 * 
 * 
 * cpdef bool randequivalent(_Fst ifst1,             # <<<<<<<<<<<<<<
 *                           _Fst ifst2,
 *                           int32 npath=1,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pywrapfst.randequivalent", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_43randequivalent(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9pywrapfst_42randequivalent[] = "\n  randequivalent(ifst1, ifst2, npath=1, delta=0.0009765625, seed=0,\n                 select=\"uniform\", max_length=2147483647)\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\n  See also: `equal`, `equivalent`, `isomorphic`, `randgen`.\n  ";
static PyObject *__pyx_pw_9pywrapfst_43randequivalent(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst1 = 0;
  struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst2 = 0;
  __pyx_t_10basictypes_int32 __pyx_v_npath;
  float __pyx_v_delta;
  time_t __pyx_v_seed;
  PyObject *__pyx_v_select = 0;
  __pyx_t_10basictypes_int32 __pyx_v_max_length;
  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_seed,&__pyx_n_s_select,&__pyx_n_s_max_length,0};
    PyObject* values[7] = {0,0,0,0,0,0,0};
    values[5] = ((PyObject *)__pyx_n_b_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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ifst1)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ifst2)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("randequivalent", 0, 2, 7, 1); __PYX_ERR(0, 3740, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_npath);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_delta);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_seed);
          if (value) { values[4] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_select);
          if (value) { values[5] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_max_length);
          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, 3740, __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_9pywrapfst__Fst *)values[0]);
    __pyx_v_ifst2 = ((struct __pyx_obj_9pywrapfst__Fst *)values[1]);
    if (values[2]) {
      __pyx_v_npath = __Pyx_PyInt_As_int32_t(values[2]); if (unlikely((__pyx_v_npath == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3742, __pyx_L3_error)
    } else {
      __pyx_v_npath = ((__pyx_t_10basictypes_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, 3743, __pyx_L3_error)
    } else {
      __pyx_v_delta = __pyx_k__79;
    }
    if (values[4]) {
      __pyx_v_seed = __Pyx_PyInt_As_time_t(values[4]); if (unlikely((__pyx_v_seed == ((time_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3744, __pyx_L3_error)
    } else {
      __pyx_v_seed = ((time_t)0);
    }
    __pyx_v_select = values[5];
    if (values[6]) {
      __pyx_v_max_length = __Pyx_PyInt_As_int32_t(values[6]); if (unlikely((__pyx_v_max_length == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3746, __pyx_L3_error)
    } else {
      __pyx_v_max_length = __pyx_k__80;
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("randequivalent", 0, 2, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3740, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("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_9pywrapfst__Fst, 1, "ifst1", 0))) __PYX_ERR(0, 3740, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst2), __pyx_ptype_9pywrapfst__Fst, 1, "ifst2", 0))) __PYX_ERR(0, 3741, __pyx_L1_error)
  __pyx_r = __pyx_pf_9pywrapfst_42randequivalent(__pyx_self, __pyx_v_ifst1, __pyx_v_ifst2, __pyx_v_npath, __pyx_v_delta, __pyx_v_seed, __pyx_v_select, __pyx_v_max_length);

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

static PyObject *__pyx_pf_9pywrapfst_42randequivalent(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst1, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst2, __pyx_t_10basictypes_int32 __pyx_v_npath, float __pyx_v_delta, time_t __pyx_v_seed, PyObject *__pyx_v_select, __pyx_t_10basictypes_int32 __pyx_v_max_length) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  bool __pyx_t_1;
  struct __pyx_opt_args_9pywrapfst_randequivalent __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __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.seed = __pyx_v_seed;
  __pyx_t_2.select = __pyx_v_select;
  __pyx_t_2.max_length = __pyx_v_max_length;
  __pyx_t_1 = __pyx_f_9pywrapfst_randequivalent(__pyx_v_ifst1, __pyx_v_ifst2, 0, &__pyx_t_2); if (unlikely(__pyx_t_1 == ((bool)-1) && PyErr_Occurred())) __PYX_ERR(0, 3740, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3740, __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("pywrapfst.randequivalent", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":3786
 * 
 * 
 * cpdef _MutableFst randgen(_Fst ifst,             # <<<<<<<<<<<<<<
 *                           int32 npath=1,
 *                           time_t seed=0,
 */

static PyObject *__pyx_pw_9pywrapfst_45randgen(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_randgen(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_randgen *__pyx_optional_args) {
  __pyx_t_10basictypes_int32 __pyx_v_npath = ((__pyx_t_10basictypes_int32)1);
  time_t __pyx_v_seed = ((time_t)0);
  PyObject *__pyx_v_select = ((PyObject *)__pyx_n_b_uniform);
  __pyx_t_10basictypes_int32 __pyx_v_max_length = __pyx_k__81;

  /* "pywrapfst.pyx":3791
 *                           select=b"uniform",
 *                           int32 max_length=INT32_MAX,
 *                           bool weighted=False,             # <<<<<<<<<<<<<<
 *                           bool remove_total_weight=False):
 *   """
 */
  bool __pyx_v_weighted = ((bool)0);

  /* "pywrapfst.pyx":3792
 *                           int32 max_length=INT32_MAX,
 *                           bool weighted=False,
 *                           bool remove_total_weight=False):             # <<<<<<<<<<<<<<
 *   """
 *   randgen(ifst, npath=1, seed=0, select="uniform", max_length=2147483647,
 */
  bool __pyx_v_remove_total_weight = ((bool)0);
  enum fst::script::RandArcSelection __pyx_v_ras;
  std::unique_ptr<fst::RandGenOptions<enum fst::script::RandArcSelection> >  __pyx_v_opts;
  std::unique_ptr<fst::script::VectorFstClass>  __pyx_v_tfst;
  struct __pyx_obj_9pywrapfst__MutableFst *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  enum fst::script::RandArcSelection __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __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_seed = __pyx_optional_args->seed;
        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_weighted = __pyx_optional_args->weighted;
              if (__pyx_optional_args->__pyx_n > 5) {
                __pyx_v_remove_total_weight = __pyx_optional_args->remove_total_weight;
              }
            }
          }
        }
      }
    }
  }

  /* "pywrapfst.pyx":3824
 *   See also: `randequivalent`.
 *   """
 *   cdef fst.RandArcSelection ras = _get_rand_arc_selection(tostring(select))             # <<<<<<<<<<<<<<
 *   cdef unique_ptr[fst.RandGenOptions[fst.RandArcSelection]] opts
 *   opts.reset(new fst.RandGenOptions[fst.RandArcSelection](ras, max_length,
 */
  __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_select, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3824, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_9pywrapfst__get_rand_arc_selection(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3824, __pyx_L1_error)
  __pyx_v_ras = __pyx_t_2;

  /* "pywrapfst.pyx":3826
 *   cdef fst.RandArcSelection ras = _get_rand_arc_selection(tostring(select))
 *   cdef unique_ptr[fst.RandGenOptions[fst.RandArcSelection]] opts
 *   opts.reset(new fst.RandGenOptions[fst.RandArcSelection](ras, max_length,             # <<<<<<<<<<<<<<
 *                                                           npath, weighted,
 *                                                           remove_total_weight))
 */
  __pyx_v_opts.reset(new fst::RandGenOptions<enum fst::script::RandArcSelection> (__pyx_v_ras, __pyx_v_max_length, __pyx_v_npath, __pyx_v_weighted, __pyx_v_remove_total_weight));

  /* "pywrapfst.pyx":3830
 *                                                           remove_total_weight))
 *   cdef unique_ptr[fst.VectorFstClass] tfst
 *   tfst.reset(new fst.VectorFstClass(ifst.arc_type()))             # <<<<<<<<<<<<<<
 *   if seed == 0:
 *     seed = time(NULL) + getpid()
 */
  if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "arc_type");
    __PYX_ERR(0, 3830, __pyx_L1_error)
  }
  __pyx_v_tfst.reset(new fst::script::VectorFstClass(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_ifst->__pyx_vtab)->arc_type(__pyx_v_ifst, 0)));

  /* "pywrapfst.pyx":3831
 *   cdef unique_ptr[fst.VectorFstClass] tfst
 *   tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
 *   if seed == 0:             # <<<<<<<<<<<<<<
 *     seed = time(NULL) + getpid()
 *   fst.RandGen(deref(ifst._fst), tfst.get(), seed, deref(opts))
 */
  __pyx_t_3 = ((__pyx_v_seed == 0) != 0);
  if (__pyx_t_3) {

    /* "pywrapfst.pyx":3832
 *   tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
 *   if seed == 0:
 *     seed = time(NULL) + getpid()             # <<<<<<<<<<<<<<
 *   fst.RandGen(deref(ifst._fst), tfst.get(), seed, deref(opts))
 *   return _init_MutableFst(tfst.release())
 */
    __pyx_v_seed = (time(NULL) + getpid());

    /* "pywrapfst.pyx":3831
 *   cdef unique_ptr[fst.VectorFstClass] tfst
 *   tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
 *   if seed == 0:             # <<<<<<<<<<<<<<
 *     seed = time(NULL) + getpid()
 *   fst.RandGen(deref(ifst._fst), tfst.get(), seed, deref(opts))
 */
  }

  /* "pywrapfst.pyx":3833
 *   if seed == 0:
 *     seed = time(NULL) + getpid()
 *   fst.RandGen(deref(ifst._fst), tfst.get(), seed, 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, 3833, __pyx_L1_error)
  }
  fst::script::RandGen((*__pyx_v_ifst->_fst), __pyx_v_tfst.get(), __pyx_v_seed, (*__pyx_v_opts));

  /* "pywrapfst.pyx":3834
 *     seed = time(NULL) + getpid()
 *   fst.RandGen(deref(ifst._fst), tfst.get(), seed, deref(opts))
 *   return _init_MutableFst(tfst.release())             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_4 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst.release())); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3834, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_r = ((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_t_4);
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":3786
 * 
 * 
 * cpdef _MutableFst randgen(_Fst ifst,             # <<<<<<<<<<<<<<
 *                           int32 npath=1,
 *                           time_t seed=0,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("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_9pywrapfst_45randgen(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9pywrapfst_44randgen[] = "\n  randgen(ifst, npath=1, seed=0, select=\"uniform\", max_length=2147483647,\n          weight=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\n  See also: `randequivalent`.\n  ";
static PyObject *__pyx_pw_9pywrapfst_45randgen(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst = 0;
  __pyx_t_10basictypes_int32 __pyx_v_npath;
  time_t __pyx_v_seed;
  PyObject *__pyx_v_select = 0;
  __pyx_t_10basictypes_int32 __pyx_v_max_length;
  bool __pyx_v_weighted;
  bool __pyx_v_remove_total_weight;
  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_seed,&__pyx_n_s_select,&__pyx_n_s_max_length,&__pyx_n_s_weighted,&__pyx_n_s_remove_total_weight,0};
    PyObject* values[7] = {0,0,0,0,0,0,0};
    values[3] = ((PyObject *)__pyx_n_b_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] = PyDict_GetItem(__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 = PyDict_GetItem(__pyx_kwds, __pyx_n_s_npath);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_seed);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_select);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_max_length);
          if (value) { values[4] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_weighted);
          if (value) { values[5] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_remove_total_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, "randgen") < 0)) __PYX_ERR(0, 3786, __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_9pywrapfst__Fst *)values[0]);
    if (values[1]) {
      __pyx_v_npath = __Pyx_PyInt_As_int32_t(values[1]); if (unlikely((__pyx_v_npath == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3787, __pyx_L3_error)
    } else {
      __pyx_v_npath = ((__pyx_t_10basictypes_int32)1);
    }
    if (values[2]) {
      __pyx_v_seed = __Pyx_PyInt_As_time_t(values[2]); if (unlikely((__pyx_v_seed == ((time_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3788, __pyx_L3_error)
    } else {
      __pyx_v_seed = ((time_t)0);
    }
    __pyx_v_select = values[3];
    if (values[4]) {
      __pyx_v_max_length = __Pyx_PyInt_As_int32_t(values[4]); if (unlikely((__pyx_v_max_length == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3790, __pyx_L3_error)
    } else {
      __pyx_v_max_length = __pyx_k__81;
    }
    if (values[5]) {
      __pyx_v_weighted = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_weighted == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3791, __pyx_L3_error)
    } else {

      /* "pywrapfst.pyx":3791
 *                           select=b"uniform",
 *                           int32 max_length=INT32_MAX,
 *                           bool weighted=False,             # <<<<<<<<<<<<<<
 *                           bool remove_total_weight=False):
 *   """
 */
      __pyx_v_weighted = ((bool)0);
    }
    if (values[6]) {
      __pyx_v_remove_total_weight = __Pyx_PyObject_IsTrue(values[6]); if (unlikely((__pyx_v_remove_total_weight == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3792, __pyx_L3_error)
    } else {

      /* "pywrapfst.pyx":3792
 *                           int32 max_length=INT32_MAX,
 *                           bool weighted=False,
 *                           bool remove_total_weight=False):             # <<<<<<<<<<<<<<
 *   """
 *   randgen(ifst, npath=1, seed=0, select="uniform", max_length=2147483647,
 */
      __pyx_v_remove_total_weight = ((bool)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, 3786, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("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_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 3786, __pyx_L1_error)
  __pyx_r = __pyx_pf_9pywrapfst_44randgen(__pyx_self, __pyx_v_ifst, __pyx_v_npath, __pyx_v_seed, __pyx_v_select, __pyx_v_max_length, __pyx_v_weighted, __pyx_v_remove_total_weight);

  /* "pywrapfst.pyx":3786
 * 
 * 
 * cpdef _MutableFst randgen(_Fst ifst,             # <<<<<<<<<<<<<<
 *                           int32 npath=1,
 *                           time_t seed=0,
 */

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

static PyObject *__pyx_pf_9pywrapfst_44randgen(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst, __pyx_t_10basictypes_int32 __pyx_v_npath, time_t __pyx_v_seed, PyObject *__pyx_v_select, __pyx_t_10basictypes_int32 __pyx_v_max_length, bool __pyx_v_weighted, bool __pyx_v_remove_total_weight) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_9pywrapfst_randgen __pyx_t_2;
  __Pyx_RefNannySetupContext("randgen", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 6;
  __pyx_t_2.npath = __pyx_v_npath;
  __pyx_t_2.seed = __pyx_v_seed;
  __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_1 = ((PyObject *)__pyx_f_9pywrapfst_randgen(__pyx_v_ifst, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3786, __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("pywrapfst.randgen", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":3837
 * 
 * 
 * cpdef _MutableFst replace(pairs,             # <<<<<<<<<<<<<<
 *                           call_arc_labeling=b"input",
 *                           return_arc_labeling=b"neither",
 */

static PyObject *__pyx_pw_9pywrapfst_47replace(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_replace(PyObject *__pyx_v_pairs, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_replace *__pyx_optional_args) {
  PyObject *__pyx_v_call_arc_labeling = ((PyObject *)__pyx_n_b_input);
  PyObject *__pyx_v_return_arc_labeling = ((PyObject *)__pyx_n_b_neither);

  /* "pywrapfst.pyx":3840
 *                           call_arc_labeling=b"input",
 *                           return_arc_labeling=b"neither",
 *                           bool epsilon_on_replace=False,             # <<<<<<<<<<<<<<
 *                           int64 return_label=0):
 *   """
 */
  bool __pyx_v_epsilon_on_replace = ((bool)0);
  __pyx_t_10basictypes_int64 __pyx_v_return_label = ((__pyx_t_10basictypes_int64)0);
  std::vector<__pyx_t_3fst_LabelFstClassPair>  __pyx_v__pairs;
  __pyx_t_10basictypes_int64 __pyx_v_root_label;
  __pyx_t_10basictypes_int64 __pyx_v_label;
  struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst = 0;
  PyObject *__pyx_v_it = NULL;
  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_9pywrapfst__MutableFst *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *(*__pyx_t_5)(PyObject *);
  __pyx_t_10basictypes_int64 __pyx_t_6;
  __pyx_t_3fst_LabelFstClassPair __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  PyObject *(*__pyx_t_9)(PyObject *);
  PyObject *__pyx_t_10 = NULL;
  std::string __pyx_t_11;
  enum fst::ReplaceLabelType __pyx_t_12;
  __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;
          }
        }
      }
    }
  }

  /* "pywrapfst.pyx":3882
 *   cdef int64 label
 *   cdef _Fst ifst
 *   it = iter(pairs)             # <<<<<<<<<<<<<<
 *   (root_label, ifst) = next(it)
 *   _pairs.push_back(fst.LabelFstClassPair(root_label, ifst._fst.get()))
 */
  __pyx_t_1 = PyObject_GetIter(__pyx_v_pairs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3882, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_it = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pywrapfst.pyx":3883
 *   cdef _Fst ifst
 *   it = iter(pairs)
 *   (root_label, ifst) = next(it)             # <<<<<<<<<<<<<<
 *   _pairs.push_back(fst.LabelFstClassPair(root_label, ifst._fst.get()))
 *   cdef unique_ptr[fst.VectorFstClass] tfst
 */
  __pyx_t_1 = __Pyx_PyIter_Next(__pyx_v_it); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3883, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
    PyObject* sequence = __pyx_t_1;
    #if !CYTHON_COMPILING_IN_PYPY
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 3883, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_3);
    #else
    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3883, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3883, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3883, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext;
    index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) __PYX_ERR(0, 3883, __pyx_L1_error)
    __pyx_t_5 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 3883, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  __pyx_t_6 = __Pyx_PyInt_As_int64_t(__pyx_t_2); if (unlikely((__pyx_t_6 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3883, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_9pywrapfst__Fst))))) __PYX_ERR(0, 3883, __pyx_L1_error)
  __pyx_v_root_label = __pyx_t_6;
  __pyx_v_ifst = ((struct __pyx_obj_9pywrapfst__Fst *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "pywrapfst.pyx":3884
 *   it = iter(pairs)
 *   (root_label, ifst) = next(it)
 *   _pairs.push_back(fst.LabelFstClassPair(root_label, ifst._fst.get()))             # <<<<<<<<<<<<<<
 *   cdef unique_ptr[fst.VectorFstClass] tfst
 *   tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
 */
  if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 3884, __pyx_L1_error)
  }
  try {
    __pyx_t_7 = __pyx_t_3fst_LabelFstClassPair(__pyx_v_root_label, __pyx_v_ifst->_fst.get());
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(0, 3884, __pyx_L1_error)
  }
  try {
    __pyx_v__pairs.push_back(__pyx_t_7);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(0, 3884, __pyx_L1_error)
  }

  /* "pywrapfst.pyx":3886
 *   _pairs.push_back(fst.LabelFstClassPair(root_label, ifst._fst.get()))
 *   cdef unique_ptr[fst.VectorFstClass] tfst
 *   tfst.reset(new fst.VectorFstClass(ifst.arc_type()))             # <<<<<<<<<<<<<<
 *   for (label, ifst) in it:
 *     _pairs.push_back(fst.LabelFstClassPair(label, ifst._fst.get()))
 */
  if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "arc_type");
    __PYX_ERR(0, 3886, __pyx_L1_error)
  }
  __pyx_v_tfst.reset(new fst::script::VectorFstClass(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_ifst->__pyx_vtab)->arc_type(__pyx_v_ifst, 0)));

  /* "pywrapfst.pyx":3887
 *   cdef unique_ptr[fst.VectorFstClass] tfst
 *   tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
 *   for (label, ifst) in it:             # <<<<<<<<<<<<<<
 *     _pairs.push_back(fst.LabelFstClassPair(label, ifst._fst.get()))
 *   cdef fst.ReplaceLabelType cal = _get_replace_label_type(
 */
  if (likely(PyList_CheckExact(__pyx_v_it)) || PyTuple_CheckExact(__pyx_v_it)) {
    __pyx_t_1 = __pyx_v_it; __Pyx_INCREF(__pyx_t_1); __pyx_t_8 = 0;
    __pyx_t_9 = NULL;
  } else {
    __pyx_t_8 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_it); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3887, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_9 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3887, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_9)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_3); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 3887, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3887, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      } else {
        if (__pyx_t_8 >= 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_8); __Pyx_INCREF(__pyx_t_3); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 3887, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3887, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      }
    } else {
      __pyx_t_3 = __pyx_t_9(__pyx_t_1);
      if (unlikely(!__pyx_t_3)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 3887, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_3);
    }
    if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
      PyObject* sequence = __pyx_t_3;
      #if !CYTHON_COMPILING_IN_PYPY
      Py_ssize_t size = Py_SIZE(sequence);
      #else
      Py_ssize_t size = PySequence_Size(sequence);
      #endif
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 3887, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_4 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      #else
      __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3887, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3887, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      #endif
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_10 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3887, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_5 = Py_TYPE(__pyx_t_10)->tp_iternext;
      index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_10); if (unlikely(!__pyx_t_2)) goto __pyx_L7_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_2);
      index = 1; __pyx_t_4 = __pyx_t_5(__pyx_t_10); if (unlikely(!__pyx_t_4)) goto __pyx_L7_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_4);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_10), 2) < 0) __PYX_ERR(0, 3887, __pyx_L1_error)
      __pyx_t_5 = NULL;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L8_unpacking_done;
      __pyx_L7_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_5 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 3887, __pyx_L1_error)
      __pyx_L8_unpacking_done:;
    }
    __pyx_t_6 = __Pyx_PyInt_As_int64_t(__pyx_t_2); if (unlikely((__pyx_t_6 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3887, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_9pywrapfst__Fst))))) __PYX_ERR(0, 3887, __pyx_L1_error)
    __pyx_v_label = __pyx_t_6;
    __Pyx_DECREF_SET(__pyx_v_ifst, ((struct __pyx_obj_9pywrapfst__Fst *)__pyx_t_4));
    __pyx_t_4 = 0;

    /* "pywrapfst.pyx":3888
 *   tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
 *   for (label, ifst) in it:
 *     _pairs.push_back(fst.LabelFstClassPair(label, ifst._fst.get()))             # <<<<<<<<<<<<<<
 *   cdef fst.ReplaceLabelType cal = _get_replace_label_type(
 *       tostring(call_arc_labeling), epsilon_on_replace)
 */
    if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
      __PYX_ERR(0, 3888, __pyx_L1_error)
    }
    try {
      __pyx_t_7 = __pyx_t_3fst_LabelFstClassPair(__pyx_v_label, __pyx_v_ifst->_fst.get());
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(0, 3888, __pyx_L1_error)
    }
    try {
      __pyx_v__pairs.push_back(__pyx_t_7);
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(0, 3888, __pyx_L1_error)
    }

    /* "pywrapfst.pyx":3887
 *   cdef unique_ptr[fst.VectorFstClass] tfst
 *   tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
 *   for (label, ifst) in it:             # <<<<<<<<<<<<<<
 *     _pairs.push_back(fst.LabelFstClassPair(label, ifst._fst.get()))
 *   cdef fst.ReplaceLabelType cal = _get_replace_label_type(
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pywrapfst.pyx":3890
 *     _pairs.push_back(fst.LabelFstClassPair(label, ifst._fst.get()))
 *   cdef fst.ReplaceLabelType cal = _get_replace_label_type(
 *       tostring(call_arc_labeling), epsilon_on_replace)             # <<<<<<<<<<<<<<
 *   cdef fst.ReplaceLabelType ral = _get_replace_label_type(
 *       tostring(return_arc_labeling), epsilon_on_replace)
 */
  __pyx_t_11 = __pyx_f_9pywrapfst_tostring(__pyx_v_call_arc_labeling, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3890, __pyx_L1_error)

  /* "pywrapfst.pyx":3889
 *   for (label, ifst) in it:
 *     _pairs.push_back(fst.LabelFstClassPair(label, ifst._fst.get()))
 *   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_12 = __pyx_f_9pywrapfst__get_replace_label_type(__pyx_t_11, __pyx_v_epsilon_on_replace); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3889, __pyx_L1_error)
  __pyx_v_cal = __pyx_t_12;

  /* "pywrapfst.pyx":3892
 *       tostring(call_arc_labeling), epsilon_on_replace)
 *   cdef fst.ReplaceLabelType ral = _get_replace_label_type(
 *       tostring(return_arc_labeling), epsilon_on_replace)             # <<<<<<<<<<<<<<
 *   cdef unique_ptr[fst.ReplaceOptions] opts
 *   opts.reset(new fst.ReplaceOptions(root_label, cal, ral, return_label))
 */
  __pyx_t_11 = __pyx_f_9pywrapfst_tostring(__pyx_v_return_arc_labeling, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3892, __pyx_L1_error)

  /* "pywrapfst.pyx":3891
 *   cdef fst.ReplaceLabelType cal = _get_replace_label_type(
 *       tostring(call_arc_labeling), 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_12 = __pyx_f_9pywrapfst__get_replace_label_type(__pyx_t_11, __pyx_v_epsilon_on_replace); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3891, __pyx_L1_error)
  __pyx_v_ral = __pyx_t_12;

  /* "pywrapfst.pyx":3894
 *       tostring(return_arc_labeling), epsilon_on_replace)
 *   cdef unique_ptr[fst.ReplaceOptions] opts
 *   opts.reset(new fst.ReplaceOptions(root_label, 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_root_label, __pyx_v_cal, __pyx_v_ral, __pyx_v_return_label));

  /* "pywrapfst.pyx":3895
 *   cdef unique_ptr[fst.ReplaceOptions] opts
 *   opts.reset(new fst.ReplaceOptions(root_label, 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));

  /* "pywrapfst.pyx":3896
 *   opts.reset(new fst.ReplaceOptions(root_label, 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_9pywrapfst__init_MutableFst(__pyx_v_tfst.release())); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3896, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":3837
 * 
 * 
 * cpdef _MutableFst replace(pairs,             # <<<<<<<<<<<<<<
 *                           call_arc_labeling=b"input",
 *                           return_arc_labeling=b"neither",
 */

  /* 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_10);
  __Pyx_AddTraceback("pywrapfst.replace", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_ifst);
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_47replace(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9pywrapfst_46replace[] = "\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_9pywrapfst_47replace(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;
  __pyx_t_10basictypes_int64 __pyx_v_return_label;
  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_b_input);
    values[2] = ((PyObject *)__pyx_n_b_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] = PyDict_GetItem(__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 = PyDict_GetItem(__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 = PyDict_GetItem(__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 = PyDict_GetItem(__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 = PyDict_GetItem(__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, 3837, __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, 3840, __pyx_L3_error)
    } else {

      /* "pywrapfst.pyx":3840
 *                           call_arc_labeling=b"input",
 *                           return_arc_labeling=b"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_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3841, __pyx_L3_error)
    } else {
      __pyx_v_return_label = ((__pyx_t_10basictypes_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, 3837, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pywrapfst.replace", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pywrapfst_46replace(__pyx_self, __pyx_v_pairs, __pyx_v_call_arc_labeling, __pyx_v_return_arc_labeling, __pyx_v_epsilon_on_replace, __pyx_v_return_label);

  /* "pywrapfst.pyx":3837
 * 
 * 
 * cpdef _MutableFst replace(pairs,             # <<<<<<<<<<<<<<
 *                           call_arc_labeling=b"input",
 *                           return_arc_labeling=b"neither",
 */

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

static PyObject *__pyx_pf_9pywrapfst_46replace(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, __pyx_t_10basictypes_int64 __pyx_v_return_label) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_9pywrapfst_replace __pyx_t_2;
  __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_9pywrapfst_replace(__pyx_v_pairs, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3837, __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("pywrapfst.replace", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":3899
 * 
 * 
 * cpdef _MutableFst reverse(_Fst ifst, bool require_superinitial=True):             # <<<<<<<<<<<<<<
 *   """
 *   reverse(ifst, require_superinitial=True)
 */

static PyObject *__pyx_pw_9pywrapfst_49reverse(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_reverse(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_reverse *__pyx_optional_args) {
  bool __pyx_v_require_superinitial = ((bool)1);
  std::unique_ptr<fst::script::VectorFstClass>  __pyx_v_tfst;
  struct __pyx_obj_9pywrapfst__MutableFst *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("reverse", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_require_superinitial = __pyx_optional_args->require_superinitial;
    }
  }

  /* "pywrapfst.pyx":3919
 *   """
 *   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, 3919, __pyx_L1_error)
  }
  __pyx_v_tfst.reset(new fst::script::VectorFstClass(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_ifst->__pyx_vtab)->arc_type(__pyx_v_ifst, 0)));

  /* "pywrapfst.pyx":3920
 *   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, 3920, __pyx_L1_error)
  }
  fst::script::Reverse((*__pyx_v_ifst->_fst), __pyx_v_tfst.get(), __pyx_v_require_superinitial);

  /* "pywrapfst.pyx":3921
 *   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_9pywrapfst__init_MutableFst(__pyx_v_tfst.release())); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3921, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":3899
 * 
 * 
 * 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("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_9pywrapfst_49reverse(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9pywrapfst_48reverse[] = "\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_9pywrapfst_49reverse(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst = 0;
  bool __pyx_v_require_superinitial;
  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] = PyDict_GetItem(__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 = PyDict_GetItem(__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, 3899, __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_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, 3899, __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, 3899, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("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_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 3899, __pyx_L1_error)
  __pyx_r = __pyx_pf_9pywrapfst_48reverse(__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_9pywrapfst_48reverse(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_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_9pywrapfst_reverse __pyx_t_2;
  __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_9pywrapfst_reverse(__pyx_v_ifst, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3899, __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("pywrapfst.reverse", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":3927
 * 
 * 
 * cdef vector[fst.WeightClass] *_shortestdistance(_Fst ifst,             # <<<<<<<<<<<<<<
 *                                                 float delta=fst.kShortestDelta,
 *                                                 int64 nstate=fst.kNoStateId,
 */

static std::vector<fst::script::WeightClass>  *__pyx_f_9pywrapfst__shortestdistance(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst, struct __pyx_opt_args_9pywrapfst__shortestdistance *__pyx_optional_args) {
  float __pyx_v_delta = __pyx_k__82;
  __pyx_t_10basictypes_int64 __pyx_v_nstate = __pyx_k__83;
  PyObject *__pyx_v_queue_type = ((PyObject *)__pyx_n_b_auto);

  /* "pywrapfst.pyx":3931
 *                                                 int64 nstate=fst.kNoStateId,
 *                                                 queue_type=b"auto",
 *                                                 bool reverse=False) except *:             # <<<<<<<<<<<<<<
 *   cdef unique_ptr[vector[fst.WeightClass]] distance
 *   distance.reset(new vector[fst.WeightClass]())
 */
  bool __pyx_v_reverse = ((bool)0);
  std::unique_ptr<std::vector<fst::script::WeightClass> >  __pyx_v_distance;
  std::unique_ptr<fst::script::ShortestDistanceOptions>  __pyx_v_opts;
  std::vector<fst::script::WeightClass>  *__pyx_r;
  __Pyx_RefNannyDeclarations
  std::vector<fst::script::WeightClass>  *__pyx_t_1;
  int __pyx_t_2;
  std::string __pyx_t_3;
  enum fst::QueueType __pyx_t_4;
  __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;
          }
        }
      }
    }
  }

  /* "pywrapfst.pyx":3933
 *                                                 bool reverse=False) except *:
 *   cdef unique_ptr[vector[fst.WeightClass]] distance
 *   distance.reset(new vector[fst.WeightClass]())             # <<<<<<<<<<<<<<
 *   # For scoping reasons, these have to be declared here even though they may
 *   # not be used in all cases.
 */
  try {
    __pyx_t_1 = new std::vector<fst::script::WeightClass> ();
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(0, 3933, __pyx_L1_error)
  }
  __pyx_v_distance.reset(__pyx_t_1);

  /* "pywrapfst.pyx":3937
 *   # not be used in all cases.
 *   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_2 = (__pyx_v_reverse != 0);
  if (__pyx_t_2) {

    /* "pywrapfst.pyx":3940
 *     # Only the simpler signature supports shortest distance to final states;
 *     # `nstate` and `queue_type` arguments are ignored.
 *     fst.ShortestDistance(deref(ifst._fst), distance.get(), True, delta)             # <<<<<<<<<<<<<<
 *   else:
 *     opts.reset(new fst.ShortestDistanceOptions(
 */
    if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
      __PYX_ERR(0, 3940, __pyx_L1_error)
    }
    fst::script::ShortestDistance((*__pyx_v_ifst->_fst), __pyx_v_distance.get(), 1, __pyx_v_delta);

    /* "pywrapfst.pyx":3937
 *   # not be used in all cases.
 *   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;
  }

  /* "pywrapfst.pyx":3942
 *     fst.ShortestDistance(deref(ifst._fst), distance.get(), True, delta)
 *   else:
 *     opts.reset(new fst.ShortestDistanceOptions(             # <<<<<<<<<<<<<<
 *         _get_queue_type(tostring(queue_type)), fst.ANY_ARC_FILTER, nstate,
 *         delta))
 */
  /*else*/ {

    /* "pywrapfst.pyx":3943
 *   else:
 *     opts.reset(new fst.ShortestDistanceOptions(
 *         _get_queue_type(tostring(queue_type)), fst.ANY_ARC_FILTER, nstate,             # <<<<<<<<<<<<<<
 *         delta))
 *     fst.ShortestDistance(deref(ifst._fst), distance.get(), deref(opts))
 */
    __pyx_t_3 = __pyx_f_9pywrapfst_tostring(__pyx_v_queue_type, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3943, __pyx_L1_error)
    __pyx_t_4 = __pyx_f_9pywrapfst__get_queue_type(__pyx_t_3); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3943, __pyx_L1_error)

    /* "pywrapfst.pyx":3942
 *     fst.ShortestDistance(deref(ifst._fst), distance.get(), True, delta)
 *   else:
 *     opts.reset(new fst.ShortestDistanceOptions(             # <<<<<<<<<<<<<<
 *         _get_queue_type(tostring(queue_type)), fst.ANY_ARC_FILTER, nstate,
 *         delta))
 */
    __pyx_v_opts.reset(new fst::script::ShortestDistanceOptions(__pyx_t_4, fst::script::ANY_ARC_FILTER, __pyx_v_nstate, __pyx_v_delta));

    /* "pywrapfst.pyx":3945
 *         _get_queue_type(tostring(queue_type)), fst.ANY_ARC_FILTER, nstate,
 *         delta))
 *     fst.ShortestDistance(deref(ifst._fst), distance.get(), deref(opts))             # <<<<<<<<<<<<<<
 *   return distance.release()
 * 
 */
    if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
      __PYX_ERR(0, 3945, __pyx_L1_error)
    }
    fst::script::ShortestDistance((*__pyx_v_ifst->_fst), __pyx_v_distance.get(), (*__pyx_v_opts));
  }
  __pyx_L3:;

  /* "pywrapfst.pyx":3946
 *         delta))
 *     fst.ShortestDistance(deref(ifst._fst), distance.get(), deref(opts))
 *   return distance.release()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_distance.release();
  goto __pyx_L0;

  /* "pywrapfst.pyx":3927
 * 
 * 
 * cdef vector[fst.WeightClass] *_shortestdistance(_Fst ifst,             # <<<<<<<<<<<<<<
 *                                                 float delta=fst.kShortestDelta,
 *                                                 int64 nstate=fst.kNoStateId,
 */

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

/* "pywrapfst.pyx":3949
 * 
 * 
 * def shortestdistance(_Fst ifst,             # <<<<<<<<<<<<<<
 *                      float delta=fst.kShortestDelta,
 *                      int64 nstate=fst.kNoStateId,
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_51shortestdistance(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9pywrapfst_50shortestdistance[] = "\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_9pywrapfst_51shortestdistance = {"shortestdistance", (PyCFunction)__pyx_pw_9pywrapfst_51shortestdistance, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_50shortestdistance};
static PyObject *__pyx_pw_9pywrapfst_51shortestdistance(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst = 0;
  float __pyx_v_delta;
  __pyx_t_10basictypes_int64 __pyx_v_nstate;
  PyObject *__pyx_v_queue_type = 0;
  bool __pyx_v_reverse;
  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_b_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] = PyDict_GetItem(__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 = PyDict_GetItem(__pyx_kwds, __pyx_n_s_delta);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nstate);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_queue_type);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__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, 3949, __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_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, 3950, __pyx_L3_error)
    } else {
      __pyx_v_delta = __pyx_k__84;
    }
    if (values[2]) {
      __pyx_v_nstate = __Pyx_PyInt_As_int64_t(values[2]); if (unlikely((__pyx_v_nstate == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3951, __pyx_L3_error)
    } else {
      __pyx_v_nstate = __pyx_k__85;
    }
    __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, 3953, __pyx_L3_error)
    } else {

      /* "pywrapfst.pyx":3953
 *                      int64 nstate=fst.kNoStateId,
 *                      queue_type=b"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, 3949, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("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_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 3949, __pyx_L1_error)
  __pyx_r = __pyx_pf_9pywrapfst_50shortestdistance(__pyx_self, __pyx_v_ifst, __pyx_v_delta, __pyx_v_nstate, __pyx_v_queue_type, __pyx_v_reverse);

  /* "pywrapfst.pyx":3949
 * 
 * 
 * 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_9pywrapfst_50shortestdistance(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst, float __pyx_v_delta, __pyx_t_10basictypes_int64 __pyx_v_nstate, PyObject *__pyx_v_queue_type, bool __pyx_v_reverse) {
  std::unique_ptr<std::vector<fst::script::WeightClass> >  __pyx_v_distance;
  std::string __pyx_v_weight_type;
  fst::script::WeightClass __pyx_v_weight;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::vector<fst::script::WeightClass>  *__pyx_t_1;
  struct __pyx_opt_args_9pywrapfst__shortestdistance __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  std::vector<fst::script::WeightClass> ::iterator __pyx_t_4;
  fst::script::WeightClass __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("shortestdistance", 0);

  /* "pywrapfst.pyx":3981
 *   """
 *   cdef unique_ptr[vector[fst.WeightClass]] distance
 *   distance.reset(_shortestdistance(ifst, delta, nstate, queue_type, reverse))             # <<<<<<<<<<<<<<
 *   cdef string weight_type = ifst.weight_type()
 *   return [Weight(weight_type, weight.ToString()) for weight in deref(distance)]
 */
  __pyx_t_2.__pyx_n = 4;
  __pyx_t_2.delta = __pyx_v_delta;
  __pyx_t_2.nstate = __pyx_v_nstate;
  __pyx_t_2.queue_type = __pyx_v_queue_type;
  __pyx_t_2.reverse = __pyx_v_reverse;
  __pyx_t_1 = __pyx_f_9pywrapfst__shortestdistance(__pyx_v_ifst, &__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3981, __pyx_L1_error)
  __pyx_v_distance.reset(__pyx_t_1);

  /* "pywrapfst.pyx":3982
 *   cdef unique_ptr[vector[fst.WeightClass]] distance
 *   distance.reset(_shortestdistance(ifst, delta, nstate, queue_type, reverse))
 *   cdef string weight_type = ifst.weight_type()             # <<<<<<<<<<<<<<
 *   return [Weight(weight_type, weight.ToString()) for weight in deref(distance)]
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "weight_type");
    __PYX_ERR(0, 3982, __pyx_L1_error)
  }
  __pyx_v_weight_type = ((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_ifst->__pyx_vtab)->weight_type(__pyx_v_ifst, 0);

  /* "pywrapfst.pyx":3983
 *   distance.reset(_shortestdistance(ifst, delta, nstate, queue_type, reverse))
 *   cdef string weight_type = ifst.weight_type()
 *   return [Weight(weight_type, weight.ToString()) for weight in deref(distance)]             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3983, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = &(*__pyx_v_distance);
  __pyx_t_4 = __pyx_t_1->begin();
  for (;;) {
    if (!(__pyx_t_4 != __pyx_t_1->end())) break;
    __pyx_t_5 = *__pyx_t_4;
    ++__pyx_t_4;
    __pyx_v_weight = __pyx_t_5;
    __pyx_t_6 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_weight_type); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3983, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_weight.ToString()); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3983, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3983, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_7);
    __pyx_t_6 = 0;
    __pyx_t_7 = 0;
    __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_9pywrapfst_Weight), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3983, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 3983, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":3949
 * 
 * 
 * def shortestdistance(_Fst ifst,             # <<<<<<<<<<<<<<
 *                      float delta=fst.kShortestDelta,
 *                      int64 nstate=fst.kNoStateId,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("pywrapfst.shortestdistance", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":3986
 * 
 * 
 * cpdef _MutableFst shortestpath(_Fst ifst,             # <<<<<<<<<<<<<<
 *                                float delta=fst.kShortestDelta,
 *                                int32 nshortest=1,
 */

static PyObject *__pyx_pw_9pywrapfst_53shortestpath(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_shortestpath(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_shortestpath *__pyx_optional_args) {
  float __pyx_v_delta = __pyx_k__86;
  __pyx_t_10basictypes_int32 __pyx_v_nshortest = ((__pyx_t_10basictypes_int32)1);
  __pyx_t_10basictypes_int64 __pyx_v_nstate = __pyx_k__87;
  PyObject *__pyx_v_queue_type = ((PyObject *)__pyx_n_b_auto);

  /* "pywrapfst.pyx":3991
 *                                int64 nstate=fst.kNoStateId,
 *                                queue_type=b"auto",
 *                                bool unique=False,             # <<<<<<<<<<<<<<
 *                                weight=None):
 *   """
 */
  bool __pyx_v_unique = ((bool)0);

  /* "pywrapfst.pyx":3992
 *                                queue_type=b"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_wc;
  std::unique_ptr<fst::script::ShortestPathOptions>  __pyx_v_opts;
  struct __pyx_obj_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;
  __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;
              }
            }
          }
        }
      }
    }
  }

  /* "pywrapfst.pyx":4024
 *   """
 *   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 wc = _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, 4024, __pyx_L1_error)
  }
  __pyx_v_tfst.reset(new fst::script::VectorFstClass(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_ifst->__pyx_vtab)->arc_type(__pyx_v_ifst, 0)));

  /* "pywrapfst.pyx":4026
 *   tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
 *   # Threshold is set to semiring Zero (no pruning) if no weight is specified.
 *   cdef fst.WeightClass wc = _get_WeightClass_or_Zero(ifst.weight_type(), weight)             # <<<<<<<<<<<<<<
 *   cdef unique_ptr[fst.ShortestPathOptions] opts
 *   opts.reset(new fst.ShortestPathOptions(_get_queue_type(tostring(queue_type)),
 */
  if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "weight_type");
    __PYX_ERR(0, 4026, __pyx_L1_error)
  }
  __pyx_t_1 = __pyx_f_9pywrapfst__get_WeightClass_or_Zero(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_ifst->__pyx_vtab)->weight_type(__pyx_v_ifst, 0), __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4026, __pyx_L1_error)
  __pyx_v_wc = __pyx_t_1;

  /* "pywrapfst.pyx":4028
 *   cdef fst.WeightClass wc = _get_WeightClass_or_Zero(ifst.weight_type(), weight)
 *   cdef unique_ptr[fst.ShortestPathOptions] opts
 *   opts.reset(new fst.ShortestPathOptions(_get_queue_type(tostring(queue_type)),             # <<<<<<<<<<<<<<
 *                                          nshortest, unique, delta, wc, nstate))
 *   fst.ShortestPath(deref(ifst._fst), tfst.get(), deref(opts))
 */
  __pyx_t_2 = __pyx_f_9pywrapfst_tostring(__pyx_v_queue_type, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4028, __pyx_L1_error)
  __pyx_t_3 = __pyx_f_9pywrapfst__get_queue_type(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4028, __pyx_L1_error)

  /* "pywrapfst.pyx":4029
 *   cdef unique_ptr[fst.ShortestPathOptions] opts
 *   opts.reset(new fst.ShortestPathOptions(_get_queue_type(tostring(queue_type)),
 *                                          nshortest, unique, delta, wc, nstate))             # <<<<<<<<<<<<<<
 *   fst.ShortestPath(deref(ifst._fst), tfst.get(), deref(opts))
 *   return _init_MutableFst(tfst.release())
 */
  __pyx_v_opts.reset(new fst::script::ShortestPathOptions(__pyx_t_3, __pyx_v_nshortest, __pyx_v_unique, __pyx_v_delta, __pyx_v_wc, __pyx_v_nstate));

  /* "pywrapfst.pyx":4030
 *   opts.reset(new fst.ShortestPathOptions(_get_queue_type(tostring(queue_type)),
 *                                          nshortest, unique, delta, wc, 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, 4030, __pyx_L1_error)
  }
  fst::script::ShortestPath((*__pyx_v_ifst->_fst), __pyx_v_tfst.get(), (*__pyx_v_opts));

  /* "pywrapfst.pyx":4031
 *                                          nshortest, unique, delta, wc, 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_9pywrapfst__init_MutableFst(__pyx_v_tfst.release())); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4031, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_r = ((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_t_4);
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":3986
 * 
 * 
 * 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("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_9pywrapfst_53shortestpath(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9pywrapfst_52shortestpath[] = "\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_9pywrapfst_53shortestpath(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst = 0;
  float __pyx_v_delta;
  __pyx_t_10basictypes_int32 __pyx_v_nshortest;
  __pyx_t_10basictypes_int64 __pyx_v_nstate;
  PyObject *__pyx_v_queue_type = 0;
  bool __pyx_v_unique;
  PyObject *__pyx_v_weight = 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_b_auto);

    /* "pywrapfst.pyx":3992
 *                                queue_type=b"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] = PyDict_GetItem(__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 = PyDict_GetItem(__pyx_kwds, __pyx_n_s_delta);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nshortest);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nstate);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_queue_type);
          if (value) { values[4] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_unique);
          if (value) { values[5] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__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, 3986, __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_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, 3987, __pyx_L3_error)
    } else {
      __pyx_v_delta = __pyx_k__86;
    }
    if (values[2]) {
      __pyx_v_nshortest = __Pyx_PyInt_As_int32_t(values[2]); if (unlikely((__pyx_v_nshortest == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3988, __pyx_L3_error)
    } else {
      __pyx_v_nshortest = ((__pyx_t_10basictypes_int32)1);
    }
    if (values[3]) {
      __pyx_v_nstate = __Pyx_PyInt_As_int64_t(values[3]); if (unlikely((__pyx_v_nstate == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3989, __pyx_L3_error)
    } else {
      __pyx_v_nstate = __pyx_k__87;
    }
    __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, 3991, __pyx_L3_error)
    } else {

      /* "pywrapfst.pyx":3991
 *                                int64 nstate=fst.kNoStateId,
 *                                queue_type=b"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, 3986, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("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_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 3986, __pyx_L1_error)
  __pyx_r = __pyx_pf_9pywrapfst_52shortestpath(__pyx_self, __pyx_v_ifst, __pyx_v_delta, __pyx_v_nshortest, __pyx_v_nstate, __pyx_v_queue_type, __pyx_v_unique, __pyx_v_weight);

  /* "pywrapfst.pyx":3986
 * 
 * 
 * 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_9pywrapfst_52shortestpath(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst, float __pyx_v_delta, __pyx_t_10basictypes_int32 __pyx_v_nshortest, __pyx_t_10basictypes_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_9pywrapfst_shortestpath __pyx_t_2;
  __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_9pywrapfst_shortestpath(__pyx_v_ifst, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3986, __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("pywrapfst.shortestpath", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":4034
 * 
 * 
 * cpdef _Fst statemap(_Fst ifst, map_type):             # <<<<<<<<<<<<<<
 *   """
 *   state_map(ifst, map_type)
 */

static PyObject *__pyx_pw_9pywrapfst_55statemap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst_statemap(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst, PyObject *__pyx_v_map_type, CYTHON_UNUSED int __pyx_skip_dispatch) {
  struct __pyx_obj_9pywrapfst__Fst *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_9pywrapfst__map __pyx_t_2;
  __Pyx_RefNannySetupContext("statemap", 0);

  /* "pywrapfst.pyx":4057
 *   See also: `arcmap`.
 *   """
 *   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_9pywrapfst__map(__pyx_v_ifst, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4057, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_9pywrapfst__Fst *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":4034
 * 
 * 
 * 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("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_9pywrapfst_55statemap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9pywrapfst_54statemap[] = "\n  state_map(ifst, map_type)\n\n  Constructively applies a transform to all states.\n\n  This operation transforms each state according to the requested map type.\n  Note that currently, only one state-mapping operation is supported.\n\n  Args:\n    ifst: The input FST.\n    map_type: A string matching a known mapping operation; one of: \"arc_sum\"\n        (sum weights of identically-labeled multi-arcs), \"arc_unique\" (deletes\n        non-unique identically-labeled multi-arcs).\n\n  Returns:\n    An FST with states remapped.\n\n  Raises:\n    FstArgError: Unknown map type.\n\n  See also: `arcmap`.\n  ";
static PyObject *__pyx_pw_9pywrapfst_55statemap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst = 0;
  PyObject *__pyx_v_map_type = 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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ifst)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_map_type)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("statemap", 1, 2, 2, 1); __PYX_ERR(0, 4034, __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, 4034, __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_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, 4034, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("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_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 4034, __pyx_L1_error)
  __pyx_r = __pyx_pf_9pywrapfst_54statemap(__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_9pywrapfst_54statemap(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst, PyObject *__pyx_v_map_type) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("statemap", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_statemap(__pyx_v_ifst, __pyx_v_map_type, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4034, __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("pywrapfst.statemap", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":4060
 * 
 * 
 * cpdef _MutableFst synchronize(_Fst ifst):             # <<<<<<<<<<<<<<
 *   """
 *   synchronize(ifst)
 */

static PyObject *__pyx_pw_9pywrapfst_57synchronize(PyObject *__pyx_self, PyObject *__pyx_v_ifst); /*proto*/
static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_synchronize(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst, CYTHON_UNUSED int __pyx_skip_dispatch) {
  std::unique_ptr<fst::script::VectorFstClass>  __pyx_v_tfst;
  struct __pyx_obj_9pywrapfst__MutableFst *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("synchronize", 0);

  /* "pywrapfst.pyx":4080
 *   """
 *   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, 4080, __pyx_L1_error)
  }
  __pyx_v_tfst.reset(new fst::script::VectorFstClass(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_ifst->__pyx_vtab)->arc_type(__pyx_v_ifst, 0)));

  /* "pywrapfst.pyx":4081
 *   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, 4081, __pyx_L1_error)
  }
  fst::script::Synchronize((*__pyx_v_ifst->_fst), __pyx_v_tfst.get());

  /* "pywrapfst.pyx":4082
 *   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_9pywrapfst__init_MutableFst(__pyx_v_tfst.release())); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4082, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":4060
 * 
 * 
 * cpdef _MutableFst synchronize(_Fst ifst):             # <<<<<<<<<<<<<<
 *   """
 *   synchronize(ifst)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("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_9pywrapfst_57synchronize(PyObject *__pyx_self, PyObject *__pyx_v_ifst); /*proto*/
static char __pyx_doc_9pywrapfst_56synchronize[] = "\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_9pywrapfst_57synchronize(PyObject *__pyx_self, PyObject *__pyx_v_ifst) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("synchronize (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 4060, __pyx_L1_error)
  __pyx_r = __pyx_pf_9pywrapfst_56synchronize(__pyx_self, ((struct __pyx_obj_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_9pywrapfst_56synchronize(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("synchronize", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_synchronize(__pyx_v_ifst, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4060, __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("pywrapfst.synchronize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":4139
 *   """
 * 
 *   def __cinit__(self,             # <<<<<<<<<<<<<<
 *                 string fst_type=b"vector",
 *                 string arc_type=b"standard",
 */

/* Python wrapper */
static int __pyx_pw_9pywrapfst_8Compiler_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_9pywrapfst_8Compiler_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  std::string __pyx_v_fst_type;
  std::string __pyx_v_arc_type;
  struct __pyx_obj_9pywrapfst_SymbolTable *__pyx_v_isymbols = 0;
  struct __pyx_obj_9pywrapfst_SymbolTable *__pyx_v_osymbols = 0;
  struct __pyx_obj_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_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};

    /* "pywrapfst.pyx":4142
 *                 string fst_type=b"vector",
 *                 string arc_type=b"standard",
 *                 SymbolTable isymbols=None,             # <<<<<<<<<<<<<<
 *                 SymbolTable osymbols=None,
 *                 SymbolTable ssymbols=None,
 */
    values[2] = (PyObject *)((struct __pyx_obj_9pywrapfst_SymbolTable *)Py_None);

    /* "pywrapfst.pyx":4143
 *                 string arc_type=b"standard",
 *                 SymbolTable isymbols=None,
 *                 SymbolTable osymbols=None,             # <<<<<<<<<<<<<<
 *                 SymbolTable ssymbols=None,
 *                 bool acceptor=False,
 */
    values[3] = (PyObject *)((struct __pyx_obj_9pywrapfst_SymbolTable *)Py_None);

    /* "pywrapfst.pyx":4144
 *                 SymbolTable isymbols=None,
 *                 SymbolTable osymbols=None,
 *                 SymbolTable ssymbols=None,             # <<<<<<<<<<<<<<
 *                 bool acceptor=False,
 *                 bool keep_isymbols=False,
 */
    values[4] = (PyObject *)((struct __pyx_obj_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 = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fst_type);
          if (value) { values[0] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arc_type);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_isymbols);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_osymbols);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ssymbols);
          if (value) { values[4] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_acceptor);
          if (value) { values[5] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_keep_isymbols);
          if (value) { values[6] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_keep_osymbols);
          if (value) { values[7] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__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 = PyDict_GetItem(__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, 4139, __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;
      }
    }
    if (values[0]) {
      __pyx_v_fst_type = __pyx_convert_string_from_py_std__in_string(values[0]); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4140, __pyx_L3_error)
    } else {
      __pyx_v_fst_type = __pyx_k__88;
    }
    if (values[1]) {
      __pyx_v_arc_type = __pyx_convert_string_from_py_std__in_string(values[1]); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4141, __pyx_L3_error)
    } else {
      __pyx_v_arc_type = __pyx_k__89;
    }
    __pyx_v_isymbols = ((struct __pyx_obj_9pywrapfst_SymbolTable *)values[2]);
    __pyx_v_osymbols = ((struct __pyx_obj_9pywrapfst_SymbolTable *)values[3]);
    __pyx_v_ssymbols = ((struct __pyx_obj_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, 4145, __pyx_L3_error)
    } else {

      /* "pywrapfst.pyx":4145
 *                 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, 4146, __pyx_L3_error)
    } else {

      /* "pywrapfst.pyx":4146
 *                 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, 4147, __pyx_L3_error)
    } else {

      /* "pywrapfst.pyx":4147
 *                 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, 4148, __pyx_L3_error)
    } else {

      /* "pywrapfst.pyx":4148
 *                 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, 4149, __pyx_L3_error)
    } else {

      /* "pywrapfst.pyx":4149
 *                 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, 4139, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("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_isymbols), __pyx_ptype_9pywrapfst_SymbolTable, 1, "isymbols", 0))) __PYX_ERR(0, 4142, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_osymbols), __pyx_ptype_9pywrapfst_SymbolTable, 1, "osymbols", 0))) __PYX_ERR(0, 4143, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ssymbols), __pyx_ptype_9pywrapfst_SymbolTable, 1, "ssymbols", 0))) __PYX_ERR(0, 4144, __pyx_L1_error)
  __pyx_r = __pyx_pf_9pywrapfst_8Compiler___cinit__(((struct __pyx_obj_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);

  /* "pywrapfst.pyx":4139
 *   """
 * 
 *   def __cinit__(self,             # <<<<<<<<<<<<<<
 *                 string fst_type=b"vector",
 *                 string arc_type=b"standard",
 */

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

static int __pyx_pf_9pywrapfst_8Compiler___cinit__(struct __pyx_obj_9pywrapfst_Compiler *__pyx_v_self, std::string __pyx_v_fst_type, std::string __pyx_v_arc_type, struct __pyx_obj_9pywrapfst_SymbolTable *__pyx_v_isymbols, struct __pyx_obj_9pywrapfst_SymbolTable *__pyx_v_osymbols, struct __pyx_obj_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
  PyObject *__pyx_t_1 = NULL;
  std::string __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  fst::SymbolTable *__pyx_t_5;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "pywrapfst.pyx":4150
 *                 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, 4150, __pyx_L1_error)
  }
  __pyx_v_self->_sstrm.reset(new std::stringstream());

  /* "pywrapfst.pyx":4151
 *                 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_convert_PyBytes_string_to_py_std__in_string(__pyx_v_fst_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4151, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __pyx_f_9pywrapfst_tostring(__pyx_t_1, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4151, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst_type");
    __PYX_ERR(0, 4151, __pyx_L1_error)
  }
  __pyx_v_self->_fst_type = __pyx_t_2;

  /* "pywrapfst.pyx":4152
 *     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_convert_PyBytes_string_to_py_std__in_string(__pyx_v_arc_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4152, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __pyx_f_9pywrapfst_tostring(__pyx_t_1, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4152, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_arc_type");
    __PYX_ERR(0, 4152, __pyx_L1_error)
  }
  __pyx_v_self->_arc_type = __pyx_t_2;

  /* "pywrapfst.pyx":4153
 *     self._fst_type = tostring(fst_type)
 *     self._arc_type = tostring(arc_type)
 *     self._isymbols = NULL             # <<<<<<<<<<<<<<
 *     if isymbols is not None:
 *       self._isymbols = isymbols._table
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_isymbols");
    __PYX_ERR(0, 4153, __pyx_L1_error)
  }
  __pyx_v_self->_isymbols = NULL;

  /* "pywrapfst.pyx":4154
 *     self._arc_type = tostring(arc_type)
 *     self._isymbols = NULL
 *     if isymbols is not None:             # <<<<<<<<<<<<<<
 *       self._isymbols = isymbols._table
 *     self._osymbols = NULL
 */
  __pyx_t_3 = (((PyObject *)__pyx_v_isymbols) != Py_None);
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {

    /* "pywrapfst.pyx":4155
 *     self._isymbols = NULL
 *     if isymbols is not None:
 *       self._isymbols = isymbols._table             # <<<<<<<<<<<<<<
 *     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'", "_table");
      __PYX_ERR(0, 4155, __pyx_L1_error)
    }
    __pyx_t_5 = __pyx_v_isymbols->__pyx_base.__pyx_base._table;
    if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_isymbols");
      __PYX_ERR(0, 4155, __pyx_L1_error)
    }
    __pyx_v_self->_isymbols = __pyx_t_5;

    /* "pywrapfst.pyx":4154
 *     self._arc_type = tostring(arc_type)
 *     self._isymbols = NULL
 *     if isymbols is not None:             # <<<<<<<<<<<<<<
 *       self._isymbols = isymbols._table
 *     self._osymbols = NULL
 */
  }

  /* "pywrapfst.pyx":4156
 *     if isymbols is not None:
 *       self._isymbols = isymbols._table
 *     self._osymbols = NULL             # <<<<<<<<<<<<<<
 *     if osymbols is not None:
 *       self._osymbols = osymbols._table
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_osymbols");
    __PYX_ERR(0, 4156, __pyx_L1_error)
  }
  __pyx_v_self->_osymbols = NULL;

  /* "pywrapfst.pyx":4157
 *       self._isymbols = isymbols._table
 *     self._osymbols = NULL
 *     if osymbols is not None:             # <<<<<<<<<<<<<<
 *       self._osymbols = osymbols._table
 *     self._ssymbols = NULL
 */
  __pyx_t_4 = (((PyObject *)__pyx_v_osymbols) != Py_None);
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "pywrapfst.pyx":4158
 *     self._osymbols = NULL
 *     if osymbols is not None:
 *       self._osymbols = osymbols._table             # <<<<<<<<<<<<<<
 *     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'", "_table");
      __PYX_ERR(0, 4158, __pyx_L1_error)
    }
    __pyx_t_5 = __pyx_v_osymbols->__pyx_base.__pyx_base._table;
    if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_osymbols");
      __PYX_ERR(0, 4158, __pyx_L1_error)
    }
    __pyx_v_self->_osymbols = __pyx_t_5;

    /* "pywrapfst.pyx":4157
 *       self._isymbols = isymbols._table
 *     self._osymbols = NULL
 *     if osymbols is not None:             # <<<<<<<<<<<<<<
 *       self._osymbols = osymbols._table
 *     self._ssymbols = NULL
 */
  }

  /* "pywrapfst.pyx":4159
 *     if osymbols is not None:
 *       self._osymbols = osymbols._table
 *     self._ssymbols = NULL             # <<<<<<<<<<<<<<
 *     if ssymbols is not None:
 *       self._ssymbols = ssymbols._table
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_ssymbols");
    __PYX_ERR(0, 4159, __pyx_L1_error)
  }
  __pyx_v_self->_ssymbols = NULL;

  /* "pywrapfst.pyx":4160
 *       self._osymbols = osymbols._table
 *     self._ssymbols = NULL
 *     if ssymbols is not None:             # <<<<<<<<<<<<<<
 *       self._ssymbols = ssymbols._table
 *     self._acceptor = acceptor
 */
  __pyx_t_3 = (((PyObject *)__pyx_v_ssymbols) != Py_None);
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {

    /* "pywrapfst.pyx":4161
 *     self._ssymbols = NULL
 *     if ssymbols is not None:
 *       self._ssymbols = ssymbols._table             # <<<<<<<<<<<<<<
 *     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'", "_table");
      __PYX_ERR(0, 4161, __pyx_L1_error)
    }
    __pyx_t_5 = __pyx_v_ssymbols->__pyx_base.__pyx_base._table;
    if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_ssymbols");
      __PYX_ERR(0, 4161, __pyx_L1_error)
    }
    __pyx_v_self->_ssymbols = __pyx_t_5;

    /* "pywrapfst.pyx":4160
 *       self._osymbols = osymbols._table
 *     self._ssymbols = NULL
 *     if ssymbols is not None:             # <<<<<<<<<<<<<<
 *       self._ssymbols = ssymbols._table
 *     self._acceptor = acceptor
 */
  }

  /* "pywrapfst.pyx":4162
 *     if ssymbols is not None:
 *       self._ssymbols = ssymbols._table
 *     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, 4162, __pyx_L1_error)
  }
  __pyx_v_self->_acceptor = __pyx_v_acceptor;

  /* "pywrapfst.pyx":4163
 *       self._ssymbols = ssymbols._table
 *     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, 4163, __pyx_L1_error)
  }
  __pyx_v_self->_keep_isymbols = __pyx_v_keep_isymbols;

  /* "pywrapfst.pyx":4164
 *     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, 4164, __pyx_L1_error)
  }
  __pyx_v_self->_keep_osymbols = __pyx_v_keep_osymbols;

  /* "pywrapfst.pyx":4165
 *     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, 4165, __pyx_L1_error)
  }
  __pyx_v_self->_keep_state_numbering = __pyx_v_keep_state_numbering;

  /* "pywrapfst.pyx":4166
 *     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, 4166, __pyx_L1_error)
  }
  __pyx_v_self->_allow_negative_labels = __pyx_v_allow_negative_labels;

  /* "pywrapfst.pyx":4139
 *   """
 * 
 *   def __cinit__(self,             # <<<<<<<<<<<<<<
 *                 string fst_type=b"vector",
 *                 string arc_type=b"standard",
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pywrapfst.Compiler.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":4168
 *     self._allow_negative_labels = allow_negative_labels
 * 
 *   cpdef _Fst compile(self):             # <<<<<<<<<<<<<<
 *     """
 *     compile()
 */

static PyObject *__pyx_pw_9pywrapfst_8Compiler_3compile(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst_8Compiler_compile(struct __pyx_obj_9pywrapfst_Compiler *__pyx_v_self, int __pyx_skip_dispatch) {
  std::unique_ptr<fst::script::FstClass>  __pyx_v_tfst;
  struct __pyx_obj_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;
  std::string __pyx_t_5;
  int __pyx_t_6;
  __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)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_compile); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4168, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_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);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4168, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4168, __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_9pywrapfst__Fst))))) __PYX_ERR(0, 4168, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_9pywrapfst__Fst *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pywrapfst.pyx":4183
 *     """
 *     cdef unique_ptr[fst.FstClass] tfst
 *     tfst.reset(fst.CompileFstInternal(deref(self._sstrm),             # <<<<<<<<<<<<<<
 *         b"<pywrapfst>", self._fst_type, self._arc_type, 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'", "_sstrm");
    __PYX_ERR(0, 4183, __pyx_L1_error)
  }

  /* "pywrapfst.pyx":4184
 *     cdef unique_ptr[fst.FstClass] tfst
 *     tfst.reset(fst.CompileFstInternal(deref(self._sstrm),
 *         b"<pywrapfst>", self._fst_type, self._arc_type, self._isymbols,             # <<<<<<<<<<<<<<
 *         self._osymbols, self._ssymbols, self._acceptor, self._keep_isymbols,
 *         self._keep_osymbols, self._keep_state_numbering,
 */
  __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_kp_b_pywrapfst); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4184, __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, 4184, __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, 4184, __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, 4184, __pyx_L1_error)
  }

  /* "pywrapfst.pyx":4185
 *     tfst.reset(fst.CompileFstInternal(deref(self._sstrm),
 *         b"<pywrapfst>", self._fst_type, self._arc_type, self._isymbols,
 *         self._osymbols, self._ssymbols, 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'", "_osymbols");
    __PYX_ERR(0, 4185, __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, 4185, __pyx_L1_error)
  }
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_acceptor");
    __PYX_ERR(0, 4185, __pyx_L1_error)
  }
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_keep_isymbols");
    __PYX_ERR(0, 4185, __pyx_L1_error)
  }

  /* "pywrapfst.pyx":4186
 *         b"<pywrapfst>", self._fst_type, self._arc_type, self._isymbols,
 *         self._osymbols, self._ssymbols, self._acceptor, 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_osymbols");
    __PYX_ERR(0, 4186, __pyx_L1_error)
  }
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_keep_state_numbering");
    __PYX_ERR(0, 4186, __pyx_L1_error)
  }

  /* "pywrapfst.pyx":4187
 *         self._osymbols, self._ssymbols, self._acceptor, self._keep_isymbols,
 *         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, 4187, __pyx_L1_error)
  }

  /* "pywrapfst.pyx":4183
 *     """
 *     cdef unique_ptr[fst.FstClass] tfst
 *     tfst.reset(fst.CompileFstInternal(deref(self._sstrm),             # <<<<<<<<<<<<<<
 *         b"<pywrapfst>", self._fst_type, self._arc_type, self._isymbols,
 *         self._osymbols, self._ssymbols, self._acceptor, self._keep_isymbols,
 */
  __pyx_v_tfst.reset(fst::script::CompileFstInternal((*__pyx_v_self->_sstrm), __pyx_t_5, __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));

  /* "pywrapfst.pyx":4188
 *         self._keep_osymbols, 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, 4188, __pyx_L1_error)
  }
  __pyx_v_self->_sstrm.reset(new std::stringstream());

  /* "pywrapfst.pyx":4189
 *         self._allow_negative_labels))
 *     self._sstrm.reset(new stringstream())
 *     if tfst.get() == NULL:             # <<<<<<<<<<<<<<
 *       raise FstOpError("Compilation failed")
 *     return _init_XFst(tfst.release())
 */
  __pyx_t_6 = ((__pyx_v_tfst.get() == NULL) != 0);
  if (__pyx_t_6) {

    /* "pywrapfst.pyx":4190
 *     self._sstrm.reset(new stringstream())
 *     if tfst.get() == NULL:
 *       raise FstOpError("Compilation failed")             # <<<<<<<<<<<<<<
 *     return _init_XFst(tfst.release())
 * 
 */
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstOpError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4190, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__90, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4190, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 4190, __pyx_L1_error)

    /* "pywrapfst.pyx":4189
 *         self._allow_negative_labels))
 *     self._sstrm.reset(new stringstream())
 *     if tfst.get() == NULL:             # <<<<<<<<<<<<<<
 *       raise FstOpError("Compilation failed")
 *     return _init_XFst(tfst.release())
 */
  }

  /* "pywrapfst.pyx":4191
 *     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_2 = ((PyObject *)__pyx_f_9pywrapfst__init_XFst(__pyx_v_tfst.release())); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4191, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = ((struct __pyx_obj_9pywrapfst__Fst *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":4168
 *     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("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_9pywrapfst_8Compiler_3compile(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_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_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_9pywrapfst_8Compiler_2compile(((struct __pyx_obj_9pywrapfst_Compiler *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_8Compiler_2compile(struct __pyx_obj_9pywrapfst_Compiler *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("compile", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_8Compiler_compile(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4168, __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("pywrapfst.Compiler.compile", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":4193
 *     return _init_XFst(tfst.release())
 * 
 *   cpdef void write(self, expression):             # <<<<<<<<<<<<<<
 *     """
 *     write(expression)
 */

static PyObject *__pyx_pw_9pywrapfst_8Compiler_5write(PyObject *__pyx_v_self, PyObject *__pyx_v_expression); /*proto*/
static void __pyx_f_9pywrapfst_8Compiler_write(struct __pyx_obj_9pywrapfst_Compiler *__pyx_v_self, PyObject *__pyx_v_expression, 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;
  std::string __pyx_t_6;
  __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)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_write); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4193, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_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);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_expression); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4193, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_expression};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4193, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_expression};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4193, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4193, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_expression);
          __Pyx_GIVEREF(__pyx_v_expression);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_expression);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4193, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pywrapfst.pyx":4209
 *       expression: A string expression to add to compiler string buffer.
 *     """
 *     deref(self._sstrm) << tostring(expression)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_sstrm");
    __PYX_ERR(0, 4209, __pyx_L1_error)
  }
  __pyx_t_6 = __pyx_f_9pywrapfst_tostring(__pyx_v_expression, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4209, __pyx_L1_error)
  ((*__pyx_v_self->_sstrm) << __pyx_t_6);

  /* "pywrapfst.pyx":4193
 *     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_XDECREF(__pyx_t_5);
  __Pyx_WriteUnraisable("pywrapfst.Compiler.write", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_8Compiler_5write(PyObject *__pyx_v_self, PyObject *__pyx_v_expression); /*proto*/
static char __pyx_doc_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        print >> compiler, \"0 0 49 49\"\n        print >> compiler, \"0\"\n\n    Args:\n      expression: A string expression to add to compiler string buffer.\n    ";
static PyObject *__pyx_pw_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_9pywrapfst_8Compiler_4write(((struct __pyx_obj_9pywrapfst_Compiler *)__pyx_v_self), ((PyObject *)__pyx_v_expression));

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

static PyObject *__pyx_pf_9pywrapfst_8Compiler_4write(struct __pyx_obj_9pywrapfst_Compiler *__pyx_v_self, PyObject *__pyx_v_expression) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("write", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_9pywrapfst_8Compiler_write(__pyx_v_self, __pyx_v_expression, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4193, __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("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_9pywrapfst_8Compiler_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_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_9pywrapfst_8Compiler_6__reduce_cython__(((struct __pyx_obj_9pywrapfst_Compiler *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_8Compiler_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9pywrapfst_Compiler *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __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__91, 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("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_9pywrapfst_8Compiler_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static PyObject *__pyx_pw_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_9pywrapfst_8Compiler_8__setstate_cython__(((struct __pyx_obj_9pywrapfst_Compiler *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

static PyObject *__pyx_pf_9pywrapfst_8Compiler_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_9pywrapfst_Compiler *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __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__92, 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("pywrapfst.Compiler.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":4231
 *   """
 * 
 *   def __init__(self):             # <<<<<<<<<<<<<<
 *     raise FstDeletedConstructorError(
 *         "Cannot construct {}".format(self.__class__.__name__))
 */

/* Python wrapper */
static int __pyx_pw_9pywrapfst_9FarReader_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_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_9pywrapfst_9FarReader___init__(((struct __pyx_obj_9pywrapfst_FarReader *)__pyx_v_self));

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

static int __pyx_pf_9pywrapfst_9FarReader___init__(struct __pyx_obj_9pywrapfst_FarReader *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pywrapfst.pyx":4232
 * 
 *   def __init__(self):
 *     raise FstDeletedConstructorError(             # <<<<<<<<<<<<<<
 *         "Cannot construct {}".format(self.__class__.__name__))
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstDeletedConstructorError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4232, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "pywrapfst.pyx":4233
 *   def __init__(self):
 *     raise FstDeletedConstructorError(
 *         "Cannot construct {}".format(self.__class__.__name__))             # <<<<<<<<<<<<<<
 * 
 *   def __repr__(self):
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Cannot_construct, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4233, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4233, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_name); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4233, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (!__pyx_t_5) {
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4233, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_GOTREF(__pyx_t_3);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_6};
      __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4233, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_6};
      __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4233, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    } else
    #endif
    {
      __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4233, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_6);
      __pyx_t_6 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4233, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4232, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_3};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4232, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_3};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4232, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    } else
    #endif
    {
      __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4232, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL;
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4232, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
  }
  __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, 4232, __pyx_L1_error)

  /* "pywrapfst.pyx":4231
 *   """
 * 
 *   def __init__(self):             # <<<<<<<<<<<<<<
 *     raise FstDeletedConstructorError(
 *         "Cannot construct {}".format(self.__class__.__name__))
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pywrapfst.FarReader.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":4235
 *         "Cannot construct {}".format(self.__class__.__name__))
 * 
 *   def __repr__(self):             # <<<<<<<<<<<<<<
 *     return "<{} FarReader at 0x{:x}>".format(self.far_type(), id(self))
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_9FarReader_3__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9pywrapfst_9FarReader_3__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9pywrapfst_9FarReader_2__repr__(((struct __pyx_obj_9pywrapfst_FarReader *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_9FarReader_2__repr__(struct __pyx_obj_9pywrapfst_FarReader *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "pywrapfst.pyx":4236
 * 
 *   def __repr__(self):
 *     return "<{} FarReader at 0x{:x}>".format(self.far_type(), id(self))             # <<<<<<<<<<<<<<
 * 
 *   @classmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_FarReader_at_0x_x, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4236, __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'", "far_type");
    __PYX_ERR(0, 4236, __pyx_L1_error)
  }
  __pyx_t_3 = __pyx_convert_PyBytes_string_to_py_std__in_string(((struct __pyx_vtabstruct_9pywrapfst_FarReader *)__pyx_v_self->__pyx_vtab)->far_type(__pyx_v_self, 0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4236, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4236, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_self));
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4236, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_6 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4236, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4236, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else
  #endif
  {
    __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4236, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__pyx_t_4) {
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_5);
    __pyx_t_3 = 0;
    __pyx_t_5 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4236, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":4235
 *         "Cannot construct {}".format(self.__class__.__name__))
 * 
 *   def __repr__(self):             # <<<<<<<<<<<<<<
 *     return "<{} FarReader at 0x{:x}>".format(self.far_type(), id(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_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pywrapfst.FarReader.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":4239
 * 
 *   @classmethod
 *   def open(cls, *filenames):             # <<<<<<<<<<<<<<
 *     """
 *     FarReader.open(*filenames)
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_9FarReader_5open(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9pywrapfst_9FarReader_4open[] = "\n    FarReader.open(*filenames)\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      *filenames: 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_9pywrapfst_9FarReader_5open(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_filenames = 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_filenames = __pyx_args;
  __pyx_r = __pyx_pf_9pywrapfst_9FarReader_4open(((PyTypeObject*)__pyx_v_cls), __pyx_v_filenames);

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

static PyObject *__pyx_pf_9pywrapfst_9FarReader_4open(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_filenames) {
  std::unique_ptr<fst::script::FarReaderClass>  __pyx_v_tfar;
  struct __pyx_obj_9pywrapfst_FarReader *__pyx_v_result = 0;
  PyObject *__pyx_v_filename = 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;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  __Pyx_RefNannySetupContext("open", 0);
  __Pyx_INCREF(__pyx_v_filenames);

  /* "pywrapfst.pyx":4257
 *       FstIOError: Read failed.
 *     """
 *     filenames = [tostring(filename) for filename in filenames]             # <<<<<<<<<<<<<<
 *     cdef unique_ptr[fst.FarReaderClass] tfar
 *     tfar.reset(fst.FarReaderClass.Open(filenames))
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4257, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __pyx_v_filenames; __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, 4257, __pyx_L1_error)
    #else
    __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4257, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_filename, __pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_5 = __pyx_f_9pywrapfst_tostring(__pyx_v_filename, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4257, __pyx_L1_error)
    __pyx_t_4 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4257, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 4257, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF_SET(__pyx_v_filenames, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "pywrapfst.pyx":4259
 *     filenames = [tostring(filename) for filename in filenames]
 *     cdef unique_ptr[fst.FarReaderClass] tfar
 *     tfar.reset(fst.FarReaderClass.Open(filenames))             # <<<<<<<<<<<<<<
 *     if tfar.get() == NULL:
 *       raise FstIOError("Read failed: {!r}".format(filenames))
 */
  __pyx_t_6 = __pyx_convert_vector_from_py_std_3a__3a_string(__pyx_v_filenames); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4259, __pyx_L1_error)
  __pyx_v_tfar.reset(fst::script::FarReaderClass::Open(__pyx_t_6));

  /* "pywrapfst.pyx":4260
 *     cdef unique_ptr[fst.FarReaderClass] tfar
 *     tfar.reset(fst.FarReaderClass.Open(filenames))
 *     if tfar.get() == NULL:             # <<<<<<<<<<<<<<
 *       raise FstIOError("Read failed: {!r}".format(filenames))
 *     cdef FarReader result = FarReader.__new__(FarReader)
 */
  __pyx_t_7 = ((__pyx_v_tfar.get() == NULL) != 0);
  if (__pyx_t_7) {

    /* "pywrapfst.pyx":4261
 *     tfar.reset(fst.FarReaderClass.Open(filenames))
 *     if tfar.get() == NULL:
 *       raise FstIOError("Read failed: {!r}".format(filenames))             # <<<<<<<<<<<<<<
 *     cdef FarReader result = FarReader.__new__(FarReader)
 *     result._reader.reset(tfar.release())
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIOError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4261, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Read_failed_r, __pyx_n_s_format); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4261, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_8, function);
      }
    }
    if (!__pyx_t_9) {
      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_v_filenames); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4261, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_8)) {
        PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_v_filenames};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4261, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
        PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_v_filenames};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4261, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4261, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); __pyx_t_9 = NULL;
        __Pyx_INCREF(__pyx_v_filenames);
        __Pyx_GIVEREF(__pyx_v_filenames);
        PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_v_filenames);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4261, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_8) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4261, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_2)) {
        PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_4};
        __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4261, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
        PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_4};
        __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4261, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else
      #endif
      {
        __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4261, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __pyx_t_8 = NULL;
        __Pyx_GIVEREF(__pyx_t_4);
        PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_4);
        __pyx_t_4 = 0;
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4261, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      }
    }
    __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, 4261, __pyx_L1_error)

    /* "pywrapfst.pyx":4260
 *     cdef unique_ptr[fst.FarReaderClass] tfar
 *     tfar.reset(fst.FarReaderClass.Open(filenames))
 *     if tfar.get() == NULL:             # <<<<<<<<<<<<<<
 *       raise FstIOError("Read failed: {!r}".format(filenames))
 *     cdef FarReader result = FarReader.__new__(FarReader)
 */
  }

  /* "pywrapfst.pyx":4262
 *     if tfar.get() == NULL:
 *       raise FstIOError("Read failed: {!r}".format(filenames))
 *     cdef FarReader result = FarReader.__new__(FarReader)             # <<<<<<<<<<<<<<
 *     result._reader.reset(tfar.release())
 *     return result
 */
  __pyx_t_1 = __pyx_tp_new_9pywrapfst_FarReader(((PyTypeObject *)__pyx_ptype_9pywrapfst_FarReader), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4262, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_9pywrapfst_FarReader)))) __PYX_ERR(0, 4262, __pyx_L1_error)
  __pyx_v_result = ((struct __pyx_obj_9pywrapfst_FarReader *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pywrapfst.pyx":4263
 *       raise FstIOError("Read failed: {!r}".format(filenames))
 *     cdef FarReader result = FarReader.__new__(FarReader)
 *     result._reader.reset(tfar.release())             # <<<<<<<<<<<<<<
 *     return result
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_result) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_reader");
    __PYX_ERR(0, 4263, __pyx_L1_error)
  }
  __pyx_v_result->_reader.reset(__pyx_v_tfar.release());

  /* "pywrapfst.pyx":4264
 *     cdef FarReader result = FarReader.__new__(FarReader)
 *     result._reader.reset(tfar.release())
 *     return result             # <<<<<<<<<<<<<<
 * 
 *   cpdef string arc_type(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  /* "pywrapfst.pyx":4239
 * 
 *   @classmethod
 *   def open(cls, *filenames):             # <<<<<<<<<<<<<<
 *     """
 *     FarReader.open(*filenames)
 */

  /* 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_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("pywrapfst.FarReader.open", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_filenames);
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_filename);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":4266
 *     return result
 * 
 *   cpdef string arc_type(self):             # <<<<<<<<<<<<<<
 *     """
 *     arc_type(self)
 */

static PyObject *__pyx_pw_9pywrapfst_9FarReader_7arc_type(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static std::string __pyx_f_9pywrapfst_9FarReader_arc_type(struct __pyx_obj_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;
  __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)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_arc_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4266, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_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);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4266, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4266, __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, 4266, __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;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pywrapfst.pyx":4272
 *     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, 4272, __pyx_L1_error)
  }
  __pyx_r = __pyx_v_self->_reader.get()->ArcType();
  goto __pyx_L0;

  /* "pywrapfst.pyx":4266
 *     return result
 * 
 *   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("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_9pywrapfst_9FarReader_7arc_type(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_9pywrapfst_9FarReader_6arc_type[] = "\n    arc_type(self)\n\n    Returns a string indicating the arc type.\n    ";
static PyObject *__pyx_pw_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_9pywrapfst_9FarReader_6arc_type(((struct __pyx_obj_9pywrapfst_FarReader *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_9FarReader_6arc_type(struct __pyx_obj_9pywrapfst_FarReader *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("arc_type", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_f_9pywrapfst_9FarReader_arc_type(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4266, __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("pywrapfst.FarReader.arc_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":4274
 *     return self._reader.get().ArcType()
 * 
 *   cpdef bool done(self):             # <<<<<<<<<<<<<<
 *     """
 *     done(self)
 */

static PyObject *__pyx_pw_9pywrapfst_9FarReader_9done(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static bool __pyx_f_9pywrapfst_9FarReader_done(struct __pyx_obj_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;
  __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)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_done); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4274, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_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);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4274, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4274, __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, 4274, __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;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pywrapfst.pyx":4283
 *       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, 4283, __pyx_L1_error)
  }
  __pyx_r = __pyx_v_self->_reader.get()->Done();
  goto __pyx_L0;

  /* "pywrapfst.pyx":4274
 *     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("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_9pywrapfst_9FarReader_9done(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_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_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_9pywrapfst_9FarReader_8done(((struct __pyx_obj_9pywrapfst_FarReader *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_9FarReader_8done(struct __pyx_obj_9pywrapfst_FarReader *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("done", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_9pywrapfst_9FarReader_done(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4274, __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("pywrapfst.FarReader.done", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":4285
 *     return self._reader.get().Done()
 * 
 *   cpdef bool error(self):             # <<<<<<<<<<<<<<
 *     """
 *     error(self)
 */

static PyObject *__pyx_pw_9pywrapfst_9FarReader_11error(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static bool __pyx_f_9pywrapfst_9FarReader_error(struct __pyx_obj_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;
  __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)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4285, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_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);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4285, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4285, __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, 4285, __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;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pywrapfst.pyx":4294
 *       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, 4294, __pyx_L1_error)
  }
  __pyx_r = __pyx_v_self->_reader.get()->Error();
  goto __pyx_L0;

  /* "pywrapfst.pyx":4285
 *     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("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_9pywrapfst_9FarReader_11error(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_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_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_9pywrapfst_9FarReader_10error(((struct __pyx_obj_9pywrapfst_FarReader *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_9FarReader_10error(struct __pyx_obj_9pywrapfst_FarReader *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("error", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_9pywrapfst_9FarReader_error(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4285, __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("pywrapfst.FarReader.error", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":4296
 *     return self._reader.get().Error()
 * 
 *   cpdef string far_type(self):             # <<<<<<<<<<<<<<
 *     return fst.GetFarTypeString(self._reader.get().Type())
 * 
 */

static PyObject *__pyx_pw_9pywrapfst_9FarReader_13far_type(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static std::string __pyx_f_9pywrapfst_9FarReader_far_type(struct __pyx_obj_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;
  __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)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_far_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4296, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_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);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4296, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4296, __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, 4296, __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;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pywrapfst.pyx":4297
 * 
 *   cpdef string far_type(self):
 *     return fst.GetFarTypeString(self._reader.get().Type())             # <<<<<<<<<<<<<<
 * 
 *   cpdef bool find(self, key) except *:
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_reader");
    __PYX_ERR(0, 4297, __pyx_L1_error)
  }
  __pyx_r = fst::GetFarTypeString(__pyx_v_self->_reader.get()->Type());
  goto __pyx_L0;

  /* "pywrapfst.pyx":4296
 *     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("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_9pywrapfst_9FarReader_13far_type(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_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_9pywrapfst_9FarReader_12far_type(((struct __pyx_obj_9pywrapfst_FarReader *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_9FarReader_12far_type(struct __pyx_obj_9pywrapfst_FarReader *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("far_type", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_f_9pywrapfst_9FarReader_far_type(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4296, __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("pywrapfst.FarReader.far_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":4299
 *     return fst.GetFarTypeString(self._reader.get().Type())
 * 
 *   cpdef bool find(self, key) except *:             # <<<<<<<<<<<<<<
 *     """
 *     find(self, key)
 */

static PyObject *__pyx_pw_9pywrapfst_9FarReader_15find(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static bool __pyx_f_9pywrapfst_9FarReader_find(struct __pyx_obj_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;
  PyObject *__pyx_t_5 = NULL;
  bool __pyx_t_6;
  std::string __pyx_t_7;
  __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)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_find); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4299, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_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);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4299, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4299, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4299, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4299, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_key);
          __Pyx_GIVEREF(__pyx_v_key);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_key);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4299, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4299, __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;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pywrapfst.pyx":4312
 *       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, 4312, __pyx_L1_error)
  }
  __pyx_t_7 = __pyx_f_9pywrapfst_tostring(__pyx_v_key, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4312, __pyx_L1_error)
  __pyx_r = __pyx_v_self->_reader.get()->Find(__pyx_t_7);
  goto __pyx_L0;

  /* "pywrapfst.pyx":4299
 *     return fst.GetFarTypeString(self._reader.get().Type())
 * 
 *   cpdef bool find(self, key) except *:             # <<<<<<<<<<<<<<
 *     """
 *     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_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pywrapfst.FarReader.find", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_9FarReader_15find(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static char __pyx_doc_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_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_9pywrapfst_9FarReader_14find(((struct __pyx_obj_9pywrapfst_FarReader *)__pyx_v_self), ((PyObject *)__pyx_v_key));

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

static PyObject *__pyx_pf_9pywrapfst_9FarReader_14find(struct __pyx_obj_9pywrapfst_FarReader *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  bool __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("find", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_9pywrapfst_9FarReader_find(__pyx_v_self, __pyx_v_key, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4299, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4299, __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("pywrapfst.FarReader.find", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":4314
 *     return self._reader.get().Find(tostring(key))
 * 
 *   cpdef _Fst get_fst(self):             # <<<<<<<<<<<<<<
 *     """
 *     get_fst(self)
 */

static PyObject *__pyx_pw_9pywrapfst_9FarReader_17get_fst(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst_9FarReader_get_fst(struct __pyx_obj_9pywrapfst_FarReader *__pyx_v_self, int __pyx_skip_dispatch) {
  struct __pyx_obj_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;
  __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)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_fst); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4314, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_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);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4314, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4314, __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_9pywrapfst__Fst))))) __PYX_ERR(0, 4314, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_9pywrapfst__Fst *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pywrapfst.pyx":4323
 *       A copy of the FST at the current position.
 *     """
 *     return _init_XFst(new fst.FstClass(             # <<<<<<<<<<<<<<
 *         deref(self._reader.get().GetFstClass())))
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));

  /* "pywrapfst.pyx":4324
 *     """
 *     return _init_XFst(new fst.FstClass(
 *         deref(self._reader.get().GetFstClass())))             # <<<<<<<<<<<<<<
 * 
 *   cpdef string get_key(self):
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_reader");
    __PYX_ERR(0, 4324, __pyx_L1_error)
  }

  /* "pywrapfst.pyx":4323
 *       A copy of the FST at the current position.
 *     """
 *     return _init_XFst(new fst.FstClass(             # <<<<<<<<<<<<<<
 *         deref(self._reader.get().GetFstClass())))
 * 
 */
  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_XFst(new fst::script::FstClass((*__pyx_v_self->_reader.get()->GetFstClass())))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4323, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_9pywrapfst__Fst *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":4314
 *     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("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_9pywrapfst_9FarReader_17get_fst(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_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_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_9pywrapfst_9FarReader_16get_fst(((struct __pyx_obj_9pywrapfst_FarReader *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_9FarReader_16get_fst(struct __pyx_obj_9pywrapfst_FarReader *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("get_fst", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_9FarReader_get_fst(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4314, __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("pywrapfst.FarReader.get_fst", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":4326
 *         deref(self._reader.get().GetFstClass())))
 * 
 *   cpdef string get_key(self):             # <<<<<<<<<<<<<<
 *     """
 *     get_key(self)
 */

static PyObject *__pyx_pw_9pywrapfst_9FarReader_19get_key(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static std::string __pyx_f_9pywrapfst_9FarReader_get_key(struct __pyx_obj_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;
  __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)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4326, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_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);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4326, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4326, __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, 4326, __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;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pywrapfst.pyx":4335
 *       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, 4335, __pyx_L1_error)
  }
  __pyx_r = __pyx_v_self->_reader.get()->GetKey();
  goto __pyx_L0;

  /* "pywrapfst.pyx":4326
 *         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("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_9pywrapfst_9FarReader_19get_key(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_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_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_9pywrapfst_9FarReader_18get_key(((struct __pyx_obj_9pywrapfst_FarReader *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_9FarReader_18get_key(struct __pyx_obj_9pywrapfst_FarReader *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("get_key", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_f_9pywrapfst_9FarReader_get_key(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4326, __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("pywrapfst.FarReader.get_key", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":4337
 *     return self._reader.get().GetKey()
 * 
 *   cpdef void next(self):             # <<<<<<<<<<<<<<
 *     """
 *     next(self)
 */

static PyObject *__pyx_pw_9pywrapfst_9FarReader_21next(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static void __pyx_f_9pywrapfst_9FarReader_next(struct __pyx_obj_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;
  __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)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_next); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4337, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_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);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4337, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4337, __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;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pywrapfst.pyx":4343
 *     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, 4343, __pyx_L1_error)
  }
  __pyx_v_self->_reader.get()->Next();

  /* "pywrapfst.pyx":4337
 *     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("pywrapfst.FarReader.next", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_9FarReader_21next(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_9pywrapfst_9FarReader_20next[] = "\n    next(self)\n\n    Advances the iterator.\n    ";
static PyObject *__pyx_pw_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_9pywrapfst_9FarReader_20next(((struct __pyx_obj_9pywrapfst_FarReader *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_9FarReader_20next(struct __pyx_obj_9pywrapfst_FarReader *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("next", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_9pywrapfst_9FarReader_next(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4337, __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("pywrapfst.FarReader.next", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":4345
 *     self._reader.get().Next()
 * 
 *   cpdef void reset(self):             # <<<<<<<<<<<<<<
 *     """
 *     reset(self)
 */

static PyObject *__pyx_pw_9pywrapfst_9FarReader_23reset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static void __pyx_f_9pywrapfst_9FarReader_reset(struct __pyx_obj_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;
  __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)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4345, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_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);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4345, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4345, __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;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pywrapfst.pyx":4351
 *     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, 4351, __pyx_L1_error)
  }
  __pyx_v_self->_reader.get()->Reset();

  /* "pywrapfst.pyx":4345
 *     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("pywrapfst.FarReader.reset", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_9FarReader_23reset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_9pywrapfst_9FarReader_22reset[] = "\n    reset(self)\n\n    Resets the iterator to the initial position.\n    ";
static PyObject *__pyx_pw_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_9pywrapfst_9FarReader_22reset(((struct __pyx_obj_9pywrapfst_FarReader *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_9FarReader_22reset(struct __pyx_obj_9pywrapfst_FarReader *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("reset", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_9pywrapfst_9FarReader_reset(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4345, __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("pywrapfst.FarReader.reset", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":4353
 *     self._reader.get().Reset()
 * 
 *   def __getitem__(self, key):             # <<<<<<<<<<<<<<
 *     cdef string ckey = tostring(key)
 *     if self.get_key() == ckey or self._reader.get().Find(ckey):
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_9FarReader_25__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_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_9pywrapfst_9FarReader_24__getitem__(((struct __pyx_obj_9pywrapfst_FarReader *)__pyx_v_self), ((PyObject *)__pyx_v_key));

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

static PyObject *__pyx_pf_9pywrapfst_9FarReader_24__getitem__(struct __pyx_obj_9pywrapfst_FarReader *__pyx_v_self, PyObject *__pyx_v_key) {
  std::string __pyx_v_ckey;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "pywrapfst.pyx":4354
 * 
 *   def __getitem__(self, key):
 *     cdef string ckey = tostring(key)             # <<<<<<<<<<<<<<
 *     if self.get_key() == ckey or self._reader.get().Find(ckey):
 *       return self.get_fst()
 */
  __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_key, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4354, __pyx_L1_error)
  __pyx_v_ckey = __pyx_t_1;

  /* "pywrapfst.pyx":4355
 *   def __getitem__(self, key):
 *     cdef string ckey = tostring(key)
 *     if self.get_key() == ckey or self._reader.get().Find(ckey):             # <<<<<<<<<<<<<<
 *       return self.get_fst()
 *     raise KeyError(key)
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get_key");
    __PYX_ERR(0, 4355, __pyx_L1_error)
  }
  __pyx_t_3 = ((((struct __pyx_vtabstruct_9pywrapfst_FarReader *)__pyx_v_self->__pyx_vtab)->get_key(__pyx_v_self, 0) == __pyx_v_ckey) != 0);
  if (!__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_reader");
    __PYX_ERR(0, 4355, __pyx_L1_error)
  }
  __pyx_t_3 = (__pyx_v_self->_reader.get()->Find(__pyx_v_ckey) != 0);
  __pyx_t_2 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "pywrapfst.pyx":4356
 *     cdef string ckey = tostring(key)
 *     if self.get_key() == ckey or self._reader.get().Find(ckey):
 *       return self.get_fst()             # <<<<<<<<<<<<<<
 *     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, 4356, __pyx_L1_error)
    }
    __pyx_t_4 = ((PyObject *)((struct __pyx_vtabstruct_9pywrapfst_FarReader *)__pyx_v_self->__pyx_vtab)->get_fst(__pyx_v_self, 0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4356, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "pywrapfst.pyx":4355
 *   def __getitem__(self, key):
 *     cdef string ckey = tostring(key)
 *     if self.get_key() == ckey or self._reader.get().Find(ckey):             # <<<<<<<<<<<<<<
 *       return self.get_fst()
 *     raise KeyError(key)
 */
  }

  /* "pywrapfst.pyx":4357
 *     if self.get_key() == ckey or self._reader.get().Find(ckey):
 *       return self.get_fst()
 *     raise KeyError(key)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4357, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_key);
  __Pyx_GIVEREF(__pyx_v_key);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_key);
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_KeyError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4357, __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, 4357, __pyx_L1_error)

  /* "pywrapfst.pyx":4353
 *     self._reader.get().Reset()
 * 
 *   def __getitem__(self, key):             # <<<<<<<<<<<<<<
 *     cdef string ckey = tostring(key)
 *     if self.get_key() == ckey or self._reader.get().Find(ckey):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pywrapfst.FarReader.__getitem__", __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._reader cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_9FarReader_27__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_9pywrapfst_9FarReader_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_9pywrapfst_9FarReader_26__reduce_cython__(((struct __pyx_obj_9pywrapfst_FarReader *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_9FarReader_26__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9pywrapfst_FarReader *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __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__93, 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("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_9pywrapfst_9FarReader_29__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static PyObject *__pyx_pw_9pywrapfst_9FarReader_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_9pywrapfst_9FarReader_28__setstate_cython__(((struct __pyx_obj_9pywrapfst_FarReader *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

static PyObject *__pyx_pf_9pywrapfst_9FarReader_28__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_9pywrapfst_FarReader *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __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__94, 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("pywrapfst.FarReader.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":4380
 *   """
 * 
 *   def __init__(self):             # <<<<<<<<<<<<<<
 *     raise FstDeletedConstructorError(
 *         "Cannot construct {}".format(self.__class__.__name__))
 */

/* Python wrapper */
static int __pyx_pw_9pywrapfst_9FarWriter_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_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_9pywrapfst_9FarWriter___init__(((struct __pyx_obj_9pywrapfst_FarWriter *)__pyx_v_self));

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

static int __pyx_pf_9pywrapfst_9FarWriter___init__(struct __pyx_obj_9pywrapfst_FarWriter *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pywrapfst.pyx":4381
 * 
 *   def __init__(self):
 *     raise FstDeletedConstructorError(             # <<<<<<<<<<<<<<
 *         "Cannot construct {}".format(self.__class__.__name__))
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstDeletedConstructorError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4381, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "pywrapfst.pyx":4382
 *   def __init__(self):
 *     raise FstDeletedConstructorError(
 *         "Cannot construct {}".format(self.__class__.__name__))             # <<<<<<<<<<<<<<
 * 
 *   def __repr__(self):
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Cannot_construct, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4382, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4382, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_name); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4382, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (!__pyx_t_5) {
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4382, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_GOTREF(__pyx_t_3);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_6};
      __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4382, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_6};
      __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4382, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    } else
    #endif
    {
      __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4382, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_6);
      __pyx_t_6 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4382, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4381, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_3};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4381, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_3};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4381, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    } else
    #endif
    {
      __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4381, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL;
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4381, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
  }
  __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, 4381, __pyx_L1_error)

  /* "pywrapfst.pyx":4380
 *   """
 * 
 *   def __init__(self):             # <<<<<<<<<<<<<<
 *     raise FstDeletedConstructorError(
 *         "Cannot construct {}".format(self.__class__.__name__))
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pywrapfst.FarWriter.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":4384
 *         "Cannot construct {}".format(self.__class__.__name__))
 * 
 *   def __repr__(self):             # <<<<<<<<<<<<<<
 *     return "<{} FarWriter at 0x{:x}>".format(self.far_type(), id(self))
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_9FarWriter_3__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9pywrapfst_9FarWriter_3__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9pywrapfst_9FarWriter_2__repr__(((struct __pyx_obj_9pywrapfst_FarWriter *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_9FarWriter_2__repr__(struct __pyx_obj_9pywrapfst_FarWriter *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "pywrapfst.pyx":4385
 * 
 *   def __repr__(self):
 *     return "<{} FarWriter at 0x{:x}>".format(self.far_type(), id(self))             # <<<<<<<<<<<<<<
 * 
 *   @classmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_FarWriter_at_0x_x, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4385, __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'", "far_type");
    __PYX_ERR(0, 4385, __pyx_L1_error)
  }
  __pyx_t_3 = __pyx_convert_PyBytes_string_to_py_std__in_string(((struct __pyx_vtabstruct_9pywrapfst_FarWriter *)__pyx_v_self->__pyx_vtab)->far_type(__pyx_v_self, 0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4385, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4385, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_self));
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4385, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_6 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4385, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4385, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else
  #endif
  {
    __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4385, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__pyx_t_4) {
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_5);
    __pyx_t_3 = 0;
    __pyx_t_5 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4385, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":4384
 *         "Cannot construct {}".format(self.__class__.__name__))
 * 
 *   def __repr__(self):             # <<<<<<<<<<<<<<
 *     return "<{} FarWriter at 0x{:x}>".format(self.far_type(), id(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_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pywrapfst.FarWriter.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":4388
 * 
 *   @classmethod
 *   def create(cls, filename, arc_type=b"standard", far_type=b"default"):             # <<<<<<<<<<<<<<
 *     """
 *     FarWriter.
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_9FarWriter_5create(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_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      filename: 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_9pywrapfst_9FarWriter_5create(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_filename = 0;
  PyObject *__pyx_v_arc_type = 0;
  PyObject *__pyx_v_far_type = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("create (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_filename,&__pyx_n_s_arc_type,&__pyx_n_s_far_type,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject *)__pyx_n_b_standard);
    values[2] = ((PyObject *)__pyx_n_b_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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_filename)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arc_type);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__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, 4388, __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_filename = 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, 4388, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pywrapfst.FarWriter.create", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pywrapfst_9FarWriter_4create(((PyTypeObject*)__pyx_v_cls), __pyx_v_filename, __pyx_v_arc_type, __pyx_v_far_type);

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

static PyObject *__pyx_pf_9pywrapfst_9FarWriter_4create(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_filename, PyObject *__pyx_v_arc_type, PyObject *__pyx_v_far_type) {
  enum fst::FarType __pyx_v_ft;
  fst::script::FarWriterClass *__pyx_v_tfar;
  struct __pyx_obj_9pywrapfst_FarWriter *__pyx_v_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::string __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;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  __Pyx_RefNannySetupContext("create", 0);

  /* "pywrapfst.pyx":4409
 *       FstIOError: Read failed.
 *     """
 *     cdef fst.FarType ft = fst.GetFarType(tostring(far_type))             # <<<<<<<<<<<<<<
 *     cdef fst.FarWriterClass *tfar = fst.FarWriterClass.Create(
 *         tostring(filename), tostring(arc_type), ft)
 */
  __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_far_type, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4409, __pyx_L1_error)
  __pyx_v_ft = fst::script::GetFarType(__pyx_t_1);

  /* "pywrapfst.pyx":4411
 *     cdef fst.FarType ft = fst.GetFarType(tostring(far_type))
 *     cdef fst.FarWriterClass *tfar = fst.FarWriterClass.Create(
 *         tostring(filename), tostring(arc_type), ft)             # <<<<<<<<<<<<<<
 *     if tfar == NULL:
 *       raise FstIOError("Open failed: {!r}".format(filename))
 */
  __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_filename, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4411, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_9pywrapfst_tostring(__pyx_v_arc_type, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4411, __pyx_L1_error)

  /* "pywrapfst.pyx":4410
 *     """
 *     cdef fst.FarType ft = fst.GetFarType(tostring(far_type))
 *     cdef fst.FarWriterClass *tfar = fst.FarWriterClass.Create(             # <<<<<<<<<<<<<<
 *         tostring(filename), tostring(arc_type), ft)
 *     if tfar == NULL:
 */
  __pyx_v_tfar = fst::script::FarWriterClass::Create(__pyx_t_1, __pyx_t_2, __pyx_v_ft);

  /* "pywrapfst.pyx":4412
 *     cdef fst.FarWriterClass *tfar = fst.FarWriterClass.Create(
 *         tostring(filename), tostring(arc_type), ft)
 *     if tfar == NULL:             # <<<<<<<<<<<<<<
 *       raise FstIOError("Open failed: {!r}".format(filename))
 *     cdef FarWriter result = FarWriter.__new__(FarWriter)
 */
  __pyx_t_3 = ((__pyx_v_tfar == NULL) != 0);
  if (__pyx_t_3) {

    /* "pywrapfst.pyx":4413
 *         tostring(filename), tostring(arc_type), ft)
 *     if tfar == NULL:
 *       raise FstIOError("Open failed: {!r}".format(filename))             # <<<<<<<<<<<<<<
 *     cdef FarWriter result = FarWriter.__new__(FarWriter)
 *     result._writer.reset(tfar)
 */
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIOError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4413, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Open_failed_r, __pyx_n_s_format); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4413, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
      }
    }
    if (!__pyx_t_8) {
      __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_filename); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4413, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_filename};
        __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4413, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_GOTREF(__pyx_t_6);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_filename};
        __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4413, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_GOTREF(__pyx_t_6);
      } else
      #endif
      {
        __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4413, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
        __Pyx_INCREF(__pyx_v_filename);
        __Pyx_GIVEREF(__pyx_v_filename);
        PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_v_filename);
        __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4413, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = 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);
      }
    }
    if (!__pyx_t_7) {
      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4413, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_4);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_5)) {
        PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4413, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
        PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4413, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else
      #endif
      {
        __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4413, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
        __Pyx_GIVEREF(__pyx_t_6);
        PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_6);
        __pyx_t_6 = 0;
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4413, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(0, 4413, __pyx_L1_error)

    /* "pywrapfst.pyx":4412
 *     cdef fst.FarWriterClass *tfar = fst.FarWriterClass.Create(
 *         tostring(filename), tostring(arc_type), ft)
 *     if tfar == NULL:             # <<<<<<<<<<<<<<
 *       raise FstIOError("Open failed: {!r}".format(filename))
 *     cdef FarWriter result = FarWriter.__new__(FarWriter)
 */
  }

  /* "pywrapfst.pyx":4414
 *     if tfar == NULL:
 *       raise FstIOError("Open failed: {!r}".format(filename))
 *     cdef FarWriter result = FarWriter.__new__(FarWriter)             # <<<<<<<<<<<<<<
 *     result._writer.reset(tfar)
 *     return result
 */
  __pyx_t_4 = __pyx_tp_new_9pywrapfst_FarWriter(((PyTypeObject *)__pyx_ptype_9pywrapfst_FarWriter), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4414, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (!(likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_9pywrapfst_FarWriter)))) __PYX_ERR(0, 4414, __pyx_L1_error)
  __pyx_v_result = ((struct __pyx_obj_9pywrapfst_FarWriter *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pywrapfst.pyx":4415
 *       raise FstIOError("Open failed: {!r}".format(filename))
 *     cdef FarWriter result = FarWriter.__new__(FarWriter)
 *     result._writer.reset(tfar)             # <<<<<<<<<<<<<<
 *     return result
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_result) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_writer");
    __PYX_ERR(0, 4415, __pyx_L1_error)
  }
  __pyx_v_result->_writer.reset(__pyx_v_tfar);

  /* "pywrapfst.pyx":4416
 *     cdef FarWriter result = FarWriter.__new__(FarWriter)
 *     result._writer.reset(tfar)
 *     return result             # <<<<<<<<<<<<<<
 * 
 *   # NB: Invoking this method may be dangerous: calling any other method on the
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  /* "pywrapfst.pyx":4388
 * 
 *   @classmethod
 *   def create(cls, filename, arc_type=b"standard", far_type=b"default"):             # <<<<<<<<<<<<<<
 *     """
 *     FarWriter.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("pywrapfst.FarWriter.create", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":4420
 *   # 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_9pywrapfst_9FarWriter_close(struct __pyx_obj_9pywrapfst_FarWriter *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("close", 0);

  /* "pywrapfst.pyx":4421
 *   # 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, 4421, __pyx_L1_error)
  }
  __pyx_v_self->_writer.reset();

  /* "pywrapfst.pyx":4420
 *   # 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("pywrapfst.FarWriter.close", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pywrapfst.pyx":4423
 *     self._writer.reset()
 * 
 *   cpdef void add(self, key, _Fst ifst) except *:             # <<<<<<<<<<<<<<
 *     """
 *     add(self, key, ifst)
 */

static PyObject *__pyx_pw_9pywrapfst_9FarWriter_7add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static void __pyx_f_9pywrapfst_9FarWriter_add(struct __pyx_obj_9pywrapfst_FarWriter *__pyx_v_self, PyObject *__pyx_v_key, struct __pyx_obj_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;
  __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)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4423, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_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, 4423, __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, 4423, __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, 4423, __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, 4423, __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;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pywrapfst.pyx":4442
 *     # 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")
 *     # An error here usually indicates a key out of order.
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_writer");
    __PYX_ERR(0, 4442, __pyx_L1_error)
  }
  __pyx_t_7 = __pyx_f_9pywrapfst_tostring(__pyx_v_key, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4442, __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, 4442, __pyx_L1_error)
  }
  __pyx_t_8 = ((!(__pyx_v_self->_writer.get()->Add(__pyx_t_7, (*__pyx_v_ifst->_fst)) != 0)) != 0);
  if (__pyx_t_8) {

    /* "pywrapfst.pyx":4443
 *     # 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")             # <<<<<<<<<<<<<<
 *     # An error here usually indicates a key out of order.
 *     if self._writer.get().Error():
 */
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstOpError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4443, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__95, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4443, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 4443, __pyx_L1_error)

    /* "pywrapfst.pyx":4442
 *     # 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")
 *     # An error here usually indicates a key out of order.
 */
  }

  /* "pywrapfst.pyx":4445
 *       raise FstOpError("Incompatible or invalid arc type")
 *     # An error here usually indicates a key out of order.
 *     if self._writer.get().Error():             # <<<<<<<<<<<<<<
 *       raise FstArgError("Key out of order")
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_writer");
    __PYX_ERR(0, 4445, __pyx_L1_error)
  }
  __pyx_t_8 = (__pyx_v_self->_writer.get()->Error() != 0);
  if (__pyx_t_8) {

    /* "pywrapfst.pyx":4446
 *     # An error here usually indicates a key out of order.
 *     if self._writer.get().Error():
 *       raise FstArgError("Key out of order")             # <<<<<<<<<<<<<<
 * 
 *   cpdef string arc_type(self):
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstArgError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4446, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__96, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4446, __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, 4446, __pyx_L1_error)

    /* "pywrapfst.pyx":4445
 *       raise FstOpError("Incompatible or invalid arc type")
 *     # An error here usually indicates a key out of order.
 *     if self._writer.get().Error():             # <<<<<<<<<<<<<<
 *       raise FstArgError("Key out of order")
 * 
 */
  }

  /* "pywrapfst.pyx":4423
 *     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("pywrapfst.FarWriter.add", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_9FarWriter_7add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_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      FstArgError: Key out of order.\n      FstOpError: Incompatible or invalid arc type.\n    ";
static PyObject *__pyx_pw_9pywrapfst_9FarWriter_7add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_key = 0;
  struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst = 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] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ifst)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("add", 1, 2, 2, 1); __PYX_ERR(0, 4423, __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, 4423, __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_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, 4423, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("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_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 4423, __pyx_L1_error)
  __pyx_r = __pyx_pf_9pywrapfst_9FarWriter_6add(((struct __pyx_obj_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_9pywrapfst_9FarWriter_6add(struct __pyx_obj_9pywrapfst_FarWriter *__pyx_v_self, PyObject *__pyx_v_key, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("add", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_9pywrapfst_9FarWriter_add(__pyx_v_self, __pyx_v_key, __pyx_v_ifst, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4423, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4423, __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("pywrapfst.FarWriter.add", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":4448
 *       raise FstArgError("Key out of order")
 * 
 *   cpdef string arc_type(self):             # <<<<<<<<<<<<<<
 *     """
 *     arc_type(self)
 */

static PyObject *__pyx_pw_9pywrapfst_9FarWriter_9arc_type(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static std::string __pyx_f_9pywrapfst_9FarWriter_arc_type(struct __pyx_obj_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;
  __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)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_arc_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4448, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_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);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4448, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4448, __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, 4448, __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;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pywrapfst.pyx":4454
 *     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, 4454, __pyx_L1_error)
  }
  __pyx_r = __pyx_v_self->_writer.get()->ArcType();
  goto __pyx_L0;

  /* "pywrapfst.pyx":4448
 *       raise FstArgError("Key out of order")
 * 
 *   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("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_9pywrapfst_9FarWriter_9arc_type(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_9pywrapfst_9FarWriter_8arc_type[] = "\n    arc_type(self)\n\n    Returns a string indicating the arc type.\n    ";
static PyObject *__pyx_pw_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_9pywrapfst_9FarWriter_8arc_type(((struct __pyx_obj_9pywrapfst_FarWriter *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_9FarWriter_8arc_type(struct __pyx_obj_9pywrapfst_FarWriter *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("arc_type", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_f_9pywrapfst_9FarWriter_arc_type(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4448, __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("pywrapfst.FarWriter.arc_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":4456
 *     return self._writer.get().ArcType()
 * 
 *   cpdef bool error(self):             # <<<<<<<<<<<<<<
 *     """
 *     error(self)
 */

static PyObject *__pyx_pw_9pywrapfst_9FarWriter_11error(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static bool __pyx_f_9pywrapfst_9FarWriter_error(struct __pyx_obj_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;
  __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)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4456, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_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);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4456, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4456, __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, 4456, __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;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pywrapfst.pyx":4465
 *       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, 4465, __pyx_L1_error)
  }
  __pyx_r = __pyx_v_self->_writer.get()->Error();
  goto __pyx_L0;

  /* "pywrapfst.pyx":4456
 *     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("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_9pywrapfst_9FarWriter_11error(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_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_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_9pywrapfst_9FarWriter_10error(((struct __pyx_obj_9pywrapfst_FarWriter *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_9FarWriter_10error(struct __pyx_obj_9pywrapfst_FarWriter *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("error", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_9pywrapfst_9FarWriter_error(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4456, __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("pywrapfst.FarWriter.error", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":4467
 *     return self._writer.get().Error()
 * 
 *   cpdef string far_type(self):             # <<<<<<<<<<<<<<
 *     """
 *     far_type(self)
 */

static PyObject *__pyx_pw_9pywrapfst_9FarWriter_13far_type(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static std::string __pyx_f_9pywrapfst_9FarWriter_far_type(struct __pyx_obj_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;
  __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)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_far_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4467, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_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);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4467, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4467, __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, 4467, __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;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pywrapfst.pyx":4473
 *     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, 4473, __pyx_L1_error)
  }
  __pyx_r = fst::GetFarTypeString(__pyx_v_self->_writer.get()->Type());
  goto __pyx_L0;

  /* "pywrapfst.pyx":4467
 *     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("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_9pywrapfst_9FarWriter_13far_type(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_9pywrapfst_9FarWriter_12far_type[] = "\n    far_type(self)\n\n    Returns a string indicating the FAR type.\n    ";
static PyObject *__pyx_pw_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_9pywrapfst_9FarWriter_12far_type(((struct __pyx_obj_9pywrapfst_FarWriter *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_9FarWriter_12far_type(struct __pyx_obj_9pywrapfst_FarWriter *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("far_type", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_f_9pywrapfst_9FarWriter_far_type(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4467, __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("pywrapfst.FarWriter.far_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":4476
 * 
 *   # Dictionary-like assignment.
 *   def __setitem__(self, key, _Fst fst):             # <<<<<<<<<<<<<<
 *     self.add(key, fst)
 * 
 */

/* Python wrapper */
static int __pyx_pw_9pywrapfst_9FarWriter_15__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_fst); /*proto*/
static int __pyx_pw_9pywrapfst_9FarWriter_15__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_fst) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fst), __pyx_ptype_9pywrapfst__Fst, 1, "fst", 0))) __PYX_ERR(0, 4476, __pyx_L1_error)
  __pyx_r = __pyx_pf_9pywrapfst_9FarWriter_14__setitem__(((struct __pyx_obj_9pywrapfst_FarWriter *)__pyx_v_self), ((PyObject *)__pyx_v_key), ((struct __pyx_obj_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_9pywrapfst_9FarWriter_14__setitem__(struct __pyx_obj_9pywrapfst_FarWriter *__pyx_v_self, PyObject *__pyx_v_key, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_fst) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setitem__", 0);

  /* "pywrapfst.pyx":4477
 *   # 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, 4477, __pyx_L1_error)
  }
  ((struct __pyx_vtabstruct_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, 4477, __pyx_L1_error)

  /* "pywrapfst.pyx":4476
 * 
 *   # 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("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_9pywrapfst_9FarWriter_17__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_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_9pywrapfst_9FarWriter_16__reduce_cython__(((struct __pyx_obj_9pywrapfst_FarWriter *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_9FarWriter_16__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9pywrapfst_FarWriter *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __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__97, 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("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_9pywrapfst_9FarWriter_19__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static PyObject *__pyx_pw_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_9pywrapfst_9FarWriter_18__setstate_cython__(((struct __pyx_obj_9pywrapfst_FarWriter *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

static PyObject *__pyx_pf_9pywrapfst_9FarWriter_18__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_9pywrapfst_FarWriter *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __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__98, 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("pywrapfst.FarWriter.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":4492
 * 
 * @atexit.register
 * def _reset_fst_error_fatal():             # <<<<<<<<<<<<<<
 *   fst.FLAGS_fst_error_fatal = _fst_error_fatal_old
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_59_reset_fst_error_fatal(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_9pywrapfst_59_reset_fst_error_fatal = {"_reset_fst_error_fatal", (PyCFunction)__pyx_pw_9pywrapfst_59_reset_fst_error_fatal, METH_NOARGS, 0};
static PyObject *__pyx_pw_9pywrapfst_59_reset_fst_error_fatal(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_reset_fst_error_fatal (wrapper)", 0);
  __pyx_r = __pyx_pf_9pywrapfst_58_reset_fst_error_fatal(__pyx_self);

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

static PyObject *__pyx_pf_9pywrapfst_58_reset_fst_error_fatal(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  bool __pyx_t_2;
  __Pyx_RefNannySetupContext("_reset_fst_error_fatal", 0);

  /* "pywrapfst.pyx":4493
 * @atexit.register
 * def _reset_fst_error_fatal():
 *   fst.FLAGS_fst_error_fatal = _fst_error_fatal_old             # <<<<<<<<<<<<<<
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_fst_error_fatal_old); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4493, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4493, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  FLAGS_fst_error_fatal = __pyx_t_2;

  /* "pywrapfst.pyx":4492
 * 
 * @atexit.register
 * def _reset_fst_error_fatal():             # <<<<<<<<<<<<<<
 *   fst.FLAGS_fst_error_fatal = _fst_error_fatal_old
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pywrapfst._reset_fst_error_fatal", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __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
 *     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;
  __Pyx_RefNannySetupContext("__pyx_convert_string_from_py_std__in_string", 0);

  /* "string.from_py":15
 * cdef string __pyx_convert_string_from_py_std__in_string(object o) except *:
 *     cdef Py_ssize_t length
 *     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
 *     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
 *     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;
  __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;
  __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;
  __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;
  __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;
  __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___pyx_t_10basictypes_int64")
 * cdef vector[X] __pyx_convert_vector_from_py___pyx_t_10basictypes_int64(object o) except *:             # <<<<<<<<<<<<<<
 *     cdef vector[X] v
 *     for item in o:
 */

static std::vector<__pyx_t_10basictypes_int64>  __pyx_convert_vector_from_py___pyx_t_10basictypes_int64(PyObject *__pyx_v_o) {
  std::vector<__pyx_t_10basictypes_int64>  __pyx_v_v;
  PyObject *__pyx_v_item = NULL;
  std::vector<__pyx_t_10basictypes_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;
  __pyx_t_10basictypes_int64 __pyx_t_5;
  __Pyx_RefNannySetupContext("__pyx_convert_vector_from_py___pyx_t_10basictypes_int64", 0);

  /* "vector.from_py":47
 * cdef vector[X] __pyx_convert_vector_from_py___pyx_t_10basictypes_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_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 48, __pyx_L1_error)
    __pyx_v_v.push_back(((__pyx_t_10basictypes_int64)__pyx_t_5));

    /* "vector.from_py":47
 * cdef vector[X] __pyx_convert_vector_from_py___pyx_t_10basictypes_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___pyx_t_10basictypes_int64")
 * cdef vector[X] __pyx_convert_vector_from_py___pyx_t_10basictypes_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___pyx_t_10basictypes_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;
  __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_9pywrapfst_Weight __pyx_vtable_9pywrapfst_Weight;

static PyObject *__pyx_tp_new_9pywrapfst_Weight(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_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_9pywrapfst_Weight *)o);
  p->__pyx_vtab = __pyx_vtabptr_9pywrapfst_Weight;
  new((void*)&(p->_weight)) std::unique_ptr<fst::script::WeightClass> ();
  return o;
}

static void __pyx_tp_dealloc_9pywrapfst_Weight(PyObject *o) {
  struct __pyx_obj_9pywrapfst_Weight *p = (struct __pyx_obj_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_9pywrapfst_Weight(PyObject *o1, PyObject *o2, int op) {
  switch (op) {
    case Py_EQ: {
      return __pyx_pw_9pywrapfst_6Weight_17__eq__(o1, o2);
    }
    case Py_NE: {
      return __pyx_pw_9pywrapfst_6Weight_19__ne__(o1, o2);
    }
    default: {
      return __Pyx_NewRef(Py_NotImplemented);
    }
  }
}

static PyMethodDef __pyx_methods_9pywrapfst_Weight[] = {
  {"copy", (PyCFunction)__pyx_pw_9pywrapfst_6Weight_9copy, METH_NOARGS, __pyx_doc_9pywrapfst_6Weight_8copy},
  {"Zero", (PyCFunction)__pyx_pw_9pywrapfst_6Weight_11Zero, METH_O, __pyx_doc_9pywrapfst_6Weight_10Zero},
  {"One", (PyCFunction)__pyx_pw_9pywrapfst_6Weight_13One, METH_O, __pyx_doc_9pywrapfst_6Weight_12One},
  {"NoWeight", (PyCFunction)__pyx_pw_9pywrapfst_6Weight_15NoWeight, METH_O, __pyx_doc_9pywrapfst_6Weight_14NoWeight},
  {"to_string", (PyCFunction)__pyx_pw_9pywrapfst_6Weight_21to_string, METH_NOARGS, 0},
  {"type", (PyCFunction)__pyx_pw_9pywrapfst_6Weight_23type, METH_NOARGS, __pyx_doc_9pywrapfst_6Weight_22type},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_9pywrapfst_6Weight_25__reduce_cython__, METH_NOARGS, 0},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_9pywrapfst_6Weight_27__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_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_9pywrapfst_Weight = {
  PyVarObject_HEAD_INIT(0, 0)
  "pywrapfst.Weight", /*tp_name*/
  sizeof(struct __pyx_obj_9pywrapfst_Weight), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_9pywrapfst_Weight, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_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_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_9pywrapfst_Weight, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_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_9pywrapfst_6Weight_7__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_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
};
static struct __pyx_vtabstruct_9pywrapfst__SymbolTable __pyx_vtable_9pywrapfst__SymbolTable;

static PyObject *__pyx_tp_new_9pywrapfst__SymbolTable(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_9pywrapfst__SymbolTable *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_9pywrapfst__SymbolTable *)o);
  p->__pyx_vtab = __pyx_vtabptr_9pywrapfst__SymbolTable;
  return o;
}

static void __pyx_tp_dealloc_9pywrapfst__SymbolTable(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_9pywrapfst__SymbolTable[] = {
  {"available_key", (PyCFunction)__pyx_pw_9pywrapfst_12_SymbolTable_5available_key, METH_NOARGS, __pyx_doc_9pywrapfst_12_SymbolTable_4available_key},
  {"checksum", (PyCFunction)__pyx_pw_9pywrapfst_12_SymbolTable_7checksum, METH_NOARGS, __pyx_doc_9pywrapfst_12_SymbolTable_6checksum},
  {"copy", (PyCFunction)__pyx_pw_9pywrapfst_12_SymbolTable_9copy, METH_NOARGS, __pyx_doc_9pywrapfst_12_SymbolTable_8copy},
  {"find", (PyCFunction)__pyx_pw_9pywrapfst_12_SymbolTable_11find, METH_O, __pyx_doc_9pywrapfst_12_SymbolTable_10find},
  {"get_nth_key", (PyCFunction)__pyx_pw_9pywrapfst_12_SymbolTable_13get_nth_key, METH_O, __pyx_doc_9pywrapfst_12_SymbolTable_12get_nth_key},
  {"labeled_checksum", (PyCFunction)__pyx_pw_9pywrapfst_12_SymbolTable_15labeled_checksum, METH_NOARGS, __pyx_doc_9pywrapfst_12_SymbolTable_14labeled_checksum},
  {"member", (PyCFunction)__pyx_pw_9pywrapfst_12_SymbolTable_17member, METH_O, __pyx_doc_9pywrapfst_12_SymbolTable_16member},
  {"name", (PyCFunction)__pyx_pw_9pywrapfst_12_SymbolTable_21name, METH_NOARGS, __pyx_doc_9pywrapfst_12_SymbolTable_20name},
  {"num_symbols", (PyCFunction)__pyx_pw_9pywrapfst_12_SymbolTable_23num_symbols, METH_NOARGS, __pyx_doc_9pywrapfst_12_SymbolTable_22num_symbols},
  {"write", (PyCFunction)__pyx_pw_9pywrapfst_12_SymbolTable_25write, METH_O, __pyx_doc_9pywrapfst_12_SymbolTable_24write},
  {"write_text", (PyCFunction)__pyx_pw_9pywrapfst_12_SymbolTable_27write_text, METH_O, __pyx_doc_9pywrapfst_12_SymbolTable_26write_text},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_9pywrapfst_12_SymbolTable_29__reduce_cython__, METH_NOARGS, 0},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_9pywrapfst_12_SymbolTable_31__setstate_cython__, METH_O, 0},
  {0, 0, 0, 0}
};

static PySequenceMethods __pyx_tp_as_sequence__SymbolTable = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  __pyx_pw_9pywrapfst_12_SymbolTable_19__contains__, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyTypeObject __pyx_type_9pywrapfst__SymbolTable = {
  PyVarObject_HEAD_INIT(0, 0)
  "pywrapfst._SymbolTable", /*tp_name*/
  sizeof(struct __pyx_obj_9pywrapfst__SymbolTable), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_9pywrapfst__SymbolTable, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  &__pyx_tp_as_sequence__SymbolTable, /*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_9pywrapfst_12_SymbolTable_3__iter__, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_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_9pywrapfst_12_SymbolTable_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_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
};
static struct __pyx_vtabstruct_9pywrapfst__EncodeMapperSymbolTable __pyx_vtable_9pywrapfst__EncodeMapperSymbolTable;

static PyObject *__pyx_tp_new_9pywrapfst__EncodeMapperSymbolTable(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTable *p;
  PyObject *o = __pyx_tp_new_9pywrapfst__SymbolTable(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTable *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_9pywrapfst__SymbolTable*)__pyx_vtabptr_9pywrapfst__EncodeMapperSymbolTable;
  new((void*)&(p->_encoder)) std::shared_ptr<fst::script::EncodeMapperClass> ();
  return o;
}

static void __pyx_tp_dealloc_9pywrapfst__EncodeMapperSymbolTable(PyObject *o) {
  struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTable *p = (struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTable *)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->_encoder);
  __pyx_tp_dealloc_9pywrapfst__SymbolTable(o);
}

static PyMethodDef __pyx_methods_9pywrapfst__EncodeMapperSymbolTable[] = {
  {"__reduce_cython__", (PyCFunction)__pyx_pw_9pywrapfst_24_EncodeMapperSymbolTable_3__reduce_cython__, METH_NOARGS, 0},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_9pywrapfst_24_EncodeMapperSymbolTable_5__setstate_cython__, METH_O, 0},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_9pywrapfst__EncodeMapperSymbolTable = {
  PyVarObject_HEAD_INIT(0, 0)
  "pywrapfst._EncodeMapperSymbolTable", /*tp_name*/
  sizeof(struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTable), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_9pywrapfst__EncodeMapperSymbolTable, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_9pywrapfst_24_EncodeMapperSymbolTable_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_9pywrapfst_12_SymbolTable_3__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  __pyx_methods_9pywrapfst__EncodeMapperSymbolTable, /*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_9pywrapfst_12_SymbolTable_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_9pywrapfst__EncodeMapperSymbolTable, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};
static struct __pyx_vtabstruct_9pywrapfst__FstSymbolTable __pyx_vtable_9pywrapfst__FstSymbolTable;

static PyObject *__pyx_tp_new_9pywrapfst__FstSymbolTable(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_9pywrapfst__FstSymbolTable *p;
  PyObject *o = __pyx_tp_new_9pywrapfst__SymbolTable(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_9pywrapfst__FstSymbolTable *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_9pywrapfst__SymbolTable*)__pyx_vtabptr_9pywrapfst__FstSymbolTable;
  new((void*)&(p->_fst)) std::shared_ptr<fst::script::FstClass> ();
  return o;
}

static void __pyx_tp_dealloc_9pywrapfst__FstSymbolTable(PyObject *o) {
  struct __pyx_obj_9pywrapfst__FstSymbolTable *p = (struct __pyx_obj_9pywrapfst__FstSymbolTable *)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_9pywrapfst__SymbolTable(o);
}

static PyMethodDef __pyx_methods_9pywrapfst__FstSymbolTable[] = {
  {"__reduce_cython__", (PyCFunction)__pyx_pw_9pywrapfst_15_FstSymbolTable_3__reduce_cython__, METH_NOARGS, 0},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_9pywrapfst_15_FstSymbolTable_5__setstate_cython__, METH_O, 0},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_9pywrapfst__FstSymbolTable = {
  PyVarObject_HEAD_INIT(0, 0)
  "pywrapfst._FstSymbolTable", /*tp_name*/
  sizeof(struct __pyx_obj_9pywrapfst__FstSymbolTable), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_9pywrapfst__FstSymbolTable, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_9pywrapfst_15_FstSymbolTable_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_9pywrapfst_12_SymbolTable_3__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  __pyx_methods_9pywrapfst__FstSymbolTable, /*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_9pywrapfst_12_SymbolTable_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_9pywrapfst__FstSymbolTable, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};
static struct __pyx_vtabstruct_9pywrapfst__MutableSymbolTable __pyx_vtable_9pywrapfst__MutableSymbolTable;

static PyObject *__pyx_tp_new_9pywrapfst__MutableSymbolTable(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_9pywrapfst__MutableSymbolTable *p;
  PyObject *o = __pyx_tp_new_9pywrapfst__SymbolTable(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_9pywrapfst__MutableSymbolTable *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_9pywrapfst__SymbolTable*)__pyx_vtabptr_9pywrapfst__MutableSymbolTable;
  return o;
}

static PyMethodDef __pyx_methods_9pywrapfst__MutableSymbolTable[] = {
  {"add_symbol", (PyCFunction)__pyx_pw_9pywrapfst_19_MutableSymbolTable_1add_symbol, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_19_MutableSymbolTable_add_symbol},
  {"add_table", (PyCFunction)__pyx_pw_9pywrapfst_19_MutableSymbolTable_3add_table, METH_O, __pyx_doc_9pywrapfst_19_MutableSymbolTable_2add_table},
  {"set_name", (PyCFunction)__pyx_pw_9pywrapfst_19_MutableSymbolTable_5set_name, METH_O, 0},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_9pywrapfst_19_MutableSymbolTable_7__reduce_cython__, METH_NOARGS, 0},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_9pywrapfst_19_MutableSymbolTable_9__setstate_cython__, METH_O, 0},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_9pywrapfst__MutableSymbolTable = {
  PyVarObject_HEAD_INIT(0, 0)
  "pywrapfst._MutableSymbolTable", /*tp_name*/
  sizeof(struct __pyx_obj_9pywrapfst__MutableSymbolTable), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_9pywrapfst__SymbolTable, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_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_9pywrapfst_12_SymbolTable_3__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  __pyx_methods_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_9pywrapfst_12_SymbolTable_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_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
};
static struct __pyx_vtabstruct_9pywrapfst__MutableFstSymbolTable __pyx_vtable_9pywrapfst__MutableFstSymbolTable;

static PyObject *__pyx_tp_new_9pywrapfst__MutableFstSymbolTable(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_9pywrapfst__MutableFstSymbolTable *p;
  PyObject *o = __pyx_tp_new_9pywrapfst__MutableSymbolTable(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_9pywrapfst__MutableFstSymbolTable *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_9pywrapfst__SymbolTable*)__pyx_vtabptr_9pywrapfst__MutableFstSymbolTable;
  new((void*)&(p->_mfst)) std::shared_ptr<fst::script::MutableFstClass> ();
  return o;
}

static void __pyx_tp_dealloc_9pywrapfst__MutableFstSymbolTable(PyObject *o) {
  struct __pyx_obj_9pywrapfst__MutableFstSymbolTable *p = (struct __pyx_obj_9pywrapfst__MutableFstSymbolTable *)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_9pywrapfst__SymbolTable(o);
}

static PyMethodDef __pyx_methods_9pywrapfst__MutableFstSymbolTable[] = {
  {"__reduce_cython__", (PyCFunction)__pyx_pw_9pywrapfst_22_MutableFstSymbolTable_3__reduce_cython__, METH_NOARGS, 0},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_9pywrapfst_22_MutableFstSymbolTable_5__setstate_cython__, METH_O, 0},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_9pywrapfst__MutableFstSymbolTable = {
  PyVarObject_HEAD_INIT(0, 0)
  "pywrapfst._MutableFstSymbolTable", /*tp_name*/
  sizeof(struct __pyx_obj_9pywrapfst__MutableFstSymbolTable), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_9pywrapfst__MutableFstSymbolTable, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_9pywrapfst_22_MutableFstSymbolTable_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_9pywrapfst_12_SymbolTable_3__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  __pyx_methods_9pywrapfst__MutableFstSymbolTable, /*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_9pywrapfst_12_SymbolTable_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_9pywrapfst__MutableFstSymbolTable, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};
static struct __pyx_vtabstruct_9pywrapfst_SymbolTable __pyx_vtable_9pywrapfst_SymbolTable;

static PyObject *__pyx_tp_new_9pywrapfst_SymbolTable(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_9pywrapfst_SymbolTable *p;
  PyObject *o = __pyx_tp_new_9pywrapfst__MutableSymbolTable(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_9pywrapfst_SymbolTable *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_9pywrapfst__SymbolTable*)__pyx_vtabptr_9pywrapfst_SymbolTable;
  new((void*)&(p->_smart_table)) std::unique_ptr<fst::SymbolTable> ();
  return o;
}

static void __pyx_tp_dealloc_9pywrapfst_SymbolTable(PyObject *o) {
  struct __pyx_obj_9pywrapfst_SymbolTable *p = (struct __pyx_obj_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_9pywrapfst__SymbolTable(o);
}

static PyMethodDef __pyx_methods_9pywrapfst_SymbolTable[] = {
  {"read", (PyCFunction)__pyx_pw_9pywrapfst_11SymbolTable_5read, METH_O, __pyx_doc_9pywrapfst_11SymbolTable_4read},
  {"read_text", (PyCFunction)__pyx_pw_9pywrapfst_11SymbolTable_7read_text, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_11SymbolTable_6read_text},
  {"read_fst", (PyCFunction)__pyx_pw_9pywrapfst_11SymbolTable_9read_fst, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_11SymbolTable_8read_fst},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_9pywrapfst_11SymbolTable_11__reduce_cython__, METH_NOARGS, 0},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_9pywrapfst_11SymbolTable_13__setstate_cython__, METH_O, 0},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_9pywrapfst_SymbolTable = {
  PyVarObject_HEAD_INIT(0, 0)
  "pywrapfst.SymbolTable", /*tp_name*/
  sizeof(struct __pyx_obj_9pywrapfst_SymbolTable), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_9pywrapfst_SymbolTable, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_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_9pywrapfst_12_SymbolTable_3__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  __pyx_methods_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_9pywrapfst_11SymbolTable_3__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_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
};
static struct __pyx_vtabstruct_9pywrapfst_SymbolTableIterator __pyx_vtable_9pywrapfst_SymbolTableIterator;

static PyObject *__pyx_tp_new_9pywrapfst_SymbolTableIterator(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_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_9pywrapfst_SymbolTableIterator *)o);
  p->__pyx_vtab = __pyx_vtabptr_9pywrapfst_SymbolTableIterator;
  new((void*)&(p->_table)) std::shared_ptr<fst::SymbolTable> ();
  new((void*)&(p->_siter)) std::unique_ptr<fst::SymbolTableIterator> ();
  return o;
}

static void __pyx_tp_dealloc_9pywrapfst_SymbolTableIterator(PyObject *o) {
  struct __pyx_obj_9pywrapfst_SymbolTableIterator *p = (struct __pyx_obj_9pywrapfst_SymbolTableIterator *)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->_table);
  __Pyx_call_destructor(p->_siter);
  (*Py_TYPE(o)->tp_free)(o);
}

static PyMethodDef __pyx_methods_9pywrapfst_SymbolTableIterator[] = {
  {"__next__", (PyCFunction)__pyx_pw_9pywrapfst_19SymbolTableIterator_7__next__, METH_NOARGS|METH_COEXIST, 0},
  {"done", (PyCFunction)__pyx_pw_9pywrapfst_19SymbolTableIterator_9done, METH_NOARGS, __pyx_doc_9pywrapfst_19SymbolTableIterator_8done},
  {"next", (PyCFunction)__pyx_pw_9pywrapfst_19SymbolTableIterator_11next, METH_NOARGS, __pyx_doc_9pywrapfst_19SymbolTableIterator_10next},
  {"reset", (PyCFunction)__pyx_pw_9pywrapfst_19SymbolTableIterator_13reset, METH_NOARGS, __pyx_doc_9pywrapfst_19SymbolTableIterator_12reset},
  {"symbol", (PyCFunction)__pyx_pw_9pywrapfst_19SymbolTableIterator_15symbol, METH_NOARGS, __pyx_doc_9pywrapfst_19SymbolTableIterator_14symbol},
  {"value", (PyCFunction)__pyx_pw_9pywrapfst_19SymbolTableIterator_17value, METH_NOARGS, __pyx_doc_9pywrapfst_19SymbolTableIterator_16value},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_9pywrapfst_19SymbolTableIterator_19__reduce_cython__, METH_NOARGS, 0},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_9pywrapfst_19SymbolTableIterator_21__setstate_cython__, METH_O, 0},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_9pywrapfst_SymbolTableIterator = {
  PyVarObject_HEAD_INIT(0, 0)
  "pywrapfst.SymbolTableIterator", /*tp_name*/
  sizeof(struct __pyx_obj_9pywrapfst_SymbolTableIterator), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_9pywrapfst_SymbolTableIterator, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_9pywrapfst_19SymbolTableIterator_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  SymbolTableIterator(syms)\n\n  This class is used for iterating over a symbol table.\n  ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_9pywrapfst_19SymbolTableIterator_5__iter__, /*tp_iter*/
  __pyx_pw_9pywrapfst_19SymbolTableIterator_7__next__, /*tp_iternext*/
  __pyx_methods_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_9pywrapfst_19SymbolTableIterator_3__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_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
};
static struct __pyx_vtabstruct_9pywrapfst_EncodeMapper __pyx_vtable_9pywrapfst_EncodeMapper;

static PyObject *__pyx_tp_new_9pywrapfst_EncodeMapper(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_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_9pywrapfst_EncodeMapper *)o);
  p->__pyx_vtab = __pyx_vtabptr_9pywrapfst_EncodeMapper;
  new((void*)&(p->_encoder)) std::shared_ptr<fst::script::EncodeMapperClass> ();
  return o;
}

static void __pyx_tp_dealloc_9pywrapfst_EncodeMapper(PyObject *o) {
  struct __pyx_obj_9pywrapfst_EncodeMapper *p = (struct __pyx_obj_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->_encoder);
  (*Py_TYPE(o)->tp_free)(o);
}

static PyMethodDef __pyx_methods_9pywrapfst_EncodeMapper[] = {
  {"arc_type", (PyCFunction)__pyx_pw_9pywrapfst_12EncodeMapper_5arc_type, METH_NOARGS, __pyx_doc_9pywrapfst_12EncodeMapper_4arc_type},
  {"flags", (PyCFunction)__pyx_pw_9pywrapfst_12EncodeMapper_9flags, METH_NOARGS, __pyx_doc_9pywrapfst_12EncodeMapper_8flags},
  {"input_symbols", (PyCFunction)__pyx_pw_9pywrapfst_12EncodeMapper_11input_symbols, METH_NOARGS, __pyx_doc_9pywrapfst_12EncodeMapper_10input_symbols},
  {"output_symbols", (PyCFunction)__pyx_pw_9pywrapfst_12EncodeMapper_13output_symbols, METH_NOARGS, __pyx_doc_9pywrapfst_12EncodeMapper_12output_symbols},
  {"properties", (PyCFunction)__pyx_pw_9pywrapfst_12EncodeMapper_15properties, METH_O, __pyx_doc_9pywrapfst_12EncodeMapper_14properties},
  {"set_input_symbols", (PyCFunction)__pyx_pw_9pywrapfst_12EncodeMapper_17set_input_symbols, METH_O, __pyx_doc_9pywrapfst_12EncodeMapper_16set_input_symbols},
  {"set_output_symbols", (PyCFunction)__pyx_pw_9pywrapfst_12EncodeMapper_19set_output_symbols, METH_O, __pyx_doc_9pywrapfst_12EncodeMapper_18set_output_symbols},
  {"weight_type", (PyCFunction)__pyx_pw_9pywrapfst_12EncodeMapper_21weight_type, METH_NOARGS, __pyx_doc_9pywrapfst_12EncodeMapper_20weight_type},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_9pywrapfst_12EncodeMapper_23__reduce_cython__, METH_NOARGS, 0},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_9pywrapfst_12EncodeMapper_25__setstate_cython__, METH_O, 0},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_9pywrapfst_EncodeMapper = {
  PyVarObject_HEAD_INIT(0, 0)
  "pywrapfst.EncodeMapper", /*tp_name*/
  sizeof(struct __pyx_obj_9pywrapfst_EncodeMapper), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_9pywrapfst_EncodeMapper, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_9pywrapfst_12EncodeMapper_1__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  __pyx_pw_9pywrapfst_12EncodeMapper_7__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 encoder 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 encoder\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_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_9pywrapfst_12EncodeMapper_3__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_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
};
static struct __pyx_vtabstruct_9pywrapfst__Fst __pyx_vtable_9pywrapfst__Fst;

static PyObject *__pyx_tp_new_9pywrapfst__Fst(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_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_9pywrapfst__Fst *)o);
  p->__pyx_vtab = __pyx_vtabptr_9pywrapfst__Fst;
  new((void*)&(p->_fst)) std::shared_ptr<fst::script::FstClass> ();
  return o;
}

static void __pyx_tp_dealloc_9pywrapfst__Fst(PyObject *o) {
  struct __pyx_obj_9pywrapfst__Fst *p = (struct __pyx_obj_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_9pywrapfst__Fst[] = {
  {"_repr_svg_", (PyCFunction)__pyx_pw_9pywrapfst_4_Fst_1_repr_svg_, METH_NOARGS, __pyx_doc_9pywrapfst_4_Fst__repr_svg_},
  {"__reduce__", (PyCFunction)__pyx_pw_9pywrapfst_4_Fst_9__reduce__, METH_NOARGS, 0},
  {"arc_type", (PyCFunction)__pyx_pw_9pywrapfst_4_Fst_11arc_type, METH_NOARGS, __pyx_doc_9pywrapfst_4_Fst_10arc_type},
  {"arcs", (PyCFunction)__pyx_pw_9pywrapfst_4_Fst_13arcs, METH_O, __pyx_doc_9pywrapfst_4_Fst_12arcs},
  {"copy", (PyCFunction)__pyx_pw_9pywrapfst_4_Fst_15copy, METH_NOARGS, __pyx_doc_9pywrapfst_4_Fst_14copy},
  {"draw", (PyCFunction)__pyx_pw_9pywrapfst_4_Fst_17draw, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_4_Fst_16draw},
  {"final", (PyCFunction)__pyx_pw_9pywrapfst_4_Fst_19final, METH_O, __pyx_doc_9pywrapfst_4_Fst_18final},
  {"fst_type", (PyCFunction)__pyx_pw_9pywrapfst_4_Fst_21fst_type, METH_NOARGS, __pyx_doc_9pywrapfst_4_Fst_20fst_type},
  {"input_symbols", (PyCFunction)__pyx_pw_9pywrapfst_4_Fst_23input_symbols, METH_NOARGS, __pyx_doc_9pywrapfst_4_Fst_22input_symbols},
  {"num_arcs", (PyCFunction)__pyx_pw_9pywrapfst_4_Fst_25num_arcs, METH_O, __pyx_doc_9pywrapfst_4_Fst_24num_arcs},
  {"num_input_epsilons", (PyCFunction)__pyx_pw_9pywrapfst_4_Fst_27num_input_epsilons, METH_O, __pyx_doc_9pywrapfst_4_Fst_26num_input_epsilons},
  {"num_output_epsilons", (PyCFunction)__pyx_pw_9pywrapfst_4_Fst_29num_output_epsilons, METH_O, __pyx_doc_9pywrapfst_4_Fst_28num_output_epsilons},
  {"output_symbols", (PyCFunction)__pyx_pw_9pywrapfst_4_Fst_31output_symbols, METH_NOARGS, __pyx_doc_9pywrapfst_4_Fst_30output_symbols},
  {"properties", (PyCFunction)__pyx_pw_9pywrapfst_4_Fst_33properties, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_4_Fst_32properties},
  {"start", (PyCFunction)__pyx_pw_9pywrapfst_4_Fst_35start, METH_NOARGS, __pyx_doc_9pywrapfst_4_Fst_34start},
  {"states", (PyCFunction)__pyx_pw_9pywrapfst_4_Fst_37states, METH_NOARGS, __pyx_doc_9pywrapfst_4_Fst_36states},
  {"text", (PyCFunction)__pyx_pw_9pywrapfst_4_Fst_39text, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_4_Fst_38text},
  {"verify", (PyCFunction)__pyx_pw_9pywrapfst_4_Fst_41verify, METH_NOARGS, __pyx_doc_9pywrapfst_4_Fst_40verify},
  {"weight_type", (PyCFunction)__pyx_pw_9pywrapfst_4_Fst_43weight_type, METH_NOARGS, __pyx_doc_9pywrapfst_4_Fst_42weight_type},
  {"write", (PyCFunction)__pyx_pw_9pywrapfst_4_Fst_45write, METH_O, __pyx_doc_9pywrapfst_4_Fst_44write},
  {"write_to_string", (PyCFunction)__pyx_pw_9pywrapfst_4_Fst_47write_to_string, METH_NOARGS, __pyx_doc_9pywrapfst_4_Fst_46write_to_string},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_9pywrapfst__Fst = {
  PyVarObject_HEAD_INIT(0, 0)
  "pywrapfst._Fst", /*tp_name*/
  sizeof(struct __pyx_obj_9pywrapfst__Fst), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_9pywrapfst__Fst, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_9pywrapfst_4_Fst_3__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  __pyx_pw_9pywrapfst_4_Fst_7__str__, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "\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_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_9pywrapfst_4_Fst_5__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_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
};
static struct __pyx_vtabstruct_9pywrapfst__MutableFst __pyx_vtable_9pywrapfst__MutableFst;

static PyObject *__pyx_tp_new_9pywrapfst__MutableFst(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_9pywrapfst__MutableFst *p;
  PyObject *o = __pyx_tp_new_9pywrapfst__Fst(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_9pywrapfst__MutableFst *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_9pywrapfst__Fst*)__pyx_vtabptr_9pywrapfst__MutableFst;
  new((void*)&(p->_mfst)) std::shared_ptr<fst::script::MutableFstClass> ();
  return o;
}

static void __pyx_tp_dealloc_9pywrapfst__MutableFst(PyObject *o) {
  struct __pyx_obj_9pywrapfst__MutableFst *p = (struct __pyx_obj_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_9pywrapfst__Fst(o);
}

static PyMethodDef __pyx_methods_9pywrapfst__MutableFst[] = {
  {"add_arc", (PyCFunction)__pyx_pw_9pywrapfst_11_MutableFst_1add_arc, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_11_MutableFst_add_arc},
  {"add_state", (PyCFunction)__pyx_pw_9pywrapfst_11_MutableFst_3add_state, METH_NOARGS, __pyx_doc_9pywrapfst_11_MutableFst_2add_state},
  {"arcsort", (PyCFunction)__pyx_pw_9pywrapfst_11_MutableFst_5arcsort, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_11_MutableFst_4arcsort},
  {"closure", (PyCFunction)__pyx_pw_9pywrapfst_11_MutableFst_7closure, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_11_MutableFst_6closure},
  {"concat", (PyCFunction)__pyx_pw_9pywrapfst_11_MutableFst_9concat, METH_O, __pyx_doc_9pywrapfst_11_MutableFst_8concat},
  {"connect", (PyCFunction)__pyx_pw_9pywrapfst_11_MutableFst_11connect, METH_NOARGS, __pyx_doc_9pywrapfst_11_MutableFst_10connect},
  {"decode", (PyCFunction)__pyx_pw_9pywrapfst_11_MutableFst_13decode, METH_O, __pyx_doc_9pywrapfst_11_MutableFst_12decode},
  {"delete_arcs", (PyCFunction)__pyx_pw_9pywrapfst_11_MutableFst_15delete_arcs, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_11_MutableFst_14delete_arcs},
  {"delete_states", (PyCFunction)__pyx_pw_9pywrapfst_11_MutableFst_17delete_states, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_11_MutableFst_16delete_states},
  {"encode", (PyCFunction)__pyx_pw_9pywrapfst_11_MutableFst_19encode, METH_O, __pyx_doc_9pywrapfst_11_MutableFst_18encode},
  {"invert", (PyCFunction)__pyx_pw_9pywrapfst_11_MutableFst_21invert, METH_NOARGS, __pyx_doc_9pywrapfst_11_MutableFst_20invert},
  {"minimize", (PyCFunction)__pyx_pw_9pywrapfst_11_MutableFst_23minimize, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_11_MutableFst_22minimize},
  {"mutable_arcs", (PyCFunction)__pyx_pw_9pywrapfst_11_MutableFst_25mutable_arcs, METH_O, __pyx_doc_9pywrapfst_11_MutableFst_24mutable_arcs},
  {"mutable_input_symbols", (PyCFunction)__pyx_pw_9pywrapfst_11_MutableFst_27mutable_input_symbols, METH_NOARGS, __pyx_doc_9pywrapfst_11_MutableFst_26mutable_input_symbols},
  {"mutable_output_symbols", (PyCFunction)__pyx_pw_9pywrapfst_11_MutableFst_29mutable_output_symbols, METH_NOARGS, __pyx_doc_9pywrapfst_11_MutableFst_28mutable_output_symbols},
  {"num_states", (PyCFunction)__pyx_pw_9pywrapfst_11_MutableFst_31num_states, METH_NOARGS, __pyx_doc_9pywrapfst_11_MutableFst_30num_states},
  {"project", (PyCFunction)__pyx_pw_9pywrapfst_11_MutableFst_33project, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_11_MutableFst_32project},
  {"prune", (PyCFunction)__pyx_pw_9pywrapfst_11_MutableFst_35prune, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_11_MutableFst_34prune},
  {"push", (PyCFunction)__pyx_pw_9pywrapfst_11_MutableFst_37push, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_11_MutableFst_36push},
  {"relabel_pairs", (PyCFunction)__pyx_pw_9pywrapfst_11_MutableFst_39relabel_pairs, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_11_MutableFst_38relabel_pairs},
  {"relabel_tables", (PyCFunction)__pyx_pw_9pywrapfst_11_MutableFst_41relabel_tables, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_11_MutableFst_40relabel_tables},
  {"reserve_arcs", (PyCFunction)__pyx_pw_9pywrapfst_11_MutableFst_43reserve_arcs, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_11_MutableFst_42reserve_arcs},
  {"reserve_states", (PyCFunction)__pyx_pw_9pywrapfst_11_MutableFst_45reserve_states, METH_O, __pyx_doc_9pywrapfst_11_MutableFst_44reserve_states},
  {"reweight", (PyCFunction)__pyx_pw_9pywrapfst_11_MutableFst_47reweight, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_11_MutableFst_46reweight},
  {"rmepsilon", (PyCFunction)__pyx_pw_9pywrapfst_11_MutableFst_49rmepsilon, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_11_MutableFst_48rmepsilon},
  {"set_final", (PyCFunction)__pyx_pw_9pywrapfst_11_MutableFst_51set_final, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_11_MutableFst_50set_final},
  {"set_input_symbols", (PyCFunction)__pyx_pw_9pywrapfst_11_MutableFst_53set_input_symbols, METH_O, __pyx_doc_9pywrapfst_11_MutableFst_52set_input_symbols},
  {"set_output_symbols", (PyCFunction)__pyx_pw_9pywrapfst_11_MutableFst_55set_output_symbols, METH_O, __pyx_doc_9pywrapfst_11_MutableFst_54set_output_symbols},
  {"set_properties", (PyCFunction)__pyx_pw_9pywrapfst_11_MutableFst_57set_properties, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_11_MutableFst_56set_properties},
  {"set_start", (PyCFunction)__pyx_pw_9pywrapfst_11_MutableFst_59set_start, METH_O, __pyx_doc_9pywrapfst_11_MutableFst_58set_start},
  {"topsort", (PyCFunction)__pyx_pw_9pywrapfst_11_MutableFst_61topsort, METH_NOARGS, __pyx_doc_9pywrapfst_11_MutableFst_60topsort},
  {"union", (PyCFunction)__pyx_pw_9pywrapfst_11_MutableFst_63union, METH_O, __pyx_doc_9pywrapfst_11_MutableFst_62union},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_9pywrapfst__MutableFst = {
  PyVarObject_HEAD_INIT(0, 0)
  "pywrapfst._MutableFst", /*tp_name*/
  sizeof(struct __pyx_obj_9pywrapfst__MutableFst), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_9pywrapfst__MutableFst, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_9pywrapfst_4_Fst_3__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_9pywrapfst_4_Fst_7__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_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_9pywrapfst_4_Fst_5__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_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
};
static struct __pyx_vtabstruct_9pywrapfst_Arc __pyx_vtable_9pywrapfst_Arc;

static PyObject *__pyx_tp_new_9pywrapfst_Arc(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_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_9pywrapfst_Arc *)o);
  p->__pyx_vtab = __pyx_vtabptr_9pywrapfst_Arc;
  new((void*)&(p->_arc)) std::unique_ptr<fst::script::ArcClass> ();
  return o;
}

static void __pyx_tp_dealloc_9pywrapfst_Arc(PyObject *o) {
  struct __pyx_obj_9pywrapfst_Arc *p = (struct __pyx_obj_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_9pywrapfst_3Arc_ilabel(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9pywrapfst_3Arc_6ilabel_1__get__(o);
}

static int __pyx_setprop_9pywrapfst_3Arc_ilabel(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_9pywrapfst_3Arc_6ilabel_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_9pywrapfst_3Arc_olabel(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9pywrapfst_3Arc_6olabel_1__get__(o);
}

static int __pyx_setprop_9pywrapfst_3Arc_olabel(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_9pywrapfst_3Arc_6olabel_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_9pywrapfst_3Arc_weight(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9pywrapfst_3Arc_6weight_1__get__(o);
}

static int __pyx_setprop_9pywrapfst_3Arc_weight(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_9pywrapfst_3Arc_6weight_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_9pywrapfst_3Arc_nextstate(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9pywrapfst_3Arc_9nextstate_1__get__(o);
}

static int __pyx_setprop_9pywrapfst_3Arc_nextstate(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_9pywrapfst_3Arc_9nextstate_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyMethodDef __pyx_methods_9pywrapfst_Arc[] = {
  {"copy", (PyCFunction)__pyx_pw_9pywrapfst_3Arc_5copy, METH_NOARGS, 0},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_9pywrapfst_3Arc_7__reduce_cython__, METH_NOARGS, 0},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_9pywrapfst_3Arc_9__setstate_cython__, METH_O, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_9pywrapfst_Arc[] = {
  {(char *)"ilabel", __pyx_getprop_9pywrapfst_3Arc_ilabel, __pyx_setprop_9pywrapfst_3Arc_ilabel, (char *)0, 0},
  {(char *)"olabel", __pyx_getprop_9pywrapfst_3Arc_olabel, __pyx_setprop_9pywrapfst_3Arc_olabel, (char *)0, 0},
  {(char *)"weight", __pyx_getprop_9pywrapfst_3Arc_weight, __pyx_setprop_9pywrapfst_3Arc_weight, (char *)0, 0},
  {(char *)"nextstate", __pyx_getprop_9pywrapfst_3Arc_nextstate, __pyx_setprop_9pywrapfst_3Arc_nextstate, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_9pywrapfst_Arc = {
  PyVarObject_HEAD_INIT(0, 0)
  "pywrapfst.Arc", /*tp_name*/
  sizeof(struct __pyx_obj_9pywrapfst_Arc), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_9pywrapfst_Arc, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_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_9pywrapfst_Arc, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_9pywrapfst_Arc, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_9pywrapfst_3Arc_3__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_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
};
static struct __pyx_vtabstruct_9pywrapfst_ArcIterator __pyx_vtable_9pywrapfst_ArcIterator;

static PyObject *__pyx_tp_new_9pywrapfst_ArcIterator(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_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_9pywrapfst_ArcIterator *)o);
  p->__pyx_vtab = __pyx_vtabptr_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_9pywrapfst_ArcIterator(PyObject *o) {
  struct __pyx_obj_9pywrapfst_ArcIterator *p = (struct __pyx_obj_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 PyMethodDef __pyx_methods_9pywrapfst_ArcIterator[] = {
  {"__next__", (PyCFunction)__pyx_pw_9pywrapfst_11ArcIterator_7__next__, METH_NOARGS|METH_COEXIST, 0},
  {"done", (PyCFunction)__pyx_pw_9pywrapfst_11ArcIterator_9done, METH_NOARGS, __pyx_doc_9pywrapfst_11ArcIterator_8done},
  {"flags", (PyCFunction)__pyx_pw_9pywrapfst_11ArcIterator_11flags, METH_NOARGS, __pyx_doc_9pywrapfst_11ArcIterator_10flags},
  {"next", (PyCFunction)__pyx_pw_9pywrapfst_11ArcIterator_13next, METH_NOARGS, __pyx_doc_9pywrapfst_11ArcIterator_12next},
  {"position", (PyCFunction)__pyx_pw_9pywrapfst_11ArcIterator_15position, METH_NOARGS, __pyx_doc_9pywrapfst_11ArcIterator_14position},
  {"reset", (PyCFunction)__pyx_pw_9pywrapfst_11ArcIterator_17reset, METH_NOARGS, __pyx_doc_9pywrapfst_11ArcIterator_16reset},
  {"seek", (PyCFunction)__pyx_pw_9pywrapfst_11ArcIterator_19seek, METH_O, __pyx_doc_9pywrapfst_11ArcIterator_18seek},
  {"set_flags", (PyCFunction)__pyx_pw_9pywrapfst_11ArcIterator_21set_flags, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_11ArcIterator_20set_flags},
  {"value", (PyCFunction)__pyx_pw_9pywrapfst_11ArcIterator_23value, METH_NOARGS, __pyx_doc_9pywrapfst_11ArcIterator_22value},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_9pywrapfst_11ArcIterator_25__reduce_cython__, METH_NOARGS, 0},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_9pywrapfst_11ArcIterator_27__setstate_cython__, METH_O, 0},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_9pywrapfst_ArcIterator = {
  PyVarObject_HEAD_INIT(0, 0)
  "pywrapfst.ArcIterator", /*tp_name*/
  sizeof(struct __pyx_obj_9pywrapfst_ArcIterator), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_9pywrapfst_ArcIterator, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_9pywrapfst_11ArcIterator_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_9pywrapfst_11ArcIterator_5__iter__, /*tp_iter*/
  __pyx_pw_9pywrapfst_11ArcIterator_7__next__, /*tp_iternext*/
  __pyx_methods_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_9pywrapfst_11ArcIterator_3__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_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
};
static struct __pyx_vtabstruct_9pywrapfst_MutableArcIterator __pyx_vtable_9pywrapfst_MutableArcIterator;

static PyObject *__pyx_tp_new_9pywrapfst_MutableArcIterator(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_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_9pywrapfst_MutableArcIterator *)o);
  p->__pyx_vtab = __pyx_vtabptr_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_9pywrapfst_MutableArcIterator(PyObject *o) {
  struct __pyx_obj_9pywrapfst_MutableArcIterator *p = (struct __pyx_obj_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 PyMethodDef __pyx_methods_9pywrapfst_MutableArcIterator[] = {
  {"done", (PyCFunction)__pyx_pw_9pywrapfst_18MutableArcIterator_5done, METH_NOARGS, __pyx_doc_9pywrapfst_18MutableArcIterator_4done},
  {"flags", (PyCFunction)__pyx_pw_9pywrapfst_18MutableArcIterator_7flags, METH_NOARGS, __pyx_doc_9pywrapfst_18MutableArcIterator_6flags},
  {"next", (PyCFunction)__pyx_pw_9pywrapfst_18MutableArcIterator_9next, METH_NOARGS, __pyx_doc_9pywrapfst_18MutableArcIterator_8next},
  {"position", (PyCFunction)__pyx_pw_9pywrapfst_18MutableArcIterator_11position, METH_NOARGS, __pyx_doc_9pywrapfst_18MutableArcIterator_10position},
  {"reset", (PyCFunction)__pyx_pw_9pywrapfst_18MutableArcIterator_13reset, METH_NOARGS, __pyx_doc_9pywrapfst_18MutableArcIterator_12reset},
  {"seek", (PyCFunction)__pyx_pw_9pywrapfst_18MutableArcIterator_15seek, METH_O, __pyx_doc_9pywrapfst_18MutableArcIterator_14seek},
  {"set_flags", (PyCFunction)__pyx_pw_9pywrapfst_18MutableArcIterator_17set_flags, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_18MutableArcIterator_16set_flags},
  {"set_value", (PyCFunction)__pyx_pw_9pywrapfst_18MutableArcIterator_19set_value, METH_O, __pyx_doc_9pywrapfst_18MutableArcIterator_18set_value},
  {"value", (PyCFunction)__pyx_pw_9pywrapfst_18MutableArcIterator_21value, METH_NOARGS, __pyx_doc_9pywrapfst_18MutableArcIterator_20value},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_9pywrapfst_18MutableArcIterator_23__reduce_cython__, METH_NOARGS, 0},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_9pywrapfst_18MutableArcIterator_25__setstate_cython__, METH_O, 0},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_9pywrapfst_MutableArcIterator = {
  PyVarObject_HEAD_INIT(0, 0)
  "pywrapfst.MutableArcIterator", /*tp_name*/
  sizeof(struct __pyx_obj_9pywrapfst_MutableArcIterator), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_9pywrapfst_MutableArcIterator, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_9pywrapfst_18MutableArcIterator_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*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_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_9pywrapfst_18MutableArcIterator_3__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_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
};
static struct __pyx_vtabstruct_9pywrapfst_StateIterator __pyx_vtable_9pywrapfst_StateIterator;

static PyObject *__pyx_tp_new_9pywrapfst_StateIterator(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_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_9pywrapfst_StateIterator *)o);
  p->__pyx_vtab = __pyx_vtabptr_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_9pywrapfst_StateIterator(PyObject *o) {
  struct __pyx_obj_9pywrapfst_StateIterator *p = (struct __pyx_obj_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 PyMethodDef __pyx_methods_9pywrapfst_StateIterator[] = {
  {"__next__", (PyCFunction)__pyx_pw_9pywrapfst_13StateIterator_7__next__, METH_NOARGS|METH_COEXIST, 0},
  {"done", (PyCFunction)__pyx_pw_9pywrapfst_13StateIterator_9done, METH_NOARGS, __pyx_doc_9pywrapfst_13StateIterator_8done},
  {"next", (PyCFunction)__pyx_pw_9pywrapfst_13StateIterator_11next, METH_NOARGS, __pyx_doc_9pywrapfst_13StateIterator_10next},
  {"reset", (PyCFunction)__pyx_pw_9pywrapfst_13StateIterator_13reset, METH_NOARGS, __pyx_doc_9pywrapfst_13StateIterator_12reset},
  {"value", (PyCFunction)__pyx_pw_9pywrapfst_13StateIterator_15value, METH_NOARGS, __pyx_doc_9pywrapfst_13StateIterator_14value},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_9pywrapfst_13StateIterator_17__reduce_cython__, METH_NOARGS, 0},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_9pywrapfst_13StateIterator_19__setstate_cython__, METH_O, 0},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_9pywrapfst_StateIterator = {
  PyVarObject_HEAD_INIT(0, 0)
  "pywrapfst.StateIterator", /*tp_name*/
  sizeof(struct __pyx_obj_9pywrapfst_StateIterator), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_9pywrapfst_StateIterator, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_9pywrapfst_13StateIterator_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_9pywrapfst_13StateIterator_5__iter__, /*tp_iter*/
  __pyx_pw_9pywrapfst_13StateIterator_7__next__, /*tp_iternext*/
  __pyx_methods_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_9pywrapfst_13StateIterator_3__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_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
};
static struct __pyx_vtabstruct_9pywrapfst_Compiler __pyx_vtable_9pywrapfst_Compiler;

static PyObject *__pyx_tp_new_9pywrapfst_Compiler(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_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_9pywrapfst_Compiler *)o);
  p->__pyx_vtab = __pyx_vtabptr_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_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_9pywrapfst_Compiler(PyObject *o) {
  struct __pyx_obj_9pywrapfst_Compiler *p = (struct __pyx_obj_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_9pywrapfst_Compiler[] = {
  {"compile", (PyCFunction)__pyx_pw_9pywrapfst_8Compiler_3compile, METH_NOARGS, __pyx_doc_9pywrapfst_8Compiler_2compile},
  {"write", (PyCFunction)__pyx_pw_9pywrapfst_8Compiler_5write, METH_O, __pyx_doc_9pywrapfst_8Compiler_4write},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_9pywrapfst_8Compiler_7__reduce_cython__, METH_NOARGS, 0},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_9pywrapfst_8Compiler_9__setstate_cython__, METH_O, 0},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_9pywrapfst_Compiler = {
  PyVarObject_HEAD_INIT(0, 0)
  "pywrapfst.Compiler", /*tp_name*/
  sizeof(struct __pyx_obj_9pywrapfst_Compiler), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_9pywrapfst_Compiler, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_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_syms, osymbols=ascii_syms)\n\n  Once constructed, Compiler instances behave like a file handle opened for\n  writing:\n\n      # /ba+/\n      print >> compiler, \"0 1 50 50\"\n      print >> compiler, \"1 2 49 49\"\n      print >> compiler, \"2 2 49 49\"\n      print >> compiler, \"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_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_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
};
static struct __pyx_vtabstruct_9pywrapfst_FarReader __pyx_vtable_9pywrapfst_FarReader;

static PyObject *__pyx_tp_new_9pywrapfst_FarReader(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_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_9pywrapfst_FarReader *)o);
  p->__pyx_vtab = __pyx_vtabptr_9pywrapfst_FarReader;
  new((void*)&(p->_reader)) std::unique_ptr<fst::script::FarReaderClass> ();
  return o;
}

static void __pyx_tp_dealloc_9pywrapfst_FarReader(PyObject *o) {
  struct __pyx_obj_9pywrapfst_FarReader *p = (struct __pyx_obj_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_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 PyMethodDef __pyx_methods_9pywrapfst_FarReader[] = {
  {"open", (PyCFunction)__pyx_pw_9pywrapfst_9FarReader_5open, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_9FarReader_4open},
  {"arc_type", (PyCFunction)__pyx_pw_9pywrapfst_9FarReader_7arc_type, METH_NOARGS, __pyx_doc_9pywrapfst_9FarReader_6arc_type},
  {"done", (PyCFunction)__pyx_pw_9pywrapfst_9FarReader_9done, METH_NOARGS, __pyx_doc_9pywrapfst_9FarReader_8done},
  {"error", (PyCFunction)__pyx_pw_9pywrapfst_9FarReader_11error, METH_NOARGS, __pyx_doc_9pywrapfst_9FarReader_10error},
  {"far_type", (PyCFunction)__pyx_pw_9pywrapfst_9FarReader_13far_type, METH_NOARGS, 0},
  {"find", (PyCFunction)__pyx_pw_9pywrapfst_9FarReader_15find, METH_O, __pyx_doc_9pywrapfst_9FarReader_14find},
  {"get_fst", (PyCFunction)__pyx_pw_9pywrapfst_9FarReader_17get_fst, METH_NOARGS, __pyx_doc_9pywrapfst_9FarReader_16get_fst},
  {"get_key", (PyCFunction)__pyx_pw_9pywrapfst_9FarReader_19get_key, METH_NOARGS, __pyx_doc_9pywrapfst_9FarReader_18get_key},
  {"next", (PyCFunction)__pyx_pw_9pywrapfst_9FarReader_21next, METH_NOARGS, __pyx_doc_9pywrapfst_9FarReader_20next},
  {"reset", (PyCFunction)__pyx_pw_9pywrapfst_9FarReader_23reset, METH_NOARGS, __pyx_doc_9pywrapfst_9FarReader_22reset},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_9pywrapfst_9FarReader_27__reduce_cython__, METH_NOARGS, 0},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_9pywrapfst_9FarReader_29__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_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_9pywrapfst_9FarReader_25__getitem__, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyTypeObject __pyx_type_9pywrapfst_FarReader = {
  PyVarObject_HEAD_INIT(0, 0)
  "pywrapfst.FarReader", /*tp_name*/
  sizeof(struct __pyx_obj_9pywrapfst_FarReader), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_9pywrapfst_FarReader, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_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*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_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_9pywrapfst_9FarReader_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_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
};
static struct __pyx_vtabstruct_9pywrapfst_FarWriter __pyx_vtable_9pywrapfst_FarWriter;

static PyObject *__pyx_tp_new_9pywrapfst_FarWriter(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_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_9pywrapfst_FarWriter *)o);
  p->__pyx_vtab = __pyx_vtabptr_9pywrapfst_FarWriter;
  new((void*)&(p->_writer)) std::unique_ptr<fst::script::FarWriterClass> ();
  return o;
}

static void __pyx_tp_dealloc_9pywrapfst_FarWriter(PyObject *o) {
  struct __pyx_obj_9pywrapfst_FarWriter *p = (struct __pyx_obj_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_9pywrapfst_FarWriter(PyObject *o, PyObject *i, PyObject *v) {
  if (v) {
    return __pyx_pw_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_9pywrapfst_FarWriter[] = {
  {"create", (PyCFunction)__pyx_pw_9pywrapfst_9FarWriter_5create, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_9FarWriter_4create},
  {"add", (PyCFunction)__pyx_pw_9pywrapfst_9FarWriter_7add, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_9FarWriter_6add},
  {"arc_type", (PyCFunction)__pyx_pw_9pywrapfst_9FarWriter_9arc_type, METH_NOARGS, __pyx_doc_9pywrapfst_9FarWriter_8arc_type},
  {"error", (PyCFunction)__pyx_pw_9pywrapfst_9FarWriter_11error, METH_NOARGS, __pyx_doc_9pywrapfst_9FarWriter_10error},
  {"far_type", (PyCFunction)__pyx_pw_9pywrapfst_9FarWriter_13far_type, METH_NOARGS, __pyx_doc_9pywrapfst_9FarWriter_12far_type},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_9pywrapfst_9FarWriter_17__reduce_cython__, METH_NOARGS, 0},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_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_9pywrapfst_FarWriter, /*mp_ass_subscript*/
};

static PyTypeObject __pyx_type_9pywrapfst_FarWriter = {
  PyVarObject_HEAD_INIT(0, 0)
  "pywrapfst.FarWriter", /*tp_name*/
  sizeof(struct __pyx_obj_9pywrapfst_FarWriter), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_9pywrapfst_FarWriter, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_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_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_9pywrapfst_9FarWriter_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_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
};

static PyMethodDef __pyx_methods[] = {
  {"compact_symbol_table", (PyCFunction)__pyx_pw_9pywrapfst_9compact_symbol_table, METH_O, __pyx_doc_9pywrapfst_8compact_symbol_table},
  {"merge_symbol_table", (PyCFunction)__pyx_pw_9pywrapfst_11merge_symbol_table, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_10merge_symbol_table},
  {"_read", (PyCFunction)__pyx_pw_9pywrapfst_13_read, METH_O, 0},
  {"_read_from_string", (PyCFunction)__pyx_pw_9pywrapfst_15_read_from_string, METH_O, 0},
  {"arcmap", (PyCFunction)__pyx_pw_9pywrapfst_17arcmap, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_16arcmap},
  {"compose", (PyCFunction)__pyx_pw_9pywrapfst_19compose, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_18compose},
  {"convert", (PyCFunction)__pyx_pw_9pywrapfst_21convert, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_20convert},
  {"determinize", (PyCFunction)__pyx_pw_9pywrapfst_23determinize, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_22determinize},
  {"difference", (PyCFunction)__pyx_pw_9pywrapfst_25difference, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_24difference},
  {"disambiguate", (PyCFunction)__pyx_pw_9pywrapfst_27disambiguate, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_26disambiguate},
  {"epsnormalize", (PyCFunction)__pyx_pw_9pywrapfst_29epsnormalize, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_28epsnormalize},
  {"equal", (PyCFunction)__pyx_pw_9pywrapfst_31equal, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_30equal},
  {"equivalent", (PyCFunction)__pyx_pw_9pywrapfst_33equivalent, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_32equivalent},
  {"intersect", (PyCFunction)__pyx_pw_9pywrapfst_35intersect, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_34intersect},
  {"isomorphic", (PyCFunction)__pyx_pw_9pywrapfst_37isomorphic, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_36isomorphic},
  {"prune", (PyCFunction)__pyx_pw_9pywrapfst_39prune, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_38prune},
  {"push", (PyCFunction)__pyx_pw_9pywrapfst_41push, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_40push},
  {"randequivalent", (PyCFunction)__pyx_pw_9pywrapfst_43randequivalent, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_42randequivalent},
  {"randgen", (PyCFunction)__pyx_pw_9pywrapfst_45randgen, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_44randgen},
  {"replace", (PyCFunction)__pyx_pw_9pywrapfst_47replace, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_46replace},
  {"reverse", (PyCFunction)__pyx_pw_9pywrapfst_49reverse, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_48reverse},
  {"shortestpath", (PyCFunction)__pyx_pw_9pywrapfst_53shortestpath, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_52shortestpath},
  {"statemap", (PyCFunction)__pyx_pw_9pywrapfst_55statemap, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_54statemap},
  {"synchronize", (PyCFunction)__pyx_pw_9pywrapfst_57synchronize, METH_O, __pyx_doc_9pywrapfst_56synchronize},
  {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

static __Pyx_StringTabEntry __pyx_string_tab[] = {
  {&__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_kp_s_ArcIterator_at_0x_x, __pyx_k_ArcIterator_at_0x_x, sizeof(__pyx_k_ArcIterator_at_0x_x), 0, 0, 1, 0},
  {&__pyx_kp_s_Arc_at_0x_x, __pyx_k_Arc_at_0x_x, sizeof(__pyx_k_Arc_at_0x_x), 0, 0, 1, 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_n_s_CalledProcessError, __pyx_k_CalledProcessError, sizeof(__pyx_k_CalledProcessError), 0, 0, 1, 1},
  {&__pyx_kp_s_Cannot_construct, __pyx_k_Cannot_construct, sizeof(__pyx_k_Cannot_construct), 0, 0, 1, 0},
  {&__pyx_kp_s_Cannot_encode_as_string_r, __pyx_k_Cannot_encode_as_string_r, sizeof(__pyx_k_Cannot_encode_as_string_r), 0, 0, 1, 0},
  {&__pyx_kp_s_Cannot_topsort_cyclic_FST, __pyx_k_Cannot_topsort_cyclic_FST, sizeof(__pyx_k_Cannot_topsort_cyclic_FST), 0, 0, 1, 0},
  {&__pyx_kp_s_Compilation_failed, __pyx_k_Compilation_failed, sizeof(__pyx_k_Compilation_failed), 0, 0, 1, 0},
  {&__pyx_kp_s_Conversion_to_r_failed, __pyx_k_Conversion_to_r_failed, sizeof(__pyx_k_Conversion_to_r_failed), 0, 0, 1, 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_DOT_TSVG, __pyx_k_DOT_TSVG, sizeof(__pyx_k_DOT_TSVG), 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_kp_s_EncodeMapper_at_0x_x, __pyx_k_EncodeMapper_at_0x_x, sizeof(__pyx_k_EncodeMapper_at_0x_x), 0, 0, 1, 0},
  {&__pyx_n_s_FST_PROPERTIES, __pyx_k_FST_PROPERTIES, sizeof(__pyx_k_FST_PROPERTIES), 0, 0, 1, 1},
  {&__pyx_kp_s_FarReader_at_0x_x, __pyx_k_FarReader_at_0x_x, sizeof(__pyx_k_FarReader_at_0x_x), 0, 0, 1, 0},
  {&__pyx_kp_s_FarWriter_at_0x_x, __pyx_k_FarWriter_at_0x_x, sizeof(__pyx_k_FarWriter_at_0x_x), 0, 0, 1, 0},
  {&__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_FstDeletedConstructorError, __pyx_k_FstDeletedConstructorError, sizeof(__pyx_k_FstDeletedConstructorError), 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_kp_s_Fst_SymbolTable_r_at_0x_x, __pyx_k_Fst_SymbolTable_r_at_0x_x, sizeof(__pyx_k_Fst_SymbolTable_r_at_0x_x), 0, 0, 1, 0},
  {&__pyx_n_s_Fst___new, __pyx_k_Fst___new, sizeof(__pyx_k_Fst___new), 0, 0, 1, 1},
  {&__pyx_kp_s_Fst_arc_type_standard_Construct, __pyx_k_Fst_arc_type_standard_Construct, sizeof(__pyx_k_Fst_arc_type_standard_Construct), 0, 0, 1, 0},
  {&__pyx_kp_s_Fst_at_0x_x, __pyx_k_Fst_at_0x_x, sizeof(__pyx_k_Fst_at_0x_x), 0, 0, 1, 0},
  {&__pyx_n_s_Fst_read, __pyx_k_Fst_read, sizeof(__pyx_k_Fst_read), 0, 0, 1, 1},
  {&__pyx_n_s_Fst_read_from_string, __pyx_k_Fst_read_from_string, sizeof(__pyx_k_Fst_read_from_string), 0, 0, 1, 1},
  {&__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_s_Incompatible_or_invalid_arc_type, __pyx_k_Incompatible_or_invalid_arc_type, sizeof(__pyx_k_Incompatible_or_invalid_arc_type), 0, 0, 1, 0},
  {&__pyx_kp_s_Incompatible_or_invalid_weight, __pyx_k_Incompatible_or_invalid_weight, sizeof(__pyx_k_Incompatible_or_invalid_weight), 0, 0, 1, 0},
  {&__pyx_kp_s_Incompatible_or_invalid_weight_t, __pyx_k_Incompatible_or_invalid_weight_t, sizeof(__pyx_k_Incompatible_or_invalid_weight_t), 0, 0, 1, 0},
  {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
  {&__pyx_kp_s_Invalid_weight, __pyx_k_Invalid_weight, sizeof(__pyx_k_Invalid_weight), 0, 0, 1, 0},
  {&__pyx_n_s_KeyError, __pyx_k_KeyError, sizeof(__pyx_k_KeyError), 0, 0, 1, 1},
  {&__pyx_kp_s_Key_out_of_order, __pyx_k_Key_out_of_order, sizeof(__pyx_k_Key_out_of_order), 0, 0, 1, 0},
  {&__pyx_n_s_MUTABLE, __pyx_k_MUTABLE, sizeof(__pyx_k_MUTABLE), 0, 0, 1, 1},
  {&__pyx_kp_s_MutableArcIterator_at_0x_x, __pyx_k_MutableArcIterator_at_0x_x, sizeof(__pyx_k_MutableArcIterator_at_0x_x), 0, 0, 1, 0},
  {&__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_n_s_NoWeight, __pyx_k_NoWeight, sizeof(__pyx_k_NoWeight), 0, 0, 1, 1},
  {&__pyx_kp_s_No_new_SymbolTables_specified, __pyx_k_No_new_SymbolTables_specified, sizeof(__pyx_k_No_new_SymbolTables_specified), 0, 0, 1, 0},
  {&__pyx_kp_s_No_relabeling_pairs_specified, __pyx_k_No_relabeling_pairs_specified, sizeof(__pyx_k_No_relabeling_pairs_specified), 0, 0, 1, 0},
  {&__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_n_s_One, __pyx_k_One, sizeof(__pyx_k_One), 0, 0, 1, 1},
  {&__pyx_kp_s_Open_failed_r, __pyx_k_Open_failed_r, sizeof(__pyx_k_Open_failed_r), 0, 0, 1, 0},
  {&__pyx_kp_s_Operation_failed, __pyx_k_Operation_failed, sizeof(__pyx_k_Operation_failed), 0, 0, 1, 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_RM_SUPERFINAL_PROPERTIES, __pyx_k_RM_SUPERFINAL_PROPERTIES, sizeof(__pyx_k_RM_SUPERFINAL_PROPERTIES), 0, 0, 1, 1},
  {&__pyx_kp_s_Read_failed_r, __pyx_k_Read_failed_r, sizeof(__pyx_k_Read_failed_r), 0, 0, 1, 0},
  {&__pyx_kp_s_Read_failed_string, __pyx_k_Read_failed_string, sizeof(__pyx_k_Read_failed_string), 0, 0, 1, 0},
  {&__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_kp_s_StateIterator_at_0x_x, __pyx_k_StateIterator_at_0x_x, sizeof(__pyx_k_StateIterator_at_0x_x), 0, 0, 1, 0},
  {&__pyx_kp_s_State_index_out_of_range, __pyx_k_State_index_out_of_range, sizeof(__pyx_k_State_index_out_of_range), 0, 0, 1, 0},
  {&__pyx_n_s_StopIteration, __pyx_k_StopIteration, sizeof(__pyx_k_StopIteration), 0, 0, 1, 1},
  {&__pyx_kp_s_SymbolTableIterator_at_0x_x, __pyx_k_SymbolTableIterator_at_0x_x, sizeof(__pyx_k_SymbolTableIterator_at_0x_x), 0, 0, 1, 0},
  {&__pyx_kp_s_SymbolTable_r_at_0x_x, __pyx_k_SymbolTable_r_at_0x_x, sizeof(__pyx_k_SymbolTable_r_at_0x_x), 0, 0, 1, 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_s_Tsvg, __pyx_k_Tsvg, sizeof(__pyx_k_Tsvg), 0, 0, 1, 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_s_Unknown_arc_type_r, __pyx_k_Unknown_arc_type_r, sizeof(__pyx_k_Unknown_arc_type_r), 0, 0, 1, 0},
  {&__pyx_kp_s_Unknown_compose_filter_type_r, __pyx_k_Unknown_compose_filter_type_r, sizeof(__pyx_k_Unknown_compose_filter_type_r), 0, 0, 1, 0},
  {&__pyx_kp_s_Unknown_determinization_type_r, __pyx_k_Unknown_determinization_type_r, sizeof(__pyx_k_Unknown_determinization_type_r), 0, 0, 1, 0},
  {&__pyx_kp_s_Unknown_map_type_r, __pyx_k_Unknown_map_type_r, sizeof(__pyx_k_Unknown_map_type_r), 0, 0, 1, 0},
  {&__pyx_kp_s_Unknown_queue_type_r, __pyx_k_Unknown_queue_type_r, sizeof(__pyx_k_Unknown_queue_type_r), 0, 0, 1, 0},
  {&__pyx_kp_s_Unknown_random_arc_selection_typ, __pyx_k_Unknown_random_arc_selection_typ, sizeof(__pyx_k_Unknown_random_arc_selection_typ), 0, 0, 1, 0},
  {&__pyx_kp_s_Unknown_replace_label_type_r, __pyx_k_Unknown_replace_label_type_r, sizeof(__pyx_k_Unknown_replace_label_type_r), 0, 0, 1, 0},
  {&__pyx_kp_s_Unknown_sort_type_r, __pyx_k_Unknown_sort_type_r, sizeof(__pyx_k_Unknown_sort_type_r), 0, 0, 1, 0},
  {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 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_s_Weight_at_0x_x, __pyx_k_Weight_at_0x_x, sizeof(__pyx_k_Weight_at_0x_x), 0, 0, 1, 0},
  {&__pyx_kp_s_Weight_type_not_found, __pyx_k_Weight_type_not_found, sizeof(__pyx_k_Weight_type_not_found), 0, 0, 1, 0},
  {&__pyx_kp_s_Write_failed_r, __pyx_k_Write_failed_r, sizeof(__pyx_k_Write_failed_r), 0, 0, 1, 0},
  {&__pyx_kp_s_Write_to_string_failed, __pyx_k_Write_to_string_failed, sizeof(__pyx_k_Write_to_string_failed), 0, 0, 1, 0},
  {&__pyx_n_s_Zero, __pyx_k_Zero, sizeof(__pyx_k_Zero), 0, 0, 1, 1},
  {&__pyx_kp_b__24, __pyx_k__24, sizeof(__pyx_k__24), 0, 0, 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_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_atexit, __pyx_k_atexit, sizeof(__pyx_k_atexit), 0, 0, 1, 1},
  {&__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_b_auto, __pyx_k_auto, sizeof(__pyx_k_auto), 0, 0, 0, 1},
  {&__pyx_n_s_available_key, __pyx_k_available_key, sizeof(__pyx_k_available_key), 0, 0, 1, 1},
  {&__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_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 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_cls, __pyx_k_cls, sizeof(__pyx_k_cls), 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_s_const_EncodeMapper_SymbolTable, __pyx_k_const_EncodeMapper_SymbolTable, sizeof(__pyx_k_const_EncodeMapper_SymbolTable), 0, 0, 1, 0},
  {&__pyx_kp_s_const_Fst_SymbolTable_r_at_0x_x, __pyx_k_const_Fst_SymbolTable_r_at_0x_x, sizeof(__pyx_k_const_Fst_SymbolTable_r_at_0x_x), 0, 0, 1, 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_s_decode, __pyx_k_decode, sizeof(__pyx_k_decode), 0, 0, 1, 1},
  {&__pyx_n_b_default, __pyx_k_default, sizeof(__pyx_k_default), 0, 0, 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_s_dot, __pyx_k_dot, sizeof(__pyx_k_dot), 0, 0, 1, 1},
  {&__pyx_n_s_draw, __pyx_k_draw, sizeof(__pyx_k_draw), 0, 0, 1, 1},
  {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 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_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_n_s_far_type, __pyx_k_far_type, sizeof(__pyx_k_far_type), 0, 0, 1, 1},
  {&__pyx_n_s_filename, __pyx_k_filename, sizeof(__pyx_k_filename), 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_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
  {&__pyx_n_s_fst_error_fatal_old, __pyx_k_fst_error_fatal_old, sizeof(__pyx_k_fst_error_fatal_old), 0, 0, 1, 1},
  {&__pyx_n_s_fst_type, __pyx_k_fst_type, sizeof(__pyx_k_fst_type), 0, 0, 1, 1},
  {&__pyx_n_b_functional, __pyx_k_functional, sizeof(__pyx_k_functional), 0, 0, 0, 1},
  {&__pyx_n_b_g, __pyx_k_g, sizeof(__pyx_k_g), 0, 0, 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_b_identity, __pyx_k_identity, sizeof(__pyx_k_identity), 0, 0, 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_b_ilabel, __pyx_k_ilabel, sizeof(__pyx_k_ilabel), 0, 0, 0, 1},
  {&__pyx_n_s_ilabel, __pyx_k_ilabel, sizeof(__pyx_k_ilabel), 0, 0, 1, 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_b_input, __pyx_k_input, sizeof(__pyx_k_input), 0, 0, 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_kNoSymbol, __pyx_k_kNoSymbol, sizeof(__pyx_k_kNoSymbol), 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_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_b_neither, __pyx_k_neither, sizeof(__pyx_k_neither), 0, 0, 0, 1},
  {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 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_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_object, __pyx_k_object, sizeof(__pyx_k_object), 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_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_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_project_output, __pyx_k_project_output, sizeof(__pyx_k_project_output), 0, 0, 1, 1},
  {&__pyx_n_s_properties, __pyx_k_properties, sizeof(__pyx_k_properties), 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_kp_b_pywrapfst, __pyx_k_pywrapfst, sizeof(__pyx_k_pywrapfst), 0, 0, 0, 0},
  {&__pyx_n_s_pywrapfst_2, __pyx_k_pywrapfst_2, sizeof(__pyx_k_pywrapfst_2), 0, 0, 1, 1},
  {&__pyx_kp_s_pywrapfst_pyx, __pyx_k_pywrapfst_pyx, sizeof(__pyx_k_pywrapfst_pyx), 0, 0, 1, 0},
  {&__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_from_string, __pyx_k_read_from_string, sizeof(__pyx_k_read_from_string), 0, 0, 1, 1},
  {&__pyx_n_s_read_from_string_2, __pyx_k_read_from_string_2, sizeof(__pyx_k_read_from_string_2), 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_register, __pyx_k_register, sizeof(__pyx_k_register), 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_b_repr_svg, __pyx_k_repr_svg, sizeof(__pyx_k_repr_svg), 0, 0, 0, 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_reset_fst_error_fatal, __pyx_k_reset_fst_error_fatal, sizeof(__pyx_k_reset_fst_error_fatal), 0, 0, 1, 1},
  {&__pyx_n_s_result, __pyx_k_result, sizeof(__pyx_k_result), 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_returncode, __pyx_k_returncode, sizeof(__pyx_k_returncode), 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__encoder_cannot_be_converte, __pyx_k_self__encoder_cannot_be_converte, sizeof(__pyx_k_self__encoder_cannot_be_converte), 0, 0, 1, 0},
  {&__pyx_kp_s_self__encoder_self__table_cannot, __pyx_k_self__encoder_self__table_cannot, sizeof(__pyx_k_self__encoder_self__table_cannot), 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__fst_self__table_cannot_be, __pyx_k_self__fst_self__table_cannot_be, sizeof(__pyx_k_self__fst_self__table_cannot_be), 0, 0, 1, 0},
  {&__pyx_kp_s_self__mfst_self__table_cannot_be, __pyx_k_self__mfst_self__table_cannot_be, sizeof(__pyx_k_self__mfst_self__table_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_self__table_cannot_b, __pyx_k_self__siter_self__table_cannot_b, sizeof(__pyx_k_self__siter_self__table_cannot_b), 0, 0, 1, 0},
  {&__pyx_kp_s_self__smart_table_self__table_ca, __pyx_k_self__smart_table_self__table_ca, sizeof(__pyx_k_self__smart_table_self__table_ca), 0, 0, 1, 0},
  {&__pyx_kp_s_self__table_cannot_be_converted, __pyx_k_self__table_cannot_be_converted, sizeof(__pyx_k_self__table_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_set_flags, __pyx_k_set_flags, sizeof(__pyx_k_set_flags), 0, 0, 1, 1},
  {&__pyx_n_s_set_input_symbols, __pyx_k_set_input_symbols, sizeof(__pyx_k_set_input_symbols), 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_output_symbols, __pyx_k_set_output_symbols, sizeof(__pyx_k_set_output_symbols), 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_ssymbols, __pyx_k_ssymbols, sizeof(__pyx_k_ssymbols), 0, 0, 1, 1},
  {&__pyx_n_b_standard, __pyx_k_standard, sizeof(__pyx_k_standard), 0, 0, 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_stderr, __pyx_k_stderr, sizeof(__pyx_k_stderr), 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_syms, __pyx_k_syms, sizeof(__pyx_k_syms), 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_text, __pyx_k_text, sizeof(__pyx_k_text), 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_b_tropical, __pyx_k_tropical, sizeof(__pyx_k_tropical), 0, 0, 0, 1},
  {&__pyx_n_s_type, __pyx_k_type, sizeof(__pyx_k_type), 0, 0, 1, 1},
  {&__pyx_n_b_uniform, __pyx_k_uniform, sizeof(__pyx_k_uniform), 0, 0, 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_b_unspecified, __pyx_k_unspecified, sizeof(__pyx_k_unspecified), 0, 0, 0, 0},
  {&__pyx_n_s_utf8, __pyx_k_utf8, sizeof(__pyx_k_utf8), 0, 0, 1, 1},
  {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1},
  {&__pyx_n_b_vector, __pyx_k_vector, sizeof(__pyx_k_vector), 0, 0, 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_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_b_write_to_string, __pyx_k_write_to_string, sizeof(__pyx_k_write_to_string), 0, 0, 0, 1},
  {&__pyx_n_s_write_to_string, __pyx_k_write_to_string, sizeof(__pyx_k_write_to_string), 0, 0, 1, 1},
  {0, 0, 0, 0, 0, 0, 0}
};
static int __Pyx_InitCachedBuiltins(void) {
  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 126, __pyx_L1_error)
  __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 136, __pyx_L1_error)
  __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(0, 141, __pyx_L1_error)
  __pyx_builtin_IOError = __Pyx_GetBuiltinName(__pyx_n_s_IOError); if (!__pyx_builtin_IOError) __PYX_ERR(0, 146, __pyx_L1_error)
  __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) __PYX_ERR(0, 2742, __pyx_L1_error)
  __pyx_builtin_staticmethod = __Pyx_GetBuiltinName(__pyx_n_s_staticmethod); if (!__pyx_builtin_staticmethod) __PYX_ERR(0, 2762, __pyx_L1_error)
  __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(0, 370, __pyx_L1_error)
  __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error)
  __pyx_builtin_StopIteration = __Pyx_GetBuiltinName(__pyx_n_s_StopIteration); if (!__pyx_builtin_StopIteration) __PYX_ERR(0, 1145, __pyx_L1_error)
  __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(0, 4357, __pyx_L1_error)
  return 0;
  __pyx_L1_error:;
  return -1;
}

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

  /* "pywrapfst.pyx":388
 *   cdef void _check_weight(self) except *:
 *     if self.type() == b"none":
 *       raise FstArgError("Weight type not found")             # <<<<<<<<<<<<<<
 *     if self.to_string() == b"BadNumber":
 *       raise FstBadWeightError("Invalid weight")
 */
  __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_Weight_type_not_found); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 388, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple_);
  __Pyx_GIVEREF(__pyx_tuple_);

  /* "pywrapfst.pyx":390
 *       raise FstArgError("Weight type not found")
 *     if self.to_string() == b"BadNumber":
 *       raise FstBadWeightError("Invalid weight")             # <<<<<<<<<<<<<<
 * 
 *   cpdef Weight copy(self):
 */
  __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_Invalid_weight); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 390, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__2);
  __Pyx_GIVEREF(__pyx_tuple__2);

  /* "(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__3 = PyTuple_Pack(1, __pyx_kp_s_self__weight_cannot_be_converted); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(1, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__3);
  __Pyx_GIVEREF(__pyx_tuple__3);

  /* "(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__4 = PyTuple_Pack(1, __pyx_kp_s_self__weight_cannot_be_converted); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__4);
  __Pyx_GIVEREF(__pyx_tuple__4);

  /* "pywrapfst.pyx":638
 *       tostring(weight_type))))
 *   if result._weight.get().Type() == b"none":
 *     raise FstArgError("Weight type not found")             # <<<<<<<<<<<<<<
 *   return result
 * 
 */
  __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_Weight_type_not_found); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 638, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__5);
  __Pyx_GIVEREF(__pyx_tuple__5);

  /* "pywrapfst.pyx":647
 *         fst.WeightClass.One(tostring(weight_type))))
 *   if result._weight.get().Type() == b"none":
 *     raise FstArgError("Weight type not found")             # <<<<<<<<<<<<<<
 *   return result
 * 
 */
  __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_Weight_type_not_found); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 647, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__6);
  __Pyx_GIVEREF(__pyx_tuple__6);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self._table cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self._table cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_self__table_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._table cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self._table cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_self__table_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);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self._encoder,self._table cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self._encoder,self._table cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_self__encoder_self__table_cannot); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(1, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__9);
  __Pyx_GIVEREF(__pyx_tuple__9);

  /* "(tree fragment)":4
 *     raise TypeError("self._encoder,self._table cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self._encoder,self._table cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_self__encoder_self__table_cannot); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__10);
  __Pyx_GIVEREF(__pyx_tuple__10);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self._fst,self._table cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self._fst,self._table cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_self__fst_self__table_cannot_be); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(1, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__11);
  __Pyx_GIVEREF(__pyx_tuple__11);

  /* "(tree fragment)":4
 *     raise TypeError("self._fst,self._table cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self._fst,self._table cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_self__fst_self__table_cannot_be); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__12);
  __Pyx_GIVEREF(__pyx_tuple__12);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self._table cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self._table cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_self__table_cannot_be_converted); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(1, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__14);
  __Pyx_GIVEREF(__pyx_tuple__14);

  /* "(tree fragment)":4
 *     raise TypeError("self._table cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self._table cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_self__table_cannot_be_converted); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__15);
  __Pyx_GIVEREF(__pyx_tuple__15);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self._mfst,self._table cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self._mfst,self._table cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_self__mfst_self__table_cannot_be); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(1, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__16);
  __Pyx_GIVEREF(__pyx_tuple__16);

  /* "(tree fragment)":4
 *     raise TypeError("self._mfst,self._table cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self._mfst,self._table cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_self__mfst_self__table_cannot_be); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__17);
  __Pyx_GIVEREF(__pyx_tuple__17);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self._smart_table,self._table cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self._smart_table,self._table cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_self__smart_table_self__table_ca); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(1, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__18);
  __Pyx_GIVEREF(__pyx_tuple__18);

  /* "(tree fragment)":4
 *     raise TypeError("self._smart_table,self._table cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self._smart_table,self._table cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_self__smart_table_self__table_ca); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__19);
  __Pyx_GIVEREF(__pyx_tuple__19);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self._siter,self._table cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self._siter,self._table cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_self__siter_self__table_cannot_b); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(1, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__20);
  __Pyx_GIVEREF(__pyx_tuple__20);

  /* "(tree fragment)":4
 *     raise TypeError("self._siter,self._table cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self._siter,self._table cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_self__siter_self__table_cannot_b); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__21);
  __Pyx_GIVEREF(__pyx_tuple__21);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self._encoder cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self._encoder cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_self__encoder_cannot_be_converte); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(1, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__22);
  __Pyx_GIVEREF(__pyx_tuple__22);

  /* "(tree fragment)":4
 *     raise TypeError("self._encoder cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self._encoder cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_self__encoder_cannot_be_converte); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__23);
  __Pyx_GIVEREF(__pyx_tuple__23);

  /* "pywrapfst.pyx":1400
 *     if proc.returncode != 0:  # Just to be explicit.
 *       raise subprocess.CalledProcessError(proc.returncode, self._DOT_TSVG)
 *     return sout.decode("utf8")             # <<<<<<<<<<<<<<
 * 
 *   def __repr__(self):
 */
  __pyx_tuple__25 = PyTuple_Pack(1, __pyx_n_s_utf8); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 1400, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__25);
  __Pyx_GIVEREF(__pyx_tuple__25);

  /* "pywrapfst.pyx":1576
 *     cdef size_t result = self._fst.get().NumArcs(state)
 *     if result == SIZE_MAX:
 *       raise FstIndexError("State index out of range")             # <<<<<<<<<<<<<<
 *     return result
 * 
 */
  __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_State_index_out_of_range); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 1576, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__26);
  __Pyx_GIVEREF(__pyx_tuple__26);

  /* "pywrapfst.pyx":1598
 *     cdef size_t result = self._fst.get().NumInputEpsilons(state)
 *     if result == SIZE_MAX:
 *       raise FstIndexError("State index out of range")             # <<<<<<<<<<<<<<
 *     return result
 * 
 */
  __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_State_index_out_of_range); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 1598, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__27);
  __Pyx_GIVEREF(__pyx_tuple__27);

  /* "pywrapfst.pyx":1620
 *     cdef size_t result = self._fst.get().NumOutputEpsilons(state)
 *     if result == SIZE_MAX:
 *       raise FstIndexError("State index out of range")             # <<<<<<<<<<<<<<
 *     return result
 * 
 */
  __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_State_index_out_of_range); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 1620, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__28);
  __Pyx_GIVEREF(__pyx_tuple__28);

  /* "pywrapfst.pyx":1770
 *     cdef stringstream sstrm
 *     if not self._fst.get().Write(sstrm, "write_to_string"):
 *       raise FstIOError("Write to string failed")             # <<<<<<<<<<<<<<
 *     return sstrm.str()
 * 
 */
  __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_Write_to_string_failed); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 1770, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__29);
  __Pyx_GIVEREF(__pyx_tuple__29);

  /* "pywrapfst.pyx":1790
 *     """
 *     if self._fst.get().Properties(fst.kError, True) == fst.kError:
 *       raise FstOpError("Operation failed")             # <<<<<<<<<<<<<<
 * 
 *   cdef void _add_arc(self, int64 state, Arc arc) except *:
 */
  __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_Operation_failed); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 1790, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__30);
  __Pyx_GIVEREF(__pyx_tuple__30);

  /* "pywrapfst.pyx":1794
 *   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_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_State_index_out_of_range); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 1794, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__31);
  __Pyx_GIVEREF(__pyx_tuple__31);

  /* "pywrapfst.pyx":1796
 *       raise FstIndexError("State index out of range")
 *     if not self._mfst.get().AddArc(state, deref(arc._arc)):
 *       raise FstOpError("Incompatible or invalid weight type")             # <<<<<<<<<<<<<<
 *     self._check_mutating_imethod()
 * 
 */
  __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_Incompatible_or_invalid_weight_t); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 1796, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__32);
  __Pyx_GIVEREF(__pyx_tuple__32);

  /* "pywrapfst.pyx":1961
 *     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_tuple__33 = PyTuple_Pack(1, __pyx_kp_s_State_index_out_of_range); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 1961, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__33);
  __Pyx_GIVEREF(__pyx_tuple__33);

  /* "pywrapfst.pyx":1991
 *     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_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_State_index_out_of_range); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 1991, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__34);
  __Pyx_GIVEREF(__pyx_tuple__34);

  /* "pywrapfst.pyx":2260
 *         _opairs.get().push_back(fst.LabelPair(before, after))
 *     if _ipairs.get().empty() and _opairs.get().empty():
 *       raise FstArgError("No relabeling pairs specified.")             # <<<<<<<<<<<<<<
 *     fst.Relabel(self._mfst.get(), deref(_ipairs), deref(_opairs))
 *     self._check_mutating_imethod()
 */
  __pyx_tuple__43 = PyTuple_Pack(1, __pyx_kp_s_No_relabeling_pairs_specified); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 2260, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__43);
  __Pyx_GIVEREF(__pyx_tuple__43);

  /* "pywrapfst.pyx":2299
 *                             bool attach_new_osymbols=True) except *:
 *     if new_isymbols is None and new_osymbols is None:
 *       raise FstArgError("No new SymbolTables specified")             # <<<<<<<<<<<<<<
 *     cdef fst.SymbolTable *new_isymbols_ptr = NULL
 *     if new_isymbols is not None:
 */
  __pyx_tuple__44 = PyTuple_Pack(1, __pyx_kp_s_No_new_SymbolTables_specified); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 2299, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__44);
  __Pyx_GIVEREF(__pyx_tuple__44);

  /* "pywrapfst.pyx":2367
 *   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_tuple__45 = PyTuple_Pack(1, __pyx_kp_s_State_index_out_of_range); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 2367, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__45);
  __Pyx_GIVEREF(__pyx_tuple__45);

  /* "pywrapfst.pyx":2494
 *   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 wc = _get_WeightClass_or_One(self.weight_type(),
 *                                                       weight)
 */
  __pyx_tuple__50 = PyTuple_Pack(1, __pyx_kp_s_State_index_out_of_range); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(0, 2494, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__50);
  __Pyx_GIVEREF(__pyx_tuple__50);

  /* "pywrapfst.pyx":2498
 *                                                       weight)
 *     if not self._mfst.get().SetFinal(state, wc):
 *       raise FstOpError("Incompatible or invalid weight")             # <<<<<<<<<<<<<<
 *     self._check_mutating_imethod()
 * 
 */
  __pyx_tuple__51 = PyTuple_Pack(1, __pyx_kp_s_Incompatible_or_invalid_weight); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(0, 2498, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__51);
  __Pyx_GIVEREF(__pyx_tuple__51);

  /* "pywrapfst.pyx":2598
 *   cdef void _set_start(self, int64 state) except *:
 *     if not self._mfst.get().SetStart(state):
 *       raise FstIndexError("State index out of range")             # <<<<<<<<<<<<<<
 *     self._check_mutating_imethod()
 * 
 */
  __pyx_tuple__52 = PyTuple_Pack(1, __pyx_kp_s_State_index_out_of_range); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(0, 2598, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__52);
  __Pyx_GIVEREF(__pyx_tuple__52);

  /* "pywrapfst.pyx":2624
 *     # 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.")             # <<<<<<<<<<<<<<
 *     self._check_mutating_imethod()
 * 
 */
  __pyx_tuple__53 = PyTuple_Pack(1, __pyx_kp_s_Cannot_topsort_cyclic_FST); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(0, 2624, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__53);
  __Pyx_GIVEREF(__pyx_tuple__53);

  /* "pywrapfst.pyx":2693
 * cdef _Fst _init_Fst(FstClass_ptr tfst):
 *   if tfst.Properties(fst.kError, True):
 *     raise FstOpError("Operation failed")             # <<<<<<<<<<<<<<
 *   cdef _Fst ofst = _Fst.__new__(_Fst)
 *   ofst._fst.reset(tfst)
 */
  __pyx_tuple__54 = PyTuple_Pack(1, __pyx_kp_s_Operation_failed); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(0, 2693, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__54);
  __Pyx_GIVEREF(__pyx_tuple__54);

  /* "pywrapfst.pyx":2701
 * cdef _MutableFst _init_MutableFst(MutableFstClass_ptr tfst):
 *   if tfst.Properties(fst.kError, True):
 *     raise FstOpError("Operation failed")             # <<<<<<<<<<<<<<
 *   cdef _MutableFst ofst = _MutableFst.__new__(_MutableFst)
 *   ofst._fst.reset(tfst)
 */
  __pyx_tuple__55 = PyTuple_Pack(1, __pyx_kp_s_Operation_failed); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(0, 2701, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__55);
  __Pyx_GIVEREF(__pyx_tuple__55);

  /* "pywrapfst.pyx":2738
 *   tfst.reset(fst.FstClass.ReadFromStream(sstrm, b"<pywrapfst>"))
 *   if tfst.get() == NULL:
 *     raise FstIOError("Read failed: <string>")             # <<<<<<<<<<<<<<
 *   return _init_XFst(tfst.release())
 * 
 */
  __pyx_tuple__56 = PyTuple_Pack(1, __pyx_kp_s_Read_failed_string); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(0, 2738, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__56);
  __Pyx_GIVEREF(__pyx_tuple__56);

  /* "(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__57 = PyTuple_Pack(1, __pyx_kp_s_self__arc_cannot_be_converted_to); 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._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__58 = PyTuple_Pack(1, __pyx_kp_s_self__arc_cannot_be_converted_to); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__58);
  __Pyx_GIVEREF(__pyx_tuple__58);

  /* "pywrapfst.pyx":2978
 *   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_tuple__59 = PyTuple_Pack(1, __pyx_kp_s_State_index_out_of_range); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(0, 2978, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__59);
  __Pyx_GIVEREF(__pyx_tuple__59);

  /* "(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__60 = PyTuple_Pack(1, __pyx_kp_s_self__aiter_self__fst_cannot_be); if (unlikely(!__pyx_tuple__60)) __PYX_ERR(1, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__60);
  __Pyx_GIVEREF(__pyx_tuple__60);

  /* "(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__61 = PyTuple_Pack(1, __pyx_kp_s_self__aiter_self__fst_cannot_be); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__61);
  __Pyx_GIVEREF(__pyx_tuple__61);

  /* "pywrapfst.pyx":3090
 *   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_tuple__62 = PyTuple_Pack(1, __pyx_kp_s_State_index_out_of_range); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(0, 3090, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__62);
  __Pyx_GIVEREF(__pyx_tuple__62);

  /* "(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__63 = PyTuple_Pack(1, __pyx_kp_s_self__aiter_self__mfst_cannot_be); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(1, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__63);
  __Pyx_GIVEREF(__pyx_tuple__63);

  /* "(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__64 = PyTuple_Pack(1, __pyx_kp_s_self__aiter_self__mfst_cannot_be); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__64);
  __Pyx_GIVEREF(__pyx_tuple__64);

  /* "(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__65 = PyTuple_Pack(1, __pyx_kp_s_self__fst_self__siter_cannot_be); if (unlikely(!__pyx_tuple__65)) __PYX_ERR(1, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__65);
  __Pyx_GIVEREF(__pyx_tuple__65);

  /* "(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__66 = PyTuple_Pack(1, __pyx_kp_s_self__fst_self__siter_cannot_be); if (unlikely(!__pyx_tuple__66)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__66);
  __Pyx_GIVEREF(__pyx_tuple__66);

  /* "pywrapfst.pyx":4190
 *     self._sstrm.reset(new stringstream())
 *     if tfst.get() == NULL:
 *       raise FstOpError("Compilation failed")             # <<<<<<<<<<<<<<
 *     return _init_XFst(tfst.release())
 * 
 */
  __pyx_tuple__90 = PyTuple_Pack(1, __pyx_kp_s_Compilation_failed); if (unlikely(!__pyx_tuple__90)) __PYX_ERR(0, 4190, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__90);
  __Pyx_GIVEREF(__pyx_tuple__90);

  /* "(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__91 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__91)) __PYX_ERR(1, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__91);
  __Pyx_GIVEREF(__pyx_tuple__91);

  /* "(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__92 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__92)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__92);
  __Pyx_GIVEREF(__pyx_tuple__92);

  /* "(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__93 = PyTuple_Pack(1, __pyx_kp_s_self__reader_cannot_be_converted); if (unlikely(!__pyx_tuple__93)) __PYX_ERR(1, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__93);
  __Pyx_GIVEREF(__pyx_tuple__93);

  /* "(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__94 = PyTuple_Pack(1, __pyx_kp_s_self__reader_cannot_be_converted); if (unlikely(!__pyx_tuple__94)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__94);
  __Pyx_GIVEREF(__pyx_tuple__94);

  /* "pywrapfst.pyx":4443
 *     # 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")             # <<<<<<<<<<<<<<
 *     # An error here usually indicates a key out of order.
 *     if self._writer.get().Error():
 */
  __pyx_tuple__95 = PyTuple_Pack(1, __pyx_kp_s_Incompatible_or_invalid_arc_type); if (unlikely(!__pyx_tuple__95)) __PYX_ERR(0, 4443, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__95);
  __Pyx_GIVEREF(__pyx_tuple__95);

  /* "pywrapfst.pyx":4446
 *     # An error here usually indicates a key out of order.
 *     if self._writer.get().Error():
 *       raise FstArgError("Key out of order")             # <<<<<<<<<<<<<<
 * 
 *   cpdef string arc_type(self):
 */
  __pyx_tuple__96 = PyTuple_Pack(1, __pyx_kp_s_Key_out_of_order); if (unlikely(!__pyx_tuple__96)) __PYX_ERR(0, 4446, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__96);
  __Pyx_GIVEREF(__pyx_tuple__96);

  /* "(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__97 = PyTuple_Pack(1, __pyx_kp_s_self__writer_cannot_be_converted); if (unlikely(!__pyx_tuple__97)) __PYX_ERR(1, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__97);
  __Pyx_GIVEREF(__pyx_tuple__97);

  /* "(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__98 = PyTuple_Pack(1, __pyx_kp_s_self__writer_cannot_be_converted); if (unlikely(!__pyx_tuple__98)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__98);
  __Pyx_GIVEREF(__pyx_tuple__98);

  /* "pywrapfst.pyx":456
 * 
 * 
 * def plus(Weight lhs, Weight rhs):             # <<<<<<<<<<<<<<
 *   """
 *   plus(lhs, rhs)
 */
  __pyx_tuple__99 = PyTuple_Pack(3, __pyx_n_s_lhs, __pyx_n_s_rhs, __pyx_n_s_result); if (unlikely(!__pyx_tuple__99)) __PYX_ERR(0, 456, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__99);
  __Pyx_GIVEREF(__pyx_tuple__99);
  __pyx_codeobj__100 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__99, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pywrapfst_pyx, __pyx_n_s_plus, 456, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__100)) __PYX_ERR(0, 456, __pyx_L1_error)

  /* "pywrapfst.pyx":488
 * 
 * 
 * def times(Weight lhs, Weight rhs):             # <<<<<<<<<<<<<<
 *   """
 *   times(lhs, rhs)
 */
  __pyx_tuple__101 = PyTuple_Pack(3, __pyx_n_s_lhs, __pyx_n_s_rhs, __pyx_n_s_result); if (unlikely(!__pyx_tuple__101)) __PYX_ERR(0, 488, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__101);
  __Pyx_GIVEREF(__pyx_tuple__101);
  __pyx_codeobj__102 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__101, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pywrapfst_pyx, __pyx_n_s_times, 488, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__102)) __PYX_ERR(0, 488, __pyx_L1_error)

  /* "pywrapfst.pyx":520
 * 
 * 
 * def divide(Weight lhs, Weight rhs):             # <<<<<<<<<<<<<<
 *   """
 *   divide(lhs, rhs)
 */
  __pyx_tuple__103 = PyTuple_Pack(3, __pyx_n_s_lhs, __pyx_n_s_rhs, __pyx_n_s_result); if (unlikely(!__pyx_tuple__103)) __PYX_ERR(0, 520, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__103);
  __Pyx_GIVEREF(__pyx_tuple__103);
  __pyx_codeobj__104 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__103, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pywrapfst_pyx, __pyx_n_s_divide, 520, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__104)) __PYX_ERR(0, 520, __pyx_L1_error)

  /* "pywrapfst.pyx":553
 * 
 * 
 * def power(Weight w, size_t n):             # <<<<<<<<<<<<<<
 *   """
 *   power(lhs, rhs)
 */
  __pyx_tuple__105 = PyTuple_Pack(3, __pyx_n_s_w, __pyx_n_s_n, __pyx_n_s_result); if (unlikely(!__pyx_tuple__105)) __PYX_ERR(0, 553, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__105);
  __Pyx_GIVEREF(__pyx_tuple__105);
  __pyx_codeobj__106 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__105, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pywrapfst_pyx, __pyx_n_s_power, 553, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__106)) __PYX_ERR(0, 553, __pyx_L1_error)

  /* "pywrapfst.pyx":2742
 * 
 * 
 * class Fst(object):             # <<<<<<<<<<<<<<
 * 
 *    """
 */
  __pyx_tuple__107 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__107)) __PYX_ERR(0, 2742, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__107);
  __Pyx_GIVEREF(__pyx_tuple__107);

  /* "pywrapfst.pyx":2759
 *    """
 * 
 *    def __new__(cls, arc_type=b"standard"):             # <<<<<<<<<<<<<<
 *     return _create_Fst(arc_type)
 * 
 */
  __pyx_tuple__108 = PyTuple_Pack(2, __pyx_n_s_cls, __pyx_n_s_arc_type); if (unlikely(!__pyx_tuple__108)) __PYX_ERR(0, 2759, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__108);
  __Pyx_GIVEREF(__pyx_tuple__108);
  __pyx_codeobj__109 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__108, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pywrapfst_pyx, __pyx_n_s_new, 2759, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__109)) __PYX_ERR(0, 2759, __pyx_L1_error)
  __pyx_tuple__110 = PyTuple_Pack(1, ((PyObject*)__pyx_n_b_standard)); if (unlikely(!__pyx_tuple__110)) __PYX_ERR(0, 2759, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__110);
  __Pyx_GIVEREF(__pyx_tuple__110);

  /* "pywrapfst.pyx":2763
 * 
 *    @staticmethod
 *    def read(filename):             # <<<<<<<<<<<<<<
 *      """
 *      read(filename):
 */
  __pyx_tuple__111 = PyTuple_Pack(1, __pyx_n_s_filename); if (unlikely(!__pyx_tuple__111)) __PYX_ERR(0, 2763, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__111);
  __Pyx_GIVEREF(__pyx_tuple__111);
  __pyx_codeobj__112 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__111, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pywrapfst_pyx, __pyx_n_s_read, 2763, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__112)) __PYX_ERR(0, 2763, __pyx_L1_error)

  /* "pywrapfst.pyx":2781
 * 
 *    @staticmethod
 *    def read_from_string(state):             # <<<<<<<<<<<<<<
 *      """
 *      read_from_string(string, fst_type=None)
 */
  __pyx_tuple__113 = PyTuple_Pack(1, __pyx_n_s_state); if (unlikely(!__pyx_tuple__113)) __PYX_ERR(0, 2781, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__113);
  __Pyx_GIVEREF(__pyx_tuple__113);
  __pyx_codeobj__114 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__113, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pywrapfst_pyx, __pyx_n_s_read_from_string_2, 2781, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__114)) __PYX_ERR(0, 2781, __pyx_L1_error)

  /* "pywrapfst.pyx":3949
 * 
 * 
 * def shortestdistance(_Fst ifst,             # <<<<<<<<<<<<<<
 *                      float delta=fst.kShortestDelta,
 *                      int64 nstate=fst.kNoStateId,
 */
  __pyx_tuple__115 = PyTuple_Pack(8, __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_type, __pyx_n_s_weight); if (unlikely(!__pyx_tuple__115)) __PYX_ERR(0, 3949, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__115);
  __Pyx_GIVEREF(__pyx_tuple__115);
  __pyx_codeobj__116 = (PyObject*)__Pyx_PyCode_New(5, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__115, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pywrapfst_pyx, __pyx_n_s_shortestdistance, 3949, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__116)) __PYX_ERR(0, 3949, __pyx_L1_error)

  /* "pywrapfst.pyx":4492
 * 
 * @atexit.register
 * def _reset_fst_error_fatal():             # <<<<<<<<<<<<<<
 *   fst.FLAGS_fst_error_fatal = _fst_error_fatal_old
 * 
 */
  __pyx_codeobj__117 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pywrapfst_pyx, __pyx_n_s_reset_fst_error_fatal, 4492, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__117)) __PYX_ERR(0, 4492, __pyx_L1_error)
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_InitGlobals(void) {
  if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  return 0;
  __pyx_L1_error:;
  return -1;
}

#if PY_MAJOR_VERSION < 3
PyMODINIT_FUNC initpywrapfst(void); /*proto*/
PyMODINIT_FUNC initpywrapfst(void)
#else
PyMODINIT_FUNC PyInit_pywrapfst(void); /*proto*/
PyMODINIT_FUNC PyInit_pywrapfst(void)
#if CYTHON_PEP489_MULTI_PHASE_INIT
{
  return PyModuleDef_Init(&__pyx_moduledef);
}
static int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name) {
    PyObject *value = PyObject_GetAttrString(spec, from_name);
    int result = 0;
    if (likely(value)) {
        result = PyDict_SetItemString(moddict, to_name, value);
        Py_DECREF(value);
    } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
        PyErr_Clear();
    } else {
        result = -1;
    }
    return result;
}
static PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
    PyObject *module = NULL, *moddict, *modname;
    if (__pyx_m)
        return __Pyx_NewRef(__pyx_m);
    modname = PyObject_GetAttrString(spec, "name");
    if (unlikely(!modname)) goto bad;
    module = PyModule_NewObject(modname);
    Py_DECREF(modname);
    if (unlikely(!module)) goto bad;
    moddict = PyModule_GetDict(module);
    if (unlikely(!moddict)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__") < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__") < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__") < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__") < 0)) goto bad;
    return module;
bad:
    Py_XDECREF(module);
    return NULL;
}


static int __pyx_pymod_exec_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;
  __pyx_t_10basictypes_int64 __pyx_t_5;
  std::string __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannyDeclarations
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  if (__pyx_m && __pyx_m == __pyx_pyinit_module) return 0;
  #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("PyMODINIT_FUNC PyInit_pywrapfst(void)", 0);
  if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
  #ifdef __Pyx_CyFunction_USED
  if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_FusedFunction_USED
  if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_Coroutine_USED
  if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_Generator_USED
  if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_AsyncGen_USED
  if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_StopAsyncIteration_USED
  if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  /*--- Library function declarations ---*/
  /*--- Threads initialization code ---*/
  #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
  #ifdef WITH_THREAD /* Python build with threading support? */
  PyEval_InitThreads();
  #endif
  #endif
  /*--- Module creation code ---*/
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  __pyx_m = __pyx_pyinit_module;
  Py_INCREF(__pyx_m);
  #else
  #if PY_MAJOR_VERSION < 3
  __pyx_m = Py_InitModule4("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)
  __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
  #if CYTHON_COMPILING_IN_PYPY
  Py_INCREF(__pyx_b);
  #endif
  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  /*--- Initialize various global constants etc. ---*/
  if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
  if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  if (__pyx_module_is_main_pywrapfst) {
    if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  }
  #if PY_MAJOR_VERSION >= 3
  {
    PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
    if (!PyDict_GetItemString(modules, "pywrapfst")) {
      if (unlikely(PyDict_SetItemString(modules, "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 init code ---*/
  /*--- Variable export code ---*/
  /*--- Function export code ---*/
  if (__Pyx_ExportFunction("tostring", (void (*)(void))__pyx_f_9pywrapfst_tostring, "std::string (PyObject *, struct __pyx_opt_args_9pywrapfst_tostring *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("weight_tostring", (void (*)(void))__pyx_f_9pywrapfst_weight_tostring, "std::string (PyObject *, struct __pyx_opt_args_9pywrapfst_weight_tostring *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_get_compose_filter", (void (*)(void))__pyx_f_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_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_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_9pywrapfst__get_rand_arc_selection, "enum 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_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_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_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_9pywrapfst__Zero, "struct __pyx_obj_9pywrapfst_Weight *(PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_One", (void (*)(void))__pyx_f_9pywrapfst__One, "struct __pyx_obj_9pywrapfst_Weight *(PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_NoWeight", (void (*)(void))__pyx_f_9pywrapfst__NoWeight, "struct __pyx_obj_9pywrapfst_Weight *(PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_plus", (void (*)(void))__pyx_f_9pywrapfst__plus, "struct __pyx_obj_9pywrapfst_Weight *(struct __pyx_obj_9pywrapfst_Weight *, struct __pyx_obj_9pywrapfst_Weight *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_times", (void (*)(void))__pyx_f_9pywrapfst__times, "struct __pyx_obj_9pywrapfst_Weight *(struct __pyx_obj_9pywrapfst_Weight *, struct __pyx_obj_9pywrapfst_Weight *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_divide", (void (*)(void))__pyx_f_9pywrapfst__divide, "struct __pyx_obj_9pywrapfst_Weight *(struct __pyx_obj_9pywrapfst_Weight *, struct __pyx_obj_9pywrapfst_Weight *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_power", (void (*)(void))__pyx_f_9pywrapfst__power, "struct __pyx_obj_9pywrapfst_Weight *(struct __pyx_obj_9pywrapfst_Weight *, size_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_init_EncodeMapperSymbolTable", (void (*)(void))__pyx_f_9pywrapfst__init_EncodeMapperSymbolTable, "struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTable *(fst::SymbolTable *, std::shared_ptr<fst::script::EncodeMapperClass> )") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_init_FstSymbolTable", (void (*)(void))__pyx_f_9pywrapfst__init_FstSymbolTable, "struct __pyx_obj_9pywrapfst__FstSymbolTable *(fst::SymbolTable *, std::shared_ptr<fst::script::FstClass> )") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_init_MutableFstSymbolTable", (void (*)(void))__pyx_f_9pywrapfst__init_MutableFstSymbolTable, "struct __pyx_obj_9pywrapfst__MutableFstSymbolTable *(fst::SymbolTable *, std::shared_ptr<fst::script::MutableFstClass> )") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_init_SymbolTable", (void (*)(void))__pyx_f_9pywrapfst__init_SymbolTable, "struct __pyx_obj_9pywrapfst_SymbolTable *(fst::SymbolTable *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_init_Fst", (void (*)(void))__pyx_f_9pywrapfst__init_Fst, "struct __pyx_obj_9pywrapfst__Fst *(__pyx_t_9pywrapfst_FstClass_ptr)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_init_MutableFst", (void (*)(void))__pyx_f_9pywrapfst__init_MutableFst, "struct __pyx_obj_9pywrapfst__MutableFst *(__pyx_t_9pywrapfst_MutableFstClass_ptr)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_init_XFst", (void (*)(void))__pyx_f_9pywrapfst__init_XFst, "struct __pyx_obj_9pywrapfst__Fst *(__pyx_t_9pywrapfst_FstClass_ptr)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_create_Fst", (void (*)(void))__pyx_f_9pywrapfst__create_Fst, "struct __pyx_obj_9pywrapfst__MutableFst *(struct __pyx_opt_args_9pywrapfst__create_Fst *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_read", (void (*)(void))__pyx_f_9pywrapfst__read, "struct __pyx_obj_9pywrapfst__Fst *(PyObject *, int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_read_from_string", (void (*)(void))__pyx_f_9pywrapfst__read_from_string, "struct __pyx_obj_9pywrapfst__Fst *(PyObject *, int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_init_Arc", (void (*)(void))__pyx_f_9pywrapfst__init_Arc, "struct __pyx_obj_9pywrapfst_Arc *(fst::script::ArcClass const &)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_map", (void (*)(void))__pyx_f_9pywrapfst__map, "struct __pyx_obj_9pywrapfst__Fst *(struct __pyx_obj_9pywrapfst__Fst *, struct __pyx_opt_args_9pywrapfst__map *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("arcmap", (void (*)(void))__pyx_f_9pywrapfst_arcmap, "struct __pyx_obj_9pywrapfst__Fst *(struct __pyx_obj_9pywrapfst__Fst *, int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_arcmap *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("compose", (void (*)(void))__pyx_f_9pywrapfst_compose, "struct __pyx_obj_9pywrapfst__MutableFst *(struct __pyx_obj_9pywrapfst__Fst *, struct __pyx_obj_9pywrapfst__Fst *, int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_compose *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("convert", (void (*)(void))__pyx_f_9pywrapfst_convert, "struct __pyx_obj_9pywrapfst__Fst *(struct __pyx_obj_9pywrapfst__Fst *, int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_convert *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("determinize", (void (*)(void))__pyx_f_9pywrapfst_determinize, "struct __pyx_obj_9pywrapfst__MutableFst *(struct __pyx_obj_9pywrapfst__Fst *, int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_determinize *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("difference", (void (*)(void))__pyx_f_9pywrapfst_difference, "struct __pyx_obj_9pywrapfst__MutableFst *(struct __pyx_obj_9pywrapfst__Fst *, struct __pyx_obj_9pywrapfst__Fst *, int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_difference *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("disambiguate", (void (*)(void))__pyx_f_9pywrapfst_disambiguate, "struct __pyx_obj_9pywrapfst__MutableFst *(struct __pyx_obj_9pywrapfst__Fst *, int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_disambiguate *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("epsnormalize", (void (*)(void))__pyx_f_9pywrapfst_epsnormalize, "struct __pyx_obj_9pywrapfst__MutableFst *(struct __pyx_obj_9pywrapfst__Fst *, int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_epsnormalize *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("equal", (void (*)(void))__pyx_f_9pywrapfst_equal, "bool (struct __pyx_obj_9pywrapfst__Fst *, struct __pyx_obj_9pywrapfst__Fst *, int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_equal *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("equivalent", (void (*)(void))__pyx_f_9pywrapfst_equivalent, "bool (struct __pyx_obj_9pywrapfst__Fst *, struct __pyx_obj_9pywrapfst__Fst *, int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_equivalent *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("intersect", (void (*)(void))__pyx_f_9pywrapfst_intersect, "struct __pyx_obj_9pywrapfst__MutableFst *(struct __pyx_obj_9pywrapfst__Fst *, struct __pyx_obj_9pywrapfst__Fst *, int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_intersect *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("isomorphic", (void (*)(void))__pyx_f_9pywrapfst_isomorphic, "bool (struct __pyx_obj_9pywrapfst__Fst *, struct __pyx_obj_9pywrapfst__Fst *, int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_isomorphic *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("prune", (void (*)(void))__pyx_f_9pywrapfst_prune, "struct __pyx_obj_9pywrapfst__MutableFst *(struct __pyx_obj_9pywrapfst__Fst *, int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_prune *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("push", (void (*)(void))__pyx_f_9pywrapfst_push, "struct __pyx_obj_9pywrapfst__MutableFst *(struct __pyx_obj_9pywrapfst__Fst *, int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_push *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("randequivalent", (void (*)(void))__pyx_f_9pywrapfst_randequivalent, "bool (struct __pyx_obj_9pywrapfst__Fst *, struct __pyx_obj_9pywrapfst__Fst *, int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_randequivalent *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("randgen", (void (*)(void))__pyx_f_9pywrapfst_randgen, "struct __pyx_obj_9pywrapfst__MutableFst *(struct __pyx_obj_9pywrapfst__Fst *, int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_randgen *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("replace", (void (*)(void))__pyx_f_9pywrapfst_replace, "struct __pyx_obj_9pywrapfst__MutableFst *(PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_replace *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("reverse", (void (*)(void))__pyx_f_9pywrapfst_reverse, "struct __pyx_obj_9pywrapfst__MutableFst *(struct __pyx_obj_9pywrapfst__Fst *, int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_reverse *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_shortestdistance", (void (*)(void))__pyx_f_9pywrapfst__shortestdistance, "std::vector<fst::script::WeightClass>  *(struct __pyx_obj_9pywrapfst__Fst *, struct __pyx_opt_args_9pywrapfst__shortestdistance *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("shortestpath", (void (*)(void))__pyx_f_9pywrapfst_shortestpath, "struct __pyx_obj_9pywrapfst__MutableFst *(struct __pyx_obj_9pywrapfst__Fst *, int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_shortestpath *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("statemap", (void (*)(void))__pyx_f_9pywrapfst_statemap, "struct __pyx_obj_9pywrapfst__Fst *(struct __pyx_obj_9pywrapfst__Fst *, PyObject *, int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("synchronize", (void (*)(void))__pyx_f_9pywrapfst_synchronize, "struct __pyx_obj_9pywrapfst__MutableFst *(struct __pyx_obj_9pywrapfst__Fst *, int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Type init code ---*/
  __pyx_vtabptr_9pywrapfst_Weight = &__pyx_vtable_9pywrapfst_Weight;
  __pyx_vtable_9pywrapfst_Weight._check_weight = (void (*)(struct __pyx_obj_9pywrapfst_Weight *))__pyx_f_9pywrapfst_6Weight__check_weight;
  __pyx_vtable_9pywrapfst_Weight.copy = (struct __pyx_obj_9pywrapfst_Weight *(*)(struct __pyx_obj_9pywrapfst_Weight *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_6Weight_copy;
  __pyx_vtable_9pywrapfst_Weight.to_string = (std::string (*)(struct __pyx_obj_9pywrapfst_Weight *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_6Weight_to_string;
  __pyx_vtable_9pywrapfst_Weight.type = (std::string (*)(struct __pyx_obj_9pywrapfst_Weight *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_6Weight_type;
  if (PyType_Ready(&__pyx_type_9pywrapfst_Weight) < 0) __PYX_ERR(0, 348, __pyx_L1_error)
  __pyx_type_9pywrapfst_Weight.tp_print = 0;
  if (__Pyx_SetVtable(__pyx_type_9pywrapfst_Weight.tp_dict, __pyx_vtabptr_9pywrapfst_Weight) < 0) __PYX_ERR(0, 348, __pyx_L1_error)
  if (PyObject_SetAttrString(__pyx_m, "Weight", (PyObject *)&__pyx_type_9pywrapfst_Weight) < 0) __PYX_ERR(0, 348, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_9pywrapfst_Weight) < 0) __PYX_ERR(0, 348, __pyx_L1_error)
  __pyx_ptype_9pywrapfst_Weight = &__pyx_type_9pywrapfst_Weight;
  __pyx_vtabptr_9pywrapfst__SymbolTable = &__pyx_vtable_9pywrapfst__SymbolTable;
  __pyx_vtable_9pywrapfst__SymbolTable.available_key = (__pyx_t_10basictypes_int64 (*)(struct __pyx_obj_9pywrapfst__SymbolTable *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_12_SymbolTable_available_key;
  __pyx_vtable_9pywrapfst__SymbolTable.checksum = (std::string (*)(struct __pyx_obj_9pywrapfst__SymbolTable *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_12_SymbolTable_checksum;
  __pyx_vtable_9pywrapfst__SymbolTable.copy = (struct __pyx_obj_9pywrapfst_SymbolTable *(*)(struct __pyx_obj_9pywrapfst__SymbolTable *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_12_SymbolTable_copy;
  __pyx_vtable_9pywrapfst__SymbolTable.get_nth_key = (__pyx_t_10basictypes_int64 (*)(struct __pyx_obj_9pywrapfst__SymbolTable *, Py_ssize_t, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_12_SymbolTable_get_nth_key;
  __pyx_vtable_9pywrapfst__SymbolTable.labeled_checksum = (std::string (*)(struct __pyx_obj_9pywrapfst__SymbolTable *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_12_SymbolTable_labeled_checksum;
  __pyx_vtable_9pywrapfst__SymbolTable.member = (bool (*)(struct __pyx_obj_9pywrapfst__SymbolTable *, PyObject *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_12_SymbolTable_member;
  __pyx_vtable_9pywrapfst__SymbolTable.name = (std::string (*)(struct __pyx_obj_9pywrapfst__SymbolTable *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_12_SymbolTable_name;
  __pyx_vtable_9pywrapfst__SymbolTable.num_symbols = (size_t (*)(struct __pyx_obj_9pywrapfst__SymbolTable *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_12_SymbolTable_num_symbols;
  __pyx_vtable_9pywrapfst__SymbolTable.write = (void (*)(struct __pyx_obj_9pywrapfst__SymbolTable *, PyObject *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_12_SymbolTable_write;
  __pyx_vtable_9pywrapfst__SymbolTable.write_text = (void (*)(struct __pyx_obj_9pywrapfst__SymbolTable *, PyObject *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_12_SymbolTable_write_text;
  if (PyType_Ready(&__pyx_type_9pywrapfst__SymbolTable) < 0) __PYX_ERR(0, 675, __pyx_L1_error)
  __pyx_type_9pywrapfst__SymbolTable.tp_print = 0;
  if (__Pyx_SetVtable(__pyx_type_9pywrapfst__SymbolTable.tp_dict, __pyx_vtabptr_9pywrapfst__SymbolTable) < 0) __PYX_ERR(0, 675, __pyx_L1_error)
  if (PyObject_SetAttrString(__pyx_m, "_SymbolTable", (PyObject *)&__pyx_type_9pywrapfst__SymbolTable) < 0) __PYX_ERR(0, 675, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_9pywrapfst__SymbolTable) < 0) __PYX_ERR(0, 675, __pyx_L1_error)
  __pyx_ptype_9pywrapfst__SymbolTable = &__pyx_type_9pywrapfst__SymbolTable;
  __pyx_vtabptr_9pywrapfst__EncodeMapperSymbolTable = &__pyx_vtable_9pywrapfst__EncodeMapperSymbolTable;
  __pyx_vtable_9pywrapfst__EncodeMapperSymbolTable.__pyx_base = *__pyx_vtabptr_9pywrapfst__SymbolTable;
  __pyx_type_9pywrapfst__EncodeMapperSymbolTable.tp_base = __pyx_ptype_9pywrapfst__SymbolTable;
  if (PyType_Ready(&__pyx_type_9pywrapfst__EncodeMapperSymbolTable) < 0) __PYX_ERR(0, 839, __pyx_L1_error)
  __pyx_type_9pywrapfst__EncodeMapperSymbolTable.tp_print = 0;
  if (__Pyx_SetVtable(__pyx_type_9pywrapfst__EncodeMapperSymbolTable.tp_dict, __pyx_vtabptr_9pywrapfst__EncodeMapperSymbolTable) < 0) __PYX_ERR(0, 839, __pyx_L1_error)
  if (PyObject_SetAttrString(__pyx_m, "_EncodeMapperSymbolTable", (PyObject *)&__pyx_type_9pywrapfst__EncodeMapperSymbolTable) < 0) __PYX_ERR(0, 839, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_9pywrapfst__EncodeMapperSymbolTable) < 0) __PYX_ERR(0, 839, __pyx_L1_error)
  __pyx_ptype_9pywrapfst__EncodeMapperSymbolTable = &__pyx_type_9pywrapfst__EncodeMapperSymbolTable;
  __pyx_vtabptr_9pywrapfst__FstSymbolTable = &__pyx_vtable_9pywrapfst__FstSymbolTable;
  __pyx_vtable_9pywrapfst__FstSymbolTable.__pyx_base = *__pyx_vtabptr_9pywrapfst__SymbolTable;
  __pyx_type_9pywrapfst__FstSymbolTable.tp_base = __pyx_ptype_9pywrapfst__SymbolTable;
  if (PyType_Ready(&__pyx_type_9pywrapfst__FstSymbolTable) < 0) __PYX_ERR(0, 859, __pyx_L1_error)
  __pyx_type_9pywrapfst__FstSymbolTable.tp_print = 0;
  if (__Pyx_SetVtable(__pyx_type_9pywrapfst__FstSymbolTable.tp_dict, __pyx_vtabptr_9pywrapfst__FstSymbolTable) < 0) __PYX_ERR(0, 859, __pyx_L1_error)
  if (PyObject_SetAttrString(__pyx_m, "_FstSymbolTable", (PyObject *)&__pyx_type_9pywrapfst__FstSymbolTable) < 0) __PYX_ERR(0, 859, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_9pywrapfst__FstSymbolTable) < 0) __PYX_ERR(0, 859, __pyx_L1_error)
  __pyx_ptype_9pywrapfst__FstSymbolTable = &__pyx_type_9pywrapfst__FstSymbolTable;
  __pyx_vtabptr_9pywrapfst__MutableSymbolTable = &__pyx_vtable_9pywrapfst__MutableSymbolTable;
  __pyx_vtable_9pywrapfst__MutableSymbolTable.__pyx_base = *__pyx_vtabptr_9pywrapfst__SymbolTable;
  __pyx_vtable_9pywrapfst__MutableSymbolTable.add_symbol = (__pyx_t_10basictypes_int64 (*)(struct __pyx_obj_9pywrapfst__MutableSymbolTable *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_19_MutableSymbolTable_add_symbol *__pyx_optional_args))__pyx_f_9pywrapfst_19_MutableSymbolTable_add_symbol;
  __pyx_vtable_9pywrapfst__MutableSymbolTable.add_table = (void (*)(struct __pyx_obj_9pywrapfst__MutableSymbolTable *, struct __pyx_obj_9pywrapfst__SymbolTable *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_19_MutableSymbolTable_add_table;
  __pyx_vtable_9pywrapfst__MutableSymbolTable.set_name = (void (*)(struct __pyx_obj_9pywrapfst__MutableSymbolTable *, PyObject *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_19_MutableSymbolTable_set_name;
  __pyx_type_9pywrapfst__MutableSymbolTable.tp_base = __pyx_ptype_9pywrapfst__SymbolTable;
  if (PyType_Ready(&__pyx_type_9pywrapfst__MutableSymbolTable) < 0) __PYX_ERR(0, 878, __pyx_L1_error)
  __pyx_type_9pywrapfst__MutableSymbolTable.tp_print = 0;
  if (__Pyx_SetVtable(__pyx_type_9pywrapfst__MutableSymbolTable.tp_dict, __pyx_vtabptr_9pywrapfst__MutableSymbolTable) < 0) __PYX_ERR(0, 878, __pyx_L1_error)
  if (PyObject_SetAttrString(__pyx_m, "_MutableSymbolTable", (PyObject *)&__pyx_type_9pywrapfst__MutableSymbolTable) < 0) __PYX_ERR(0, 878, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_9pywrapfst__MutableSymbolTable) < 0) __PYX_ERR(0, 878, __pyx_L1_error)
  __pyx_ptype_9pywrapfst__MutableSymbolTable = &__pyx_type_9pywrapfst__MutableSymbolTable;
  __pyx_vtabptr_9pywrapfst__MutableFstSymbolTable = &__pyx_vtable_9pywrapfst__MutableFstSymbolTable;
  __pyx_vtable_9pywrapfst__MutableFstSymbolTable.__pyx_base = *__pyx_vtabptr_9pywrapfst__MutableSymbolTable;
  __pyx_type_9pywrapfst__MutableFstSymbolTable.tp_base = __pyx_ptype_9pywrapfst__MutableSymbolTable;
  if (PyType_Ready(&__pyx_type_9pywrapfst__MutableFstSymbolTable) < 0) __PYX_ERR(0, 930, __pyx_L1_error)
  __pyx_type_9pywrapfst__MutableFstSymbolTable.tp_print = 0;
  if (__Pyx_SetVtable(__pyx_type_9pywrapfst__MutableFstSymbolTable.tp_dict, __pyx_vtabptr_9pywrapfst__MutableFstSymbolTable) < 0) __PYX_ERR(0, 930, __pyx_L1_error)
  if (PyObject_SetAttrString(__pyx_m, "_MutableFstSymbolTable", (PyObject *)&__pyx_type_9pywrapfst__MutableFstSymbolTable) < 0) __PYX_ERR(0, 930, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_9pywrapfst__MutableFstSymbolTable) < 0) __PYX_ERR(0, 930, __pyx_L1_error)
  __pyx_ptype_9pywrapfst__MutableFstSymbolTable = &__pyx_type_9pywrapfst__MutableFstSymbolTable;
  __pyx_vtabptr_9pywrapfst_SymbolTable = &__pyx_vtable_9pywrapfst_SymbolTable;
  __pyx_vtable_9pywrapfst_SymbolTable.__pyx_base = *__pyx_vtabptr_9pywrapfst__MutableSymbolTable;
  __pyx_type_9pywrapfst_SymbolTable.tp_base = __pyx_ptype_9pywrapfst__MutableSymbolTable;
  if (PyType_Ready(&__pyx_type_9pywrapfst_SymbolTable) < 0) __PYX_ERR(0, 941, __pyx_L1_error)
  __pyx_type_9pywrapfst_SymbolTable.tp_print = 0;
  if (__Pyx_SetVtable(__pyx_type_9pywrapfst_SymbolTable.tp_dict, __pyx_vtabptr_9pywrapfst_SymbolTable) < 0) __PYX_ERR(0, 941, __pyx_L1_error)
  if (PyObject_SetAttrString(__pyx_m, "SymbolTable", (PyObject *)&__pyx_type_9pywrapfst_SymbolTable) < 0) __PYX_ERR(0, 941, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_9pywrapfst_SymbolTable) < 0) __PYX_ERR(0, 941, __pyx_L1_error)
  __pyx_ptype_9pywrapfst_SymbolTable = &__pyx_type_9pywrapfst_SymbolTable;
  __pyx_vtabptr_9pywrapfst_SymbolTableIterator = &__pyx_vtable_9pywrapfst_SymbolTableIterator;
  __pyx_vtable_9pywrapfst_SymbolTableIterator.done = (bool (*)(struct __pyx_obj_9pywrapfst_SymbolTableIterator *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_19SymbolTableIterator_done;
  __pyx_vtable_9pywrapfst_SymbolTableIterator.next = (void (*)(struct __pyx_obj_9pywrapfst_SymbolTableIterator *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_19SymbolTableIterator_next;
  __pyx_vtable_9pywrapfst_SymbolTableIterator.reset = (void (*)(struct __pyx_obj_9pywrapfst_SymbolTableIterator *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_19SymbolTableIterator_reset;
  __pyx_vtable_9pywrapfst_SymbolTableIterator.symbol = (std::string (*)(struct __pyx_obj_9pywrapfst_SymbolTableIterator *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_19SymbolTableIterator_symbol;
  __pyx_vtable_9pywrapfst_SymbolTableIterator.value = (__pyx_t_10basictypes_int64 (*)(struct __pyx_obj_9pywrapfst_SymbolTableIterator *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_19SymbolTableIterator_value;
  if (PyType_Ready(&__pyx_type_9pywrapfst_SymbolTableIterator) < 0) __PYX_ERR(0, 1124, __pyx_L1_error)
  __pyx_type_9pywrapfst_SymbolTableIterator.tp_print = 0;
  if (__Pyx_SetVtable(__pyx_type_9pywrapfst_SymbolTableIterator.tp_dict, __pyx_vtabptr_9pywrapfst_SymbolTableIterator) < 0) __PYX_ERR(0, 1124, __pyx_L1_error)
  if (PyObject_SetAttrString(__pyx_m, "SymbolTableIterator", (PyObject *)&__pyx_type_9pywrapfst_SymbolTableIterator) < 0) __PYX_ERR(0, 1124, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_9pywrapfst_SymbolTableIterator) < 0) __PYX_ERR(0, 1124, __pyx_L1_error)
  __pyx_ptype_9pywrapfst_SymbolTableIterator = &__pyx_type_9pywrapfst_SymbolTableIterator;
  __pyx_vtabptr_9pywrapfst_EncodeMapper = &__pyx_vtable_9pywrapfst_EncodeMapper;
  __pyx_vtable_9pywrapfst_EncodeMapper.arc_type = (std::string (*)(struct __pyx_obj_9pywrapfst_EncodeMapper *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_12EncodeMapper_arc_type;
  __pyx_vtable_9pywrapfst_EncodeMapper.flags = (__pyx_t_10basictypes_uint32 (*)(struct __pyx_obj_9pywrapfst_EncodeMapper *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_12EncodeMapper_flags;
  __pyx_vtable_9pywrapfst_EncodeMapper.input_symbols = (struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTable *(*)(struct __pyx_obj_9pywrapfst_EncodeMapper *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_12EncodeMapper_input_symbols;
  __pyx_vtable_9pywrapfst_EncodeMapper.output_symbols = (struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTable *(*)(struct __pyx_obj_9pywrapfst_EncodeMapper *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_12EncodeMapper_output_symbols;
  __pyx_vtable_9pywrapfst_EncodeMapper.properties = (__pyx_t_10basictypes_uint64 (*)(struct __pyx_obj_9pywrapfst_EncodeMapper *, __pyx_t_10basictypes_uint64, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_12EncodeMapper_properties;
  __pyx_vtable_9pywrapfst_EncodeMapper.set_input_symbols = (void (*)(struct __pyx_obj_9pywrapfst_EncodeMapper *, struct __pyx_obj_9pywrapfst__SymbolTable *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_12EncodeMapper_set_input_symbols;
  __pyx_vtable_9pywrapfst_EncodeMapper.set_output_symbols = (void (*)(struct __pyx_obj_9pywrapfst_EncodeMapper *, struct __pyx_obj_9pywrapfst__SymbolTable *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_12EncodeMapper_set_output_symbols;
  __pyx_vtable_9pywrapfst_EncodeMapper.weight_type = (std::string (*)(struct __pyx_obj_9pywrapfst_EncodeMapper *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_12EncodeMapper_weight_type;
  if (PyType_Ready(&__pyx_type_9pywrapfst_EncodeMapper) < 0) __PYX_ERR(0, 1206, __pyx_L1_error)
  __pyx_type_9pywrapfst_EncodeMapper.tp_print = 0;
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_9pywrapfst_EncodeMapper, "__call__"); if (unlikely(!wrapper)) __PYX_ERR(0, 1206, __pyx_L1_error)
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_9pywrapfst_12EncodeMapper_6__call__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_9pywrapfst_12EncodeMapper_6__call__.doc = __pyx_doc_9pywrapfst_12EncodeMapper_6__call__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_9pywrapfst_12EncodeMapper_6__call__;
    }
  }
  #endif
  if (__Pyx_SetVtable(__pyx_type_9pywrapfst_EncodeMapper.tp_dict, __pyx_vtabptr_9pywrapfst_EncodeMapper) < 0) __PYX_ERR(0, 1206, __pyx_L1_error)
  if (PyObject_SetAttrString(__pyx_m, "EncodeMapper", (PyObject *)&__pyx_type_9pywrapfst_EncodeMapper) < 0) __PYX_ERR(0, 1206, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_9pywrapfst_EncodeMapper) < 0) __PYX_ERR(0, 1206, __pyx_L1_error)
  __pyx_ptype_9pywrapfst_EncodeMapper = &__pyx_type_9pywrapfst_EncodeMapper;
  __pyx_vtabptr_9pywrapfst__Fst = &__pyx_vtable_9pywrapfst__Fst;
  __pyx_vtable_9pywrapfst__Fst.arc_type = (std::string (*)(struct __pyx_obj_9pywrapfst__Fst *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_4_Fst_arc_type;
  __pyx_vtable_9pywrapfst__Fst.arcs = (struct __pyx_obj_9pywrapfst_ArcIterator *(*)(struct __pyx_obj_9pywrapfst__Fst *, __pyx_t_10basictypes_int64, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_4_Fst_arcs;
  __pyx_vtable_9pywrapfst__Fst.copy = (struct __pyx_obj_9pywrapfst__Fst *(*)(struct __pyx_obj_9pywrapfst__Fst *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_4_Fst_copy;
  __pyx_vtable_9pywrapfst__Fst.draw = (void (*)(struct __pyx_obj_9pywrapfst__Fst *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_4_Fst_draw *__pyx_optional_args))__pyx_f_9pywrapfst_4_Fst_draw;
  __pyx_vtable_9pywrapfst__Fst.final = (struct __pyx_obj_9pywrapfst_Weight *(*)(struct __pyx_obj_9pywrapfst__Fst *, __pyx_t_10basictypes_int64, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_4_Fst_final;
  __pyx_vtable_9pywrapfst__Fst.fst_type = (std::string (*)(struct __pyx_obj_9pywrapfst__Fst *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_4_Fst_fst_type;
  __pyx_vtable_9pywrapfst__Fst.input_symbols = (struct __pyx_obj_9pywrapfst__FstSymbolTable *(*)(struct __pyx_obj_9pywrapfst__Fst *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_4_Fst_input_symbols;
  __pyx_vtable_9pywrapfst__Fst.num_arcs = (size_t (*)(struct __pyx_obj_9pywrapfst__Fst *, __pyx_t_10basictypes_int64, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_4_Fst_num_arcs;
  __pyx_vtable_9pywrapfst__Fst.num_input_epsilons = (size_t (*)(struct __pyx_obj_9pywrapfst__Fst *, __pyx_t_10basictypes_int64, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_4_Fst_num_input_epsilons;
  __pyx_vtable_9pywrapfst__Fst.num_output_epsilons = (size_t (*)(struct __pyx_obj_9pywrapfst__Fst *, __pyx_t_10basictypes_int64, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_4_Fst_num_output_epsilons;
  __pyx_vtable_9pywrapfst__Fst.output_symbols = (struct __pyx_obj_9pywrapfst__FstSymbolTable *(*)(struct __pyx_obj_9pywrapfst__Fst *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_4_Fst_output_symbols;
  __pyx_vtable_9pywrapfst__Fst.properties = (__pyx_t_10basictypes_uint64 (*)(struct __pyx_obj_9pywrapfst__Fst *, __pyx_t_10basictypes_uint64, bool, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_4_Fst_properties;
  __pyx_vtable_9pywrapfst__Fst.start = (__pyx_t_10basictypes_int64 (*)(struct __pyx_obj_9pywrapfst__Fst *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_4_Fst_start;
  __pyx_vtable_9pywrapfst__Fst.states = (struct __pyx_obj_9pywrapfst_StateIterator *(*)(struct __pyx_obj_9pywrapfst__Fst *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_4_Fst_states;
  __pyx_vtable_9pywrapfst__Fst.text = (std::string (*)(struct __pyx_obj_9pywrapfst__Fst *, int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_4_Fst_text *__pyx_optional_args))__pyx_f_9pywrapfst_4_Fst_text;
  __pyx_vtable_9pywrapfst__Fst.verify = (bool (*)(struct __pyx_obj_9pywrapfst__Fst *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_4_Fst_verify;
  __pyx_vtable_9pywrapfst__Fst.weight_type = (std::string (*)(struct __pyx_obj_9pywrapfst__Fst *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_4_Fst_weight_type;
  __pyx_vtable_9pywrapfst__Fst.write = (void (*)(struct __pyx_obj_9pywrapfst__Fst *, PyObject *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_4_Fst_write;
  __pyx_vtable_9pywrapfst__Fst.write_to_string = (std::string (*)(struct __pyx_obj_9pywrapfst__Fst *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_4_Fst_write_to_string;
  if (PyType_Ready(&__pyx_type_9pywrapfst__Fst) < 0) __PYX_ERR(0, 1362, __pyx_L1_error)
  __pyx_type_9pywrapfst__Fst.tp_print = 0;
  if (__Pyx_SetVtable(__pyx_type_9pywrapfst__Fst.tp_dict, __pyx_vtabptr_9pywrapfst__Fst) < 0) __PYX_ERR(0, 1362, __pyx_L1_error)
  if (PyObject_SetAttrString(__pyx_m, "_Fst", (PyObject *)&__pyx_type_9pywrapfst__Fst) < 0) __PYX_ERR(0, 1362, __pyx_L1_error)
  __pyx_ptype_9pywrapfst__Fst = &__pyx_type_9pywrapfst__Fst;
  __pyx_vtabptr_9pywrapfst__MutableFst = &__pyx_vtable_9pywrapfst__MutableFst;
  __pyx_vtable_9pywrapfst__MutableFst.__pyx_base = *__pyx_vtabptr_9pywrapfst__Fst;
  __pyx_vtable_9pywrapfst__MutableFst._check_mutating_imethod = (void (*)(struct __pyx_obj_9pywrapfst__MutableFst *))__pyx_f_9pywrapfst_11_MutableFst__check_mutating_imethod;
  __pyx_vtable_9pywrapfst__MutableFst._add_arc = (void (*)(struct __pyx_obj_9pywrapfst__MutableFst *, __pyx_t_10basictypes_int64, struct __pyx_obj_9pywrapfst_Arc *))__pyx_f_9pywrapfst_11_MutableFst__add_arc;
  __pyx_vtable_9pywrapfst__MutableFst.add_state = (__pyx_t_10basictypes_int64 (*)(struct __pyx_obj_9pywrapfst__MutableFst *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_11_MutableFst_add_state;
  __pyx_vtable_9pywrapfst__MutableFst._arcsort = (void (*)(struct __pyx_obj_9pywrapfst__MutableFst *, struct __pyx_opt_args_9pywrapfst_11_MutableFst__arcsort *__pyx_optional_args))__pyx_f_9pywrapfst_11_MutableFst__arcsort;
  __pyx_vtable_9pywrapfst__MutableFst._closure = (void (*)(struct __pyx_obj_9pywrapfst__MutableFst *, struct __pyx_opt_args_9pywrapfst_11_MutableFst__closure *__pyx_optional_args))__pyx_f_9pywrapfst_11_MutableFst__closure;
  __pyx_vtable_9pywrapfst__MutableFst._concat = (void (*)(struct __pyx_obj_9pywrapfst__MutableFst *, struct __pyx_obj_9pywrapfst__Fst *))__pyx_f_9pywrapfst_11_MutableFst__concat;
  __pyx_vtable_9pywrapfst__MutableFst._connect = (void (*)(struct __pyx_obj_9pywrapfst__MutableFst *))__pyx_f_9pywrapfst_11_MutableFst__connect;
  __pyx_vtable_9pywrapfst__MutableFst._decode = (void (*)(struct __pyx_obj_9pywrapfst__MutableFst *, struct __pyx_obj_9pywrapfst_EncodeMapper *))__pyx_f_9pywrapfst_11_MutableFst__decode;
  __pyx_vtable_9pywrapfst__MutableFst._delete_arcs = (void (*)(struct __pyx_obj_9pywrapfst__MutableFst *, __pyx_t_10basictypes_int64, struct __pyx_opt_args_9pywrapfst_11_MutableFst__delete_arcs *__pyx_optional_args))__pyx_f_9pywrapfst_11_MutableFst__delete_arcs;
  __pyx_vtable_9pywrapfst__MutableFst._delete_states = (void (*)(struct __pyx_obj_9pywrapfst__MutableFst *, struct __pyx_opt_args_9pywrapfst_11_MutableFst__delete_states *__pyx_optional_args))__pyx_f_9pywrapfst_11_MutableFst__delete_states;
  __pyx_vtable_9pywrapfst__MutableFst._encode = (void (*)(struct __pyx_obj_9pywrapfst__MutableFst *, struct __pyx_obj_9pywrapfst_EncodeMapper *))__pyx_f_9pywrapfst_11_MutableFst__encode;
  __pyx_vtable_9pywrapfst__MutableFst._invert = (void (*)(struct __pyx_obj_9pywrapfst__MutableFst *))__pyx_f_9pywrapfst_11_MutableFst__invert;
  __pyx_vtable_9pywrapfst__MutableFst._minimize = (void (*)(struct __pyx_obj_9pywrapfst__MutableFst *, struct __pyx_opt_args_9pywrapfst_11_MutableFst__minimize *__pyx_optional_args))__pyx_f_9pywrapfst_11_MutableFst__minimize;
  __pyx_vtable_9pywrapfst__MutableFst.mutable_arcs = (struct __pyx_obj_9pywrapfst_MutableArcIterator *(*)(struct __pyx_obj_9pywrapfst__MutableFst *, __pyx_t_10basictypes_int64, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_11_MutableFst_mutable_arcs;
  __pyx_vtable_9pywrapfst__MutableFst.num_states = (__pyx_t_10basictypes_int64 (*)(struct __pyx_obj_9pywrapfst__MutableFst *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_11_MutableFst_num_states;
  __pyx_vtable_9pywrapfst__MutableFst._project = (void (*)(struct __pyx_obj_9pywrapfst__MutableFst *, struct __pyx_opt_args_9pywrapfst_11_MutableFst__project *__pyx_optional_args))__pyx_f_9pywrapfst_11_MutableFst__project;
  __pyx_vtable_9pywrapfst__MutableFst._prune = (void (*)(struct __pyx_obj_9pywrapfst__MutableFst *, struct __pyx_opt_args_9pywrapfst_11_MutableFst__prune *__pyx_optional_args))__pyx_f_9pywrapfst_11_MutableFst__prune;
  __pyx_vtable_9pywrapfst__MutableFst._push = (void (*)(struct __pyx_obj_9pywrapfst__MutableFst *, struct __pyx_opt_args_9pywrapfst_11_MutableFst__push *__pyx_optional_args))__pyx_f_9pywrapfst_11_MutableFst__push;
  __pyx_vtable_9pywrapfst__MutableFst._relabel_pairs = (void (*)(struct __pyx_obj_9pywrapfst__MutableFst *, struct __pyx_opt_args_9pywrapfst_11_MutableFst__relabel_pairs *__pyx_optional_args))__pyx_f_9pywrapfst_11_MutableFst__relabel_pairs;
  __pyx_vtable_9pywrapfst__MutableFst._relabel_tables = (void (*)(struct __pyx_obj_9pywrapfst__MutableFst *, struct __pyx_opt_args_9pywrapfst_11_MutableFst__relabel_tables *__pyx_optional_args))__pyx_f_9pywrapfst_11_MutableFst__relabel_tables;
  __pyx_vtable_9pywrapfst__MutableFst._reserve_arcs = (void (*)(struct __pyx_obj_9pywrapfst__MutableFst *, __pyx_t_10basictypes_int64, size_t))__pyx_f_9pywrapfst_11_MutableFst__reserve_arcs;
  __pyx_vtable_9pywrapfst__MutableFst._reserve_states = (void (*)(struct __pyx_obj_9pywrapfst__MutableFst *, __pyx_t_10basictypes_int64))__pyx_f_9pywrapfst_11_MutableFst__reserve_states;
  __pyx_vtable_9pywrapfst__MutableFst._reweight = (void (*)(struct __pyx_obj_9pywrapfst__MutableFst *, PyObject *, struct __pyx_opt_args_9pywrapfst_11_MutableFst__reweight *__pyx_optional_args))__pyx_f_9pywrapfst_11_MutableFst__reweight;
  __pyx_vtable_9pywrapfst__MutableFst._rmepsilon = (void (*)(struct __pyx_obj_9pywrapfst__MutableFst *, struct __pyx_opt_args_9pywrapfst_11_MutableFst__rmepsilon *__pyx_optional_args))__pyx_f_9pywrapfst_11_MutableFst__rmepsilon;
  __pyx_vtable_9pywrapfst__MutableFst._set_final = (void (*)(struct __pyx_obj_9pywrapfst__MutableFst *, __pyx_t_10basictypes_int64, struct __pyx_opt_args_9pywrapfst_11_MutableFst__set_final *__pyx_optional_args))__pyx_f_9pywrapfst_11_MutableFst__set_final;
  __pyx_vtable_9pywrapfst__MutableFst._set_properties = (void (*)(struct __pyx_obj_9pywrapfst__MutableFst *, __pyx_t_10basictypes_uint64, __pyx_t_10basictypes_uint64))__pyx_f_9pywrapfst_11_MutableFst__set_properties;
  __pyx_vtable_9pywrapfst__MutableFst._set_start = (void (*)(struct __pyx_obj_9pywrapfst__MutableFst *, __pyx_t_10basictypes_int64))__pyx_f_9pywrapfst_11_MutableFst__set_start;
  __pyx_vtable_9pywrapfst__MutableFst._set_input_symbols = (void (*)(struct __pyx_obj_9pywrapfst__MutableFst *, struct __pyx_obj_9pywrapfst__SymbolTable *))__pyx_f_9pywrapfst_11_MutableFst__set_input_symbols;
  __pyx_vtable_9pywrapfst__MutableFst._set_output_symbols = (void (*)(struct __pyx_obj_9pywrapfst__MutableFst *, struct __pyx_obj_9pywrapfst__SymbolTable *))__pyx_f_9pywrapfst_11_MutableFst__set_output_symbols;
  __pyx_vtable_9pywrapfst__MutableFst._topsort = (void (*)(struct __pyx_obj_9pywrapfst__MutableFst *))__pyx_f_9pywrapfst_11_MutableFst__topsort;
  __pyx_vtable_9pywrapfst__MutableFst._union = (void (*)(struct __pyx_obj_9pywrapfst__MutableFst *, struct __pyx_obj_9pywrapfst__Fst *))__pyx_f_9pywrapfst_11_MutableFst__union;
  __pyx_type_9pywrapfst__MutableFst.tp_base = __pyx_ptype_9pywrapfst__Fst;
  if (PyType_Ready(&__pyx_type_9pywrapfst__MutableFst) < 0) __PYX_ERR(0, 1774, __pyx_L1_error)
  __pyx_type_9pywrapfst__MutableFst.tp_print = 0;
  if (__Pyx_SetVtable(__pyx_type_9pywrapfst__MutableFst.tp_dict, __pyx_vtabptr_9pywrapfst__MutableFst) < 0) __PYX_ERR(0, 1774, __pyx_L1_error)
  if (PyObject_SetAttrString(__pyx_m, "_MutableFst", (PyObject *)&__pyx_type_9pywrapfst__MutableFst) < 0) __PYX_ERR(0, 1774, __pyx_L1_error)
  __pyx_ptype_9pywrapfst__MutableFst = &__pyx_type_9pywrapfst__MutableFst;
  __pyx_vtabptr_9pywrapfst_Arc = &__pyx_vtable_9pywrapfst_Arc;
  __pyx_vtable_9pywrapfst_Arc.copy = (struct __pyx_obj_9pywrapfst_Arc *(*)(struct __pyx_obj_9pywrapfst_Arc *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_3Arc_copy;
  if (PyType_Ready(&__pyx_type_9pywrapfst_Arc) < 0) __PYX_ERR(0, 2898, __pyx_L1_error)
  __pyx_type_9pywrapfst_Arc.tp_print = 0;
  if (__Pyx_SetVtable(__pyx_type_9pywrapfst_Arc.tp_dict, __pyx_vtabptr_9pywrapfst_Arc) < 0) __PYX_ERR(0, 2898, __pyx_L1_error)
  if (PyObject_SetAttrString(__pyx_m, "Arc", (PyObject *)&__pyx_type_9pywrapfst_Arc) < 0) __PYX_ERR(0, 2898, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_9pywrapfst_Arc) < 0) __PYX_ERR(0, 2898, __pyx_L1_error)
  __pyx_ptype_9pywrapfst_Arc = &__pyx_type_9pywrapfst_Arc;
  __pyx_vtabptr_9pywrapfst_ArcIterator = &__pyx_vtable_9pywrapfst_ArcIterator;
  __pyx_vtable_9pywrapfst_ArcIterator.done = (bool (*)(struct __pyx_obj_9pywrapfst_ArcIterator *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_11ArcIterator_done;
  __pyx_vtable_9pywrapfst_ArcIterator.flags = (__pyx_t_10basictypes_uint32 (*)(struct __pyx_obj_9pywrapfst_ArcIterator *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_11ArcIterator_flags;
  __pyx_vtable_9pywrapfst_ArcIterator.next = (void (*)(struct __pyx_obj_9pywrapfst_ArcIterator *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_11ArcIterator_next;
  __pyx_vtable_9pywrapfst_ArcIterator.position = (size_t (*)(struct __pyx_obj_9pywrapfst_ArcIterator *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_11ArcIterator_position;
  __pyx_vtable_9pywrapfst_ArcIterator.reset = (void (*)(struct __pyx_obj_9pywrapfst_ArcIterator *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_11ArcIterator_reset;
  __pyx_vtable_9pywrapfst_ArcIterator.seek = (void (*)(struct __pyx_obj_9pywrapfst_ArcIterator *, size_t, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_11ArcIterator_seek;
  __pyx_vtable_9pywrapfst_ArcIterator.set_flags = (void (*)(struct __pyx_obj_9pywrapfst_ArcIterator *, __pyx_t_10basictypes_uint32, __pyx_t_10basictypes_uint32, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_11ArcIterator_set_flags;
  __pyx_vtable_9pywrapfst_ArcIterator.value = (PyObject *(*)(struct __pyx_obj_9pywrapfst_ArcIterator *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_11ArcIterator_value;
  if (PyType_Ready(&__pyx_type_9pywrapfst_ArcIterator) < 0) __PYX_ERR(0, 2965, __pyx_L1_error)
  __pyx_type_9pywrapfst_ArcIterator.tp_print = 0;
  if (__Pyx_SetVtable(__pyx_type_9pywrapfst_ArcIterator.tp_dict, __pyx_vtabptr_9pywrapfst_ArcIterator) < 0) __PYX_ERR(0, 2965, __pyx_L1_error)
  if (PyObject_SetAttrString(__pyx_m, "ArcIterator", (PyObject *)&__pyx_type_9pywrapfst_ArcIterator) < 0) __PYX_ERR(0, 2965, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_9pywrapfst_ArcIterator) < 0) __PYX_ERR(0, 2965, __pyx_L1_error)
  __pyx_ptype_9pywrapfst_ArcIterator = &__pyx_type_9pywrapfst_ArcIterator;
  __pyx_vtabptr_9pywrapfst_MutableArcIterator = &__pyx_vtable_9pywrapfst_MutableArcIterator;
  __pyx_vtable_9pywrapfst_MutableArcIterator.done = (bool (*)(struct __pyx_obj_9pywrapfst_MutableArcIterator *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_18MutableArcIterator_done;
  __pyx_vtable_9pywrapfst_MutableArcIterator.flags = (__pyx_t_10basictypes_uint32 (*)(struct __pyx_obj_9pywrapfst_MutableArcIterator *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_18MutableArcIterator_flags;
  __pyx_vtable_9pywrapfst_MutableArcIterator.next = (void (*)(struct __pyx_obj_9pywrapfst_MutableArcIterator *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_18MutableArcIterator_next;
  __pyx_vtable_9pywrapfst_MutableArcIterator.position = (size_t (*)(struct __pyx_obj_9pywrapfst_MutableArcIterator *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_18MutableArcIterator_position;
  __pyx_vtable_9pywrapfst_MutableArcIterator.reset = (void (*)(struct __pyx_obj_9pywrapfst_MutableArcIterator *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_18MutableArcIterator_reset;
  __pyx_vtable_9pywrapfst_MutableArcIterator.seek = (void (*)(struct __pyx_obj_9pywrapfst_MutableArcIterator *, size_t, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_18MutableArcIterator_seek;
  __pyx_vtable_9pywrapfst_MutableArcIterator.set_flags = (void (*)(struct __pyx_obj_9pywrapfst_MutableArcIterator *, __pyx_t_10basictypes_uint32, __pyx_t_10basictypes_uint32, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_18MutableArcIterator_set_flags;
  __pyx_vtable_9pywrapfst_MutableArcIterator.set_value = (void (*)(struct __pyx_obj_9pywrapfst_MutableArcIterator *, struct __pyx_obj_9pywrapfst_Arc *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_18MutableArcIterator_set_value;
  __pyx_vtable_9pywrapfst_MutableArcIterator.value = (PyObject *(*)(struct __pyx_obj_9pywrapfst_MutableArcIterator *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_18MutableArcIterator_value;
  if (PyType_Ready(&__pyx_type_9pywrapfst_MutableArcIterator) < 0) __PYX_ERR(0, 3076, __pyx_L1_error)
  __pyx_type_9pywrapfst_MutableArcIterator.tp_print = 0;
  if (__Pyx_SetVtable(__pyx_type_9pywrapfst_MutableArcIterator.tp_dict, __pyx_vtabptr_9pywrapfst_MutableArcIterator) < 0) __PYX_ERR(0, 3076, __pyx_L1_error)
  if (PyObject_SetAttrString(__pyx_m, "MutableArcIterator", (PyObject *)&__pyx_type_9pywrapfst_MutableArcIterator) < 0) __PYX_ERR(0, 3076, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_9pywrapfst_MutableArcIterator) < 0) __PYX_ERR(0, 3076, __pyx_L1_error)
  __pyx_ptype_9pywrapfst_MutableArcIterator = &__pyx_type_9pywrapfst_MutableArcIterator;
  __pyx_vtabptr_9pywrapfst_StateIterator = &__pyx_vtable_9pywrapfst_StateIterator;
  __pyx_vtable_9pywrapfst_StateIterator.done = (bool (*)(struct __pyx_obj_9pywrapfst_StateIterator *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_13StateIterator_done;
  __pyx_vtable_9pywrapfst_StateIterator.next = (void (*)(struct __pyx_obj_9pywrapfst_StateIterator *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_13StateIterator_next;
  __pyx_vtable_9pywrapfst_StateIterator.reset = (void (*)(struct __pyx_obj_9pywrapfst_StateIterator *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_13StateIterator_reset;
  __pyx_vtable_9pywrapfst_StateIterator.value = (__pyx_t_10basictypes_int64 (*)(struct __pyx_obj_9pywrapfst_StateIterator *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_13StateIterator_value;
  if (PyType_Ready(&__pyx_type_9pywrapfst_StateIterator) < 0) __PYX_ERR(0, 3190, __pyx_L1_error)
  __pyx_type_9pywrapfst_StateIterator.tp_print = 0;
  if (__Pyx_SetVtable(__pyx_type_9pywrapfst_StateIterator.tp_dict, __pyx_vtabptr_9pywrapfst_StateIterator) < 0) __PYX_ERR(0, 3190, __pyx_L1_error)
  if (PyObject_SetAttrString(__pyx_m, "StateIterator", (PyObject *)&__pyx_type_9pywrapfst_StateIterator) < 0) __PYX_ERR(0, 3190, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_9pywrapfst_StateIterator) < 0) __PYX_ERR(0, 3190, __pyx_L1_error)
  __pyx_ptype_9pywrapfst_StateIterator = &__pyx_type_9pywrapfst_StateIterator;
  __pyx_vtabptr_9pywrapfst_Compiler = &__pyx_vtable_9pywrapfst_Compiler;
  __pyx_vtable_9pywrapfst_Compiler.compile = (struct __pyx_obj_9pywrapfst__Fst *(*)(struct __pyx_obj_9pywrapfst_Compiler *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_8Compiler_compile;
  __pyx_vtable_9pywrapfst_Compiler.write = (void (*)(struct __pyx_obj_9pywrapfst_Compiler *, PyObject *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_8Compiler_write;
  if (PyType_Ready(&__pyx_type_9pywrapfst_Compiler) < 0) __PYX_ERR(0, 4088, __pyx_L1_error)
  __pyx_type_9pywrapfst_Compiler.tp_print = 0;
  if (__Pyx_SetVtable(__pyx_type_9pywrapfst_Compiler.tp_dict, __pyx_vtabptr_9pywrapfst_Compiler) < 0) __PYX_ERR(0, 4088, __pyx_L1_error)
  if (PyObject_SetAttrString(__pyx_m, "Compiler", (PyObject *)&__pyx_type_9pywrapfst_Compiler) < 0) __PYX_ERR(0, 4088, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_9pywrapfst_Compiler) < 0) __PYX_ERR(0, 4088, __pyx_L1_error)
  __pyx_ptype_9pywrapfst_Compiler = &__pyx_type_9pywrapfst_Compiler;
  __pyx_vtabptr_9pywrapfst_FarReader = &__pyx_vtable_9pywrapfst_FarReader;
  __pyx_vtable_9pywrapfst_FarReader.arc_type = (std::string (*)(struct __pyx_obj_9pywrapfst_FarReader *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_9FarReader_arc_type;
  __pyx_vtable_9pywrapfst_FarReader.done = (bool (*)(struct __pyx_obj_9pywrapfst_FarReader *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_9FarReader_done;
  __pyx_vtable_9pywrapfst_FarReader.error = (bool (*)(struct __pyx_obj_9pywrapfst_FarReader *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_9FarReader_error;
  __pyx_vtable_9pywrapfst_FarReader.far_type = (std::string (*)(struct __pyx_obj_9pywrapfst_FarReader *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_9FarReader_far_type;
  __pyx_vtable_9pywrapfst_FarReader.find = (bool (*)(struct __pyx_obj_9pywrapfst_FarReader *, PyObject *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_9FarReader_find;
  __pyx_vtable_9pywrapfst_FarReader.get_fst = (struct __pyx_obj_9pywrapfst__Fst *(*)(struct __pyx_obj_9pywrapfst_FarReader *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_9FarReader_get_fst;
  __pyx_vtable_9pywrapfst_FarReader.get_key = (std::string (*)(struct __pyx_obj_9pywrapfst_FarReader *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_9FarReader_get_key;
  __pyx_vtable_9pywrapfst_FarReader.next = (void (*)(struct __pyx_obj_9pywrapfst_FarReader *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_9FarReader_next;
  __pyx_vtable_9pywrapfst_FarReader.reset = (void (*)(struct __pyx_obj_9pywrapfst_FarReader *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_9FarReader_reset;
  if (PyType_Ready(&__pyx_type_9pywrapfst_FarReader) < 0) __PYX_ERR(0, 4215, __pyx_L1_error)
  __pyx_type_9pywrapfst_FarReader.tp_print = 0;
  if (__Pyx_SetVtable(__pyx_type_9pywrapfst_FarReader.tp_dict, __pyx_vtabptr_9pywrapfst_FarReader) < 0) __PYX_ERR(0, 4215, __pyx_L1_error)
  if (PyObject_SetAttrString(__pyx_m, "FarReader", (PyObject *)&__pyx_type_9pywrapfst_FarReader) < 0) __PYX_ERR(0, 4215, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_9pywrapfst_FarReader) < 0) __PYX_ERR(0, 4215, __pyx_L1_error)
  __pyx_ptype_9pywrapfst_FarReader = &__pyx_type_9pywrapfst_FarReader;
  __pyx_vtabptr_9pywrapfst_FarWriter = &__pyx_vtable_9pywrapfst_FarWriter;
  __pyx_vtable_9pywrapfst_FarWriter.arc_type = (std::string (*)(struct __pyx_obj_9pywrapfst_FarWriter *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_9FarWriter_arc_type;
  __pyx_vtable_9pywrapfst_FarWriter.close = (void (*)(struct __pyx_obj_9pywrapfst_FarWriter *))__pyx_f_9pywrapfst_9FarWriter_close;
  __pyx_vtable_9pywrapfst_FarWriter.add = (void (*)(struct __pyx_obj_9pywrapfst_FarWriter *, PyObject *, struct __pyx_obj_9pywrapfst__Fst *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_9FarWriter_add;
  __pyx_vtable_9pywrapfst_FarWriter.error = (bool (*)(struct __pyx_obj_9pywrapfst_FarWriter *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_9FarWriter_error;
  __pyx_vtable_9pywrapfst_FarWriter.far_type = (std::string (*)(struct __pyx_obj_9pywrapfst_FarWriter *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_9FarWriter_far_type;
  if (PyType_Ready(&__pyx_type_9pywrapfst_FarWriter) < 0) __PYX_ERR(0, 4360, __pyx_L1_error)
  __pyx_type_9pywrapfst_FarWriter.tp_print = 0;
  if (__Pyx_SetVtable(__pyx_type_9pywrapfst_FarWriter.tp_dict, __pyx_vtabptr_9pywrapfst_FarWriter) < 0) __PYX_ERR(0, 4360, __pyx_L1_error)
  if (PyObject_SetAttrString(__pyx_m, "FarWriter", (PyObject *)&__pyx_type_9pywrapfst_FarWriter) < 0) __PYX_ERR(0, 4360, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_9pywrapfst_FarWriter) < 0) __PYX_ERR(0, 4360, __pyx_L1_error)
  __pyx_ptype_9pywrapfst_FarWriter = &__pyx_type_9pywrapfst_FarWriter;
  /*--- Type import code ---*/
  /*--- Variable import code ---*/
  /*--- 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

  /* "pywrapfst.pyx":107
 * 
 * # Python imports.
 * import atexit             # <<<<<<<<<<<<<<
 * import numbers
 * import subprocess
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_atexit, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 107, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_atexit, __pyx_t_1) < 0) __PYX_ERR(0, 107, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pywrapfst.pyx":108
 * # Python imports.
 * import atexit
 * import numbers             # <<<<<<<<<<<<<<
 * import subprocess
 * import logging
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_numbers, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 108, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_numbers, __pyx_t_1) < 0) __PYX_ERR(0, 108, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pywrapfst.pyx":109
 * import atexit
 * import numbers
 * import subprocess             # <<<<<<<<<<<<<<
 * import logging
 * 
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_subprocess, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 109, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_subprocess, __pyx_t_1) < 0) __PYX_ERR(0, 109, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pywrapfst.pyx":110
 * import numbers
 * import subprocess
 * import logging             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_logging, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 110, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_logging, __pyx_t_1) < 0) __PYX_ERR(0, 110, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pywrapfst.pyx":115
 * # TODO(kbg): Figure out how to access static class variables so I don't have
 * # to do it this way.
 * kNoSymbol = -1             # <<<<<<<<<<<<<<
 * 
 * 
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_kNoSymbol, __pyx_int_neg_1) < 0) __PYX_ERR(0, 115, __pyx_L1_error)

  /* "pywrapfst.pyx":121
 * 
 * 
 * class FstError(Exception):             # <<<<<<<<<<<<<<
 * 
 *   pass
 */
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 121, __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, 121, __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_pywrapfst_2, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 121, __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, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 121, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FstError, __pyx_t_4) < 0) __PYX_ERR(0, 121, __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;

  /* "pywrapfst.pyx":126
 * 
 * 
 * class FstArgError(FstError, ValueError):             # <<<<<<<<<<<<<<
 * 
 *   pass
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 126, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __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, 126, __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_pywrapfst_2, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 126, __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, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 126, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FstArgError, __pyx_t_4) < 0) __PYX_ERR(0, 126, __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;

  /* "pywrapfst.pyx":131
 * 
 * 
 * class FstBadWeightError(FstError, ValueError):             # <<<<<<<<<<<<<<
 * 
 *   pass
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 131, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 131, __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, 131, __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_pywrapfst_2, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 131, __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, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 131, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FstBadWeightError, __pyx_t_4) < 0) __PYX_ERR(0, 131, __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;

  /* "pywrapfst.pyx":136
 * 
 * 
 * class FstDeletedConstructorError(FstError, RuntimeError):             # <<<<<<<<<<<<<<
 * 
 *   pass
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 136, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 136, __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, 136, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_FstDeletedConstructorError, __pyx_n_s_FstDeletedConstructorError, (PyObject *) NULL, __pyx_n_s_pywrapfst_2, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 136, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_FstDeletedConstructorError, __pyx_t_2, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 136, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FstDeletedConstructorError, __pyx_t_4) < 0) __PYX_ERR(0, 136, __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;

  /* "pywrapfst.pyx":141
 * 
 * 
 * class FstIndexError(FstError, IndexError):             # <<<<<<<<<<<<<<
 * 
 *   pass
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 141, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 141, __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_IndexError);
  __Pyx_GIVEREF(__pyx_builtin_IndexError);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_builtin_IndexError);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 141, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_FstIndexError, __pyx_n_s_FstIndexError, (PyObject *) NULL, __pyx_n_s_pywrapfst_2, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 141, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_FstIndexError, __pyx_t_1, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 141, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FstIndexError, __pyx_t_4) < 0) __PYX_ERR(0, 141, __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;

  /* "pywrapfst.pyx":146
 * 
 * 
 * class FstIOError(FstError, IOError):             # <<<<<<<<<<<<<<
 * 
 *   pass
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 146, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 146, __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_IOError);
  __Pyx_GIVEREF(__pyx_builtin_IOError);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_builtin_IOError);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 146, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_FstIOError, __pyx_n_s_FstIOError, (PyObject *) NULL, __pyx_n_s_pywrapfst_2, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 146, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_FstIOError, __pyx_t_2, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 146, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FstIOError, __pyx_t_4) < 0) __PYX_ERR(0, 146, __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;

  /* "pywrapfst.pyx":151
 * 
 * 
 * class FstOpError(FstError, RuntimeError):             # <<<<<<<<<<<<<<
 * 
 *   pass
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 151, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 151, __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_RuntimeError);
  __Pyx_GIVEREF(__pyx_builtin_RuntimeError);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_builtin_RuntimeError);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 151, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_FstOpError, __pyx_n_s_FstOpError, (PyObject *) NULL, __pyx_n_s_pywrapfst_2, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 151, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_FstOpError, __pyx_t_1, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 151, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FstOpError, __pyx_t_4) < 0) __PYX_ERR(0, 151, __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;

  /* "pywrapfst.pyx":406
 * 
 *   @classmethod
 *   def Zero(cls, weight_type):             # <<<<<<<<<<<<<<
 *     """
 *     Weight.Zero(weight_type)
 */
  __pyx_t_1 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_9pywrapfst_Weight, __pyx_n_s_Zero); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 406, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "pywrapfst.pyx":405
 *   # C++ part out-of-class and then call it from within.
 * 
 *   @classmethod             # <<<<<<<<<<<<<<
 *   def Zero(cls, weight_type):
 *     """
 */
  __pyx_t_2 = __Pyx_Method_ClassMethod(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 405, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_9pywrapfst_Weight->tp_dict, __pyx_n_s_Zero, __pyx_t_2) < 0) __PYX_ERR(0, 406, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_9pywrapfst_Weight);

  /* "pywrapfst.pyx":415
 * 
 *   @classmethod
 *   def One(cls, weight_type):             # <<<<<<<<<<<<<<
 *     """
 *     Weight.One(weight_type)
 */
  __pyx_t_2 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_9pywrapfst_Weight, __pyx_n_s_One); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 415, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "pywrapfst.pyx":414
 *     return _Zero(weight_type)
 * 
 *   @classmethod             # <<<<<<<<<<<<<<
 *   def One(cls, weight_type):
 *     """
 */
  __pyx_t_1 = __Pyx_Method_ClassMethod(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 414, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_9pywrapfst_Weight->tp_dict, __pyx_n_s_One, __pyx_t_1) < 0) __PYX_ERR(0, 415, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_9pywrapfst_Weight);

  /* "pywrapfst.pyx":424
 * 
 *   @classmethod
 *   def NoWeight(cls, weight_type):             # <<<<<<<<<<<<<<
 *     """
 *     Weight.NoWeight(weight_type)
 */
  __pyx_t_1 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_9pywrapfst_Weight, __pyx_n_s_NoWeight); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 424, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "pywrapfst.pyx":423
 *     return _One(weight_type)
 * 
 *   @classmethod             # <<<<<<<<<<<<<<
 *   def NoWeight(cls, weight_type):
 *     """
 */
  __pyx_t_2 = __Pyx_Method_ClassMethod(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 423, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_9pywrapfst_Weight->tp_dict, __pyx_n_s_NoWeight, __pyx_t_2) < 0) __PYX_ERR(0, 424, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_9pywrapfst_Weight);

  /* "pywrapfst.pyx":456
 * 
 * 
 * def plus(Weight lhs, Weight rhs):             # <<<<<<<<<<<<<<
 *   """
 *   plus(lhs, rhs)
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_9pywrapfst_1plus, NULL, __pyx_n_s_pywrapfst_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 456, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_plus, __pyx_t_2) < 0) __PYX_ERR(0, 456, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pywrapfst.pyx":488
 * 
 * 
 * def times(Weight lhs, Weight rhs):             # <<<<<<<<<<<<<<
 *   """
 *   times(lhs, rhs)
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_9pywrapfst_3times, NULL, __pyx_n_s_pywrapfst_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 488, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_times, __pyx_t_2) < 0) __PYX_ERR(0, 488, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pywrapfst.pyx":520
 * 
 * 
 * def divide(Weight lhs, Weight rhs):             # <<<<<<<<<<<<<<
 *   """
 *   divide(lhs, rhs)
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_9pywrapfst_5divide, NULL, __pyx_n_s_pywrapfst_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 520, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_divide, __pyx_t_2) < 0) __PYX_ERR(0, 520, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pywrapfst.pyx":553
 * 
 * 
 * def power(Weight w, size_t n):             # <<<<<<<<<<<<<<
 *   """
 *   power(lhs, rhs)
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_9pywrapfst_7power, NULL, __pyx_n_s_pywrapfst_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 553, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_power, __pyx_t_2) < 0) __PYX_ERR(0, 553, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pywrapfst.pyx":889
 *   """
 * 
 *   cpdef int64 add_symbol(self, symbol, int64 key=kNoSymbol):             # <<<<<<<<<<<<<<
 *     """
 *     add_symbol(self, symbol, key=NO_SYMBOL)
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_kNoSymbol); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 889, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_PyInt_As_int64_t(__pyx_t_2); if (unlikely((__pyx_t_5 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 889, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_k__13 = __pyx_t_5;
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_kNoSymbol); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 889, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_PyInt_As_int64_t(__pyx_t_2); if (unlikely((__pyx_t_5 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 889, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_k__13 = __pyx_t_5;

  /* "pywrapfst.pyx":966
 * 
 *   @classmethod
 *   def read(cls, filename):             # <<<<<<<<<<<<<<
 *     """
 *     SymbolTable.read(filename)
 */
  __pyx_t_2 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_9pywrapfst_SymbolTable, __pyx_n_s_read); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 966, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "pywrapfst.pyx":965
 *     self._smart_table.reset(self._table)
 * 
 *   @classmethod             # <<<<<<<<<<<<<<
 *   def read(cls, filename):
 *     """
 */
  __pyx_t_1 = __Pyx_Method_ClassMethod(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 965, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_9pywrapfst_SymbolTable->tp_dict, __pyx_n_s_read, __pyx_t_1) < 0) __PYX_ERR(0, 966, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_9pywrapfst_SymbolTable);

  /* "pywrapfst.pyx":988
 * 
 *   @classmethod
 *   def read_text(cls, filename, bool allow_negative_labels=False):             # <<<<<<<<<<<<<<
 *     """
 *     SymbolTable.read_text(filename)
 */
  __pyx_t_1 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_9pywrapfst_SymbolTable, __pyx_n_s_read_text); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 988, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "pywrapfst.pyx":987
 *     return _init_SymbolTable(tsyms)
 * 
 *   @classmethod             # <<<<<<<<<<<<<<
 *   def read_text(cls, filename, bool allow_negative_labels=False):
 *     """
 */
  __pyx_t_2 = __Pyx_Method_ClassMethod(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 987, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_9pywrapfst_SymbolTable->tp_dict, __pyx_n_s_read_text, __pyx_t_2) < 0) __PYX_ERR(0, 988, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_9pywrapfst_SymbolTable);

  /* "pywrapfst.pyx":1015
 * 
 *   @classmethod
 *   def read_fst(cls, filename, bool input_table):             # <<<<<<<<<<<<<<
 *     """
 *     SymbolTable.read_fst(filename, input_table)
 */
  __pyx_t_2 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_9pywrapfst_SymbolTable, __pyx_n_s_read_fst); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1015, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "pywrapfst.pyx":1014
 *     return _init_SymbolTable(tsyms)
 * 
 *   @classmethod             # <<<<<<<<<<<<<<
 *   def read_fst(cls, filename, bool input_table):
 *     """
 */
  __pyx_t_1 = __Pyx_Method_ClassMethod(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1014, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_9pywrapfst_SymbolTable->tp_dict, __pyx_n_s_read_fst, __pyx_t_1) < 0) __PYX_ERR(0, 1015, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_9pywrapfst_SymbolTable);

  /* "pywrapfst.pyx":2064
 *     return self
 * 
 *   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__35 = fst::kShortestDelta;

  /* "pywrapfst.pyx":2070
 *     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__36 = fst::kShortestDelta;

  /* "pywrapfst.pyx":2170
 *     return self
 * 
 *   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__37 = fst::kDelta;
  __pyx_k__38 = fst::kNoStateId;

  /* "pywrapfst.pyx":2179
 * 
 *   def prune(self,
 *             float delta=fst.kDelta,             # <<<<<<<<<<<<<<
 *             int64 nstate=fst.kNoStateId,
 *             weight=None):
 */
  __pyx_k__39 = fst::kDelta;

  /* "pywrapfst.pyx":2180
 *   def prune(self,
 *             float delta=fst.kDelta,
 *             int64 nstate=fst.kNoStateId,             # <<<<<<<<<<<<<<
 *             weight=None):
 *     """
 */
  __pyx_k__40 = fst::kNoStateId;

  /* "pywrapfst.pyx":2207
 * 
 *   cdef void _push(self,
 *                   float delta=fst.kDelta,             # <<<<<<<<<<<<<<
 *                   bool remove_total_weight=False,
 *                   bool to_final=False) except *:
 */
  __pyx_k__41 = fst::kDelta;

  /* "pywrapfst.pyx":2215
 * 
 *   def push(self,
 *            float delta=fst.kDelta,             # <<<<<<<<<<<<<<
 *            bool remove_total_weight=False,
 *            bool to_final=False):
 */
  __pyx_k__42 = fst::kDelta;

  /* "pywrapfst.pyx":2452
 *                        bool connect=True,
 *                        weight=None,
 *                        int64 nstate=fst.kNoStateId,             # <<<<<<<<<<<<<<
 *                        float delta=fst.kShortestDelta) except *:
 *     cdef fst.WeightClass wc = _get_WeightClass_or_Zero(self.weight_type(),
 */
  __pyx_k__46 = fst::kNoStateId;

  /* "pywrapfst.pyx":2453
 *                        weight=None,
 *                        int64 nstate=fst.kNoStateId,
 *                        float delta=fst.kShortestDelta) except *:             # <<<<<<<<<<<<<<
 *     cdef fst.WeightClass wc = _get_WeightClass_or_Zero(self.weight_type(),
 *                                                        weight)
 */
  __pyx_k__47 = fst::kShortestDelta;

  /* "pywrapfst.pyx":2466
 *                 bool connect=True,
 *                 weight=None,
 *                 int64 nstate=fst.kNoStateId,             # <<<<<<<<<<<<<<
 *                 float delta=fst.kShortestDelta):
 *     """
 */
  __pyx_k__48 = fst::kNoStateId;

  /* "pywrapfst.pyx":2467
 *                 weight=None,
 *                 int64 nstate=fst.kNoStateId,
 *                 float delta=fst.kShortestDelta):             # <<<<<<<<<<<<<<
 *     """
 *     rmepsilon(self, queue_type="auto", connect=True, weight=None,
 */
  __pyx_k__49 = fst::kShortestDelta;

  /* "pywrapfst.pyx":2742
 * 
 * 
 * class Fst(object):             # <<<<<<<<<<<<<<
 * 
 *    """
 */
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__107); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2742, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_tuple__107, __pyx_n_s_Fst, __pyx_n_s_Fst, (PyObject *) NULL, __pyx_n_s_pywrapfst_2, __pyx_kp_s_Fst_arc_type_standard_Construct); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2742, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "pywrapfst.pyx":2759
 *    """
 * 
 *    def __new__(cls, arc_type=b"standard"):             # <<<<<<<<<<<<<<
 *     return _create_Fst(arc_type)
 * 
 */
  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9pywrapfst_3Fst_1__new__, __Pyx_CYFUNCTION_STATICMETHOD, __pyx_n_s_Fst___new, NULL, __pyx_n_s_pywrapfst_2, __pyx_d, ((PyObject *)__pyx_codeobj__109)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2759, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__110);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_new, __pyx_t_3) < 0) __PYX_ERR(0, 2759, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pywrapfst.pyx":2763
 * 
 *    @staticmethod
 *    def read(filename):             # <<<<<<<<<<<<<<
 *      """
 *      read(filename):
 */
  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9pywrapfst_3Fst_3read, __Pyx_CYFUNCTION_STATICMETHOD, __pyx_n_s_Fst_read, NULL, __pyx_n_s_pywrapfst_2, __pyx_d, ((PyObject *)__pyx_codeobj__112)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2763, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "pywrapfst.pyx":2762
 *     return _create_Fst(arc_type)
 * 
 *    @staticmethod             # <<<<<<<<<<<<<<
 *    def read(filename):
 *      """
 */
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2762, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_staticmethod, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2762, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_read, __pyx_t_3) < 0) __PYX_ERR(0, 2763, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pywrapfst.pyx":2781
 * 
 *    @staticmethod
 *    def read_from_string(state):             # <<<<<<<<<<<<<<
 *      """
 *      read_from_string(string, fst_type=None)
 */
  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9pywrapfst_3Fst_5read_from_string, __Pyx_CYFUNCTION_STATICMETHOD, __pyx_n_s_Fst_read_from_string, NULL, __pyx_n_s_pywrapfst_2, __pyx_d, ((PyObject *)__pyx_codeobj__114)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2781, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "pywrapfst.pyx":2780
 *      return _read(filename)
 * 
 *    @staticmethod             # <<<<<<<<<<<<<<
 *    def read_from_string(state):
 *      """
 */
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2780, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_staticmethod, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2780, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_read_from_string_2, __pyx_t_3) < 0) __PYX_ERR(0, 2781, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pywrapfst.pyx":2742
 * 
 * 
 * class Fst(object):             # <<<<<<<<<<<<<<
 * 
 *    """
 */
  __pyx_t_3 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_Fst, __pyx_tuple__107, __pyx_t_2, NULL, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2742, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Fst, __pyx_t_3) < 0) __PYX_ERR(0, 2742, __pyx_L1_error)
  __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;

  /* "pywrapfst.pyx":2805
 * 
 * 
 * NO_LABEL = fst.kNoLabel             # <<<<<<<<<<<<<<
 * NO_STATE_ID = fst.kNoStateId
 * # TODO(kbg): Figure out how to access static class variables so I don't have
 */
  __pyx_t_1 = __Pyx_PyInt_From_int(fst::kNoLabel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2805, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_NO_LABEL, __pyx_t_1) < 0) __PYX_ERR(0, 2805, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pywrapfst.pyx":2806
 * 
 * NO_LABEL = fst.kNoLabel
 * NO_STATE_ID = fst.kNoStateId             # <<<<<<<<<<<<<<
 * # TODO(kbg): Figure out how to access static class variables so I don't have
 * # to do it this way.
 */
  __pyx_t_1 = __Pyx_PyInt_From_int(fst::kNoStateId); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2806, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_NO_STATE_ID, __pyx_t_1) < 0) __PYX_ERR(0, 2806, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pywrapfst.pyx":2809
 * # TODO(kbg): Figure out how to access static class variables so I don't have
 * # to do it this way.
 * NO_SYMBOL = kNoSymbol             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_kNoSymbol); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2809, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_NO_SYMBOL, __pyx_t_1) < 0) __PYX_ERR(0, 2809, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pywrapfst.pyx":2815
 * 
 * 
 * EXPANDED = fst.kExpanded             # <<<<<<<<<<<<<<
 * MUTABLE = fst.kMutable
 * ERROR = fst.kError
 */
  __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kExpanded); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2815, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_EXPANDED, __pyx_t_1) < 0) __PYX_ERR(0, 2815, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pywrapfst.pyx":2816
 * 
 * EXPANDED = fst.kExpanded
 * MUTABLE = fst.kMutable             # <<<<<<<<<<<<<<
 * ERROR = fst.kError
 * ACCEPTOR = fst.kAcceptor
 */
  __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kMutable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2816, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_MUTABLE, __pyx_t_1) < 0) __PYX_ERR(0, 2816, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pywrapfst.pyx":2817
 * EXPANDED = fst.kExpanded
 * MUTABLE = fst.kMutable
 * ERROR = fst.kError             # <<<<<<<<<<<<<<
 * ACCEPTOR = fst.kAcceptor
 * NOT_ACCEPTOR = fst.kNotAcceptor
 */
  __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2817, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ERROR, __pyx_t_1) < 0) __PYX_ERR(0, 2817, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pywrapfst.pyx":2818
 * MUTABLE = fst.kMutable
 * ERROR = fst.kError
 * ACCEPTOR = fst.kAcceptor             # <<<<<<<<<<<<<<
 * NOT_ACCEPTOR = fst.kNotAcceptor
 * I_DETERMINISTIC = fst.kIDeterministic
 */
  __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kAcceptor); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2818, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ACCEPTOR, __pyx_t_1) < 0) __PYX_ERR(0, 2818, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pywrapfst.pyx":2819
 * ERROR = fst.kError
 * ACCEPTOR = fst.kAcceptor
 * NOT_ACCEPTOR = fst.kNotAcceptor             # <<<<<<<<<<<<<<
 * I_DETERMINISTIC = fst.kIDeterministic
 * NON_I_DETERMINISTIC = fst.kNonIDeterministic
 */
  __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kNotAcceptor); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2819, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOT_ACCEPTOR, __pyx_t_1) < 0) __PYX_ERR(0, 2819, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pywrapfst.pyx":2820
 * ACCEPTOR = fst.kAcceptor
 * NOT_ACCEPTOR = fst.kNotAcceptor
 * I_DETERMINISTIC = fst.kIDeterministic             # <<<<<<<<<<<<<<
 * NON_I_DETERMINISTIC = fst.kNonIDeterministic
 * O_DETERMINISTIC = fst.kODeterministic
 */
  __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kIDeterministic); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2820, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_I_DETERMINISTIC, __pyx_t_1) < 0) __PYX_ERR(0, 2820, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pywrapfst.pyx":2821
 * NOT_ACCEPTOR = fst.kNotAcceptor
 * I_DETERMINISTIC = fst.kIDeterministic
 * NON_I_DETERMINISTIC = fst.kNonIDeterministic             # <<<<<<<<<<<<<<
 * O_DETERMINISTIC = fst.kODeterministic
 * NON_O_DETERMINISTIC = fst.kNonODeterministic
 */
  __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kNonIDeterministic); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2821, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_NON_I_DETERMINISTIC, __pyx_t_1) < 0) __PYX_ERR(0, 2821, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pywrapfst.pyx":2822
 * I_DETERMINISTIC = fst.kIDeterministic
 * NON_I_DETERMINISTIC = fst.kNonIDeterministic
 * O_DETERMINISTIC = fst.kODeterministic             # <<<<<<<<<<<<<<
 * NON_O_DETERMINISTIC = fst.kNonODeterministic
 * EPSILONS = fst.kEpsilons
 */
  __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kODeterministic); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2822, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_O_DETERMINISTIC, __pyx_t_1) < 0) __PYX_ERR(0, 2822, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pywrapfst.pyx":2823
 * NON_I_DETERMINISTIC = fst.kNonIDeterministic
 * O_DETERMINISTIC = fst.kODeterministic
 * NON_O_DETERMINISTIC = fst.kNonODeterministic             # <<<<<<<<<<<<<<
 * EPSILONS = fst.kEpsilons
 * NO_EPSILONS = fst.kNoEpsilons
 */
  __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kNonODeterministic); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2823, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_NON_O_DETERMINISTIC, __pyx_t_1) < 0) __PYX_ERR(0, 2823, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pywrapfst.pyx":2824
 * O_DETERMINISTIC = fst.kODeterministic
 * NON_O_DETERMINISTIC = fst.kNonODeterministic
 * EPSILONS = fst.kEpsilons             # <<<<<<<<<<<<<<
 * NO_EPSILONS = fst.kNoEpsilons
 * I_EPSILONS = fst.kIEpsilons
 */
  __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kEpsilons); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2824, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_EPSILONS, __pyx_t_1) < 0) __PYX_ERR(0, 2824, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pywrapfst.pyx":2825
 * NON_O_DETERMINISTIC = fst.kNonODeterministic
 * EPSILONS = fst.kEpsilons
 * NO_EPSILONS = fst.kNoEpsilons             # <<<<<<<<<<<<<<
 * I_EPSILONS = fst.kIEpsilons
 * NO_I_EPSILONS = fst.kNoIEpsilons
 */
  __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kNoEpsilons); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2825, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_NO_EPSILONS, __pyx_t_1) < 0) __PYX_ERR(0, 2825, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pywrapfst.pyx":2826
 * EPSILONS = fst.kEpsilons
 * NO_EPSILONS = fst.kNoEpsilons
 * I_EPSILONS = fst.kIEpsilons             # <<<<<<<<<<<<<<
 * NO_I_EPSILONS = fst.kNoIEpsilons
 * O_EPSILONS = fst.kOEpsilons
 */
  __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kIEpsilons); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2826, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_I_EPSILONS, __pyx_t_1) < 0) __PYX_ERR(0, 2826, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pywrapfst.pyx":2827
 * NO_EPSILONS = fst.kNoEpsilons
 * I_EPSILONS = fst.kIEpsilons
 * NO_I_EPSILONS = fst.kNoIEpsilons             # <<<<<<<<<<<<<<
 * O_EPSILONS = fst.kOEpsilons
 * NO_O_EPSILONS = fst.kNoOEpsilons
 */
  __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kNoIEpsilons); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2827, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_NO_I_EPSILONS, __pyx_t_1) < 0) __PYX_ERR(0, 2827, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pywrapfst.pyx":2828
 * 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_1 = __Pyx_PyInt_From_uint64_t(fst::kOEpsilons); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2828, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_O_EPSILONS, __pyx_t_1) < 0) __PYX_ERR(0, 2828, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pywrapfst.pyx":2829
 * 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_1 = __Pyx_PyInt_From_uint64_t(fst::kNoOEpsilons); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2829, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_NO_O_EPSILONS, __pyx_t_1) < 0) __PYX_ERR(0, 2829, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pywrapfst.pyx":2830
 * 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_1 = __Pyx_PyInt_From_uint64_t(fst::kILabelSorted); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2830, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_I_LABEL_SORTED, __pyx_t_1) < 0) __PYX_ERR(0, 2830, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pywrapfst.pyx":2831
 * 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_1 = __Pyx_PyInt_From_uint64_t(fst::kNotILabelSorted); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2831, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOT_I_LABEL_SORTED, __pyx_t_1) < 0) __PYX_ERR(0, 2831, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pywrapfst.pyx":2832
 * 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_1 = __Pyx_PyInt_From_uint64_t(fst::kOLabelSorted); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2832, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_O_LABEL_SORTED, __pyx_t_1) < 0) __PYX_ERR(0, 2832, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pywrapfst.pyx":2833
 * 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_1 = __Pyx_PyInt_From_uint64_t(fst::kNotOLabelSorted); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2833, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOT_O_LABEL_SORTED, __pyx_t_1) < 0) __PYX_ERR(0, 2833, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pywrapfst.pyx":2834
 * O_LABEL_SORTED = fst.kOLabelSorted
 * NOT_O_LABEL_SORTED = fst.kNotOLabelSorted
 * WEIGHTED = fst.kWeighted             # <<<<<<<<<<<<<<
 * UNWEIGHTED = fst.kUnweighted
 * CYCLIC = fst.kCyclic
 */
  __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kWeighted); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2834, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_WEIGHTED, __pyx_t_1) < 0) __PYX_ERR(0, 2834, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pywrapfst.pyx":2835
 * NOT_O_LABEL_SORTED = fst.kNotOLabelSorted
 * WEIGHTED = fst.kWeighted
 * UNWEIGHTED = fst.kUnweighted             # <<<<<<<<<<<<<<
 * CYCLIC = fst.kCyclic
 * ACYCLIC = fst.kAcyclic
 */
  __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kUnweighted); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2835, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_UNWEIGHTED, __pyx_t_1) < 0) __PYX_ERR(0, 2835, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pywrapfst.pyx":2836
 * WEIGHTED = fst.kWeighted
 * UNWEIGHTED = fst.kUnweighted
 * CYCLIC = fst.kCyclic             # <<<<<<<<<<<<<<
 * ACYCLIC = fst.kAcyclic
 * INITIAL_CYCLIC = fst.kInitialCyclic
 */
  __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kCyclic); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2836, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_CYCLIC, __pyx_t_1) < 0) __PYX_ERR(0, 2836, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pywrapfst.pyx":2837
 * UNWEIGHTED = fst.kUnweighted
 * CYCLIC = fst.kCyclic
 * ACYCLIC = fst.kAcyclic             # <<<<<<<<<<<<<<
 * INITIAL_CYCLIC = fst.kInitialCyclic
 * INITIAL_ACYCLIC = fst.kInitialAcyclic
 */
  __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kAcyclic); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2837, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ACYCLIC, __pyx_t_1) < 0) __PYX_ERR(0, 2837, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pywrapfst.pyx":2838
 * CYCLIC = fst.kCyclic
 * ACYCLIC = fst.kAcyclic
 * INITIAL_CYCLIC = fst.kInitialCyclic             # <<<<<<<<<<<<<<
 * INITIAL_ACYCLIC = fst.kInitialAcyclic
 * TOP_SORTED = fst.kTopSorted
 */
  __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kInitialCyclic); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2838, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_INITIAL_CYCLIC, __pyx_t_1) < 0) __PYX_ERR(0, 2838, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pywrapfst.pyx":2839
 * ACYCLIC = fst.kAcyclic
 * INITIAL_CYCLIC = fst.kInitialCyclic
 * INITIAL_ACYCLIC = fst.kInitialAcyclic             # <<<<<<<<<<<<<<
 * TOP_SORTED = fst.kTopSorted
 * NOT_TOP_SORTED = fst.kNotTopSorted
 */
  __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kInitialAcyclic); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2839, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_INITIAL_ACYCLIC, __pyx_t_1) < 0) __PYX_ERR(0, 2839, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pywrapfst.pyx":2840
 * INITIAL_CYCLIC = fst.kInitialCyclic
 * INITIAL_ACYCLIC = fst.kInitialAcyclic
 * TOP_SORTED = fst.kTopSorted             # <<<<<<<<<<<<<<
 * NOT_TOP_SORTED = fst.kNotTopSorted
 * ACCESSIBLE = fst.kAccessible
 */
  __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kTopSorted); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2840, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_TOP_SORTED, __pyx_t_1) < 0) __PYX_ERR(0, 2840, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pywrapfst.pyx":2841
 * INITIAL_ACYCLIC = fst.kInitialAcyclic
 * TOP_SORTED = fst.kTopSorted
 * NOT_TOP_SORTED = fst.kNotTopSorted             # <<<<<<<<<<<<<<
 * ACCESSIBLE = fst.kAccessible
 * NOT_ACCESSIBLE = fst.kNotAccessible
 */
  __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kNotTopSorted); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2841, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOT_TOP_SORTED, __pyx_t_1) < 0) __PYX_ERR(0, 2841, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pywrapfst.pyx":2842
 * TOP_SORTED = fst.kTopSorted
 * NOT_TOP_SORTED = fst.kNotTopSorted
 * ACCESSIBLE = fst.kAccessible             # <<<<<<<<<<<<<<
 * NOT_ACCESSIBLE = fst.kNotAccessible
 * COACCESSIBLE = fst.kCoAccessible
 */
  __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kAccessible); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2842, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ACCESSIBLE, __pyx_t_1) < 0) __PYX_ERR(0, 2842, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pywrapfst.pyx":2843
 * NOT_TOP_SORTED = fst.kNotTopSorted
 * ACCESSIBLE = fst.kAccessible
 * NOT_ACCESSIBLE = fst.kNotAccessible             # <<<<<<<<<<<<<<
 * COACCESSIBLE = fst.kCoAccessible
 * NOT_COACCESSIBLE = fst.kNotCoAccessible
 */
  __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kNotAccessible); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2843, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOT_ACCESSIBLE, __pyx_t_1) < 0) __PYX_ERR(0, 2843, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pywrapfst.pyx":2844
 * ACCESSIBLE = fst.kAccessible
 * NOT_ACCESSIBLE = fst.kNotAccessible
 * COACCESSIBLE = fst.kCoAccessible             # <<<<<<<<<<<<<<
 * NOT_COACCESSIBLE = fst.kNotCoAccessible
 * STRING = fst.kString
 */
  __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kCoAccessible); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2844, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_COACCESSIBLE, __pyx_t_1) < 0) __PYX_ERR(0, 2844, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pywrapfst.pyx":2845
 * NOT_ACCESSIBLE = fst.kNotAccessible
 * COACCESSIBLE = fst.kCoAccessible
 * NOT_COACCESSIBLE = fst.kNotCoAccessible             # <<<<<<<<<<<<<<
 * STRING = fst.kString
 * NOT_STRING = fst.kNotString
 */
  __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kNotCoAccessible); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2845, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOT_COACCESSIBLE, __pyx_t_1) < 0) __PYX_ERR(0, 2845, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pywrapfst.pyx":2846
 * COACCESSIBLE = fst.kCoAccessible
 * NOT_COACCESSIBLE = fst.kNotCoAccessible
 * STRING = fst.kString             # <<<<<<<<<<<<<<
 * NOT_STRING = fst.kNotString
 * WEIGHTED_CYCLES = fst.kWeightedCycles
 */
  __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kString); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2846, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_STRING, __pyx_t_1) < 0) __PYX_ERR(0, 2846, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pywrapfst.pyx":2847
 * NOT_COACCESSIBLE = fst.kNotCoAccessible
 * STRING = fst.kString
 * NOT_STRING = fst.kNotString             # <<<<<<<<<<<<<<
 * WEIGHTED_CYCLES = fst.kWeightedCycles
 * UNWEIGHTED_CYCLES = fst.kUnweightedCycles
 */
  __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kNotString); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2847, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOT_STRING, __pyx_t_1) < 0) __PYX_ERR(0, 2847, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pywrapfst.pyx":2848
 * STRING = fst.kString
 * NOT_STRING = fst.kNotString
 * WEIGHTED_CYCLES = fst.kWeightedCycles             # <<<<<<<<<<<<<<
 * UNWEIGHTED_CYCLES = fst.kUnweightedCycles
 * NULL_PROPERTIES = fst.kNullProperties
 */
  __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kWeightedCycles); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2848, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_WEIGHTED_CYCLES, __pyx_t_1) < 0) __PYX_ERR(0, 2848, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pywrapfst.pyx":2849
 * NOT_STRING = fst.kNotString
 * WEIGHTED_CYCLES = fst.kWeightedCycles
 * UNWEIGHTED_CYCLES = fst.kUnweightedCycles             # <<<<<<<<<<<<<<
 * NULL_PROPERTIES = fst.kNullProperties
 * COPY_PROPERTIES = fst.kCopyProperties
 */
  __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kUnweightedCycles); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2849, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_UNWEIGHTED_CYCLES, __pyx_t_1) < 0) __PYX_ERR(0, 2849, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pywrapfst.pyx":2850
 * WEIGHTED_CYCLES = fst.kWeightedCycles
 * UNWEIGHTED_CYCLES = fst.kUnweightedCycles
 * NULL_PROPERTIES = fst.kNullProperties             # <<<<<<<<<<<<<<
 * COPY_PROPERTIES = fst.kCopyProperties
 * INTRINSIC_PROPERTIES = fst.kIntrinsicProperties
 */
  __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kNullProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2850, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_NULL_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2850, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pywrapfst.pyx":2851
 * UNWEIGHTED_CYCLES = fst.kUnweightedCycles
 * NULL_PROPERTIES = fst.kNullProperties
 * COPY_PROPERTIES = fst.kCopyProperties             # <<<<<<<<<<<<<<
 * INTRINSIC_PROPERTIES = fst.kIntrinsicProperties
 * EXTRINSIC_PROPERTIES = fst.kExtrinsicProperties
 */
  __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kCopyProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2851, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_COPY_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2851, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pywrapfst.pyx":2852
 * NULL_PROPERTIES = fst.kNullProperties
 * COPY_PROPERTIES = fst.kCopyProperties
 * INTRINSIC_PROPERTIES = fst.kIntrinsicProperties             # <<<<<<<<<<<<<<
 * EXTRINSIC_PROPERTIES = fst.kExtrinsicProperties
 * SET_START_PROPERTIES = fst.kSetStartProperties
 */
  __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kIntrinsicProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2852, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_INTRINSIC_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2852, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pywrapfst.pyx":2853
 * COPY_PROPERTIES = fst.kCopyProperties
 * INTRINSIC_PROPERTIES = fst.kIntrinsicProperties
 * EXTRINSIC_PROPERTIES = fst.kExtrinsicProperties             # <<<<<<<<<<<<<<
 * SET_START_PROPERTIES = fst.kSetStartProperties
 * SET_FINAL_PROPERTIES = fst.kSetFinalProperties
 */
  __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kExtrinsicProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2853, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_EXTRINSIC_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2853, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pywrapfst.pyx":2854
 * 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_1 = __Pyx_PyInt_From_uint64_t(fst::kSetStartProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2854, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_SET_START_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2854, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pywrapfst.pyx":2855
 * 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_1 = __Pyx_PyInt_From_uint64_t(fst::kSetFinalProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2855, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_SET_FINAL_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2855, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pywrapfst.pyx":2856
 * 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_1 = __Pyx_PyInt_From_uint64_t(fst::kAddStateProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2856, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ADD_STATE_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2856, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pywrapfst.pyx":2857
 * 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_1 = __Pyx_PyInt_From_uint64_t(fst::kAddArcProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2857, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ADD_ARC_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2857, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pywrapfst.pyx":2858
 * 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_1 = __Pyx_PyInt_From_uint64_t(fst::kSetArcProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2858, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_SET_ARC_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2858, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pywrapfst.pyx":2859
 * 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_1 = __Pyx_PyInt_From_uint64_t(fst::kDeleteStatesProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2859, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_DELETE_STATE_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2859, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pywrapfst.pyx":2860
 * 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_1 = __Pyx_PyInt_From_uint64_t(fst::kDeleteArcsProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2860, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_DELETE_ARC_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2860, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pywrapfst.pyx":2861
 * 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_1 = __Pyx_PyInt_From_uint64_t(fst::kStateSortProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2861, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_STATE_SORT_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2861, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pywrapfst.pyx":2862
 * 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_1 = __Pyx_PyInt_From_uint64_t(fst::kArcSortProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2862, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARC_SORT_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2862, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pywrapfst.pyx":2863
 * 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_1 = __Pyx_PyInt_From_uint64_t(fst::kILabelInvariantProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2863, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_I_LABEL_INVARIANT_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2863, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pywrapfst.pyx":2864
 * 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_1 = __Pyx_PyInt_From_uint64_t(fst::kOLabelInvariantProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2864, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_O_LABEL_INVARIANT_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2864, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pywrapfst.pyx":2865
 * 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_1 = __Pyx_PyInt_From_uint64_t(fst::kWeightInvariantProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2865, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_WEIGHT_INVARIANT_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2865, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pywrapfst.pyx":2866
 * 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_1 = __Pyx_PyInt_From_uint64_t(fst::kAddSuperFinalProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2866, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ADD_SUPERFINAL_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2866, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pywrapfst.pyx":2867
 * 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_1 = __Pyx_PyInt_From_uint64_t(fst::kRmSuperFinalProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2867, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_RM_SUPERFINAL_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2867, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pywrapfst.pyx":2868
 * 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_1 = __Pyx_PyInt_From_uint64_t(fst::kBinaryProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2868, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_BINARY_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2868, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pywrapfst.pyx":2869
 * 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_1 = __Pyx_PyInt_From_uint64_t(fst::kTrinaryProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2869, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_TRINARY_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2869, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pywrapfst.pyx":2870
 * BINARY_PROPERTIES = fst.kBinaryProperties
 * TRINARY_PROPERTIES = fst.kTrinaryProperties
 * POS_TRINARY_PROPERTIES = fst.kPosTrinaryProperties             # <<<<<<<<<<<<<<
 * NEG_TRINARY_PROPERTIES = fst.kNegTrinaryProperties
 * FST_PROPERTIES = fst.kFstProperties
 */
  __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kPosTrinaryProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2870, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_POS_TRINARY_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2870, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pywrapfst.pyx":2871
 * TRINARY_PROPERTIES = fst.kTrinaryProperties
 * POS_TRINARY_PROPERTIES = fst.kPosTrinaryProperties
 * NEG_TRINARY_PROPERTIES = fst.kNegTrinaryProperties             # <<<<<<<<<<<<<<
 * FST_PROPERTIES = fst.kFstProperties
 * 
 */
  __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kNegTrinaryProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2871, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_NEG_TRINARY_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2871, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pywrapfst.pyx":2872
 * POS_TRINARY_PROPERTIES = fst.kPosTrinaryProperties
 * NEG_TRINARY_PROPERTIES = fst.kNegTrinaryProperties
 * FST_PROPERTIES = fst.kFstProperties             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __Pyx_PyInt_From_uint64_t(fst::kFstProperties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2872, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FST_PROPERTIES, __pyx_t_1) < 0) __PYX_ERR(0, 2872, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pywrapfst.pyx":2878
 * 
 * 
 * ARC_I_LABEL_VALUE = fst.kArcILabelValue             # <<<<<<<<<<<<<<
 * ARC_O_LABEL_VALUE = fst.kArcOLabelValue
 * ARC_WEIGHT_VALUE = fst.kArcWeightValue
 */
  __pyx_t_1 = __Pyx_PyInt_From_uint32_t(fst::kArcILabelValue); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2878, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARC_I_LABEL_VALUE, __pyx_t_1) < 0) __PYX_ERR(0, 2878, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pywrapfst.pyx":2879
 * 
 * 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_1 = __Pyx_PyInt_From_uint32_t(fst::kArcOLabelValue); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2879, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARC_O_LABEL_VALUE, __pyx_t_1) < 0) __PYX_ERR(0, 2879, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pywrapfst.pyx":2880
 * 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_1 = __Pyx_PyInt_From_uint32_t(fst::kArcWeightValue); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2880, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARC_WEIGHT_VALUE, __pyx_t_1) < 0) __PYX_ERR(0, 2880, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pywrapfst.pyx":2881
 * 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_1 = __Pyx_PyInt_From_uint32_t(fst::kArcNextStateValue); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2881, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARC_NEXT_STATE_VALUE, __pyx_t_1) < 0) __PYX_ERR(0, 2881, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pywrapfst.pyx":2882
 * 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_1 = __Pyx_PyInt_From_uint32_t(fst::kArcNoCache); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2882, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARC_NO_CACHE, __pyx_t_1) < 0) __PYX_ERR(0, 2882, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pywrapfst.pyx":2883
 * ARC_NEXT_STATE_VALUE = fst.kArcNextStateValue
 * ARC_NO_CACHE = fst.kArcNoCache
 * ARC_VALUE_FLAGS = fst.kArcValueFlags             # <<<<<<<<<<<<<<
 * ARC_FLAGS = fst.kArcFlags
 * 
 */
  __pyx_t_1 = __Pyx_PyInt_From_uint32_t(fst::kArcValueFlags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2883, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARC_VALUE_FLAGS, __pyx_t_1) < 0) __PYX_ERR(0, 2883, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pywrapfst.pyx":2884
 * ARC_NO_CACHE = fst.kArcNoCache
 * ARC_VALUE_FLAGS = fst.kArcValueFlags
 * ARC_FLAGS = fst.kArcFlags             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __Pyx_PyInt_From_uint32_t(fst::kArcFlags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2884, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARC_FLAGS, __pyx_t_1) < 0) __PYX_ERR(0, 2884, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pywrapfst.pyx":2890
 * 
 * 
 * ENCODE_LABELS = fst.kEncodeLabels             # <<<<<<<<<<<<<<
 * ENCODE_WEIGHTS = fst.kEncodeWeights
 * ENCODE_FLAGS = fst.kEncodeFlags
 */
  __pyx_t_1 = __Pyx_PyInt_From_uint32_t(fst::kEncodeLabels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2890, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ENCODE_LABELS, __pyx_t_1) < 0) __PYX_ERR(0, 2890, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pywrapfst.pyx":2891
 * 
 * ENCODE_LABELS = fst.kEncodeLabels
 * ENCODE_WEIGHTS = fst.kEncodeWeights             # <<<<<<<<<<<<<<
 * ENCODE_FLAGS = fst.kEncodeFlags
 * 
 */
  __pyx_t_1 = __Pyx_PyInt_From_uint32_t(fst::kEncodeWeights); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2891, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ENCODE_WEIGHTS, __pyx_t_1) < 0) __PYX_ERR(0, 2891, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pywrapfst.pyx":2892
 * ENCODE_LABELS = fst.kEncodeLabels
 * ENCODE_WEIGHTS = fst.kEncodeWeights
 * ENCODE_FLAGS = fst.kEncodeFlags             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __Pyx_PyInt_From_uint32_t(fst::kEncodeFlags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2892, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ENCODE_FLAGS, __pyx_t_1) < 0) __PYX_ERR(0, 2892, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pywrapfst.pyx":3258
 * 
 * cdef _Fst _map(_Fst ifst,
 *                float delta=fst.kDelta,             # <<<<<<<<<<<<<<
 *                map_type=b"identity",
 *                double power=1.,
 */
  __pyx_k__67 = fst::kDelta;

  /* "pywrapfst.pyx":3272
 * 
 * cpdef _Fst arcmap(_Fst ifst,
 *                   float delta=fst.kDelta,             # <<<<<<<<<<<<<<
 *                   map_type=b"identity",
 *                   double power=1.,
 */
  __pyx_k__68 = fst::kDelta;

  /* "pywrapfst.pyx":3271
 * 
 * 
 * cpdef _Fst arcmap(_Fst ifst,             # <<<<<<<<<<<<<<
 *                   float delta=fst.kDelta,
 *                   map_type=b"identity",
 */
  __pyx_k__68 = fst::kDelta;

  /* "pywrapfst.pyx":3384
 * 
 * cpdef _MutableFst determinize(_Fst ifst,
 *                               float delta=fst.kShortestDelta,             # <<<<<<<<<<<<<<
 *                               det_type=b"functional",
 *                               int64 nstate=fst.kNoStateId,
 */
  __pyx_k__69 = fst::kShortestDelta;

  /* "pywrapfst.pyx":3386
 *                               float delta=fst.kShortestDelta,
 *                               det_type=b"functional",
 *                               int64 nstate=fst.kNoStateId,             # <<<<<<<<<<<<<<
 *                               int64 subsequential_label=0,
 *                               weight=None,
 */
  __pyx_k__70 = fst::kNoStateId;

  /* "pywrapfst.pyx":3384
 * 
 * cpdef _MutableFst determinize(_Fst ifst,
 *                               float delta=fst.kShortestDelta,             # <<<<<<<<<<<<<<
 *                               det_type=b"functional",
 *                               int64 nstate=fst.kNoStateId,
 */
  __pyx_k__69 = fst::kShortestDelta;

  /* "pywrapfst.pyx":3386
 *                               float delta=fst.kShortestDelta,
 *                               det_type=b"functional",
 *                               int64 nstate=fst.kNoStateId,             # <<<<<<<<<<<<<<
 *                               int64 subsequential_label=0,
 *                               weight=None,
 */
  __pyx_k__70 = fst::kNoStateId;

  /* "pywrapfst.pyx":3477
 * 
 * cpdef _MutableFst disambiguate(_Fst ifst,
 *                                float delta=fst.kDelta,             # <<<<<<<<<<<<<<
 *                                int64 nstate=fst.kNoStateId,
 *                                int64 subsequential_label=0,
 */
  __pyx_k__71 = fst::kDelta;

  /* "pywrapfst.pyx":3478
 * cpdef _MutableFst disambiguate(_Fst ifst,
 *                                float delta=fst.kDelta,
 *                                int64 nstate=fst.kNoStateId,             # <<<<<<<<<<<<<<
 *                                int64 subsequential_label=0,
 *                                weight=None):
 */
  __pyx_k__72 = fst::kNoStateId;

  /* "pywrapfst.pyx":3477
 * 
 * cpdef _MutableFst disambiguate(_Fst ifst,
 *                                float delta=fst.kDelta,             # <<<<<<<<<<<<<<
 *                                int64 nstate=fst.kNoStateId,
 *                                int64 subsequential_label=0,
 */
  __pyx_k__71 = fst::kDelta;

  /* "pywrapfst.pyx":3478
 * cpdef _MutableFst disambiguate(_Fst ifst,
 *                                float delta=fst.kDelta,
 *                                int64 nstate=fst.kNoStateId,             # <<<<<<<<<<<<<<
 *                                int64 subsequential_label=0,
 *                                weight=None):
 */
  __pyx_k__72 = fst::kNoStateId;

  /* "pywrapfst.pyx":3548
 * 
 * 
 * cpdef bool equal(_Fst ifst1, _Fst ifst2, float delta=fst.kDelta):             # <<<<<<<<<<<<<<
 *   """
 *   equal(ifst1, ifst2, delta=0.0009765625)
 */
  __pyx_k__73 = fst::kDelta;
  __pyx_k__73 = fst::kDelta;

  /* "pywrapfst.pyx":3571
 * 
 * 
 * cpdef bool equivalent(_Fst ifst1, _Fst ifst2, float delta=fst.kDelta) except *:             # <<<<<<<<<<<<<<
 *   """
 *   equivalent(ifst1, ifst2, delta=0.0009765625)
 */
  __pyx_k__74 = fst::kDelta;
  __pyx_k__74 = fst::kDelta;

  /* "pywrapfst.pyx":3627
 * 
 * 
 * cpdef bool isomorphic(_Fst ifst1, _Fst ifst2, float delta=fst.kDelta):             # <<<<<<<<<<<<<<
 *   """
 *   isomorphic(ifst1, ifst2, delta=0.0009765625)
 */
  __pyx_k__75 = fst::kDelta;
  __pyx_k__75 = fst::kDelta;

  /* "pywrapfst.pyx":3654
 * 
 * cpdef _MutableFst prune(_Fst ifst,
 *                         float delta=fst.kDelta,             # <<<<<<<<<<<<<<
 *                         int64 nstate=fst.kNoStateId,
 *                         weight=None):
 */
  __pyx_k__76 = fst::kDelta;

  /* "pywrapfst.pyx":3655
 * cpdef _MutableFst prune(_Fst ifst,
 *                         float delta=fst.kDelta,
 *                         int64 nstate=fst.kNoStateId,             # <<<<<<<<<<<<<<
 *                         weight=None):
 *   """
 */
  __pyx_k__77 = fst::kNoStateId;

  /* "pywrapfst.pyx":3654
 * 
 * cpdef _MutableFst prune(_Fst ifst,
 *                         float delta=fst.kDelta,             # <<<<<<<<<<<<<<
 *                         int64 nstate=fst.kNoStateId,
 *                         weight=None):
 */
  __pyx_k__76 = fst::kDelta;

  /* "pywrapfst.pyx":3655
 * cpdef _MutableFst prune(_Fst ifst,
 *                         float delta=fst.kDelta,
 *                         int64 nstate=fst.kNoStateId,             # <<<<<<<<<<<<<<
 *                         weight=None):
 *   """
 */
  __pyx_k__77 = fst::kNoStateId;

  /* "pywrapfst.pyx":3687
 * 
 * cpdef _MutableFst push(_Fst ifst,
 *                        float delta=fst.kDelta,             # <<<<<<<<<<<<<<
 *                        bool push_weights=False,
 *                        bool push_labels=False,
 */
  __pyx_k__78 = fst::kDelta;

  /* "pywrapfst.pyx":3686
 * 
 * 
 * cpdef _MutableFst push(_Fst ifst,             # <<<<<<<<<<<<<<
 *                        float delta=fst.kDelta,
 *                        bool push_weights=False,
 */
  __pyx_k__78 = fst::kDelta;

  /* "pywrapfst.pyx":3743
 *                           _Fst ifst2,
 *                           int32 npath=1,
 *                           float delta=fst.kDelta,             # <<<<<<<<<<<<<<
 *                           time_t seed=0,
 *                           select=b"uniform",
 */
  __pyx_k__79 = fst::kDelta;

  /* "pywrapfst.pyx":3746
 *                           time_t seed=0,
 *                           select=b"uniform",
 *                           int32 max_length=INT32_MAX) except *:             # <<<<<<<<<<<<<<
 *   """
 *   randequivalent(ifst1, ifst2, npath=1, delta=0.0009765625, seed=0,
 */
  __pyx_k__80 = INT32_MAX;

  /* "pywrapfst.pyx":3743
 *                           _Fst ifst2,
 *                           int32 npath=1,
 *                           float delta=fst.kDelta,             # <<<<<<<<<<<<<<
 *                           time_t seed=0,
 *                           select=b"uniform",
 */
  __pyx_k__79 = fst::kDelta;

  /* "pywrapfst.pyx":3746
 *                           time_t seed=0,
 *                           select=b"uniform",
 *                           int32 max_length=INT32_MAX) except *:             # <<<<<<<<<<<<<<
 *   """
 *   randequivalent(ifst1, ifst2, npath=1, delta=0.0009765625, seed=0,
 */
  __pyx_k__80 = INT32_MAX;

  /* "pywrapfst.pyx":3790
 *                           time_t seed=0,
 *                           select=b"uniform",
 *                           int32 max_length=INT32_MAX,             # <<<<<<<<<<<<<<
 *                           bool weighted=False,
 *                           bool remove_total_weight=False):
 */
  __pyx_k__81 = INT32_MAX;

  /* "pywrapfst.pyx":3786
 * 
 * 
 * cpdef _MutableFst randgen(_Fst ifst,             # <<<<<<<<<<<<<<
 *                           int32 npath=1,
 *                           time_t seed=0,
 */
  __pyx_k__81 = INT32_MAX;

  /* "pywrapfst.pyx":3928
 * 
 * cdef vector[fst.WeightClass] *_shortestdistance(_Fst ifst,
 *                                                 float delta=fst.kShortestDelta,             # <<<<<<<<<<<<<<
 *                                                 int64 nstate=fst.kNoStateId,
 *                                                 queue_type=b"auto",
 */
  __pyx_k__82 = fst::kShortestDelta;

  /* "pywrapfst.pyx":3929
 * cdef vector[fst.WeightClass] *_shortestdistance(_Fst ifst,
 *                                                 float delta=fst.kShortestDelta,
 *                                                 int64 nstate=fst.kNoStateId,             # <<<<<<<<<<<<<<
 *                                                 queue_type=b"auto",
 *                                                 bool reverse=False) except *:
 */
  __pyx_k__83 = fst::kNoStateId;

  /* "pywrapfst.pyx":3950
 * 
 * def shortestdistance(_Fst ifst,
 *                      float delta=fst.kShortestDelta,             # <<<<<<<<<<<<<<
 *                      int64 nstate=fst.kNoStateId,
 *                      queue_type=b"auto",
 */
  __pyx_k__84 = fst::kShortestDelta;

  /* "pywrapfst.pyx":3951
 * def shortestdistance(_Fst ifst,
 *                      float delta=fst.kShortestDelta,
 *                      int64 nstate=fst.kNoStateId,             # <<<<<<<<<<<<<<
 *                      queue_type=b"auto",
 *                      bool reverse=False):
 */
  __pyx_k__85 = fst::kNoStateId;

  /* "pywrapfst.pyx":3949
 * 
 * 
 * def shortestdistance(_Fst ifst,             # <<<<<<<<<<<<<<
 *                      float delta=fst.kShortestDelta,
 *                      int64 nstate=fst.kNoStateId,
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_9pywrapfst_51shortestdistance, NULL, __pyx_n_s_pywrapfst_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3949, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_shortestdistance, __pyx_t_1) < 0) __PYX_ERR(0, 3949, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pywrapfst.pyx":3987
 * 
 * cpdef _MutableFst shortestpath(_Fst ifst,
 *                                float delta=fst.kShortestDelta,             # <<<<<<<<<<<<<<
 *                                int32 nshortest=1,
 *                                int64 nstate=fst.kNoStateId,
 */
  __pyx_k__86 = fst::kShortestDelta;

  /* "pywrapfst.pyx":3989
 *                                float delta=fst.kShortestDelta,
 *                                int32 nshortest=1,
 *                                int64 nstate=fst.kNoStateId,             # <<<<<<<<<<<<<<
 *                                queue_type=b"auto",
 *                                bool unique=False,
 */
  __pyx_k__87 = fst::kNoStateId;

  /* "pywrapfst.pyx":3987
 * 
 * cpdef _MutableFst shortestpath(_Fst ifst,
 *                                float delta=fst.kShortestDelta,             # <<<<<<<<<<<<<<
 *                                int32 nshortest=1,
 *                                int64 nstate=fst.kNoStateId,
 */
  __pyx_k__86 = fst::kShortestDelta;

  /* "pywrapfst.pyx":3989
 *                                float delta=fst.kShortestDelta,
 *                                int32 nshortest=1,
 *                                int64 nstate=fst.kNoStateId,             # <<<<<<<<<<<<<<
 *                                queue_type=b"auto",
 *                                bool unique=False,
 */
  __pyx_k__87 = fst::kNoStateId;

  /* "pywrapfst.pyx":4140
 * 
 *   def __cinit__(self,
 *                 string fst_type=b"vector",             # <<<<<<<<<<<<<<
 *                 string arc_type=b"standard",
 *                 SymbolTable isymbols=None,
 */
  __pyx_t_6 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_vector); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4140, __pyx_L1_error)
  __pyx_k__88 = __pyx_t_6;

  /* "pywrapfst.pyx":4141
 *   def __cinit__(self,
 *                 string fst_type=b"vector",
 *                 string arc_type=b"standard",             # <<<<<<<<<<<<<<
 *                 SymbolTable isymbols=None,
 *                 SymbolTable osymbols=None,
 */
  __pyx_t_6 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_standard); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4141, __pyx_L1_error)
  __pyx_k__89 = __pyx_t_6;

  /* "pywrapfst.pyx":4239
 * 
 *   @classmethod
 *   def open(cls, *filenames):             # <<<<<<<<<<<<<<
 *     """
 *     FarReader.open(*filenames)
 */
  __pyx_t_1 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_9pywrapfst_FarReader, __pyx_n_s_open); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4239, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "pywrapfst.pyx":4238
 *     return "<{} FarReader at 0x{:x}>".format(self.far_type(), id(self))
 * 
 *   @classmethod             # <<<<<<<<<<<<<<
 *   def open(cls, *filenames):
 *     """
 */
  __pyx_t_2 = __Pyx_Method_ClassMethod(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4238, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_9pywrapfst_FarReader->tp_dict, __pyx_n_s_open, __pyx_t_2) < 0) __PYX_ERR(0, 4239, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_9pywrapfst_FarReader);

  /* "pywrapfst.pyx":4388
 * 
 *   @classmethod
 *   def create(cls, filename, arc_type=b"standard", far_type=b"default"):             # <<<<<<<<<<<<<<
 *     """
 *     FarWriter.
 */
  __pyx_t_2 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_9pywrapfst_FarWriter, __pyx_n_s_create); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4388, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "pywrapfst.pyx":4387
 *     return "<{} FarWriter at 0x{:x}>".format(self.far_type(), id(self))
 * 
 *   @classmethod             # <<<<<<<<<<<<<<
 *   def create(cls, filename, arc_type=b"standard", far_type=b"default"):
 *     """
 */
  __pyx_t_1 = __Pyx_Method_ClassMethod(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4387, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_9pywrapfst_FarWriter->tp_dict, __pyx_n_s_create, __pyx_t_1) < 0) __PYX_ERR(0, 4388, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_9pywrapfst_FarWriter);

  /* "pywrapfst.pyx":4487
 * 
 * 
 * _fst_error_fatal_old = fst.FLAGS_fst_error_fatal             # <<<<<<<<<<<<<<
 * fst.FLAGS_fst_error_fatal = False
 * 
 */
  __pyx_t_1 = __Pyx_PyBool_FromLong(FLAGS_fst_error_fatal); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4487, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_fst_error_fatal_old, __pyx_t_1) < 0) __PYX_ERR(0, 4487, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pywrapfst.pyx":4488
 * 
 * _fst_error_fatal_old = fst.FLAGS_fst_error_fatal
 * fst.FLAGS_fst_error_fatal = False             # <<<<<<<<<<<<<<
 * 
 * 
 */
  FLAGS_fst_error_fatal = 0;

  /* "pywrapfst.pyx":4491
 * 
 * 
 * @atexit.register             # <<<<<<<<<<<<<<
 * def _reset_fst_error_fatal():
 *   fst.FLAGS_fst_error_fatal = _fst_error_fatal_old
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_atexit); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4491, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_register); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4491, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pywrapfst.pyx":4492
 * 
 * @atexit.register
 * def _reset_fst_error_fatal():             # <<<<<<<<<<<<<<
 *   fst.FLAGS_fst_error_fatal = _fst_error_fatal_old
 * 
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_9pywrapfst_59_reset_fst_error_fatal, NULL, __pyx_n_s_pywrapfst_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4492, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4491, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_2};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4491, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_2};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4491, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else
    #endif
    {
      __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4491, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL;
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4491, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_reset_fst_error_fatal, __pyx_t_1) < 0) __PYX_ERR(0, 4492, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pywrapfst.pyx":1
 * #cython: nonecheck=True             # <<<<<<<<<<<<<<
 * # Licensed under the Apache License, Version 2.0 (the "License");
 * # you may not use this file except in compliance with the License.
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test_2, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "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);
  __Pyx_XDECREF(__pyx_t_7);
  if (__pyx_m) {
    if (__pyx_d) {
      __Pyx_AddTraceback("init pywrapfst", 0, __pyx_lineno, __pyx_filename);
    }
    Py_DECREF(__pyx_m); __pyx_m = 0;
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init 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((char *)modname);
    if (!m) goto end;
    p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
    if (!p) goto end;
    r = PyLong_AsVoidPtr(p);
end:
    Py_XDECREF(p);
    Py_XDECREF(m);
    return (__Pyx_RefNannyAPIStruct *)r;
}
#endif

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

/* PyCFunctionFastCall */
#if CYTHON_FAST_PYCCALL
static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
    PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
    PyCFunction meth = PyCFunction_GET_FUNCTION(func);
    PyObject *self = PyCFunction_GET_SELF(func);
    int flags = PyCFunction_GET_FLAGS(func);
    assert(PyCFunction_Check(func));
    assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS)));
    assert(nargs >= 0);
    assert(nargs == 0 || args != NULL);
    /* _PyCFunction_FastCallDict() must not be called with an exception set,
       because it may clear it (directly or indirectly) and so the
       caller loses its exception */
    assert(!PyErr_Occurred());
    if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
        return (*((__Pyx_PyCFunctionFastWithKeywords)meth)) (self, args, nargs, NULL);
    } else {
        return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs);
    }
}
#endif

/* PyFunctionFastCall */
#if CYTHON_FAST_PYCALL
#include "frameobject.h"
static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
                                               PyObject *globals) {
    PyFrameObject *f;
    PyThreadState *tstate = __Pyx_PyThreadState_Current;
    PyObject **fastlocals;
    Py_ssize_t i;
    PyObject *result;
    assert(globals != NULL);
    /* XXX Perhaps we should create a specialized
       PyFrame_New() that doesn't take locals, but does
       take builtins without sanity checking them.
       */
    assert(tstate != NULL);
    f = PyFrame_New(tstate, co, globals, NULL);
    if (f == NULL) {
        return NULL;
    }
    fastlocals = f->f_localsplus;
    for (i = 0; i < na; i++) {
        Py_INCREF(*args);
        fastlocals[i] = *args++;
    }
    result = PyEval_EvalFrameEx(f,0);
    ++tstate->recursion_depth;
    Py_DECREF(f);
    --tstate->recursion_depth;
    return result;
}
#if 1 || PY_VERSION_HEX < 0x030600B1
static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) {
    PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
    PyObject *globals = PyFunction_GET_GLOBALS(func);
    PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
    PyObject *closure;
#if PY_MAJOR_VERSION >= 3
    PyObject *kwdefs;
#endif
    PyObject *kwtuple, **k;
    PyObject **d;
    Py_ssize_t nd;
    Py_ssize_t nk;
    PyObject *result;
    assert(kwargs == NULL || PyDict_Check(kwargs));
    nk = kwargs ? PyDict_Size(kwargs) : 0;
    if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
        return NULL;
    }
    if (
#if PY_MAJOR_VERSION >= 3
            co->co_kwonlyargcount == 0 &&
#endif
            likely(kwargs == NULL || nk == 0) &&
            co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
        if (argdefs == NULL && co->co_argcount == nargs) {
            result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
            goto done;
        }
        else if (nargs == 0 && argdefs != NULL
                 && co->co_argcount == Py_SIZE(argdefs)) {
            /* function called with no arguments, but all parameters have
               a default value: use default values as arguments .*/
            args = &PyTuple_GET_ITEM(argdefs, 0);
            result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
            goto done;
        }
    }
    if (kwargs != NULL) {
        Py_ssize_t pos, i;
        kwtuple = PyTuple_New(2 * nk);
        if (kwtuple == NULL) {
            result = NULL;
            goto done;
        }
        k = &PyTuple_GET_ITEM(kwtuple, 0);
        pos = i = 0;
        while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
            Py_INCREF(k[i]);
            Py_INCREF(k[i+1]);
            i += 2;
        }
        nk = i / 2;
    }
    else {
        kwtuple = NULL;
        k = NULL;
    }
    closure = PyFunction_GET_CLOSURE(func);
#if PY_MAJOR_VERSION >= 3
    kwdefs = PyFunction_GET_KW_DEFAULTS(func);
#endif
    if (argdefs != NULL) {
        d = &PyTuple_GET_ITEM(argdefs, 0);
        nd = Py_SIZE(argdefs);
    }
    else {
        d = NULL;
        nd = 0;
    }
#if PY_MAJOR_VERSION >= 3
    result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
                               args, nargs,
                               k, (int)nk,
                               d, (int)nd, kwdefs, closure);
#else
    result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
                               args, nargs,
                               k, (int)nk,
                               d, (int)nd, closure);
#endif
    Py_XDECREF(kwtuple);
done:
    Py_LeaveRecursiveCall();
    return result;
}
#endif
#endif

/* PyObjectCall */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    PyObject *result;
    ternaryfunc call = func->ob_type->tp_call;
    if (unlikely(!call))
        return PyObject_Call(func, arg, kw);
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
        return NULL;
    result = (*call)(func, arg, kw);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

/* PyObjectCallMethO */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
    PyObject *self, *result;
    PyCFunction cfunc;
    cfunc = PyCFunction_GET_FUNCTION(func);
    self = PyCFunction_GET_SELF(func);
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
        return NULL;
    result = cfunc(self, arg);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

/* PyObjectCallOneArg */
#if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject *result;
    PyObject *args = PyTuple_New(1);
    if (unlikely(!args)) return NULL;
    Py_INCREF(arg);
    PyTuple_SET_ITEM(args, 0, arg);
    result = __Pyx_PyObject_Call(func, args, NULL);
    Py_DECREF(args);
    return result;
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
#if CYTHON_FAST_PYCALL
    if (PyFunction_Check(func)) {
        return __Pyx_PyFunction_FastCall(func, &arg, 1);
    }
#endif
    if (likely(PyCFunction_Check(func))) {
        if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
            return __Pyx_PyObject_CallMethO(func, arg);
#if CYTHON_FAST_PYCCALL
        } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
            return __Pyx_PyCFunction_FastCall(func, &arg, 1);
#endif
        }
    }
    return __Pyx__PyObject_CallOneArg(func, arg);
}
#else
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject *result;
    PyObject *args = PyTuple_Pack(1, arg);
    if (unlikely(!args)) return NULL;
    result = __Pyx_PyObject_Call(func, args, NULL);
    Py_DECREF(args);
    return result;
}
#endif

/* GetModuleGlobalName */
static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
    PyObject *result;
#if !CYTHON_AVOID_BORROWED_REFS
    result = PyDict_GetItem(__pyx_d, name);
    if (likely(result)) {
        Py_INCREF(result);
    } else {
#else
    result = PyObject_GetItem(__pyx_d, name);
    if (!result) {
        PyErr_Clear();
#endif
        result = __Pyx_GetBuiltinName(name);
    }
    return result;
}

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

/* RaiseArgTupleInvalid */
  static void __Pyx_RaiseArgtupleInvalid(
    const char* func_name,
    int exact,
    Py_ssize_t num_min,
    Py_ssize_t num_max,
    Py_ssize_t num_found)
{
    Py_ssize_t num_expected;
    const char *more_or_less;
    if (num_found < num_min) {
        num_expected = num_min;
        more_or_less = "at least";
    } else {
        num_expected = num_max;
        more_or_less = "at most";
    }
    if (exact) {
        more_or_less = "exactly";
    }
    PyErr_Format(PyExc_TypeError,
                 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
                 func_name, more_or_less, num_expected,
                 (num_expected == 1) ? "" : "s", num_found);
}

/* RaiseDoubleKeywords */
  static void __Pyx_RaiseDoubleKeywordsError(
    const char* func_name,
    PyObject* kw_name)
{
    PyErr_Format(PyExc_TypeError,
        #if PY_MAJOR_VERSION >= 3
        "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
        #else
        "%s() got multiple values for keyword argument '%s'", func_name,
        PyString_AsString(kw_name));
        #endif
}

/* ParseKeywords */
  static int __Pyx_ParseOptionalKeywords(
    PyObject *kwds,
    PyObject **argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    const char* function_name)
{
    PyObject *key = 0, *value = 0;
    Py_ssize_t pos = 0;
    PyObject*** name;
    PyObject*** first_kw_arg = argnames + num_pos_args;
    while (PyDict_Next(kwds, &pos, &key, &value)) {
        name = first_kw_arg;
        while (*name && (**name != key)) name++;
        if (*name) {
            values[name-argnames] = value;
            continue;
        }
        name = first_kw_arg;
        #if PY_MAJOR_VERSION < 3
        if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
            while (*name) {
                if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
                        && _PyString_Eq(**name, key)) {
                    values[name-argnames] = value;
                    break;
                }
                name++;
            }
            if (*name) continue;
            else {
                PyObject*** argname = argnames;
                while (argname != first_kw_arg) {
                    if ((**argname == key) || (
                            (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
                             && _PyString_Eq(**argname, key))) {
                        goto arg_passed_twice;
                    }
                    argname++;
                }
            }
        } else
        #endif
        if (likely(PyUnicode_Check(key))) {
            while (*name) {
                int cmp = (**name == key) ? 0 :
                #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                    (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
                #endif
                    PyUnicode_Compare(**name, key);
                if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
                if (cmp == 0) {
                    values[name-argnames] = value;
                    break;
                }
                name++;
            }
            if (*name) continue;
            else {
                PyObject*** argname = argnames;
                while (argname != first_kw_arg) {
                    int cmp = (**argname == key) ? 0 :
                    #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                        (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
                    #endif
                        PyUnicode_Compare(**argname, key);
                    if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
                    if (cmp == 0) goto arg_passed_twice;
                    argname++;
                }
            }
        } else
            goto invalid_keyword_type;
        if (kwds2) {
            if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
        } else {
            goto invalid_keyword;
        }
    }
    return 0;
arg_passed_twice:
    __Pyx_RaiseDoubleKeywordsError(function_name, key);
    goto bad;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%.200s() keywords must be strings", function_name);
    goto bad;
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
    #if PY_MAJOR_VERSION < 3
        "%.200s() got an unexpected keyword argument '%.200s'",
        function_name, PyString_AsString(key));
    #else
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
bad:
    return -1;
}

/* PyObjectCallNoArg */
  #if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
#if CYTHON_FAST_PYCALL
    if (PyFunction_Check(func)) {
        return __Pyx_PyFunction_FastCall(func, NULL, 0);
    }
#endif
#ifdef __Pyx_CyFunction_USED
    if (likely(PyCFunction_Check(func) || __Pyx_TypeCheck(func, __pyx_CyFunctionType))) {
#else
    if (likely(PyCFunction_Check(func))) {
#endif
        if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
            return __Pyx_PyObject_CallMethO(func, NULL);
        }
    }
    return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
}
#endif

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

/* SaveResetException */
    #if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
    #if PY_VERSION_HEX >= 0x030700A2
    *type = tstate->exc_state.exc_type;
    *value = tstate->exc_state.exc_value;
    *tb = tstate->exc_state.exc_traceback;
    #else
    *type = tstate->exc_type;
    *value = tstate->exc_value;
    *tb = tstate->exc_traceback;
    #endif
    Py_XINCREF(*type);
    Py_XINCREF(*value);
    Py_XINCREF(*tb);
}
static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    #if PY_VERSION_HEX >= 0x030700A2
    tmp_type = tstate->exc_state.exc_type;
    tmp_value = tstate->exc_state.exc_value;
    tmp_tb = tstate->exc_state.exc_traceback;
    tstate->exc_state.exc_type = type;
    tstate->exc_state.exc_value = value;
    tstate->exc_state.exc_traceback = tb;
    #else
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = type;
    tstate->exc_value = value;
    tstate->exc_traceback = tb;
    #endif
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
}
#endif

/* PyErrExceptionMatches */
    #if CYTHON_FAST_THREAD_STATE
static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
    Py_ssize_t i, n;
    n = PyTuple_GET_SIZE(tuple);
#if PY_MAJOR_VERSION >= 3
    for (i=0; i<n; i++) {
        if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
    }
#endif
    for (i=0; i<n; i++) {
        if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
    }
    return 0;
}
static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
    PyObject *exc_type = tstate->curexc_type;
    if (exc_type == err) return 1;
    if (unlikely(!exc_type)) return 0;
    if (unlikely(PyTuple_Check(err)))
        return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
    return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
}
#endif

/* GetException */
    #if CYTHON_FAST_THREAD_STATE
static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
#else
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
#endif
    PyObject *local_type, *local_value, *local_tb;
#if CYTHON_FAST_THREAD_STATE
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    local_type = tstate->curexc_type;
    local_value = tstate->curexc_value;
    local_tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
#else
    PyErr_Fetch(&local_type, &local_value, &local_tb);
#endif
    PyErr_NormalizeException(&local_type, &local_value, &local_tb);
#if CYTHON_FAST_THREAD_STATE
    if (unlikely(tstate->curexc_type))
#else
    if (unlikely(PyErr_Occurred()))
#endif
        goto bad;
    #if PY_MAJOR_VERSION >= 3
    if (local_tb) {
        if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
            goto bad;
    }
    #endif
    Py_XINCREF(local_tb);
    Py_XINCREF(local_type);
    Py_XINCREF(local_value);
    *type = local_type;
    *value = local_value;
    *tb = local_tb;
#if CYTHON_FAST_THREAD_STATE
    #if PY_VERSION_HEX >= 0x030700A2
    tmp_type = tstate->exc_state.exc_type;
    tmp_value = tstate->exc_state.exc_value;
    tmp_tb = tstate->exc_state.exc_traceback;
    tstate->exc_state.exc_type = local_type;
    tstate->exc_state.exc_value = local_value;
    tstate->exc_state.exc_traceback = local_tb;
    #else
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = local_type;
    tstate->exc_value = local_value;
    tstate->exc_traceback = local_tb;
    #endif
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
#else
    PyErr_SetExcInfo(local_type, local_value, local_tb);
#endif
    return 0;
bad:
    *type = 0;
    *value = 0;
    *tb = 0;
    Py_XDECREF(local_type);
    Py_XDECREF(local_value);
    Py_XDECREF(local_tb);
    return -1;
}

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

/* IterNext */
      static PyObject *__Pyx_PyIter_Next2Default(PyObject* defval) {
    PyObject* exc_type;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    exc_type = __Pyx_PyErr_Occurred();
    if (unlikely(exc_type)) {
        if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))
            return NULL;
        if (defval) {
            __Pyx_PyErr_Clear();
            Py_INCREF(defval);
        }
        return defval;
    }
    if (defval) {
        Py_INCREF(defval);
        return defval;
    }
    __Pyx_PyErr_SetNone(PyExc_StopIteration);
    return NULL;
}
static void __Pyx_PyIter_Next_ErrorNoIterator(PyObject *iterator) {
    PyErr_Format(PyExc_TypeError,
        "%.200s object is not an iterator", Py_TYPE(iterator)->tp_name);
}
static CYTHON_INLINE PyObject *__Pyx_PyIter_Next2(PyObject* iterator, PyObject* defval) {
    PyObject* next;
    iternextfunc iternext = Py_TYPE(iterator)->tp_iternext;
    if (likely(iternext)) {
#if CYTHON_USE_TYPE_SLOTS
        next = iternext(iterator);
        if (likely(next))
            return next;
        #if PY_VERSION_HEX >= 0x02070000
        if (unlikely(iternext == &_PyObject_NextNotImplemented))
            return NULL;
        #endif
#else
        next = PyIter_Next(iterator);
        if (likely(next))
            return next;
#endif
    } else if (CYTHON_USE_TYPE_SLOTS || !PyIter_Check(iterator)) {
        __Pyx_PyIter_Next_ErrorNoIterator(iterator);
        return NULL;
    }
    return __Pyx_PyIter_Next2Default(defval);
}

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

/* 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 GOOD;
#else
    if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto GOOD;
#endif
#if CYTHON_USE_PYTYPE_LOOKUP
    object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto BAD;
#else
    object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto BAD;
#endif
    reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto 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 BAD;
#else
        object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto BAD;
#endif
        reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto BAD;
        if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
            reduce_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_cython); if (unlikely(!reduce_cython)) goto BAD;
            ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto BAD;
            ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto 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_GetAttrStr(type_obj, __pyx_n_s_setstate_cython); if (unlikely(!setstate_cython)) goto BAD;
                ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto BAD;
                ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto BAD;
            }
            PyType_Modified((PyTypeObject*)type_obj);
        }
    }
    goto GOOD;
BAD:
    if (!PyErr_Occurred())
        PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
    ret = -1;
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 (strchr(__Pyx_MODULE_NAME, '.')) {
                module = PyImport_ImportModuleLevelObject(
                    name, global_dict, empty_dict, list, 1);
                if (!module) {
                    if (!PyErr_ExceptionMatches(PyExc_ImportError))
                        goto bad;
                    PyErr_Clear();
                }
            }
            level = 0;
        }
        #endif
        if (!module) {
            #if PY_MAJOR_VERSION < 3
            PyObject *py_level = PyInt_FromLong(level);
            if (!py_level)
                goto bad;
            module = PyObject_CallFunctionObjArgs(py_import,
                name, global_dict, empty_dict, list, py_level, NULL);
            Py_DECREF(py_level);
            #else
            module = PyImport_ImportModuleLevelObject(
                name, global_dict, empty_dict, list, level);
            #endif
        }
    }
bad:
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(py_import);
    #endif
    Py_XDECREF(empty_list);
    Py_XDECREF(empty_dict);
    return module;
}

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

/* GetNameInClass */
      static PyObject *__Pyx_GetGlobalNameAfterAttributeLookup(PyObject *name) {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
        return NULL;
    __Pyx_PyErr_Clear();
    return __Pyx_GetModuleGlobalName(name);
}
static PyObject *__Pyx_GetNameInClass(PyObject *nmspace, PyObject *name) {
    PyObject *result;
    result = __Pyx_PyObject_GetAttrStr(nmspace, name);
    if (!result) {
        result = __Pyx_GetGlobalNameAfterAttributeLookup(name);
    }
    return result;
}

/* ClassMethod */
      static PyObject* __Pyx_Method_ClassMethod(PyObject *method) {
#if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM <= 0x05080000
    if (PyObject_TypeCheck(method, &PyWrapperDescr_Type)) {
        return PyClassMethod_New(method);
    }
#else
#if CYTHON_COMPILING_IN_PYSTON || CYTHON_COMPILING_IN_PYPY
    if (PyMethodDescr_Check(method)) {
#else
    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);
    }
    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 if (PyCFunction_Check(method)) {
        return PyClassMethod_New(method);
    }
#ifdef __Pyx_CyFunction_USED
    else if (__Pyx_TypeCheck(method, __pyx_CyFunctionType)) {
        return PyClassMethod_New(method);
    }
#endif
    PyErr_SetString(PyExc_TypeError,
                   "Class-level classmethod() can only be called on "
                   "a method_descriptor or instance method.");
    return NULL;
}

/* FetchCommonType */
        static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
    PyObject* fake_module;
    PyTypeObject* cached_type = NULL;
    fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
    if (!fake_module) return NULL;
    Py_INCREF(fake_module);
    cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
    if (cached_type) {
        if (!PyType_Check((PyObject*)cached_type)) {
            PyErr_Format(PyExc_TypeError,
                "Shared Cython type %.200s is not a type object",
                type->tp_name);
            goto bad;
        }
        if (cached_type->tp_basicsize != type->tp_basicsize) {
            PyErr_Format(PyExc_TypeError,
                "Shared Cython type %.200s has the wrong size, try recompiling",
                type->tp_name);
            goto bad;
        }
    } else {
        if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
        PyErr_Clear();
        if (PyType_Ready(type) < 0) goto bad;
        if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
            goto bad;
        Py_INCREF(type);
        cached_type = type;
    }
done:
    Py_DECREF(fake_module);
    return cached_type;
bad:
    Py_XDECREF(cached_type);
    cached_type = NULL;
    goto done;
}

/* CythonFunction */
        static PyObject *
__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
{
    if (unlikely(op->func_doc == NULL)) {
        if (op->func.m_ml->ml_doc) {
#if PY_MAJOR_VERSION >= 3
            op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
#else
            op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
#endif
            if (unlikely(op->func_doc == NULL))
                return NULL;
        } else {
            Py_INCREF(Py_None);
            return Py_None;
        }
    }
    Py_INCREF(op->func_doc);
    return op->func_doc;
}
static int
__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value)
{
    PyObject *tmp = op->func_doc;
    if (value == NULL) {
        value = Py_None;
    }
    Py_INCREF(value);
    op->func_doc = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op)
{
    if (unlikely(op->func_name == NULL)) {
#if PY_MAJOR_VERSION >= 3
        op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
#else
        op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
#endif
        if (unlikely(op->func_name == NULL))
            return NULL;
    }
    Py_INCREF(op->func_name);
    return op->func_name;
}
static int
__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value)
{
    PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value))) {
#else
    if (unlikely(value == NULL || !PyString_Check(value))) {
#endif
        PyErr_SetString(PyExc_TypeError,
                        "__name__ must be set to a string object");
        return -1;
    }
    tmp = op->func_name;
    Py_INCREF(value);
    op->func_name = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op)
{
    Py_INCREF(op->func_qualname);
    return op->func_qualname;
}
static int
__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value)
{
    PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value))) {
#else
    if (unlikely(value == NULL || !PyString_Check(value))) {
#endif
        PyErr_SetString(PyExc_TypeError,
                        "__qualname__ must be set to a string object");
        return -1;
    }
    tmp = op->func_qualname;
    Py_INCREF(value);
    op->func_qualname = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure)
{
    PyObject *self;
    self = m->func_closure;
    if (self == NULL)
        self = Py_None;
    Py_INCREF(self);
    return self;
}
static PyObject *
__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op)
{
    if (unlikely(op->func_dict == NULL)) {
        op->func_dict = PyDict_New();
        if (unlikely(op->func_dict == NULL))
            return NULL;
    }
    Py_INCREF(op->func_dict);
    return op->func_dict;
}
static int
__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value)
{
    PyObject *tmp;
    if (unlikely(value == NULL)) {
        PyErr_SetString(PyExc_TypeError,
               "function's dictionary may not be deleted");
        return -1;
    }
    if (unlikely(!PyDict_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
               "setting function's dictionary to a non-dict");
        return -1;
    }
    tmp = op->func_dict;
    Py_INCREF(value);
    op->func_dict = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op)
{
    Py_INCREF(op->func_globals);
    return op->func_globals;
}
static PyObject *
__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op)
{
    Py_INCREF(Py_None);
    return Py_None;
}
static PyObject *
__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op)
{
    PyObject* result = (op->func_code) ? op->func_code : Py_None;
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
    int result = 0;
    PyObject *res = op->defaults_getter((PyObject *) op);
    if (unlikely(!res))
        return -1;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
    Py_INCREF(op->defaults_tuple);
    op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
    Py_INCREF(op->defaults_kwdict);
    #else
    op->defaults_tuple = PySequence_ITEM(res, 0);
    if (unlikely(!op->defaults_tuple)) result = -1;
    else {
        op->defaults_kwdict = PySequence_ITEM(res, 1);
        if (unlikely(!op->defaults_kwdict)) result = -1;
    }
    #endif
    Py_DECREF(res);
    return result;
}
static int
__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value) {
    PyObject* tmp;
    if (!value) {
        value = Py_None;
    } else if (value != Py_None && !PyTuple_Check(value)) {
        PyErr_SetString(PyExc_TypeError,
                        "__defaults__ must be set to a tuple object");
        return -1;
    }
    Py_INCREF(value);
    tmp = op->defaults_tuple;
    op->defaults_tuple = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op) {
    PyObject* result = op->defaults_tuple;
    if (unlikely(!result)) {
        if (op->defaults_getter) {
            if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
            result = op->defaults_tuple;
        } else {
            result = Py_None;
        }
    }
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value) {
    PyObject* tmp;
    if (!value) {
        value = Py_None;
    } else if (value != Py_None && !PyDict_Check(value)) {
        PyErr_SetString(PyExc_TypeError,
                        "__kwdefaults__ must be set to a dict object");
        return -1;
    }
    Py_INCREF(value);
    tmp = op->defaults_kwdict;
    op->defaults_kwdict = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op) {
    PyObject* result = op->defaults_kwdict;
    if (unlikely(!result)) {
        if (op->defaults_getter) {
            if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
            result = op->defaults_kwdict;
        } else {
            result = Py_None;
        }
    }
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value) {
    PyObject* tmp;
    if (!value || value == Py_None) {
        value = NULL;
    } else if (!PyDict_Check(value)) {
        PyErr_SetString(PyExc_TypeError,
                        "__annotations__ must be set to a dict object");
        return -1;
    }
    Py_XINCREF(value);
    tmp = op->func_annotations;
    op->func_annotations = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op) {
    PyObject* result = op->func_annotations;
    if (unlikely(!result)) {
        result = PyDict_New();
        if (unlikely(!result)) return NULL;
        op->func_annotations = result;
    }
    Py_INCREF(result);
    return result;
}
static PyGetSetDef __pyx_CyFunction_getsets[] = {
    {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
    {(char *) "__doc__",  (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
    {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
    {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
    {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
    {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0},
    {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
    {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
    {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
    {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
    {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
    {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
    {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
    {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
    {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
    {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
    {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
    {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
    {0, 0, 0, 0, 0}
};
static PyMemberDef __pyx_CyFunction_members[] = {
    {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0},
    {0, 0, 0,  0, 0}
};
static PyObject *
__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
{
#if PY_MAJOR_VERSION >= 3
    return PyUnicode_FromString(m->func.m_ml->ml_name);
#else
    return PyString_FromString(m->func.m_ml->ml_name);
#endif
}
static PyMethodDef __pyx_CyFunction_methods[] = {
    {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
    {0, 0, 0, 0}
};
#if PY_VERSION_HEX < 0x030500A0
#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
#else
#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist)
#endif
static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname,
                                      PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
    __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type);
    if (op == NULL)
        return NULL;
    op->flags = flags;
    __Pyx_CyFunction_weakreflist(op) = NULL;
    op->func.m_ml = ml;
    op->func.m_self = (PyObject *) op;
    Py_XINCREF(closure);
    op->func_closure = closure;
    Py_XINCREF(module);
    op->func.m_module = module;
    op->func_dict = NULL;
    op->func_name = NULL;
    Py_INCREF(qualname);
    op->func_qualname = qualname;
    op->func_doc = NULL;
    op->func_classobj = NULL;
    op->func_globals = globals;
    Py_INCREF(op->func_globals);
    Py_XINCREF(code);
    op->func_code = code;
    op->defaults_pyobjects = 0;
    op->defaults = NULL;
    op->defaults_tuple = NULL;
    op->defaults_kwdict = NULL;
    op->defaults_getter = NULL;
    op->func_annotations = NULL;
    PyObject_GC_Track(op);
    return (PyObject *) op;
}
static int
__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
{
    Py_CLEAR(m->func_closure);
    Py_CLEAR(m->func.m_module);
    Py_CLEAR(m->func_dict);
    Py_CLEAR(m->func_name);
    Py_CLEAR(m->func_qualname);
    Py_CLEAR(m->func_doc);
    Py_CLEAR(m->func_globals);
    Py_CLEAR(m->func_code);
    Py_CLEAR(m->func_classobj);
    Py_CLEAR(m->defaults_tuple);
    Py_CLEAR(m->defaults_kwdict);
    Py_CLEAR(m->func_annotations);
    if (m->defaults) {
        PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
        int i;
        for (i = 0; i < m->defaults_pyobjects; i++)
            Py_XDECREF(pydefaults[i]);
        PyObject_Free(m->defaults);
        m->defaults = NULL;
    }
    return 0;
}
static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
{
    if (__Pyx_CyFunction_weakreflist(m) != NULL)
        PyObject_ClearWeakRefs((PyObject *) m);
    __Pyx_CyFunction_clear(m);
    PyObject_GC_Del(m);
}
static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
{
    PyObject_GC_UnTrack(m);
    __Pyx__CyFunction_dealloc(m);
}
static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
{
    Py_VISIT(m->func_closure);
    Py_VISIT(m->func.m_module);
    Py_VISIT(m->func_dict);
    Py_VISIT(m->func_name);
    Py_VISIT(m->func_qualname);
    Py_VISIT(m->func_doc);
    Py_VISIT(m->func_globals);
    Py_VISIT(m->func_code);
    Py_VISIT(m->func_classobj);
    Py_VISIT(m->defaults_tuple);
    Py_VISIT(m->defaults_kwdict);
    if (m->defaults) {
        PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
        int i;
        for (i = 0; i < m->defaults_pyobjects; i++)
            Py_VISIT(pydefaults[i]);
    }
    return 0;
}
static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
{
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
        Py_INCREF(func);
        return func;
    }
    if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
        if (type == NULL)
            type = (PyObject *)(Py_TYPE(obj));
        return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type)));
    }
    if (obj == Py_None)
        obj = NULL;
    return __Pyx_PyMethod_New(func, obj, type);
}
static PyObject*
__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
{
#if PY_MAJOR_VERSION >= 3
    return PyUnicode_FromFormat("<cyfunction %U at %p>",
                                op->func_qualname, (void *)op);
#else
    return PyString_FromFormat("<cyfunction %s at %p>",
                               PyString_AsString(op->func_qualname), (void *)op);
#endif
}
static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
    PyCFunctionObject* f = (PyCFunctionObject*)func;
    PyCFunction meth = f->m_ml->ml_meth;
    Py_ssize_t size;
    switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
    case METH_VARARGS:
        if (likely(kw == NULL || PyDict_Size(kw) == 0))
            return (*meth)(self, arg);
        break;
    case METH_VARARGS | METH_KEYWORDS:
        return (*(PyCFunctionWithKeywords)meth)(self, arg, kw);
    case METH_NOARGS:
        if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
            size = PyTuple_GET_SIZE(arg);
            if (likely(size == 0))
                return (*meth)(self, NULL);
            PyErr_Format(PyExc_TypeError,
                "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
                f->m_ml->ml_name, size);
            return NULL;
        }
        break;
    case METH_O:
        if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
            size = PyTuple_GET_SIZE(arg);
            if (likely(size == 1)) {
                PyObject *result, *arg0;
                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                arg0 = PyTuple_GET_ITEM(arg, 0);
                #else
                arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
                #endif
                result = (*meth)(self, arg0);
                #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
                Py_DECREF(arg0);
                #endif
                return result;
            }
            PyErr_Format(PyExc_TypeError,
                "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
                f->m_ml->ml_name, size);
            return NULL;
        }
        break;
    default:
        PyErr_SetString(PyExc_SystemError, "Bad call flags in "
                        "__Pyx_CyFunction_Call. METH_OLDARGS is no "
                        "longer supported!");
        return NULL;
    }
    PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
                 f->m_ml->ml_name);
    return NULL;
}
static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw);
}
static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
    PyObject *result;
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
    if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
        Py_ssize_t argc;
        PyObject *new_args;
        PyObject *self;
        argc = PyTuple_GET_SIZE(args);
        new_args = PyTuple_GetSlice(args, 1, argc);
        if (unlikely(!new_args))
            return NULL;
        self = PyTuple_GetItem(args, 0);
        if (unlikely(!self)) {
            Py_DECREF(new_args);
            return NULL;
        }
        result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
        Py_DECREF(new_args);
    } else {
        result = __Pyx_CyFunction_Call(func, args, kw);
    }
    return result;
}
static PyTypeObject __pyx_CyFunctionType_type = {
    PyVarObject_HEAD_INIT(0, 0)
    "cython_function_or_method",
    sizeof(__pyx_CyFunctionObject),
    0,
    (destructor) __Pyx_CyFunction_dealloc,
    0,
    0,
    0,
#if PY_MAJOR_VERSION < 3
    0,
#else
    0,
#endif
    (reprfunc) __Pyx_CyFunction_repr,
    0,
    0,
    0,
    0,
    __Pyx_CyFunction_CallAsMethod,
    0,
    0,
    0,
    0,
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
    0,
    (traverseproc) __Pyx_CyFunction_traverse,
    (inquiry) __Pyx_CyFunction_clear,
    0,
#if PY_VERSION_HEX < 0x030500A0
    offsetof(__pyx_CyFunctionObject, func_weakreflist),
#else
    offsetof(PyCFunctionObject, m_weakreflist),
#endif
    0,
    0,
    __pyx_CyFunction_methods,
    __pyx_CyFunction_members,
    __pyx_CyFunction_getsets,
    0,
    0,
    __Pyx_CyFunction_descr_get,
    0,
    offsetof(__pyx_CyFunctionObject, func_dict),
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
#if PY_VERSION_HEX >= 0x030400a1
    0,
#endif
};
static int __pyx_CyFunction_init(void) {
    __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
    if (unlikely(__pyx_CyFunctionType == NULL)) {
        return -1;
    }
    return 0;
}
static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults = PyObject_Malloc(size);
    if (unlikely(!m->defaults))
        return PyErr_NoMemory();
    memset(m->defaults, 0, size);
    m->defaults_pyobjects = pyobjects;
    return m->defaults;
}
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults_tuple = tuple;
    Py_INCREF(tuple);
}
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults_kwdict = dict;
    Py_INCREF(dict);
}
static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->func_annotations = dict;
    Py_INCREF(dict);
}

/* CLineInTraceback */
            #ifndef CYTHON_CLINE_IN_TRACEBACK
static int __Pyx_CLineForTraceback(CYTHON_UNUSED PyThreadState *tstate, int c_line) {
    PyObject *use_cline;
    PyObject *ptype, *pvalue, *ptraceback;
#if CYTHON_COMPILING_IN_CPYTHON
    PyObject **cython_runtime_dict;
#endif
    __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
#if CYTHON_COMPILING_IN_CPYTHON
    cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
    if (likely(cython_runtime_dict)) {
      use_cline = PyDict_GetItem(*cython_runtime_dict, __pyx_n_s_cline_in_traceback);
    } else
#endif
    {
      PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
      if (use_cline_obj) {
        use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
        Py_DECREF(use_cline_obj);
      } else {
        PyErr_Clear();
        use_cline = NULL;
      }
    }
    if (!use_cline) {
        c_line = 0;
        PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
    }
    else if (PyObject_Not(use_cline) != 0) {
        c_line = 0;
    }
    __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
    return c_line;
}
#endif

/* CodeObjectCache */
            static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
    int start = 0, mid = 0, end = count - 1;
    if (end >= 0 && code_line > entries[end].code_line) {
        return count;
    }
    while (start < end) {
        mid = start + (end - start) / 2;
        if (code_line < entries[mid].code_line) {
            end = mid;
        } else if (code_line > entries[mid].code_line) {
             start = mid + 1;
        } else {
            return mid;
        }
    }
    if (code_line <= entries[mid].code_line) {
        return mid;
    } else {
        return mid + 1;
    }
}
static PyCodeObject *__pyx_find_code_object(int code_line) {
    PyCodeObject* code_object;
    int pos;
    if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
        return NULL;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
        return NULL;
    }
    code_object = __pyx_code_cache.entries[pos].code_object;
    Py_INCREF(code_object);
    return code_object;
}
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
    int pos, i;
    __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
    if (unlikely(!code_line)) {
        return;
    }
    if (unlikely(!entries)) {
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
        if (likely(entries)) {
            __pyx_code_cache.entries = entries;
            __pyx_code_cache.max_count = 64;
            __pyx_code_cache.count = 1;
            entries[0].code_line = code_line;
            entries[0].code_object = code_object;
            Py_INCREF(code_object);
        }
        return;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
        PyCodeObject* tmp = entries[pos].code_object;
        entries[pos].code_object = code_object;
        Py_DECREF(tmp);
        return;
    }
    if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
        int new_max = __pyx_code_cache.max_count + 64;
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
            __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry));
        if (unlikely(!entries)) {
            return;
        }
        __pyx_code_cache.entries = entries;
        __pyx_code_cache.max_count = new_max;
    }
    for (i=__pyx_code_cache.count; i>pos; i--) {
        entries[i] = entries[i-1];
    }
    entries[pos].code_line = code_line;
    entries[pos].code_object = code_object;
    __pyx_code_cache.count++;
    Py_INCREF(code_object);
}

/* AddTraceback */
            #include "compile.h"
#include "frameobject.h"
#include "traceback.h"
static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
            const char *funcname, int c_line,
            int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyObject *py_srcfile = 0;
    PyObject *py_funcname = 0;
    #if PY_MAJOR_VERSION < 3
    py_srcfile = PyString_FromString(filename);
    #else
    py_srcfile = PyUnicode_FromString(filename);
    #endif
    if (!py_srcfile) goto bad;
    if (c_line) {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        #else
        py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        #endif
    }
    else {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromString(funcname);
        #else
        py_funcname = PyUnicode_FromString(funcname);
        #endif
    }
    if (!py_funcname) goto bad;
    py_code = __Pyx_PyCode_New(
        0,
        0,
        0,
        0,
        0,
        __pyx_empty_bytes, /*PyObject *code,*/
        __pyx_empty_tuple, /*PyObject *consts,*/
        __pyx_empty_tuple, /*PyObject *names,*/
        __pyx_empty_tuple, /*PyObject *varnames,*/
        __pyx_empty_tuple, /*PyObject *freevars,*/
        __pyx_empty_tuple, /*PyObject *cellvars,*/
        py_srcfile,   /*PyObject *filename,*/
        py_funcname,  /*PyObject *name,*/
        py_line,
        __pyx_empty_bytes  /*PyObject *lnotab*/
    );
    Py_DECREF(py_srcfile);
    Py_DECREF(py_funcname);
    return py_code;
bad:
    Py_XDECREF(py_srcfile);
    Py_XDECREF(py_funcname);
    return NULL;
}
static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyFrameObject *py_frame = 0;
    PyThreadState *tstate = __Pyx_PyThreadState_Current;
    if (c_line) {
        c_line = __Pyx_CLineForTraceback(tstate, c_line);
    }
    py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
    if (!py_code) {
        py_code = __Pyx_CreateCodeObjectForTraceback(
            funcname, c_line, py_line, filename);
        if (!py_code) goto bad;
        __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
    }
    py_frame = PyFrame_New(
        tstate,            /*PyThreadState *tstate,*/
        py_code,           /*PyCodeObject *code,*/
        __pyx_d,    /*PyObject *globals,*/
        0                  /*PyObject *locals*/
    );
    if (!py_frame) goto bad;
    __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
    PyTraceBack_Here(py_frame);
bad:
    Py_XDECREF(py_code);
    Py_XDECREF(py_frame);
}

/* CIntFromPyVerify */
            #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
    __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
    __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
    {\
        func_type value = func_value;\
        if (sizeof(target_type) < sizeof(func_type)) {\
            if (unlikely(value != (func_type) (target_type) value)) {\
                func_type zero = 0;\
                if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
                    return (target_type) -1;\
                if (is_unsigned && unlikely(value < zero))\
                    goto raise_neg_overflow;\
                else\
                    goto raise_overflow;\
            }\
        }\
        return (target_type) value;\
    }

/* CIntToPy */
            static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
    const int neg_one = (int) -1, const_zero = (int) 0;
    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_uint64_t(uint64_t value) {
    const uint64_t neg_one = (uint64_t) -1, const_zero = (uint64_t) 0;
    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_uint32_t(uint32_t value) {
    const uint32_t neg_one = (uint32_t) -1, const_zero = (uint32_t) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(uint32_t) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(uint32_t) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(uint32_t) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(uint32_t) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(uint32_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(uint32_t),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
            static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int64_t(int64_t value) {
    const int64_t neg_one = (int64_t) -1, const_zero = (int64_t) 0;
    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_int32_t(int32_t value) {
    const int32_t neg_one = (int32_t) -1, const_zero = (int32_t) 0;
    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 size_t __Pyx_PyInt_As_size_t(PyObject *x) {
    const size_t neg_one = (size_t) -1, const_zero = (size_t) 0;
    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) {
    const int64_t neg_one = (int64_t) -1, const_zero = (int64_t) 0;
    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 uint64_t __Pyx_PyInt_As_uint64_t(PyObject *x) {
    const uint64_t neg_one = (uint64_t) -1, const_zero = (uint64_t) 0;
    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;
}

/* CIntFromPy */
            static CYTHON_INLINE int32_t __Pyx_PyInt_As_int32_t(PyObject *x) {
    const int32_t neg_one = (int32_t) -1, const_zero = (int32_t) 0;
    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;
}

/* CIntFromPy */
            static CYTHON_INLINE uint32_t __Pyx_PyInt_As_uint32_t(PyObject *x) {
    const uint32_t neg_one = (uint32_t) -1, const_zero = (uint32_t) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(uint32_t) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(uint32_t, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (uint32_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 (uint32_t) 0;
                case  1: __PYX_VERIFY_RETURN_INT(uint32_t, digit, digits[0])
                case 2:
                    if (8 * sizeof(uint32_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(uint32_t) >= 2 * PyLong_SHIFT) {
                            return (uint32_t) (((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(uint32_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(uint32_t) >= 3 * PyLong_SHIFT) {
                            return (uint32_t) (((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(uint32_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint32_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(uint32_t) >= 4 * PyLong_SHIFT) {
                            return (uint32_t) (((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_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 (uint32_t) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(uint32_t) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(uint32_t, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(uint32_t) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(uint32_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 (uint32_t) 0;
                case -1: __PYX_VERIFY_RETURN_INT(uint32_t, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(uint32_t,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(uint32_t) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT) {
                            return (uint32_t) (((uint32_t)-1)*(((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(uint32_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT) {
                            return (uint32_t) ((((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT) {
                            return (uint32_t) (((uint32_t)-1)*(((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(uint32_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT) {
                            return (uint32_t) ((((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint32_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(uint32_t) - 1 > 4 * PyLong_SHIFT) {
                            return (uint32_t) (((uint32_t)-1)*(((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(uint32_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint32_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(uint32_t) - 1 > 4 * PyLong_SHIFT) {
                            return (uint32_t) ((((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(uint32_t) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(uint32_t, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(uint32_t) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(uint32_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
            uint32_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 (uint32_t) -1;
        }
    } else {
        uint32_t val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (uint32_t) -1;
        val = __Pyx_PyInt_As_uint32_t(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to uint32_t");
    return (uint32_t) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to uint32_t");
    return (uint32_t) -1;
}

/* CIntFromPy */
            static CYTHON_INLINE time_t __Pyx_PyInt_As_time_t(PyObject *x) {
    const time_t neg_one = (time_t) -1, const_zero = (time_t) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(time_t) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(time_t, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (time_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 (time_t) 0;
                case  1: __PYX_VERIFY_RETURN_INT(time_t, digit, digits[0])
                case 2:
                    if (8 * sizeof(time_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(time_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(time_t) >= 2 * PyLong_SHIFT) {
                            return (time_t) (((((time_t)digits[1]) << PyLong_SHIFT) | (time_t)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(time_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(time_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(time_t) >= 3 * PyLong_SHIFT) {
                            return (time_t) (((((((time_t)digits[2]) << PyLong_SHIFT) | (time_t)digits[1]) << PyLong_SHIFT) | (time_t)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(time_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(time_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(time_t) >= 4 * PyLong_SHIFT) {
                            return (time_t) (((((((((time_t)digits[3]) << PyLong_SHIFT) | (time_t)digits[2]) << PyLong_SHIFT) | (time_t)digits[1]) << PyLong_SHIFT) | (time_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 (time_t) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(time_t) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(time_t, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(time_t) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(time_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 (time_t) 0;
                case -1: __PYX_VERIFY_RETURN_INT(time_t, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(time_t,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(time_t) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(time_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(time_t) - 1 > 2 * PyLong_SHIFT) {
                            return (time_t) (((time_t)-1)*(((((time_t)digits[1]) << PyLong_SHIFT) | (time_t)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(time_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(time_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(time_t) - 1 > 2 * PyLong_SHIFT) {
                            return (time_t) ((((((time_t)digits[1]) << PyLong_SHIFT) | (time_t)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(time_t) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(time_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(time_t) - 1 > 3 * PyLong_SHIFT) {
                            return (time_t) (((time_t)-1)*(((((((time_t)digits[2]) << PyLong_SHIFT) | (time_t)digits[1]) << PyLong_SHIFT) | (time_t)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(time_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(time_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(time_t) - 1 > 3 * PyLong_SHIFT) {
                            return (time_t) ((((((((time_t)digits[2]) << PyLong_SHIFT) | (time_t)digits[1]) << PyLong_SHIFT) | (time_t)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(time_t) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(time_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(time_t) - 1 > 4 * PyLong_SHIFT) {
                            return (time_t) (((time_t)-1)*(((((((((time_t)digits[3]) << PyLong_SHIFT) | (time_t)digits[2]) << PyLong_SHIFT) | (time_t)digits[1]) << PyLong_SHIFT) | (time_t)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(time_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(time_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(time_t) - 1 > 4 * PyLong_SHIFT) {
                            return (time_t) ((((((((((time_t)digits[3]) << PyLong_SHIFT) | (time_t)digits[2]) << PyLong_SHIFT) | (time_t)digits[1]) << PyLong_SHIFT) | (time_t)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(time_t) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(time_t, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(time_t) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(time_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
            time_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 (time_t) -1;
        }
    } else {
        time_t val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (time_t) -1;
        val = __Pyx_PyInt_As_time_t(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to time_t");
    return (time_t) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to time_t");
    return (time_t) -1;
}

/* CIntToPy */
            static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
    const long neg_one = (long) -1, const_zero = (long) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(long) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(long) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(long) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(long),
                                     little, !is_unsigned);
    }
}

/* CIntFromPy */
            static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
    const long neg_one = (long) -1, const_zero = (long) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(long) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (long) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (long) 0;
                case  1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
                case 2:
                    if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
                            return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
                            return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
                            return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (long) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(long) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (long) 0;
                case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(long,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                            return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                            return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                            return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                            return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                            return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                            return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(long) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            long val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (long) -1;
        }
    } else {
        long val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (long) -1;
        val = __Pyx_PyInt_As_long(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to long");
    return (long) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to long");
    return (long) -1;
}

/* CIntFromPy */
            static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
    const int neg_one = (int) -1, const_zero = (int) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(int) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (int) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (int) 0;
                case  1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
                case 2:
                    if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
                            return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
                            return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
                            return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (int) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(int) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (int) 0;
                case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(int,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
                            return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
                            return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
                            return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
                            return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
                            return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
                            return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(int) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            int val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (int) -1;
        }
    } else {
        int val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (int) -1;
        val = __Pyx_PyInt_As_int(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to int");
    return (int) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to int");
    return (int) -1;
}

/* FastTypeChecks */
            #if CYTHON_COMPILING_IN_CPYTHON
static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
    while (a) {
        a = a->tp_base;
        if (a == b)
            return 1;
    }
    return b == &PyBaseObject_Type;
}
static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
    PyObject *mro;
    if (a == b) return 1;
    mro = a->tp_mro;
    if (likely(mro)) {
        Py_ssize_t i, n;
        n = PyTuple_GET_SIZE(mro);
        for (i = 0; i < n; i++) {
            if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
                return 1;
        }
        return 0;
    }
    return __Pyx_InBases(a, b);
}
#if PY_MAJOR_VERSION == 2
static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
    PyObject *exception, *value, *tb;
    int res;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&exception, &value, &tb);
    res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
    if (unlikely(res == -1)) {
        PyErr_WriteUnraisable(err);
        res = 0;
    }
    if (!res) {
        res = PyObject_IsSubclass(err, exc_type2);
        if (unlikely(res == -1)) {
            PyErr_WriteUnraisable(err);
            res = 0;
        }
    }
    __Pyx_ErrRestore(exception, value, tb);
    return res;
}
#else
static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
    int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
    if (!res) {
        res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
    }
    return res;
}
#endif
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
    if (likely(err == exc_type)) return 1;
    if (likely(PyExceptionClass_Check(err))) {
        return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
    }
    return PyErr_GivenExceptionMatches(err, exc_type);
}
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
    if (likely(err == exc_type1 || err == exc_type2)) return 1;
    if (likely(PyExceptionClass_Check(err))) {
        return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
    }
    return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
}
#endif

/* CheckBinaryVersion */
            static int __Pyx_check_binary_version(void) {
    char ctversion[4], rtversion[4];
    PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
    PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
    if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
        char message[200];
        PyOS_snprintf(message, sizeof(message),
                      "compiletime version %s of module '%.100s' "
                      "does not match runtime version %s",
                      ctversion, __Pyx_MODULE_NAME, rtversion);
        return PyErr_WarnEx(NULL, message, 1);
    }
    return 0;
}

/* 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)
            PyErr_Clear();
        ++t;
    }
    return 0;
}

static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
    return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
}
static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
    Py_ssize_t ignore;
    return __Pyx_PyObject_AsStringAndSize(o, &ignore);
}
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
#if !CYTHON_PEP393_ENABLED
static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
    char* defenc_c;
    PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
    if (!defenc) return NULL;
    defenc_c = PyBytes_AS_STRING(defenc);
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
    {
        char* end = defenc_c + PyBytes_GET_SIZE(defenc);
        char* c;
        for (c = defenc_c; c < end; c++) {
            if ((unsigned char) (*c) >= 128) {
                PyUnicode_AsASCIIString(o);
                return NULL;
            }
        }
    }
#endif
    *length = PyBytes_GET_SIZE(defenc);
    return defenc_c;
}
#else
static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
    if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
    if (likely(PyUnicode_IS_ASCII(o))) {
        *length = PyUnicode_GET_LENGTH(o);
        return PyUnicode_AsUTF8(o);
    } else {
        PyUnicode_AsASCIIString(o);
        return NULL;
    }
#else
    return PyUnicode_AsUTF8AndSize(o, length);
#endif
}
#endif
#endif
static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
    if (
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
            __Pyx_sys_getdefaultencoding_not_ascii &&
#endif
            PyUnicode_Check(o)) {
        return __Pyx_PyUnicode_AsStringAndSize(o, length);
    } else
#endif
#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
    if (PyByteArray_Check(o)) {
        *length = PyByteArray_GET_SIZE(o);
        return PyByteArray_AS_STRING(o);
    } else
#endif
    {
        char* result;
        int r = PyBytes_AsStringAndSize(o, &result, length);
        if (unlikely(r < 0)) {
            return NULL;
        } else {
            return result;
        }
    }
}
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
   int is_true = x == Py_True;
   if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
   else return PyObject_IsTrue(x);
}
static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
#if PY_MAJOR_VERSION >= 3
    if (PyLong_Check(result)) {
        if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
                "__int__ returned non-int (type %.200s).  "
                "The ability to return an instance of a strict subclass of int "
                "is deprecated, and may be removed in a future version of Python.",
                Py_TYPE(result)->tp_name)) {
            Py_DECREF(result);
            return NULL;
        }
        return result;
    }
#endif
    PyErr_Format(PyExc_TypeError,
                 "__%.4s__ returned non-%.4s (type %.200s)",
                 type_name, type_name, Py_TYPE(result)->tp_name);
    Py_DECREF(result);
    return NULL;
}
static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
#if CYTHON_USE_TYPE_SLOTS
  PyNumberMethods *m;
#endif
  const char *name = NULL;
  PyObject *res = NULL;
#if PY_MAJOR_VERSION < 3
  if (likely(PyInt_Check(x) || PyLong_Check(x)))
#else
  if (likely(PyLong_Check(x)))
#endif
    return __Pyx_NewRef(x);
#if CYTHON_USE_TYPE_SLOTS
  m = Py_TYPE(x)->tp_as_number;
  #if PY_MAJOR_VERSION < 3
  if (m && m->nb_int) {
    name = "int";
    res = m->nb_int(x);
  }
  else if (m && m->nb_long) {
    name = "long";
    res = m->nb_long(x);
  }
  #else
  if (likely(m && m->nb_int)) {
    name = "int";
    res = m->nb_int(x);
  }
  #endif
#else
  if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
    res = PyNumber_Int(x);
  }
#endif
  if (likely(res)) {
#if PY_MAJOR_VERSION < 3
    if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
#else
    if (unlikely(!PyLong_CheckExact(res))) {
#endif
        return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
    }
  }
  else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_TypeError,
                    "an integer is required");
  }
  return res;
}
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
  Py_ssize_t ival;
  PyObject *x;
#if PY_MAJOR_VERSION < 3
  if (likely(PyInt_CheckExact(b))) {
    if (sizeof(Py_ssize_t) >= sizeof(long))
        return PyInt_AS_LONG(b);
    else
        return PyInt_AsSsize_t(x);
  }
#endif
  if (likely(PyLong_CheckExact(b))) {
    #if CYTHON_USE_PYLONG_INTERNALS
    const digit* digits = ((PyLongObject*)b)->ob_digit;
    const Py_ssize_t size = Py_SIZE(b);
    if (likely(__Pyx_sst_abs(size) <= 1)) {
        ival = likely(size) ? digits[0] : 0;
        if (size == -1) ival = -ival;
        return ival;
    } else {
      switch (size) {
         case 2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case 3:
           if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -3:
           if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case 4:
           if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -4:
           if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
      }
    }
    #endif
    return PyLong_AsSsize_t(b);
  }
  x = PyNumber_Index(b);
  if (!x) return -1;
  ival = PyInt_AsSsize_t(x);
  Py_DECREF(x);
  return ival;
}
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
    return PyInt_FromSize_t(ival);
}


#endif /* Py_PYTHON_H */
